Imported Upstream version 3.21.91
[platform/upstream/python-gobject.git] / gi / glibmodule.c
1 /* -*- Mode: C; c-set-style: python; c-basic-offset: 4  -*-
2  * pyglib - Python bindings for GLib toolkit.
3  * Copyright (C) 1998-2003  James Henstridge
4  *               2004-2008  Johan Dahlin
5  *
6  *   glibmodule.c: wrapper for the glib library.
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2.1 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with this library; if not, see <http://www.gnu.org/licenses/>.
20  */
21
22 #ifdef HAVE_CONFIG_H
23 #  include <config.h>
24 #endif
25
26 #include <Python.h>
27 #include <glib.h>
28 #include "pyglib.h"
29 #include "pygoptioncontext.h"
30 #include "pygoptiongroup.h"
31 #include "pygspawn.h"
32
33 /* ---------------- glib module functions -------------------- */
34
35 static PyMethodDef _glib_functions[] = {
36     { "spawn_async",
37       (PyCFunction)pyglib_spawn_async, METH_VARARGS|METH_KEYWORDS,
38       "spawn_async(argv, envp=None, working_directory=None,\n"
39       "            flags=0, child_setup=None, user_data=None,\n"
40       "            standard_input=None, standard_output=None,\n"
41       "            standard_error=None) -> (pid, stdin, stdout, stderr)\n"
42       "\n"
43       "Execute a child program asynchronously within a glib.MainLoop()\n"
44       "See the reference manual for a complete reference.\n" },
45     { NULL, NULL, 0 }
46 };
47
48 PYGLIB_MODULE_START(_glib, "_glib")
49 {
50     PyObject *d = PyModule_GetDict(module);
51
52     pyglib_spawn_register_types(d);
53     pyglib_option_context_register_types(d);
54     pyglib_option_group_register_types(d);
55 }
56 PYGLIB_MODULE_END