summaryrefslogtreecommitdiffstats
path: root/source/lib/module.c
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2002-10-31 18:08:45 +0000
committerJelmer Vernooij <jelmer@samba.org>2002-10-31 18:08:45 +0000
commita82dbb3c22e6cb2096efb87c12a6006642806aac (patch)
treed691ee7a211b8b22b11df258f12a01d5cd6ea38d /source/lib/module.c
parent54115fd16ff10d1958153268dfd0f22f3c400bb5 (diff)
downloadsamba-a82dbb3c22e6cb2096efb87c12a6006642806aac.tar.gz
samba-a82dbb3c22e6cb2096efb87c12a6006642806aac.tar.xz
samba-a82dbb3c22e6cb2096efb87c12a6006642806aac.zip
add smb_load_modules() to load a list of modules - does this function look ok ?
Diffstat (limited to 'source/lib/module.c')
-rw-r--r--source/lib/module.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/source/lib/module.c b/source/lib/module.c
index f05a68b493c..2d8bd7459ff 100644
--- a/source/lib/module.c
+++ b/source/lib/module.c
@@ -53,6 +53,22 @@ NTSTATUS smb_load_module(const char *module_name)
return nt_status;
}
+/* Load all modules in list and return number of
+ * modules that has been successfully loaded */
+int smb_load_modules(const char **modules)
+{
+ int i;
+ int success = 0;
+
+ for(i = 0; modules[i]; i++){
+ if(NT_STATUS_IS_OK(smb_load_module(modules[i]))) {
+ success++;
+ }
+ }
+
+ return success;
+}
+
#else /* HAVE_DLOPEN */
NTSTATUS smb_load_module(const char *module_name)
@@ -61,4 +77,10 @@ NTSTATUS smb_load_module(const char *module_name)
return NT_STATUS_NOT_SUPPORTED;
}
+int smb_load_modules(const char **modules)
+{
+ DEBUG(0,("This samba executable has not been build with plugin support"));
+ return -1;
+}
+
#endif /* HAVE_DLOPEN */