QuickIO  0.2
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
apps.h
Go to the documentation of this file.
1 
12 #pragma once
13 #include "quickio.h"
14 
18 #define QIO_MAGIC_NUM 0xfc63e18a
19 
23 #define QUICKIO_APP(init, exit) \
24  guint __qio_is_app = QIO_MAGIC_NUM; \
25  gboolean __qio_app_init() \
26  { \
27  return init(); } \
28  gboolean __qio_app_exit() \
29  { \
30  return exit(); }
31 
35 #define QUICKIO_APP_TEST(test) \
36  gboolean __qio_app_test() \
37  { \
38  return test(); }
39 
43 typedef gboolean (*qio_app_cb)();
44 
48 struct app {
52  gchar *name;
53 
57  GModule *mod;
58 
63 
68 };
69 
73 void apps_init();
74 
78 void apps_test();
79 
84 static G_GNUC_UNUSED gboolean qio_app_noop() { return TRUE; }
GModule * mod
The actual module.
Definition: apps.h:57
qio_app_cb exit
Makes the app exit.
Definition: apps.h:67
gchar * name
The name of the app, just for logging purposes.
Definition: apps.h:52
gboolean(* qio_app_cb)()
Callback type expected from the apps.
Definition: apps.h:43
Every header, definition, and whatnot QuickIO needs to run.
What we know about an app.
Definition: apps.h:48
void apps_test()
Runs app->test() on all the apps.
qio_app_cb init
Default setup and run function.
Definition: apps.h:62
void apps_init()
Listens for new apps in configuration and runs them as they're discovered.