aboutsummaryrefslogtreecommitdiffstats
path: root/python/pyempathy/pyempathymodule.c
blob: 59c093c8367911a8bccfc1bb1754131d6c1b5080 (plain) (blame)
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
#define NO_IMPORT_PYGOBJECT

#include <pygobject.h>

void empathy_register_classes (PyObject *d); 
void empathy_add_constants(PyObject *module, const gchar *strip_prefix);
DL_EXPORT(void) initempathy(void);
extern PyMethodDef empathy_functions[];

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

    init_pygobject ();
    
    m = Py_InitModule ("empathy", empathy_functions);
    d = PyModule_GetDict (m);
    
    empathy_register_classes (d);
    empathy_add_constants(m, "EMPATHY_");
    
    if (PyErr_Occurred ()) {
        PyErr_Print();
        Py_FatalError ("can't initialise module empathy");
    }
}