summaryrefslogtreecommitdiff
path: root/atari
diff options
context:
space:
mode:
Diffstat (limited to 'atari')
-rw-r--r--atari/gui.c3
-rw-r--r--atari/misc.c5
-rw-r--r--atari/misc.h10
3 files changed, 16 insertions, 2 deletions
diff --git a/atari/gui.c b/atari/gui.c
index 47b669353..810c7646f 100644
--- a/atari/gui.c
+++ b/atari/gui.c
@@ -1085,6 +1085,7 @@ static struct gui_fetch_table atari_fetch_table = {
static struct gui_misc_table atari_misc_table = {
.schedule = atari_schedule,
+ .warning = atari_warn_user,
.quit = gui_quit,
.cert_verify = gui_cert_verify,
@@ -1193,7 +1194,7 @@ int main(int argc, char** argv)
nsurl_unref(url);
}
if (ret != NSERROR_OK) {
- warn_user(messages_get_errorcode(ret), 0);
+ atari_warn_user(messages_get_errorcode(ret), 0);
} else {
LOG("Entering Atari event mainloop...");
while (!atari_quit) {
diff --git a/atari/misc.c b/atari/misc.c
index b46afb5d0..8c940918b 100644
--- a/atari/misc.c
+++ b/atari/misc.c
@@ -53,7 +53,8 @@ struct is_process_running_callback_data {
bool found;
};
-void warn_user(const char *warning, const char *detail)
+/* exported function documented in atari/misc/h */
+nserror atari_warn_user(const char *warning, const char *detail)
{
size_t len = 1 + ((warning != NULL) ? strlen(messages_get(warning)) :
0) + ((detail != 0) ? strlen(detail) : 0);
@@ -62,6 +63,8 @@ void warn_user(const char *warning, const char *detail)
printf("%s\n", message);
gemtk_msg_box_show(GEMTK_MSG_BOX_ALERT, message);
+
+ return NSERROR_OK;
}
void die(const char *error)
diff --git a/atari/misc.h b/atari/misc.h
index a0e53d11e..0ccaaa7a8 100644
--- a/atari/misc.h
+++ b/atari/misc.h
@@ -89,4 +89,14 @@ long nkc_to_input_key(short nkc, long * ucs4_out);
*/
void die(const char * const error) __attribute__ ((noreturn));
+/**
+ * Warn the user of an event.
+ *
+ * \param[in] message A warning looked up in the message translation table
+ * \param[in] detail Additional text to be displayed or NULL.
+ * \return NSERROR_OK on success or error code if there was a
+ * faliure displaying the message to the user.
+ */
+nserror atari_warn_user(const char *warning, const char *detail);
+
#endif