This graph shows which files directly or indirectly include this file:
Go to the source code of this file.
Functions | |
void | muxevent_add (int time, int flags, int type, void(*func)(MUXEVENT *), void *data, void *data2) |
void | muxevent_run (void) |
int | muxevent_run_by_type (int type) |
int | muxevent_last_type (void) |
void | muxevent_initialize (void) |
void | muxevent_remove_data (void *data) |
void | muxevent_remote_type_data (int type, void *data) |
void | muxevent_remote_type_data2 (int type, void *data) |
void | muxevent_remote_type_data_data (int type, void *data, void *data2) |
int | muxevent_type_data (int type, void *data) |
void | muxevent_get_type_data (int type, void *data, int *data2) |
int | muxevent_count_type (int type) |
int | muxevent_count_type_data (int type, void *data) |
int | muxevent_count_type_data2 (int type, void *data) |
int | muxevent_count_type_data_data (int type, void *data, void *data2) |
int | muxevent_count_data (int type, void *data) |
int | muxevent_count_data_data (int type, void *data, void *data2) |
void | muxevent_gothru_type_data (int type, void *data, void(*func)(MUXEVENT *)) |
void | muxevent_gothru_type (int type, void(*func)(MUXEVENT *)) |
int | muxevent_last_type_data (int type, void *data) |
int | muxevent_first_type_data (int type, void *data) |
int | muxevent_count_type_data_firstev (int type, void *data) |
void muxevent_add | ( | int | time, | |
int | flags, | |||
int | type, | |||
void(*)(MUXEVENT *) | func, | |||
void * | data, | |||
void * | data2 | |||
) |
Definition at line 111 of file event.c.
00112 { 00113 MUXEVENT *e = (MUXEVENT *)0xDEADBEEF; 00114 struct timeval tv = { 0, 0}; 00115 00116 int i, spot; 00117 00118 if (time < 1) 00119 time = 1; 00120 /* Nasty thing about the new system : we _do_ have to allocate 00121 muxevent_first_in_type dynamically. */ 00122 if (type > last_muxevent_type) { 00123 muxevent_first_in_type = 00124 realloc(muxevent_first_in_type, sizeof(MUXEVENT *) * (type + 1)); 00125 for (i = last_muxevent_type + 1; i <= type; i++) 00126 muxevent_first_in_type[i] = NULL; 00127 last_muxevent_type = type; 00128 } 00129 if (muxevent_free_list) { 00130 e = muxevent_free_list; 00131 muxevent_free_list = muxevent_free_list->next; 00132 } else { 00133 e = malloc(sizeof(MUXEVENT)); 00134 memset(e, 0, sizeof(MUXEVENT)); 00135 } 00136 00137 e->flags = flags; 00138 e->function = func; 00139 e->data = data; 00140 e->data2 = data2; 00141 e->type = type; 00142 e->tick = muxevent_tick + time; 00143 e->next = NULL; 00144 00145 00146 tv.tv_sec = time; 00147 tv.tv_usec = 0; 00148 00149 evtimer_set(&e->ev, muxevent_wakeup, e); 00150 evtimer_add(&e->ev, &tv); 00151 00152 ADD_TO_BIDIR_LIST_HEAD(muxevent_list, prev_in_main, next_in_main, e); 00153 ADD_TO_BIDIR_LIST_HEAD(muxevent_first_in_type[type], prev_in_type, 00154 next_in_type, e); 00155 }
int muxevent_count_data | ( | int | type, | |
void * | data | |||
) |
int muxevent_count_data_data | ( | int | type, | |
void * | data, | |||
void * | data2 | |||
) |
int muxevent_count_type | ( | int | type | ) |
Definition at line 263 of file event.c.
00263 { 00264 MUXEVENT *e; 00265 int count = 0; 00266 00267 if (type > last_muxevent_type) 00268 return count; 00269 LoopType(type, e) 00270 count++; 00271 return count; 00272 }
int muxevent_count_type_data | ( | int | type, | |
void * | data | |||
) |
Definition at line 275 of file event.c.
00275 { 00276 MUXEVENT *e; 00277 int count = 0; 00278 00279 if (type > last_muxevent_type) 00280 return count; 00281 LoopType(type, e) 00282 if (e->data == data) 00283 count++; 00284 return count; 00285 }
int muxevent_count_type_data2 | ( | int | type, | |
void * | data | |||
) |
Definition at line 287 of file event.c.
00287 { 00288 MUXEVENT *e; 00289 int count = 0; 00290 00291 if (type > last_muxevent_type) 00292 return count; 00293 LoopType(type, e) 00294 if (e->data2 == data) 00295 count++; 00296 return count; 00297 }
int muxevent_count_type_data_data | ( | int | type, | |
void * | data, | |||
void * | data2 | |||
) |
Definition at line 299 of file event.c.
00299 { 00300 MUXEVENT *e; 00301 int count = 0; 00302 00303 if (type > last_muxevent_type) 00304 return count; 00305 LoopType(type, e) 00306 if (e->data == data && e->data2 == data2) 00307 count++; 00308 return count; 00309 }
int muxevent_count_type_data_firstev | ( | int | type, | |
void * | data | |||
) |
int muxevent_first_type_data | ( | int | type, | |
void * | data | |||
) |
Definition at line 364 of file event.c.
00364 { 00365 MUXEVENT *e; 00366 int last = -1, t; 00367 00368 if (type > last_muxevent_type) 00369 return last; 00370 LoopType(type, e) 00371 if (e->data == data) 00372 if ((t = (e->tick - muxevent_tick)) < last || last < 0) 00373 if (t > 0) 00374 last = t; 00375 return last; 00376 }
void muxevent_get_type_data | ( | int | type, | |
void * | data, | |||
int * | data2 | |||
) |
void muxevent_gothru_type | ( | int | type, | |
void(*)(MUXEVENT *) | func | |||
) |
Definition at line 342 of file event.c.
00342 { 00343 MUXEVENT *e; 00344 00345 if (type > last_muxevent_type) 00346 return; 00347 LoopType(type, e) 00348 func(e); 00349 }
void muxevent_gothru_type_data | ( | int | type, | |
void * | data, | |||
void(*)(MUXEVENT *) | func | |||
) |
Definition at line 332 of file event.c.
00332 { 00333 MUXEVENT *e; 00334 00335 if (type > last_muxevent_type) 00336 return; 00337 LoopType(type, e) 00338 if (e->data == data) 00339 func(e); 00340 }
void muxevent_initialize | ( | void | ) |
int muxevent_last_type | ( | void | ) |
int muxevent_last_type_data | ( | int | type, | |
void * | data | |||
) |
Definition at line 351 of file event.c.
00351 { 00352 MUXEVENT *e; 00353 int last = 0, t; 00354 00355 if (type > last_muxevent_type) 00356 return last; 00357 LoopType(type, e) 00358 if (e->data == data) 00359 if ((t = (e->tick - muxevent_tick)) > last) 00360 last = t; 00361 return last; 00362 }
void muxevent_remote_type_data | ( | int | type, | |
void * | data | |||
) |
void muxevent_remote_type_data2 | ( | int | type, | |
void * | data | |||
) |
void muxevent_remote_type_data_data | ( | int | type, | |
void * | data, | |||
void * | data2 | |||
) |
void muxevent_remove_data | ( | void * | data | ) |
Definition at line 211 of file event.c.
00211 { 00212 MUXEVENT *e; 00213 00214 for (e = muxevent_list; e; e = e->next_in_main) 00215 if (e->data == data) 00216 e->flags |= FLAG_ZOMBIE; 00217 }
void muxevent_run | ( | void | ) |
int muxevent_run_by_type | ( | int | type | ) |
Definition at line 181 of file event.c.
00181 { 00182 MUXEVENT *e; 00183 int ran = 0; 00184 00185 if (type <= last_muxevent_type) { 00186 for (e = muxevent_first_in_type[type]; e; e = e->next_in_type) { 00187 if (!Zombie(e)) { 00188 prerun_event(e); 00189 e->function(e); 00190 postrun_event(e); 00191 e->flags |= FLAG_ZOMBIE; 00192 ran++; 00193 } 00194 } 00195 } 00196 return ran; 00197 }
int muxevent_type_data | ( | int | type, | |
void * | data | |||
) |