Instrument Neutral Distributed Interface INDI 2.2.5
eventloop.h
Go to the documentation of this file.
1#if 0
3Copyright (C) 2003 Elwood C. Downey
42022 Ludovic Pollet
5
6This library is free software;
7you can redistribute it and / or
8modify it under the terms of the GNU Lesser General Public
9License as published by the Free Software Foundation;
10either
11version 2.1 of the License, or (at your option) any later version.
12
13This library is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY;
15without even the implied warranty of
16MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17Lesser General Public License for more details.
18
19You should have received a copy of the GNU Lesser General Public
20License along with this library;
21if not, write to the Free Software
22Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110 - 1301 USA
23
24#endif
25
26#pragma once
27
33/* signature of a callback, workproc and timer function */
34
38typedef void(CBF)(int fd, void *);
39
43typedef void(WPF)(void *);
44
48typedef void(TCF)(void *);
49
50#ifdef __cplusplus
51extern "C" {
52#endif
53
57extern void eventLoop();
58
66extern int addCallback(int fd, CBF *fp, void *ud);
67
72extern void rmCallback(int cid);
73
80extern int addWorkProc(WPF *fp, void *ud);
81
86extern void rmWorkProc(int wid);
87
95extern int addTimer(int ms, TCF *fp, void *ud);
96
104extern int addPeriodicTimer(int ms, TCF *fp, void *ud);
105
111extern int remainingTimer(int tid);
112
118extern int nsecRemainingTimer(int tid);
119
124extern void rmTimer(int tid);
125
130extern void addImmediateWork(TCF * fp, void *ud);
131
132/* utility functions */
133extern int deferLoop(int maxms, int *flagp);
134extern int deferLoop0(int maxms, int *flagp);
135
136#ifdef __cplusplus
137}
138#endif
void eventLoop()
Main calls this when ready to hand over control.
Definition eventloop.c:109
int remainingTimer(int tid)
Definition eventloop.c:315
void rmCallback(int cid)
Definition eventloop.c:193
void rmWorkProc(int wid)
Definition eventloop.c:360
void() WPF(void *)
Signature of a work procedure function.
Definition eventloop.h:43
int addWorkProc(WPF *fp, void *ud)
Definition eventloop.c:333
int nsecRemainingTimer(int tid)
void rmTimer(int tid)
Definition eventloop.c:290
int addTimer(int ms, TCF *fp, void *ud)
Definition eventloop.c:252
int addPeriodicTimer(int ms, TCF *fp, void *ud)
Definition eventloop.c:257
void() CBF(int fd, void *)
Signature of a callback function.
Definition eventloop.h:38
void addImmediateWork(TCF *fp, void *ud)
Definition eventloop.c:528
int deferLoop0(int maxms, int *flagp)
Definition eventloop.c:145
int deferLoop(int maxms, int *flagp)
Definition eventloop.c:122
void() TCF(void *)
Signature of a timer function.
Definition eventloop.h:48
int addCallback(int fd, CBF *fp, void *ud)
Definition eventloop.c:165
int fd
Namespace to encapsulate INDI client, drivers, and mediator classes.