lib/util Rename load_samba_modules -> samba_modules_load
[kai/samba.git] / lib / util / samba_module.h
1 /*
2    Unix SMB/CIFS implementation.
3    Handling of idle/exit events
4    Copyright (C) Stefan (metze) Metzmacher      2003
5    Copyright (C) Andrew Bartlett 2011
6
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.
11
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.
16
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/>.
19 */
20
21 #ifndef _SAMBA_MODULES_H
22 #define _SAMBA_MODULES_H
23
24 /* Module support */
25 typedef NTSTATUS (*samba_init_module_fn) (void);
26
27 NTSTATUS samba_init_module(void);
28
29 /* this needs to be a string which is not in the C library. We
30    previously used "init_module", but that meant that modules which
31    did not define this function ended up calling the C library
32    function init_module() which makes a system call */
33 #define SAMBA_INIT_MODULE "samba_init_module"
34
35 /**
36  * Run the specified init functions.
37  *
38  * @return true if all functions ran successfully, false otherwise
39  */
40 bool samba_init_module_fns_run(samba_init_module_fn *fns);
41
42 /**
43  * Load the initialization functions from DSO files for a specific subsystem.
44  *
45  * Will return an array of function pointers to initialization functions
46  */
47 samba_init_module_fn *samba_modules_load(TALLOC_CTX *mem_ctx, const char *subsystem);
48
49 #endif /* _SAMBA_MODULES_H */