+/* Sets the allocation function to use, works like realloc.
+ * It is used to allocate and free memory.
+ * If it returns zero when memory needs to be allocated, the library might abort
+ * or take some potentially destructive action.
+ * The default is your system realloc function.
+ */
+void ev_set_allocator (void *(*cb)(void *ptr, size_t size));
+
+/* set the callback function to call on a
+ * retryable syscall error
+ * (such as failed select, poll, epoll_wait)
+ */
+void ev_set_syserr_cb (void (*cb)(const char *msg));
+
+# if EV_MULTIPLICITY
+/* the default loop is the only one that handles signals and child watchers */
+/* you can call this as often as you like */
+static struct ev_loop *
+ev_default_loop (unsigned int flags)
+{
+ extern struct ev_loop *ev_default_loop_ptr;
+ extern struct ev_loop *ev_default_loop_init (unsigned int flags);
+
+ if (!ev_default_loop_ptr)
+ ev_default_loop_init (flags);
+
+ return ev_default_loop_ptr;
+}
+
+/* create and destroy alternative loops that don't handle signals */
+struct ev_loop *ev_loop_new (unsigned int flags);
+void ev_loop_destroy (EV_P);
+void ev_loop_fork (EV_P);
+
+ev_tstamp ev_now (EV_P); /* time w.r.t. timers and the eventloop, updated after each poll */
+
+# else
+
+int ev_default_loop (unsigned int flags); /* returns true when successful */
+
+static ev_tstamp
+ev_now (void)
+{
+ extern ev_tstamp ev_rt_now;
+
+ return ev_rt_now;
+}
+# endif
+
+void ev_default_destroy (void); /* destroy the default loop */
+/* this needs to be called after fork, to duplicate the default loop */
+/* if you create alternative loops you have to call ev_loop_fork on them */
+/* you can call it in either the parent or the child */
+/* you can actually call it at any time, anywhere :) */
+void ev_default_fork (void);
+
+unsigned int ev_backend (EV_P);
+#endif
+