#include "p.event.h"
Include dependency graph for muxevent.h:
This graph shows which files directly or indirectly include this file:
Go to the source code of this file.
Data Structures | |
struct | my_event_type |
Defines | |
#define | FLAG_FREE_DATA 1 |
#define | FLAG_FREE_DATA2 2 |
#define | FLAG_ZOMBIE 4 |
#define | muxevent_add_simple_arg(time, func, data) muxevent_add(time,0,0,func,data, NULL) |
#define | muxevent_add_simple_noarg(time, func) muxevent_add(time,0,0,func,NULL, NULL) |
#define | REMOVE_FROM_LIST(a, c, b) |
#define | REMOVE_FROM_BIDIR_LIST(a, c, d, b) |
#define | ADD_TO_LIST_HEAD(a, c, b) b->c = a ; a = b |
#define | ADD_TO_BIDIR_LIST_HEAD(a, c, d, b) |
#define | debug(a...) |
Typedefs | |
typedef my_event_type | MUXEVENT |
Functions | |
void | muxevent_add (int time, int flags, int type, void(*func)(MUXEVENT *), void *data, void *data2) |
void | muxevent_gothru_type_data (int type, void *data, void(*func)(MUXEVENT *)) |
void | event_gothru_type (int type, void(*func)(MUXEVENT *)) |
Variables | |
int | muxevent_tick |
#define ADD_TO_BIDIR_LIST_HEAD | ( | a, | |||
c, | |||||
d, | |||||
b | ) |
Definition at line 77 of file muxevent.h.
#define debug | ( | a... | ) |
Definition at line 88 of file muxevent.h.
#define FLAG_FREE_DATA 1 |
Definition at line 24 of file muxevent.h.
#define FLAG_FREE_DATA2 2 |
Definition at line 25 of file muxevent.h.
#define FLAG_ZOMBIE 4 |
Definition at line 26 of file muxevent.h.
#define muxevent_add_simple_arg | ( | time, | |||
func, | |||||
data | ) | muxevent_add(time,0,0,func,data, NULL) |
Definition at line 64 of file muxevent.h.
#define muxevent_add_simple_noarg | ( | time, | |||
func | ) | muxevent_add(time,0,0,func,NULL, NULL) |
Definition at line 65 of file muxevent.h.
#define REMOVE_FROM_BIDIR_LIST | ( | a, | |||
c, | |||||
d, | |||||
b | ) |
Value:
if (b->c) b->c->d = b->d; \ if (b->d) b->d->c = b->c; if (a==b) { a=b->d; if (a) a->c=NULL; }
Definition at line 74 of file muxevent.h.
#define REMOVE_FROM_LIST | ( | a, | |||
c, | |||||
b | ) |
Value:
if (a == b ) a = b->c; else { MUXEVENT *t; \ for (t=a;t->c != b;t=t->c); t->c = b->c; }
Definition at line 72 of file muxevent.h.
typedef struct my_event_type MUXEVENT |
void event_gothru_type | ( | int | type, | |
void(*)(MUXEVENT *) | func | |||
) |
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 }
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 }
int muxevent_tick |
Definition at line 70 of file event.c.
Referenced by aero_move_event(), ai_check_path(), cause_internaldamage(), cheat_find_last(), CheckDamage(), describe_repairs(), DestroyParts(), DSOkToNotify(), Dump_Decrease(), game_lag(), HandleOverheat(), map_update(), MNumber(), muxevent_add(), muxevent_first_type_data(), muxevent_last_type_data(), muxevent_run(), recycle_weaponry(), save_event(), sendchannelstuff(), UpdateHeat(), and UpdatePilotSkillRolls().