aboutsummaryrefslogtreecommitdiff
path: root/src/application.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/application.h')
-rw-r--r--src/application.h52
1 files changed, 52 insertions, 0 deletions
diff --git a/src/application.h b/src/application.h
index 2c0972b..ab082a0 100644
--- a/src/application.h
+++ b/src/application.h
@@ -134,15 +134,38 @@ typedef struct MESSENGER_Application
134 } settings; 134 } settings;
135} MESSENGER_Application; 135} MESSENGER_Application;
136 136
137/**
138 * Initializes the messenger application with
139 * startup arguments.
140 *
141 * @param app Messenger application
142 * @param argc Amount of arguments
143 * @param argv Arguments
144 */
137void 145void
138application_init(MESSENGER_Application *app, 146application_init(MESSENGER_Application *app,
139 int argc, 147 int argc,
140 char **argv); 148 char **argv);
141 149
150/**
151 * Returns the path from resources of the
152 * messenger application relative to its storage.
153 *
154 * @param app Messenger application
155 * @param path Path
156 * @return Resource path
157 */
142const gchar* 158const gchar*
143application_get_resource_path(MESSENGER_Application *app, 159application_get_resource_path(MESSENGER_Application *app,
144 const char *path); 160 const char *path);
145 161
162/**
163 * Runs the messenger application starting the
164 * second thread and waiting for the application
165 * to finish.
166 *
167 * @param app Messenger application
168 */
146void 169void
147application_run(MESSENGER_Application *app); 170application_run(MESSENGER_Application *app);
148 171
@@ -156,20 +179,49 @@ typedef void (*MESSENGER_ApplicationMessageEvent) (
156 const struct GNUNET_CHAT_Message *msg 179 const struct GNUNET_CHAT_Message *msg
157); 180);
158 181
182/**
183 * Calls a given event with the messenger application
184 * asyncronously but explicitly synchronized via mutex.
185 *
186 * @param app Messenger application
187 * @param event Event
188 */
159void 189void
160application_call_event(MESSENGER_Application *app, 190application_call_event(MESSENGER_Application *app,
161 MESSENGER_ApplicationEvent event); 191 MESSENGER_ApplicationEvent event);
162 192
193/**
194 * Calls a given message event with the messenger
195 * application asyncronously but explicitly synchronized
196 * via mutex.
197 *
198 * @param app Messenger application
199 * @param event Message event
200 * @param context Chat context
201 * @param message Message
202 */
163void 203void
164application_call_message_event(MESSENGER_Application *app, 204application_call_message_event(MESSENGER_Application *app,
165 MESSENGER_ApplicationMessageEvent event, 205 MESSENGER_ApplicationMessageEvent event,
166 struct GNUNET_CHAT_Context *context, 206 struct GNUNET_CHAT_Context *context,
167 const struct GNUNET_CHAT_Message *message); 207 const struct GNUNET_CHAT_Message *message);
168 208
209/**
210 * Signals the second thread to exit the application.
211 *
212 * @param app Messenger application
213 * @param signal Exit signal
214 */
169void 215void
170application_exit(MESSENGER_Application *app, 216application_exit(MESSENGER_Application *app,
171 MESSENGER_ApplicationSignal signal); 217 MESSENGER_ApplicationSignal signal);
172 218
219/**
220 * Returns the exit status of the messenger application.
221 *
222 * @param app Messenger application
223 * @return Exit status
224 */
173int 225int
174application_status(MESSENGER_Application *app); 226application_status(MESSENGER_Application *app);
175 227