2 Unix SMB/CIFS implementation.
3 Handling of idle/exit events
4 Copyright (C) Stefan (metze) Metzmacher 2003
5 Copyright (C) Andrew Bartlett 2011
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>.
21 #ifndef _SAMBA_MODULES_H
22 #define _SAMBA_MODULES_H
25 typedef NTSTATUS (init_module_function) (void);
26 typedef NTSTATUS (*init_module_fn) (void);
28 NTSTATUS init_samba_module(void);
30 /* this needs to be a string which is not in the C library. We
31 previously used "init_module", but that meant that modules which
32 did not define this function ended up calling the C library
33 function init_module() which makes a system call */
34 #define SAMBA_INIT_MODULE "samba_init_module"
37 * Obtain the init function from a shared library file
39 init_module_fn load_module(TALLOC_CTX *mem_ctx, const char *path);
42 * Run the specified init functions.
44 * @return true if all functions ran successfully, false otherwise
46 bool run_init_functions(init_module_fn *fns);
49 * Load the initialization functions from DSO files for a specific subsystem.
51 * Will return an array of function pointers to initialization functions
53 init_module_fn *load_samba_modules(TALLOC_CTX *mem_ctx, const char *subsystem);
55 int smb_load_modules(const char **modules);
56 NTSTATUS smb_probe_module(const char *subsystem, const char *module);
58 #endif /* _SAMBA_MODULES_H */