diff options
Diffstat (limited to 'src/application.h')
-rw-r--r-- | src/application.h | 52 |
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 | */ | ||
137 | void | 145 | void |
138 | application_init(MESSENGER_Application *app, | 146 | application_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 | */ | ||
142 | const gchar* | 158 | const gchar* |
143 | application_get_resource_path(MESSENGER_Application *app, | 159 | application_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 | */ | ||
146 | void | 169 | void |
147 | application_run(MESSENGER_Application *app); | 170 | application_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 | */ | ||
159 | void | 189 | void |
160 | application_call_event(MESSENGER_Application *app, | 190 | application_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 | */ | ||
163 | void | 203 | void |
164 | application_call_message_event(MESSENGER_Application *app, | 204 | application_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 | */ | ||
169 | void | 215 | void |
170 | application_exit(MESSENGER_Application *app, | 216 | application_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 | */ | ||
173 | int | 225 | int |
174 | application_status(MESSENGER_Application *app); | 226 | application_status(MESSENGER_Application *app); |
175 | 227 | ||