Instrument Neutral Distributed Interface INDI  1.9.2
eventloop.h
Go to the documentation of this file.
1 #if 0
2 INDI
3 Copyright (C) 2003 Elwood C. Downey
4 
5 This library is free software;
6 you can redistribute it and / or
7 modify it under the terms of the GNU Lesser General Public
8 License as published by the Free Software Foundation;
9 either
10 version 2.1 of the License, or (at your option) any later version.
11 
12 This library is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY;
14 without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 Lesser General Public License for more details.
17 
18 You should have received a copy of the GNU Lesser General Public
19 License along with this library;
20 if not, write to the Free Software
21 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110 - 1301 USA
22 
23 #endif
24 
25 #pragma once
26 
32 /* signature of a callback, workproc and timer function */
33 
37 typedef void(CBF)(int fd, void *);
38 
42 typedef void(WPF)(void *);
43 
47 typedef void(TCF)(void *);
48 
49 #ifdef __cplusplus
50 extern "C" {
51 #endif
52 
56 extern void eventLoop();
57 
65 extern int addCallback(int fd, CBF *fp, void *ud);
66 
71 extern void rmCallback(int cid);
72 
79 extern int addWorkProc(WPF *fp, void *ud);
80 
85 extern void rmWorkProc(int wid);
86 
94 extern int addTimer(int ms, TCF *fp, void *ud);
95 
103 extern int addPeriodicTimer(int ms, TCF *fp, void *ud);
104 
110 extern int remainingTimer(int tid);
111 
117 extern int nsecRemainingTimer(int tid);
118 
123 extern void rmTimer(int tid);
124 
125 /* utility functions */
126 extern int deferLoop(int maxms, int *flagp);
127 extern int deferLoop0(int maxms, int *flagp);
128 
129 #ifdef __cplusplus
130 }
131 #endif
addCallback
int addCallback(int fd, CBF *fp, void *ud)
Definition: eventloop.c:161
Aux::ANY
@ ANY
Definition: celestronauxpacket.h:86
addPeriodicTimer
int addPeriodicTimer(int ms, TCF *fp, void *ud)
Definition: eventloop.c:253
rmTimer
void rmTimer(int tid)
Definition: eventloop.c:286
rmWorkProc
void rmWorkProc(int wid)
Definition: eventloop.c:356
nsecRemainingTimer
int nsecRemainingTimer(int tid)
CBF
void() CBF(int fd, void *)
Signature of a callback function.
Definition: eventloop.h:37
rmCallback
void rmCallback(int cid)
Definition: eventloop.c:189
WPF
void() WPF(void *)
Signature of a work procedure function.
Definition: eventloop.h:42
eventLoop
void eventLoop()
Main calls this when ready to hand over control.
Definition: eventloop.c:105
addTimer
int addTimer(int ms, TCF *fp, void *ud)
Definition: eventloop.c:248
TCF
void() TCF(void *)
Signature of a timer function.
Definition: eventloop.h:47
remainingTimer
int remainingTimer(int tid)
Definition: eventloop.c:311
addWorkProc
int addWorkProc(WPF *fp, void *ud)
Definition: eventloop.c:329
fd
int fd
Definition: intelliscope.c:43
INDI
Namespace to encapsulate INDI client, drivers, and mediator classes.
Definition: AlignmentSubsystemForClients.cpp:11
deferLoop
int deferLoop(int maxms, int *flagp)
Definition: eventloop.c:118
deferLoop0
int deferLoop0(int maxms, int *flagp)
Definition: eventloop.c:141