Statistics
| Branch: | Revision:

iof-bird-daemon / sysdep / unix / timer.h @ 574b2324

History | View | Annotate | Download (1.11 KB)

1
/*
2
 *        BIRD -- Unix Timers
3
 *
4
 *        (c) 1998 Martin Mares <mj@ucw.cz>
5
 *
6
 *        Can be freely distributed and used under the terms of the GNU GPL.
7
 */
8

    
9
#ifndef _BIRD_TIMER_H_
10
#define _BIRD_TIMER_H_
11

    
12
#include <time.h>
13

    
14
#include "lib/birdlib.h"
15
#include "lib/timer.h"
16

    
17

    
18
typedef struct timer2 timer;
19
#if 0
20
static inline timer *tm_new(pool *p)
21
{ return (void *) tm2_new(p); }
22

23
static inline void tm_start(timer *t, bird_clock_t after)
24
{ tm2_start(t, after S_); }
25

26
static inline void tm_stop(timer *t)
27
{ tm2_stop(t); }
28

29
// void tm_dump_all(void);
30

31
//extern bird_clock_t now;                 /* Relative, monotonic time in seconds */
32
//extern bird_clock_t now_real;                /* Time in seconds since fixed known epoch */
33
//extern bird_clock_t boot_time;
34

35
static inline int tm_active(timer *t)
36
{ return tm2_active(t); }
37

38
static inline bird_clock_t tm_remains(timer *t)
39
{ return tm2_remains(t) TO_S; }
40

41
static inline void tm_start_max(timer *t, bird_clock_t after)
42
{ tm2_start_max(t, after S_); }
43

44
static inline timer * tm_new_set(pool *p, void (*hook)(timer *), void *data, uint rand, uint rec)
45
{ return tm2_new_init(p, hook, data, rec S_, rand S_); }
46

47
#endif
48

    
49

    
50

    
51
#endif