Ejemplo n.º 1
0
PyMODINIT_FUNC initpkgfile(void) {
  PyObject *m;
  m = Py_InitModule("pkgfile", PkgfileMethods);

  if(m == NULL)
    return;

	RegexError = PyErr_NewException("pkgfile.RegexError", NULL, NULL);
	Py_INCREF(RegexError);
	PyModule_AddObject(m, "RegexError", RegexError);

  search_pyinit(m);
  match_pyinit(m);
}
Ejemplo n.º 2
0
PyMODINIT_FUNC PyInit_pkgfile(void) {
    PyObject *m = PyModule_Create(&PkgfileDef);

    if(m == NULL)
        return NULL;

    RegexError = PyErr_NewException("pkgfile.RegexError", NULL, NULL);
    Py_INCREF(RegexError);
    PyModule_AddObject(m, "RegexError", RegexError);

    search_pyinit(m);
    match_pyinit(m);

    return m;
}