annotate mcabber/modules/fifo/fifo_module.c @ 1941:2256d0626730

Modularize fifo system (Myhailo Danylenko) Merge patch from isbear's mcabber-experimental repository.
author Mikael Berthe <mikael@lilotux.net>
date Sun, 27 Feb 2011 17:42:27 +0100
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1941
2256d0626730 Modularize fifo system (Myhailo Danylenko)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
1
2256d0626730 Modularize fifo system (Myhailo Danylenko)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
2 /* Copyright 2009,2010 Myhailo Danylenko
2256d0626730 Modularize fifo system (Myhailo Danylenko)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
3 *
2256d0626730 Modularize fifo system (Myhailo Danylenko)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
4 * This file is part of mcabber
2256d0626730 Modularize fifo system (Myhailo Danylenko)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
5 *
2256d0626730 Modularize fifo system (Myhailo Danylenko)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
6 * mcabber is free software: you can redistribute it and/or modify
2256d0626730 Modularize fifo system (Myhailo Danylenko)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
7 * it under the terms of the GNU General Public License as published by
2256d0626730 Modularize fifo system (Myhailo Danylenko)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
8 * the Free Software Foundation, either version 2 of the License, or
2256d0626730 Modularize fifo system (Myhailo Danylenko)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
9 * (at your option) any later version.
2256d0626730 Modularize fifo system (Myhailo Danylenko)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
10 *
2256d0626730 Modularize fifo system (Myhailo Danylenko)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
11 * This program is distributed in the hope that it will be useful,
2256d0626730 Modularize fifo system (Myhailo Danylenko)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
2256d0626730 Modularize fifo system (Myhailo Danylenko)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2256d0626730 Modularize fifo system (Myhailo Danylenko)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
14 * GNU General Public License for more details.
2256d0626730 Modularize fifo system (Myhailo Danylenko)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
15 *
2256d0626730 Modularize fifo system (Myhailo Danylenko)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
16 * You should have received a copy of the GNU General Public License
2256d0626730 Modularize fifo system (Myhailo Danylenko)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
17 * along with this program. If not, see <http://www.gnu.org/licenses/>. */
2256d0626730 Modularize fifo system (Myhailo Danylenko)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
18
2256d0626730 Modularize fifo system (Myhailo Danylenko)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
19 #include <glib.h>
2256d0626730 Modularize fifo system (Myhailo Danylenko)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
20 #include <gmodule.h>
2256d0626730 Modularize fifo system (Myhailo Danylenko)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
21
2256d0626730 Modularize fifo system (Myhailo Danylenko)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
22 #include <mcabber/fifo.h>
2256d0626730 Modularize fifo system (Myhailo Danylenko)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
23 #include <mcabber/modules.h>
2256d0626730 Modularize fifo system (Myhailo Danylenko)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
24 #include <mcabber/config.h>
2256d0626730 Modularize fifo system (Myhailo Danylenko)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
25
2256d0626730 Modularize fifo system (Myhailo Danylenko)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
26 module_info_t info_fifo = {
2256d0626730 Modularize fifo system (Myhailo Danylenko)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
27 .branch = MCABBER_BRANCH,
2256d0626730 Modularize fifo system (Myhailo Danylenko)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
28 .api = MCABBER_API_VERSION,
2256d0626730 Modularize fifo system (Myhailo Danylenko)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
29 .version = MCABBER_VERSION,
2256d0626730 Modularize fifo system (Myhailo Danylenko)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
30 .requires = NULL,
2256d0626730 Modularize fifo system (Myhailo Danylenko)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
31 .init = NULL,
2256d0626730 Modularize fifo system (Myhailo Danylenko)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
32 .uninit = NULL,
2256d0626730 Modularize fifo system (Myhailo Danylenko)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
33 .description = "Reads and executes command from FIFO pipe\n"
2256d0626730 Modularize fifo system (Myhailo Danylenko)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
34 "Recognizes options fifo_name (required), fifo_hide_commands and fifo_ignore.",
2256d0626730 Modularize fifo system (Myhailo Danylenko)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
35 .next = NULL,
2256d0626730 Modularize fifo system (Myhailo Danylenko)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
36 };
2256d0626730 Modularize fifo system (Myhailo Danylenko)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
37
2256d0626730 Modularize fifo system (Myhailo Danylenko)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
38 gchar *g_module_check_init(GModule *module)
2256d0626730 Modularize fifo system (Myhailo Danylenko)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
39 {
2256d0626730 Modularize fifo system (Myhailo Danylenko)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
40 if (fifo_init() == -1)
2256d0626730 Modularize fifo system (Myhailo Danylenko)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
41 return "FIFO initialization failed";
2256d0626730 Modularize fifo system (Myhailo Danylenko)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
42 else
2256d0626730 Modularize fifo system (Myhailo Danylenko)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
43 return NULL;
2256d0626730 Modularize fifo system (Myhailo Danylenko)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
44 }
2256d0626730 Modularize fifo system (Myhailo Danylenko)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
45
2256d0626730 Modularize fifo system (Myhailo Danylenko)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
46 void g_module_unload(GModule *module)
2256d0626730 Modularize fifo system (Myhailo Danylenko)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
47 {
2256d0626730 Modularize fifo system (Myhailo Danylenko)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
48 fifo_deinit();
2256d0626730 Modularize fifo system (Myhailo Danylenko)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
49 }
2256d0626730 Modularize fifo system (Myhailo Danylenko)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
50
2256d0626730 Modularize fifo system (Myhailo Danylenko)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
51 /* vim: set expandtab cindent cinoptions=>2\:2(0: For Vim users... */