summaryrefslogtreecommitdiffstats
path: root/src/plugin.c
diff options
context:
space:
mode:
authorNalin Dahyabhai <nalin@blade.boston.redhat.com>2007-11-06 17:56:11 -0500
committerNalin Dahyabhai <nalin@blade.boston.redhat.com>2007-11-06 17:56:11 -0500
commit20a88ddae39851cab0e017a1022ec6825db51c50 (patch)
tree24fa74e031a3fa02fb2c7c8d3e4cac5474e555a5 /src/plugin.c
downloadslapi-nis-20a88ddae39851cab0e017a1022ec6825db51c50.tar.gz
slapi-nis-20a88ddae39851cab0e017a1022ec6825db51c50.tar.xz
slapi-nis-20a88ddae39851cab0e017a1022ec6825db51c50.zip
- bare minimal plugin, i think
Diffstat (limited to 'src/plugin.c')
-rw-r--r--src/plugin.c47
1 files changed, 47 insertions, 0 deletions
diff --git a/src/plugin.c b/src/plugin.c
new file mode 100644
index 0000000..91a6faf
--- /dev/null
+++ b/src/plugin.c
@@ -0,0 +1,47 @@
+#ifdef HAVE_CONFIG_H
+#include "../config.h"
+#endif
+
+#include <sys/types.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <dirsrv/slapi-plugin.h>
+
+#define PACKAGE_VERSION "0.0"
+
+
+/* the module initialization function */
+static Slapi_PluginDesc
+my_plugin_desc = {
+ .spd_id = "my-plugin",
+ .spd_vendor = "hamdingers.org",
+ .spd_version = PACKAGE_VERSION,
+ .spd_description = "sample plugin",
+};
+
+/* Set up the plugin. */
+static int
+start(Slapi_PBlock *pb)
+{
+ return 0;
+}
+
+/* Prepare for shutdown. */
+static int
+cleanup(Slapi_PBlock *pb)
+{
+ return 0;
+}
+
+int
+my_init_function(Slapi_PBlock *pb)
+{
+ slapi_pblock_set(pb, SLAPI_PLUGIN_VERSION, SLAPI_PLUGIN_VERSION_03);
+ slapi_pblock_set(pb, SLAPI_PLUGIN_DESCRIPTION, &my_plugin_desc);
+ slapi_pblock_set(pb, SLAPI_PLUGIN_START_FN, &start);
+ slapi_pblock_set(pb, SLAPI_PLUGIN_CLEANUP_FN, &cleanup);
+ slapi_log_error(SLAPI_LOG_PLUGIN, "my_init_function", "plugin registered\n");
+ return 0;
+}