jsoninfo: put the plugin init hook in the functions table
authorFerry Huberts <ferry.huberts@pelagic.nl>
Wed, 2 Dec 2015 10:31:09 +0000 (11:31 +0100)
committerFerry Huberts <ferry.huberts@pelagic.nl>
Wed, 2 Dec 2015 17:41:14 +0000 (18:41 +0100)
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
lib/jsoninfo/src/olsrd_jsoninfo.c

index 9c9a1e1..571b0a2 100644 (file)
@@ -87,6 +87,7 @@ static struct timer_entry *writetimer_entry;
 
 static printer_functions_t printer_functions = { //
     //
 
 static printer_functions_t printer_functions = { //
     //
+        .init = &plugin_init, //
         .determine_mime_type = &determine_mime_type, //
         .neighbors = &ipc_print_neighbors, //
         .links = &ipc_print_links, //
         .determine_mime_type = &determine_mime_type, //
         .neighbors = &ipc_print_neighbors, //
         .links = &ipc_print_links, //
@@ -165,7 +166,9 @@ int olsrd_plugin_init(void) {
   ipc_socket = -1;
   memset(&outbuffer, 0, sizeof(outbuffer));
 
   ipc_socket = -1;
   memset(&outbuffer, 0, sizeof(outbuffer));
 
-  plugin_init(PLUGIN_NAME);
+  if (printer_functions.init) {
+    (*printer_functions.init)(PLUGIN_NAME);
+  }
 
   plugin_ipc_init();
   return 1;
 
   plugin_ipc_init();
   return 1;