00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038 #if !defined(_SPANDSP_SCHEDULE_H_)
00039 #define _SPANDSP_SCHEDULE_H_
00040
00041 typedef struct span_sched_state_s span_sched_state_t;
00042
00043 typedef void (*span_sched_callback_func_t)(span_sched_state_t *s, void *user_data);
00044
00045 typedef struct
00046 {
00047 uint64_t when;
00048 span_sched_callback_func_t callback;
00049 void *user_data;
00050 } span_sched_t;
00051
00052 struct span_sched_state_s
00053 {
00054 uint64_t ticker;
00055 int allocated;
00056 int max_to_date;
00057 span_sched_t *sched;
00058 logging_state_t logging;
00059 };
00060
00061 #if defined(__cplusplus)
00062 extern "C"
00063 {
00064 #endif
00065
00066 uint64_t span_schedule_next(span_sched_state_t *s);
00067 uint64_t span_schedule_time(span_sched_state_t *s);
00068
00069 int span_schedule_event(span_sched_state_t *s, int ms, void (*function)(span_sched_state_t *s, void *data), void *user_data);
00070 void span_schedule_update(span_sched_state_t *s, int samples);
00071 void span_schedule_del(span_sched_state_t *s, int id);
00072
00073 span_sched_state_t *span_schedule_init(span_sched_state_t *s);
00074 int span_schedule_release(span_sched_state_t *s);
00075
00076 #if defined(__cplusplus)
00077 }
00078 #endif
00079
00080 #endif
00081