… | |
… | |
4 | * Copyright (c) 2007,2008,2009,2010,2011 Marc Alexander Lehmann <libev@schmorp.de> |
4 | * Copyright (c) 2007,2008,2009,2010,2011 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 | * |
10 | * 1. Redistributions of source code must retain the above copyright notice, |
10 | * 1. Redistributions of source code must retain the above copyright notice, |
11 | * this list of conditions and the following disclaimer. |
11 | * this list of conditions and the following disclaimer. |
12 | * |
12 | * |
13 | * 2. Redistributions in binary form must reproduce the above copyright |
13 | * 2. Redistributions in binary form must reproduce the above copyright |
14 | * notice, this list of conditions and the following disclaimer in the |
14 | * notice, this list of conditions and the following disclaimer in the |
15 | * documentation and/or other materials provided with the distribution. |
15 | * documentation and/or other materials provided with the distribution. |
16 | * |
16 | * |
17 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED |
17 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED |
18 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MER- |
18 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MER- |
19 | * CHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO |
19 | * CHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO |
20 | * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPE- |
20 | * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPE- |
21 | * CIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
21 | * CIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
… | |
… | |
183 | # define EV_INLINE static inline |
183 | # define EV_INLINE static inline |
184 | #else |
184 | #else |
185 | # define EV_INLINE static |
185 | # define EV_INLINE static |
186 | #endif |
186 | #endif |
187 | |
187 | |
188 | /* EV_PROTOTYPES can be sued to switch of prototype declarations */ |
188 | /* EV_PROTOTYPES can be used to switch of prototype declarations */ |
189 | #ifndef EV_PROTOTYPES |
189 | #ifndef EV_PROTOTYPES |
190 | # define EV_PROTOTYPES 1 |
190 | # define EV_PROTOTYPES 1 |
191 | #endif |
191 | #endif |
192 | |
192 | |
193 | /*****************************************************************************/ |
193 | /*****************************************************************************/ |
194 | |
194 | |
195 | #define EV_VERSION_MAJOR 4 |
195 | #define EV_VERSION_MAJOR 4 |
196 | #define EV_VERSION_MINOR 1 |
196 | #define EV_VERSION_MINOR 4 |
197 | |
197 | |
198 | /* eventmask, revents, events... */ |
198 | /* eventmask, revents, events... */ |
199 | enum { |
199 | enum { |
200 | EV_UNDEF = 0xFFFFFFFF, /* guaranteed to be invalid */ |
200 | EV_UNDEF = 0xFFFFFFFF, /* guaranteed to be invalid */ |
201 | EV_NONE = 0x00, /* no events */ |
201 | EV_NONE = 0x00, /* no events */ |
… | |
… | |
715 | |
715 | |
716 | /* stopping (enabling, adding) a watcher does nothing if it is already running */ |
716 | /* stopping (enabling, adding) a watcher does nothing if it is already running */ |
717 | /* stopping (disabling, deleting) a watcher does nothing unless its already running */ |
717 | /* stopping (disabling, deleting) a watcher does nothing unless its already running */ |
718 | #if EV_PROTOTYPES |
718 | #if EV_PROTOTYPES |
719 | |
719 | |
720 | /* feeds an event into a watcher as if the event actually occured */ |
720 | /* feeds an event into a watcher as if the event actually occurred */ |
721 | /* accepts any ev_watcher type */ |
721 | /* accepts any ev_watcher type */ |
722 | void ev_feed_event (EV_P_ void *w, int revents); |
722 | void ev_feed_event (EV_P_ void *w, int revents); |
723 | void ev_feed_fd_event (EV_P_ int fd, int revents); |
723 | void ev_feed_fd_event (EV_P_ int fd, int revents); |
724 | #if EV_SIGNAL_ENABLE |
724 | #if EV_SIGNAL_ENABLE |
725 | void ev_feed_signal (int signum); |
725 | void ev_feed_signal (int signum); |