annotate mcabber/modules/fifo/fifo.c @ 2079:8da280d34b48

Rename FIFO module file name Module: fifo_module.c -> fifo.c Code: fifo.c -> fifo_internal.c Previous scheme didn't seem go well along with new autotools since they were expecting fifo_module.* object files.
author Mikael Berthe <mikael@lilotux.net>
date Sun, 29 Sep 2013 14:31:14 +0200
parents mcabber/modules/fifo/fifo_module.c@2256d0626730
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2079
8da280d34b48 Rename FIFO module file name
Mikael Berthe <mikael@lilotux.net>
parents: 1941
diff changeset
1 /*
8da280d34b48 Rename FIFO module file name
Mikael Berthe <mikael@lilotux.net>
parents: 1941
diff changeset
2 * Module "fifo" -- Reads and executes command from FIFO pipe
1941
2256d0626730 Modularize fifo system (Myhailo Danylenko)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
3 *
2079
8da280d34b48 Rename FIFO module file name
Mikael Berthe <mikael@lilotux.net>
parents: 1941
diff changeset
4 * Copyright 2009, 2010 Myhailo Danylenko
8da280d34b48 Rename FIFO module file name
Mikael Berthe <mikael@lilotux.net>
parents: 1941
diff changeset
5 *
8da280d34b48 Rename FIFO module file name
Mikael Berthe <mikael@lilotux.net>
parents: 1941
diff changeset
6 * This file is part of mcabber.
1941
2256d0626730 Modularize fifo system (Myhailo Danylenko)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
7 *
2256d0626730 Modularize fifo system (Myhailo Danylenko)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
8 * 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
9 * 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
10 * 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
11 * (at your option) any later version.
2256d0626730 Modularize fifo system (Myhailo Danylenko)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
12 *
2256d0626730 Modularize fifo system (Myhailo Danylenko)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
13 * 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
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
2256d0626730 Modularize fifo system (Myhailo Danylenko)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2256d0626730 Modularize fifo system (Myhailo Danylenko)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
16 * GNU General Public License for more details.
2256d0626730 Modularize fifo system (Myhailo Danylenko)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
17 *
2256d0626730 Modularize fifo system (Myhailo Danylenko)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
18 * 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
19 * 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
20
2256d0626730 Modularize fifo system (Myhailo Danylenko)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
21 #include <glib.h>
2256d0626730 Modularize fifo system (Myhailo Danylenko)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
22 #include <gmodule.h>
2256d0626730 Modularize fifo system (Myhailo Danylenko)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
23
2256d0626730 Modularize fifo system (Myhailo Danylenko)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
24 #include <mcabber/fifo.h>
2256d0626730 Modularize fifo system (Myhailo Danylenko)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
25 #include <mcabber/modules.h>
2256d0626730 Modularize fifo system (Myhailo Danylenko)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
26 #include <mcabber/config.h>
2256d0626730 Modularize fifo system (Myhailo Danylenko)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
27
2256d0626730 Modularize fifo system (Myhailo Danylenko)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
28 module_info_t info_fifo = {
2256d0626730 Modularize fifo system (Myhailo Danylenko)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
29 .branch = MCABBER_BRANCH,
2256d0626730 Modularize fifo system (Myhailo Danylenko)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
30 .api = MCABBER_API_VERSION,
2256d0626730 Modularize fifo system (Myhailo Danylenko)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
31 .version = MCABBER_VERSION,
2256d0626730 Modularize fifo system (Myhailo Danylenko)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
32 .requires = NULL,
2256d0626730 Modularize fifo system (Myhailo Danylenko)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
33 .init = NULL,
2256d0626730 Modularize fifo system (Myhailo Danylenko)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
34 .uninit = NULL,
2256d0626730 Modularize fifo system (Myhailo Danylenko)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
35 .description = "Reads and executes command from FIFO pipe\n"
2256d0626730 Modularize fifo system (Myhailo Danylenko)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
36 "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
37 .next = NULL,
2256d0626730 Modularize fifo system (Myhailo Danylenko)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
38 };
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 gchar *g_module_check_init(GModule *module)
2256d0626730 Modularize fifo system (Myhailo Danylenko)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
41 {
2256d0626730 Modularize fifo system (Myhailo Danylenko)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
42 if (fifo_init() == -1)
2256d0626730 Modularize fifo system (Myhailo Danylenko)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
43 return "FIFO initialization failed";
2256d0626730 Modularize fifo system (Myhailo Danylenko)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
44 else
2256d0626730 Modularize fifo system (Myhailo Danylenko)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
45 return NULL;
2256d0626730 Modularize fifo system (Myhailo Danylenko)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
46 }
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 void g_module_unload(GModule *module)
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 fifo_deinit();
2256d0626730 Modularize fifo system (Myhailo Danylenko)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
51 }
2256d0626730 Modularize fifo system (Myhailo Danylenko)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
52
2256d0626730 Modularize fifo system (Myhailo Danylenko)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
53 /* vim: set expandtab cindent cinoptions=>2\:2(0: For Vim users... */