Instrument Neutral Distributed Interface INDI
2.0.2
|
Public interface to INDI's eventloop mechanism. More...
Go to the source code of this file.
Typedefs | |
typedef void() | CBF(int fd, void *) |
Signature of a callback function. More... | |
typedef void() | WPF(void *) |
Signature of a work procedure function. More... | |
typedef void() | TCF(void *) |
Signature of a timer function. More... | |
Functions | |
void | eventLoop () |
Main calls this when ready to hand over control. More... | |
int | addCallback (int fd, CBF *fp, void *ud) |
void | rmCallback (int cid) |
int | addWorkProc (WPF *fp, void *ud) |
void | rmWorkProc (int wid) |
int | addTimer (int ms, TCF *fp, void *ud) |
int | addPeriodicTimer (int ms, TCF *fp, void *ud) |
int | remainingTimer (int tid) |
int | nsecRemainingTimer (int tid) |
void | rmTimer (int tid) |
void | addImmediateWork (TCF *fp, void *ud) |
int | deferLoop (int maxms, int *flagp) |
int | deferLoop0 (int maxms, int *flagp) |
Public interface to INDI's eventloop mechanism.
Definition in file eventloop.h.
CBF |
Signature of a callback function.
Definition at line 38 of file eventloop.h.
TCF |
Signature of a timer function.
Definition at line 48 of file eventloop.h.
WPF |
Signature of a work procedure function.
Definition at line 43 of file eventloop.h.
int addCallback | ( | int | fd, |
CBF * | fp, | ||
void * | ud | ||
) |
Register a new callback, fp, to be called with ud as argument when fd is ready.
fd | file descriptor. |
fp | a pointer to the callback function. |
ud | a pointer to be passed to the callback function when called. |
Definition at line 161 of file eventloop.c.
void addImmediateWork | ( | TCF * | fp, |
void * | ud | ||
) |
Register a given function to be called once after the current loop
fp | a pointer to the callback function. |
ud | a pointer to be passed to the callback function when called. |
Definition at line 524 of file eventloop.c.
int addPeriodicTimer | ( | int | ms, |
TCF * | fp, | ||
void * | ud | ||
) |
Register a new periodic timer function, fp, to be called with ud as argument after ms.
ms | timer period in milliseconds. |
fp | a pointer to the callback function. |
ud | a pointer to be passed to the callback function when called. |
Definition at line 253 of file eventloop.c.
int addTimer | ( | int | ms, |
TCF * | fp, | ||
void * | ud | ||
) |
Register a new single-shot timer function, fp, to be called with ud as argument after ms.
ms | timer period in milliseconds. |
fp | a pointer to the callback function. |
ud | a pointer to be passed to the callback function when called. |
Definition at line 248 of file eventloop.c.
int addWorkProc | ( | WPF * | fp, |
void * | ud | ||
) |
Add a new work procedure, fp, to be called with ud when nothing else to do.
fp | a pointer to the work procedure callback function. |
ud | a pointer to be passed to the callback function when called. |
Definition at line 329 of file eventloop.c.
int deferLoop | ( | int | maxms, |
int * | flagp | ||
) |
Definition at line 118 of file eventloop.c.
int deferLoop0 | ( | int | maxms, |
int * | flagp | ||
) |
Definition at line 141 of file eventloop.c.
void eventLoop | ( | ) |
Main calls this when ready to hand over control.
Definition at line 105 of file eventloop.c.
int nsecRemainingTimer | ( | int | tid | ) |
Returns the timer's remaining value in nanoseconds left until the timeout.
tid | the timer callback ID returned from addTimer() or addPeriodicTimer() |
int remainingTimer | ( | int | tid | ) |
Returns the timer's remaining value in milliseconds left until the timeout.
tid | the timer callback ID returned from addTimer() or addPeriodicTimer() |
Definition at line 311 of file eventloop.c.
void rmCallback | ( | int | cid | ) |
Remove a callback function.
cid | the callback ID returned from addCallback(). |
Definition at line 189 of file eventloop.c.
void rmTimer | ( | int | tid | ) |
Remove the timer with the given id, as returned from addTimer() or addPeriodicTimer().
tid | the timer callback ID returned from addTimer() or addPeriodicTimer(). |
Definition at line 286 of file eventloop.c.
void rmWorkProc | ( | int | wid | ) |
Remove the work procedure with the given id, as returned from addWorkProc().
wid | the work procedure callback ID returned from addWorkProc(). |
Definition at line 356 of file eventloop.c.