about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2016-07-30 21:22:45 +0100
committerJames Booth <boothj5@gmail.com>2016-07-30 21:22:45 +0100
commit51a7588bc4acd45b0aebc5c021f5f196167f8962 (patch)
tree4c15f6243d02a998c1f6be32f5435ea408e009a0 /src
parentee79de61f3781f0c576a465c461669ebc9793d04 (diff)
downloadprofani-tty-51a7588bc4acd45b0aebc5c021f5f196167f8962.tar.gz
Add typedefs to C plugin API
Diffstat (limited to 'src')
-rw-r--r--src/plugins/profapi.c6
-rw-r--r--src/plugins/profapi.h9
2 files changed, 9 insertions, 6 deletions
diff --git a/src/plugins/profapi.c b/src/plugins/profapi.c
index e5f46cb4..9b99a944 100644
--- a/src/plugins/profapi.c
+++ b/src/plugins/profapi.c
@@ -44,9 +44,9 @@ int (*prof_cons_bad_cmd_usage)(const char *const cmd) = NULL;
 
 void (*_prof_register_command)(const char *filename, const char *command_name, int min_args, int max_args,
     char **synopsis, const char *description, char *arguments[][2], char **examples,
-    void(*callback)(char **args)) = NULL;
+    CMD_CB callback) = NULL;
 
-void (*_prof_register_timed)(const char *filename, void(*callback)(void), int interval_seconds) = NULL;
+void (*_prof_register_timed)(const char *filename, TIMED_CB callback, int interval_seconds) = NULL;
 
 void (*_prof_completer_add)(const char *filename, const char *key, char **items) = NULL;
 void (*_prof_completer_remove)(const char *filename, const char *key, char **items) = NULL;
@@ -67,7 +67,7 @@ void (*prof_log_info)(const char *message) = NULL;
 void (*prof_log_warning)(const char *message) = NULL;
 void (*prof_log_error)(const char *message) = NULL;
 
-void (*_prof_win_create)(const char *filename, PROF_WIN_TAG win, void(*input_handler)(PROF_WIN_TAG win, char *line)) = NULL;
+void (*_prof_win_create)(const char *filename, PROF_WIN_TAG win, WINDOW_CB input_handler) = NULL;
 int (*prof_win_exists)(PROF_WIN_TAG win) = NULL;
 int (*prof_win_focus)(PROF_WIN_TAG win) = NULL;
 int (*prof_win_show)(PROF_WIN_TAG win, char *line) = NULL;
diff --git a/src/plugins/profapi.h b/src/plugins/profapi.h
index c75b8f03..58e41fc1 100644
--- a/src/plugins/profapi.h
+++ b/src/plugins/profapi.h
@@ -43,6 +43,9 @@
 #define prof_win_create(win, input_handler) _prof_win_create(__FILE__, win, input_handler)
 
 typedef char* PROF_WIN_TAG;
+typedef void(*CMD_CB)(char **args);
+typedef void(*TIMED_CB)(void);
+typedef void(*WINDOW_CB)(PROF_WIN_TAG win, char *line);
 
 void (*prof_cons_alert)(void);
 int (*prof_cons_show)(const char * const message);
@@ -51,9 +54,9 @@ int (*prof_cons_bad_cmd_usage)(const char *const cmd);
 
 void (*_prof_register_command)(const char *filename, const char *command_name, int min_args, int max_args,
     char **synopsis, const char *description, char *arguments[][2], char **examples,
-    void(*callback)(char **args));
+    CMD_CB callback);
 
-void (*_prof_register_timed)(const char *filename, void(*callback)(void), int interval_seconds);
+void (*_prof_register_timed)(const char *filename, TIMED_CB callback, int interval_seconds);
 
 void (*_prof_completer_add)(const char *filename, const char *key, char **items);
 void (*_prof_completer_remove)(const char *filename, const char *key, char **items);
@@ -74,7 +77,7 @@ void (*prof_log_info)(const char *message);
 void (*prof_log_warning)(const char *message);
 void (*prof_log_error)(const char *message);
 
-void (*_prof_win_create)(const char *filename, PROF_WIN_TAG win, void(*input_handler)(PROF_WIN_TAG win, char *line));
+void (*_prof_win_create)(const char *filename, PROF_WIN_TAG win, WINDOW_CB input_handler);
 int (*prof_win_exists)(PROF_WIN_TAG win);
 int (*prof_win_focus)(PROF_WIN_TAG win);
 int (*prof_win_show)(PROF_WIN_TAG win, char *line);