##// END OF EJS Templates
inotify: Port of the C module to py3k....
Renato Cunha -
r11549:935c83ce default
parent child Browse files
Show More
@@ -15,6 +15,8 b''
15 #include <sys/ioctl.h>
15 #include <sys/ioctl.h>
16 #include <unistd.h>
16 #include <unistd.h>
17
17
18 #include <util.h>
19
18 /* Variables used in the event string representation */
20 /* Variables used in the event string representation */
19 static PyObject *join;
21 static PyObject *join;
20 static PyObject *er_wm;
22 static PyObject *er_wm;
@@ -394,8 +396,7 b' done:'
394 }
396 }
395
397
396 static PyTypeObject event_type = {
398 static PyTypeObject event_type = {
397 PyObject_HEAD_INIT(NULL)
399 PyVarObject_HEAD_INIT(NULL, 0)
398 0, /*ob_size*/
399 "_inotify.event", /*tp_name*/
400 "_inotify.event", /*tp_name*/
400 sizeof(struct event), /*tp_basicsize*/
401 sizeof(struct event), /*tp_basicsize*/
401 0, /*tp_itemsize*/
402 0, /*tp_itemsize*/
@@ -600,6 +601,35 b' static PyMethodDef methods[] = {'
600 {NULL},
601 {NULL},
601 };
602 };
602
603
604 #ifdef IS_PY3K
605 static struct PyModuleDef _inotify_module = {
606 PyModuleDef_HEAD_INIT,
607 "_inotify",
608 doc,
609 -1,
610 methods
611 };
612
613 PyMODINIT_FUNC PyInit__inotify(void)
614 {
615 PyObject *mod, *dict;
616
617 mod = PyModule_Create(&_inotify_module);
618
619 if (mod == NULL)
620 return NULL;
621
622 if (!init_globals())
623 return;
624
625 dict = PyModule_GetDict(mod);
626
627 if (dict)
628 define_consts(dict);
629
630 return mod;
631 }
632 #else
603 void init_inotify(void)
633 void init_inotify(void)
604 {
634 {
605 PyObject *mod, *dict;
635 PyObject *mod, *dict;
@@ -617,3 +647,4 b' void init_inotify(void)'
617 if (dict)
647 if (dict)
618 define_consts(dict);
648 define_consts(dict);
619 }
649 }
650 #endif
General Comments 0
You need to be logged in to leave comments. Login now