about summary refs log tree commit diff stats
path: root/src/plugins/api.c
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2016-03-07 20:36:25 +0000
committerJames Booth <boothj5@gmail.com>2016-03-07 20:36:25 +0000
commit5cabcf9b79880d550782da2967b9d67a531a8f7d (patch)
treeefdb501dc29c1bbd93802c4c419859a9acc576a9 /src/plugins/api.c
parent4094b75ccc19780e2e013ba897a09645a5ee4978 (diff)
downloadprofani-tty-5cabcf9b79880d550782da2967b9d67a531a8f7d.tar.gz
Plugins: Added callbacks init and close functions
Included destroy function in PluginWindowCallback
Diffstat (limited to 'src/plugins/api.c')
-rw-r--r--src/plugins/api.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/plugins/api.c b/src/plugins/api.c
index a3740f2f..e81467a9 100644
--- a/src/plugins/api.c
+++ b/src/plugins/api.c
@@ -239,12 +239,16 @@ api_win_exists(const char *tag)
 }
 
 void
-api_win_create(const char *tag, void *callback,
+api_win_create(
+    const char *tag,
+    void *callback,
+    void(*destroy)(void *callback),
     void(*callback_func)(PluginWindowCallback *window_callback, const char *tag, const char * const line))
 {
     PluginWindowCallback *window = malloc(sizeof(PluginWindowCallback));
     window->callback = callback;
     window->callback_func = callback_func;
+    window->destroy = destroy;
     callbacks_add_window_handler(tag, window);
     wins_new_plugin(tag);