5 void gnt_register_classes (PyObject
*d
);
6 extern PyMethodDef gnt_functions
[];
9 gnt_add_string_constants(PyObject
*module
)
11 #define define_key(x) if (GNT_KEY_##x && *(GNT_KEY_##x)) PyModule_AddStringConstant(module, "KEY_" #x, GNT_KEY_##x)
21 define_key(CTRL_DOWN
);
22 define_key(CTRL_RIGHT
);
23 define_key(CTRL_LEFT
);
32 define_key(BACKSPACE
);
80 bindings
= g_hash_table_new_full(g_str_hash
, g_str_equal
, g_free
, g_free
);
82 m
= Py_InitModule ("gnt", gnt_functions
);
83 d
= PyModule_GetDict (m
);
85 gnt_register_classes (d
);
86 gnt_add_constants(m
, "GNT_");
88 if (PyErr_Occurred ()) {
89 Py_FatalError ("can't initialise module sad");
93 gnt_add_string_constants(m
);