mini: cleanup
authorFerry Huberts <ferry.huberts@pelagic.nl>
Wed, 13 Apr 2016 14:38:21 +0000 (16:38 +0200)
committerFerry Huberts <ferry.huberts@pelagic.nl>
Wed, 13 Apr 2016 15:02:01 +0000 (17:02 +0200)
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
lib/mini/src/mini_plugin.c [moved from lib/mini/src/olsrd_plugin.c with 95% similarity]
lib/mini/src/mini_plugin.h [moved from lib/mini/src/olsrd_plugin.h with 92% similarity]

similarity index 95%
rename from lib/mini/src/olsrd_plugin.c
rename to lib/mini/src/mini_plugin.c
index b5df87a..3309f9c 100644 (file)
   * Example plugin for olsrd.org OLSR daemon
   * Only the bare minimum
   */
+#include "mini_plugin.h"
 
 #include <stdio.h>
 #include <string.h>
 
-#include "../../../src/olsrd_plugin.h"
-
-#include "olsrd_plugin.h"
 #include "olsr.h"
+#include "builddata.h"
+#include "olsrd_plugin.h"
 
+#define PLUGIN_NAME              "OLSRD mini plugin"
 #define PLUGIN_INTERFACE_VERSION 5
 
 /****************************************************************************
@@ -111,6 +112,9 @@ static void my_fini(void) __attribute__ ((destructor));
 static void
 my_init(void)
 {
+  /* Print plugin info to stdout */
+  olsr_printf(0, "%s (%s)\n", PLUGIN_NAME, git_descriptor);
+
   printf("*** MINI: constructor\n");
 }
 
similarity index 92%
rename from lib/mini/src/olsrd_plugin.h
rename to lib/mini/src/mini_plugin.h
index bfc1ae3..0871b42 100644 (file)
@@ -34,8 +34,8 @@
  * Dynamic linked library for the olsr.org olsr daemon
  */
 
-#ifndef _OLSRD_PLUGIN_MINI
-#define _OLSRD_PLUGIN_MINI
+#ifndef _OLSRD_PLUGIN_MINI_H
+#define _OLSRD_PLUGIN_MINI_H
 
 /****************************************************************************
  *                Functions that the plugin MUST provide                    *
@@ -46,11 +46,4 @@ int olsrd_plugin_init(void);
 
 int olsrd_plugin_interface_version(void);
 
-#endif /* _OLSRD_PLUGIN_MINI */
-
-/*
- * Local Variables:
- * c-basic-offset: 2
- * indent-tabs-mode: nil
- * End:
- */
+#endif /* _OLSRD_PLUGIN_MINI_H */