File: _keybindermodule.c

package info (click to toggle)
keybinder 0.3.1-2.1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye
  • size: 1,880 kB
  • sloc: sh: 11,397; ansic: 602; makefile: 151; python: 10
file content (32 lines) | stat: -rw-r--r-- 811 bytes parent folder | download | duplicates (5)
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
/* -*- Mode: C; c-basic-offset: 4 -*- */
#ifdef HAVE_CONFIG_H
#  include "config.h"
#endif

/* include this first, before NO_IMPORT_PYGOBJECT is defined */
#include <pygobject.h>

/* include any extra headers needed here */
#include <keybinder.h>

void py_keybinder_register_classes(PyObject *d);
extern PyMethodDef py_keybinder_functions[];

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

    /* perform any initialisation required by the library here */
    init_pygobject();
    keybinder_init();

    m = Py_InitModule("_keybinder", py_keybinder_functions);
    d = PyModule_GetDict(m);

    /* add anything else to the module dictionary (such as constants) */
    py_keybinder_register_classes(d);

    if (PyErr_Occurred())
        Py_FatalError("could not initialise module _keybinder");
}