poser
A C framework for POsix SERvices
Loading...
Searching...
No Matches
service.h
Go to the documentation of this file.
1#ifndef POSER_CORE_SERVICE_H
2#define POSER_CORE_SERVICE_H
3
8#include <poser/decl.h>
9
11#define MAXPANICHANDLERS 8
12
31C_CLASS_DECL(PSC_EAStartup);
32
33C_CLASS_DECL(PSC_Event);
34
38typedef void (*PSC_PanicHandler)(const char *msg) ATTR_NONNULL((1));
39
47DECLEXPORT PSC_Event *
49 ATTR_RETNONNULL ATTR_PURE;
50
58DECLEXPORT PSC_Event *
60 ATTR_RETNONNULL ATTR_PURE;
61
73DECLEXPORT PSC_Event *
75 ATTR_RETNONNULL ATTR_PURE;
76
88DECLEXPORT PSC_Event *
90 ATTR_RETNONNULL ATTR_PURE;
91
101DECLEXPORT PSC_Event *
103 ATTR_RETNONNULL ATTR_PURE;
104
111DECLEXPORT PSC_Event *
113 ATTR_RETNONNULL ATTR_PURE;
114
121DECLEXPORT PSC_Event *
123 ATTR_RETNONNULL ATTR_PURE;
124
132DECLEXPORT void
134
142DECLEXPORT void
144
152DECLEXPORT void
154
162DECLEXPORT void
164
172DECLEXPORT void
174 ATTR_NONNULL((1));
175
182DECLEXPORT void
184 ATTR_NONNULL((1));
185
194DECLEXPORT int
196
206DECLEXPORT int
208
217DECLEXPORT int
219
226DECLEXPORT void
228
238DECLEXPORT void
240
246DECLEXPORT void
248
257DECLEXPORT void
258PSC_Service_panic(const char *msg)
259 ATTR_NONNULL((1)) ATTR_NORETURN;
260
269DECLEXPORT void
270PSC_EAStartup_return(PSC_EAStartup *self, int rc)
271 CMETHOD;
272
273#endif
Event arguments for service (pre)startup events.
A simple event class.
void PSC_Service_shutdownUnlock(void)
Allow shutdown to continue.
void PSC_Service_unregisterPanic(PSC_PanicHandler handler)
Unregister a panic handler.
void PSC_Service_unregisterWrite(int id)
Unregister a file descriptor for write monitoring.
void PSC_Service_registerRead(int id)
Register a file descriptor for read monitoring.
void PSC_Service_panic(const char *msg)
Trigger a service panic.
void PSC_Service_registerWrite(int id)
Register a file descriptor for write monitoring.
void PSC_Service_quit(void)
Request the service to quit.
int PSC_Service_run(void)
Run the service.
void PSC_Service_registerPanic(PSC_PanicHandler handler)
Register a panic handler.
void PSC_Service_shutdownLock(void)
Delay shutdown of the service.
PSC_Event * PSC_Service_eventsDone(void)
All events for one loop iteration are processed.
void PSC_Service_unregisterRead(int id)
Unregister a file descriptor for read monitoring.
int PSC_Service_loop(void)
Run the service loop.
PSC_Event * PSC_Service_startup(void)
The service started.
PSC_Event * PSC_Service_readyWrite(void)
A file descriptor is ready for writing.
PSC_Event * PSC_Service_shutdown(void)
The service is shutting down.
PSC_Event * PSC_Service_readyRead(void)
A file descriptor is ready for reading.
PSC_Event * PSC_Service_tick(void)
The timer ticks.
int PSC_Service_setTickInterval(unsigned msec)
Set the timer tick interval.
PSC_Event * PSC_Service_prestartup(void)
The service is about to start.
void(* PSC_PanicHandler)(const char *msg)
A handler for a service panic.
Definition: service.h:38