CsEvent *cs_event_new(int (*event_routine)(void *user_data)) |
Creates a new event. The returned CsEvent structure is used in subsequent schedulings. The function event_routine will be executed the event occurs. The event also includes a count of how many times it was executed.
event_routine: |
Pointer to the function to be called when the event occurs |
int cs_event_schedule(CsEvent *event, simtime_t time, void *user_data) |
Schedules an event for execution at a later time. The event must have been previously created with a cs_event_new call. If the event is scheduled in the past, a warning message is issued. For best performance, schedule events in the order in which they occur.
event: |
The event to schedule |
time: |
The time at which the event should occur |
user_data: |
Data to be passed on to the event_routine |
int cs_event_schedule_relative(CsEvent *event, simtime_t offset, void *user_data) |
Same as cs_event_schedule, but the scheduled time is specified as an offet from the current clock time.
event: |
The event to schedule |
offset: |
Scheduled time as an offset from the current clock time |
user_data: |
Data to be passed on to the event_routine |