File: timerwheel.h

package info (click to toggle)
syslog-ng 3.3.5-4
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 14,120 kB
  • sloc: ansic: 60,880; sh: 12,423; yacc: 7,308; xml: 1,554; makefile: 1,242; python: 801; lex: 262; perl: 216; awk: 184
file content (22 lines) | stat: -rw-r--r-- 818 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#ifndef TIMERWHEEL_H_INCLUDED
#define TIMERWHEEL_H_INCLUDED

#include "syslog-ng.h"

typedef struct _TWEntry TWEntry;
typedef void (*TWCallbackFunc)(guint64 now, gpointer user_data);
typedef struct _TimerWheel TimerWheel;

TWEntry *timer_wheel_add_timer(TimerWheel *self, gint timeout, TWCallbackFunc cb, gpointer user_data, GDestroyNotify user_data_free);
void timer_wheel_del_timer(TimerWheel *self, TWEntry *entry);
void timer_wheel_mod_timer(TimerWheel *self, TWEntry *entry, gint new_timeout);
guint64 timer_wheel_get_timer_expiration(TimerWheel *self, TWEntry *entry);

void timer_wheel_set_time(TimerWheel *self, guint64 new_now);
guint64 timer_wheel_get_time(TimerWheel *self);
void timer_wheel_expire_all(TimerWheel *self);
TimerWheel *timer_wheel_new(void);
void timer_wheel_free(TimerWheel *self);


#endif