| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2000-2004 Niels Provos <provos@citi.umich.edu> | 2 * Copyright (c) 2000-2004 Niels Provos <provos@citi.umich.edu> |
| 3 * All rights reserved. | 3 * All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 | 64 |
| 65 struct event_list eventqueue; | 65 struct event_list eventqueue; |
| 66 struct timeval event_tv; | 66 struct timeval event_tv; |
| 67 | 67 |
| 68 struct min_heap timeheap; | 68 struct min_heap timeheap; |
| 69 | 69 |
| 70 struct timeval tv_cache; | 70 struct timeval tv_cache; |
| 71 }; | 71 }; |
| 72 | 72 |
| 73 /* Internal use only: Functions that might be missing from <sys/queue.h> */ | 73 /* Internal use only: Functions that might be missing from <sys/queue.h> */ |
| 74 #if !defined(HAVE_TAILQFOREACH) || defined(__QUENTIN_BUILD__) | 74 #ifndef HAVE_TAILQFOREACH |
| 75 #define TAILQ_FIRST(head) ((head)->tqh_first) | 75 #define TAILQ_FIRST(head) ((head)->tqh_first) |
| 76 #define TAILQ_END(head) NULL | 76 #define TAILQ_END(head) NULL |
| 77 #define TAILQ_NEXT(elm, field) ((elm)->field.tqe_next) | 77 #define TAILQ_NEXT(elm, field) ((elm)->field.tqe_next) |
| 78 #define TAILQ_FOREACH(var, head, field) \ | 78 #define TAILQ_FOREACH(var, head, field) \ |
| 79 for((var) = TAILQ_FIRST(head); \ | 79 for((var) = TAILQ_FIRST(head); \ |
| 80 (var) != TAILQ_END(head); \ | 80 (var) != TAILQ_END(head); \ |
| 81 (var) = TAILQ_NEXT(var, field)) | 81 (var) = TAILQ_NEXT(var, field)) |
| 82 #define TAILQ_INSERT_BEFORE(listelm, elm, field) do { \ | 82 #define TAILQ_INSERT_BEFORE(listelm, elm, field) do { \ |
| 83 (elm)->field.tqe_prev = (listelm)->field.tqe_prev; \ | 83 (elm)->field.tqe_prev = (listelm)->field.tqe_prev; \ |
| 84 (elm)->field.tqe_next = (listelm); \ | 84 (elm)->field.tqe_next = (listelm); \ |
| 85 *(listelm)->field.tqe_prev = (elm); \ | 85 *(listelm)->field.tqe_prev = (elm); \ |
| 86 (listelm)->field.tqe_prev = &(elm)->field.tqe_next; \ | 86 (listelm)->field.tqe_prev = &(elm)->field.tqe_next; \ |
| 87 } while (0) | 87 } while (0) |
| 88 #define TAILQ_LAST(head, headname) \ | |
| 89 (*(((struct headname *)((head)->tqh_last))->tqh_last)) | |
| 90 #define TAILQ_EMPTY(head) ((head)->tqh_first == NULL) | |
| 91 #endif /* TAILQ_FOREACH */ | 88 #endif /* TAILQ_FOREACH */ |
| 92 | 89 |
| 93 int _evsignal_set_handler(struct event_base *base, int evsignal, | 90 int _evsignal_set_handler(struct event_base *base, int evsignal, |
| 94 void (*fn)(int)); | 91 void (*fn)(int)); |
| 95 int _evsignal_restore_handler(struct event_base *base, int evsignal); | 92 int _evsignal_restore_handler(struct event_base *base, int evsignal); |
| 96 | 93 |
| 94 /* defined in evutil.c */ |
| 95 const char *evutil_getenv(const char *varname); |
| 96 |
| 97 #ifdef __cplusplus | 97 #ifdef __cplusplus |
| 98 } | 98 } |
| 99 #endif | 99 #endif |
| 100 | 100 |
| 101 #endif /* _EVENT_INTERNAL_H_ */ | 101 #endif /* _EVENT_INTERNAL_H_ */ |
| OLD | NEW |