File: gudevmodule.c

package info (click to toggle)
python-gudev 147.2-1%2Bsqueeze1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 116 kB
  • ctags: 5
  • sloc: sh: 137; makefile: 53; python: 32; ansic: 18
file content (43 lines) | stat: -rw-r--r-- 1,260 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/*
 * gudevmodule.
 * Copyright (C) John Stowers 2010 <john.stowers@gmail.com>
 * 
 * This program is free software: you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#include <pygobject.h>

void pygudev_register_classes(PyObject *d);
extern PyMethodDef pygudev_functions[];

DL_EXPORT(void)
initgudev(void)
{
	PyObject *m, *d;

	init_pygobject();

	m = Py_InitModule("gudev", pygudev_functions);
	d = PyModule_GetDict(m);

	pygudev_register_classes(d);
	pygudev_add_constants(m, "G_UDEV_");

    PyModule_AddObject(m, "__version__",
                           Py_BuildValue("s",VERSION));

	if (PyErr_Occurred()) {
		Py_FatalError("can't initialize module gudev");
	}
}