123456789101112131415161718192021222324252627282930313233343536 |
- #include "faux/faux.h"
- #include "faux/list.h"
- #include "faux/time.h"
- #include "faux/schev.h"
- #define FAUX_SCHEV_CLOCK_SOURCE CLOCK_MONOTONIC
- #define FAUX_SCHEV_CYCLES_INFINITE (-1)
- struct faux_ev_s {
- struct timespec time; // Planned time of event
- struct timespec interval; // Time interval for periodic event
- int cycles_num; // Number of cycles for periodic event
- faux_schev_periodic_t periodic; // Periodic flag
- int id; // Type of event
- void *data; // Arbitrary data linked to event
- };
- struct faux_schev_s {
- faux_list_t *list;
- };
- C_DECL_BEGIN
- int faux_ev_compare(const void *first, const void *second);
- int faux_ev_compare_id(const void *key, const void *list_item);
- int faux_ev_compare_data(const void *key, const void *list_item);
- faux_ev_t *faux_ev_new(const struct timespec *time, int ev_id, void *data);
- void faux_ev_free(void *ptr);
- int faux_ev_id(const faux_ev_t *ev);
- void *faux_ev_data(const faux_ev_t *ev);
- const struct timespec *faux_ev_time(const faux_ev_t *ev);
- C_DECL_END
|