1 | /* |
1 | /* |
2 | * libev native API header |
2 | * libev native API header |
3 | * |
3 | * |
4 | * Copyright (c) 2007,2008,2009,2010,2011 Marc Alexander Lehmann <libev@schmorp.de> |
4 | * Copyright (c) 2007,2008,2009,2010,2011,2012 Marc Alexander Lehmann <libev@schmorp.de> |
5 | * All rights reserved. |
5 | * All rights reserved. |
6 | * |
6 | * |
7 | * Redistribution and use in source and binary forms, with or without modifica- |
7 | * Redistribution and use in source and binary forms, with or without modifica- |
8 | * tion, are permitted provided that the following conditions are met: |
8 | * tion, are permitted provided that the following conditions are met: |
9 | * |
9 | * |
… | |
… | |
54 | #ifndef EV_COMPAT3 |
54 | #ifndef EV_COMPAT3 |
55 | # define EV_COMPAT3 1 |
55 | # define EV_COMPAT3 1 |
56 | #endif |
56 | #endif |
57 | |
57 | |
58 | #ifndef EV_FEATURES |
58 | #ifndef EV_FEATURES |
|
|
59 | # if defined __OPTIMIZE_SIZE__ |
|
|
60 | # define EV_FEATURES 0x7c |
|
|
61 | # else |
59 | # define EV_FEATURES 0x7f |
62 | # define EV_FEATURES 0x7f |
|
|
63 | # endif |
60 | #endif |
64 | #endif |
61 | |
65 | |
62 | #define EV_FEATURE_CODE ((EV_FEATURES) & 1) |
66 | #define EV_FEATURE_CODE ((EV_FEATURES) & 1) |
63 | #define EV_FEATURE_DATA ((EV_FEATURES) & 2) |
67 | #define EV_FEATURE_DATA ((EV_FEATURES) & 2) |
64 | #define EV_FEATURE_CONFIG ((EV_FEATURES) & 4) |
68 | #define EV_FEATURE_CONFIG ((EV_FEATURES) & 4) |
… | |
… | |
197 | #endif |
201 | #endif |
198 | |
202 | |
199 | /*****************************************************************************/ |
203 | /*****************************************************************************/ |
200 | |
204 | |
201 | #define EV_VERSION_MAJOR 4 |
205 | #define EV_VERSION_MAJOR 4 |
202 | #define EV_VERSION_MINOR 4 |
206 | #define EV_VERSION_MINOR 11 |
203 | |
207 | |
204 | /* eventmask, revents, events... */ |
208 | /* eventmask, revents, events... */ |
205 | enum { |
209 | enum { |
206 | EV_UNDEF = 0xFFFFFFFF, /* guaranteed to be invalid */ |
210 | EV_UNDEF = 0xFFFFFFFF, /* guaranteed to be invalid */ |
207 | EV_NONE = 0x00, /* no events */ |
211 | EV_NONE = 0x00, /* no events */ |
… | |
… | |
622 | EVBREAK_ONE = 1, /* unloop once */ |
626 | EVBREAK_ONE = 1, /* unloop once */ |
623 | EVBREAK_ALL = 2 /* unloop all loops */ |
627 | EVBREAK_ALL = 2 /* unloop all loops */ |
624 | }; |
628 | }; |
625 | |
629 | |
626 | #if EV_PROTOTYPES |
630 | #if EV_PROTOTYPES |
627 | EV_API_DECL void ev_run (EV_P_ int flags EV_CPP (= 0)); |
631 | EV_API_DECL int ev_run (EV_P_ int flags EV_CPP (= 0)); |
628 | EV_API_DECL void ev_break (EV_P_ int how EV_CPP (= EVBREAK_ONE)); /* break out of the loop */ |
632 | EV_API_DECL void ev_break (EV_P_ int how EV_CPP (= EVBREAK_ONE)); /* break out of the loop */ |
629 | |
633 | |
630 | /* |
634 | /* |
631 | * ref/unref can be used to add or remove a refcount on the mainloop. every watcher |
635 | * ref/unref can be used to add or remove a refcount on the mainloop. every watcher |
632 | * keeps one reference. if you have a long-running watcher you never unregister that |
636 | * keeps one reference. if you have a long-running watcher you never unregister that |