aboutsummaryrefslogtreecommitdiffstats
path: root/python/gevent/libev/_corecffi_cdef.c
diff options
context:
space:
mode:
authorJames Taylor <user234683@users.noreply.github.com>2018-09-14 19:32:27 -0700
committerJames Taylor <user234683@users.noreply.github.com>2018-09-14 19:32:27 -0700
commit4212164e91ba2f49583cf44ad623a29b36db8f77 (patch)
tree47aefe3c0162f03e0c823b43873356f69c1cd636 /python/gevent/libev/_corecffi_cdef.c
parent6ca20ff7010f2bafc7fefcb8cad982be27a8aeae (diff)
downloadyt-local-4212164e91ba2f49583cf44ad623a29b36db8f77.tar.lz
yt-local-4212164e91ba2f49583cf44ad623a29b36db8f77.tar.xz
yt-local-4212164e91ba2f49583cf44ad623a29b36db8f77.zip
Windows: Use 32-bit distribution of python
Diffstat (limited to 'python/gevent/libev/_corecffi_cdef.c')
-rw-r--r--python/gevent/libev/_corecffi_cdef.c27
1 files changed, 22 insertions, 5 deletions
diff --git a/python/gevent/libev/_corecffi_cdef.c b/python/gevent/libev/_corecffi_cdef.c
index d212887..3280e99 100644
--- a/python/gevent/libev/_corecffi_cdef.c
+++ b/python/gevent/libev/_corecffi_cdef.c
@@ -64,7 +64,8 @@ struct ev_loop {
// Watcher types
// base for all watchers
struct ev_watcher{
- GEVENT_STRUCT_DONE _;
+ void* data;
+ GEVENT_STRUCT_DONE _;
};
struct ev_io {
@@ -137,6 +138,9 @@ unsigned int ev_embeddable_backends (void);
ev_tstamp ev_time (void);
void ev_set_syserr_cb(void *);
+void ev_set_userdata(struct ev_loop*, void*);
+void* ev_userdata(struct ev_loop*);
+
int ev_priority(void*);
void ev_set_priority(void*, int);
@@ -212,10 +216,19 @@ void (*gevent_noop)(struct ev_loop *_loop, struct ev_timer *w, int revents);
void ev_sleep (ev_tstamp delay); /* sleep for a while */
/* gevent callbacks */
-static int (*python_callback)(void* handle, int revents);
-static void (*python_handle_error)(void* handle, int revents);
-static void (*python_stop)(void* handle);
-
+/* These will be created as static functions at the end of the
+ * _source.c and must be declared there too.
+ */
+extern "Python" {
+ int python_callback(void* handle, int revents);
+ void python_handle_error(void* handle, int revents);
+ void python_stop(void* handle);
+ void python_check_callback(struct ev_loop*, void*, int);
+ void python_prepare_callback(struct ev_loop*, void*, int);
+
+ // libev specific
+ void _syserr_cb(char*);
+}
/*
* We use a single C callback for every watcher type, which in turn calls the
* Python callbacks. The ev_watcher pointer type can be used for every watcher type
@@ -224,3 +237,7 @@ static void (*python_stop)(void* handle);
* object.
*/
static void _gevent_generic_callback(struct ev_loop* loop, struct ev_watcher* watcher, int revents);
+
+static void gevent_zero_check(struct ev_check* handle);
+static void gevent_zero_timer(struct ev_timer* handle);
+static void gevent_zero_prepare(struct ev_prepare* handle);