summaryrefslogtreecommitdiff
path: root/src/timer.h
blob: ef3e0a4a6690d5913e554e5488dd80c4194149a3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/*
 *
 * Ivy, C interface
 *
 * Copyright 1997-1999
 * Centre d'Etudes de la Navigation Aerienne
 *
 * Timers for select-based main loop
 *
 * $Id$
 *
 */

/* Module de gestion des timers autour d'un select */

typedef struct _timer *TimerId;
typedef void (*TimerCb)( TimerId id , void *user_data, unsigned long delta );

/* API  le temps est en millisecondes */
#define TIMER_LOOP -1			/* timer en boucle infinie */
TimerId TimerRepeatAfter( int count, long time, TimerCb cb, void *user_data );

void TimerModify( TimerId id, long time );

void TimerRemove( TimerId id );

/* Interface avec select */

struct timeval *TimerGetSmallestTimeout();

void TimerScan();