jsoninfo: put the plugin init hook in the functions table
[olsrd.git] / 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;