mirror of
https://github.com/samba-team/samba.git
synced 2025-02-22 05:57:43 +03:00
lib/util Rename init_module_fn to samba_init_module_fn
This prepares for making the samba_module.h header public again, for OpenChange. I am keen to avoid too much API namespace pollution if we can.
This commit is contained in:
parent
7cf00e3231
commit
1935b7b6c2
@ -878,11 +878,11 @@ _PUBLIC_ NTSTATUS gensec_init(void)
|
||||
#define _MODULE_PROTO(init) extern NTSTATUS init(void);
|
||||
#ifdef STATIC_gensec_MODULES
|
||||
STATIC_gensec_MODULES_PROTO;
|
||||
init_module_fn static_init[] = { STATIC_gensec_MODULES };
|
||||
samba_init_module_fn static_init[] = { STATIC_gensec_MODULES };
|
||||
#else
|
||||
init_module_fn *static_init = NULL;
|
||||
samba_init_module_fn *static_init = NULL;
|
||||
#endif
|
||||
init_module_fn *shared_init;
|
||||
samba_init_module_fn *shared_init;
|
||||
|
||||
if (initialized) return NT_STATUS_OK;
|
||||
initialized = true;
|
||||
|
@ -28,7 +28,7 @@
|
||||
/**
|
||||
* Obtain the init function from a shared library file
|
||||
*/
|
||||
init_module_fn load_module(const char *path, bool is_probe, void **handle_out)
|
||||
samba_init_module_fn load_module(const char *path, bool is_probe, void **handle_out)
|
||||
{
|
||||
void *handle;
|
||||
void *init_fn;
|
||||
@ -57,7 +57,7 @@ init_module_fn load_module(const char *path, bool is_probe, void **handle_out)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
init_fn = (init_module_fn)dlsym(handle, SAMBA_INIT_MODULE);
|
||||
init_fn = (samba_init_module_fn)dlsym(handle, SAMBA_INIT_MODULE);
|
||||
|
||||
/* we could check dlerror() to determine if it worked, because
|
||||
dlsym() can validly return NULL, but what would we do with
|
||||
@ -75,20 +75,20 @@ init_module_fn load_module(const char *path, bool is_probe, void **handle_out)
|
||||
*handle_out = handle;
|
||||
}
|
||||
|
||||
return (init_module_fn)init_fn;
|
||||
return (samba_init_module_fn)init_fn;
|
||||
}
|
||||
|
||||
/**
|
||||
* Obtain list of init functions from the modules in the specified
|
||||
* directory
|
||||
*/
|
||||
static init_module_fn *load_modules(TALLOC_CTX *mem_ctx, const char *path)
|
||||
static samba_init_module_fn *load_modules(TALLOC_CTX *mem_ctx, const char *path)
|
||||
{
|
||||
DIR *dir;
|
||||
struct dirent *entry;
|
||||
char *filename;
|
||||
int success = 0;
|
||||
init_module_fn *ret = talloc_array(mem_ctx, init_module_fn, 2);
|
||||
samba_init_module_fn *ret = talloc_array(mem_ctx, samba_init_module_fn, 2);
|
||||
|
||||
ret[0] = NULL;
|
||||
|
||||
@ -106,7 +106,7 @@ static init_module_fn *load_modules(TALLOC_CTX *mem_ctx, const char *path)
|
||||
|
||||
ret[success] = load_module(filename, true, NULL);
|
||||
if (ret[success]) {
|
||||
ret = talloc_realloc(mem_ctx, ret, init_module_fn, success+2);
|
||||
ret = talloc_realloc(mem_ctx, ret, samba_init_module_fn, success+2);
|
||||
success++;
|
||||
ret[success] = NULL;
|
||||
}
|
||||
@ -124,7 +124,7 @@ static init_module_fn *load_modules(TALLOC_CTX *mem_ctx, const char *path)
|
||||
*
|
||||
* @return true if all functions ran successfully, false otherwise
|
||||
*/
|
||||
bool run_init_functions(init_module_fn *fns)
|
||||
bool run_init_functions(samba_init_module_fn *fns)
|
||||
{
|
||||
int i;
|
||||
bool ret = true;
|
||||
@ -143,10 +143,10 @@ bool run_init_functions(init_module_fn *fns)
|
||||
* Will return an array of function pointers to initialization functions
|
||||
*/
|
||||
|
||||
init_module_fn *load_samba_modules(TALLOC_CTX *mem_ctx, const char *subsystem)
|
||||
samba_init_module_fn *load_samba_modules(TALLOC_CTX *mem_ctx, const char *subsystem)
|
||||
{
|
||||
char *path = modules_path(mem_ctx, subsystem);
|
||||
init_module_fn *ret;
|
||||
samba_init_module_fn *ret;
|
||||
|
||||
ret = load_modules(mem_ctx, path);
|
||||
|
||||
@ -162,7 +162,7 @@ init_module_fn *load_samba_modules(TALLOC_CTX *mem_ctx, const char *subsystem)
|
||||
static NTSTATUS do_smb_load_module(const char *module_name, bool is_probe)
|
||||
{
|
||||
void *handle;
|
||||
init_module_fn init;
|
||||
samba_init_module_fn init;
|
||||
NTSTATUS status;
|
||||
|
||||
init = load_module(module_name, is_probe, &handle);
|
||||
|
@ -22,7 +22,7 @@
|
||||
#define _SAMBA_MODULES_H
|
||||
|
||||
/* Module support */
|
||||
typedef NTSTATUS (*init_module_fn) (void);
|
||||
typedef NTSTATUS (*samba_init_module_fn) (void);
|
||||
|
||||
NTSTATUS samba_init_module(void);
|
||||
|
||||
@ -37,21 +37,21 @@ NTSTATUS samba_init_module(void);
|
||||
*
|
||||
* The handle to dlclose() in case of error is returns in *handle if handle is not NULL
|
||||
*/
|
||||
init_module_fn load_module(const char *path, bool is_probe, void **handle);
|
||||
samba_init_module_fn load_module(const char *path, bool is_probe, void **handle);
|
||||
|
||||
/**
|
||||
* Run the specified init functions.
|
||||
*
|
||||
* @return true if all functions ran successfully, false otherwise
|
||||
*/
|
||||
bool run_init_functions(init_module_fn *fns);
|
||||
bool run_init_functions(samba_init_module_fn *fns);
|
||||
|
||||
/**
|
||||
* Load the initialization functions from DSO files for a specific subsystem.
|
||||
*
|
||||
* Will return an array of function pointers to initialization functions
|
||||
*/
|
||||
init_module_fn *load_samba_modules(TALLOC_CTX *mem_ctx, const char *subsystem);
|
||||
samba_init_module_fn *load_samba_modules(TALLOC_CTX *mem_ctx, const char *subsystem);
|
||||
|
||||
int smb_load_modules(const char **modules);
|
||||
NTSTATUS smb_probe_module(const char *subsystem, const char *module);
|
||||
|
@ -660,7 +660,7 @@ _PUBLIC_ NTSTATUS auth4_init(void)
|
||||
static bool initialized = false;
|
||||
#define _MODULE_PROTO(init) extern NTSTATUS init(void);
|
||||
STATIC_auth4_MODULES_PROTO;
|
||||
init_module_fn static_init[] = { STATIC_auth4_MODULES };
|
||||
samba_init_module_fn static_init[] = { STATIC_auth4_MODULES };
|
||||
|
||||
if (initialized) return NT_STATUS_OK;
|
||||
initialized = true;
|
||||
|
@ -73,8 +73,8 @@ NTSTATUS ntptr_init(void)
|
||||
{
|
||||
#define _MODULE_PROTO(init) extern NTSTATUS init(void);
|
||||
STATIC_ntptr_MODULES_PROTO;
|
||||
init_module_fn static_init[] = { STATIC_ntptr_MODULES };
|
||||
init_module_fn *shared_init = load_samba_modules(NULL, "ntptr");
|
||||
samba_init_module_fn static_init[] = { STATIC_ntptr_MODULES };
|
||||
samba_init_module_fn *shared_init = load_samba_modules(NULL, "ntptr");
|
||||
|
||||
run_init_functions(static_init);
|
||||
run_init_functions(shared_init);
|
||||
|
@ -230,8 +230,8 @@ NTSTATUS ntvfs_init(struct loadparm_context *lp_ctx)
|
||||
static bool initialized = false;
|
||||
#define _MODULE_PROTO(init) extern NTSTATUS init(void);
|
||||
STATIC_ntvfs_MODULES_PROTO;
|
||||
init_module_fn static_init[] = { STATIC_ntvfs_MODULES };
|
||||
init_module_fn *shared_init;
|
||||
samba_init_module_fn static_init[] = { STATIC_ntvfs_MODULES };
|
||||
samba_init_module_fn *shared_init;
|
||||
|
||||
if (initialized) return NT_STATUS_OK;
|
||||
initialized = true;
|
||||
|
@ -87,8 +87,8 @@ NTSTATUS pvfs_acl_init(void)
|
||||
static bool initialized = false;
|
||||
#define _MODULE_PROTO(init) extern NTSTATUS init(void);
|
||||
STATIC_pvfs_acl_MODULES_PROTO;
|
||||
init_module_fn static_init[] = { STATIC_pvfs_acl_MODULES };
|
||||
init_module_fn *shared_init;
|
||||
samba_init_module_fn static_init[] = { STATIC_pvfs_acl_MODULES };
|
||||
samba_init_module_fn *shared_init;
|
||||
|
||||
if (initialized) return NT_STATUS_OK;
|
||||
initialized = true;
|
||||
|
@ -113,7 +113,7 @@ _PUBLIC_ NTSTATUS sys_lease_init(void)
|
||||
static bool initialized = false;
|
||||
#define _MODULE_PROTO(init) extern NTSTATUS init(void);
|
||||
STATIC_sys_lease_MODULES_PROTO;
|
||||
init_module_fn static_init[] = { STATIC_sys_lease_MODULES };
|
||||
samba_init_module_fn static_init[] = { STATIC_sys_lease_MODULES };
|
||||
|
||||
if (initialized) return NT_STATUS_OK;
|
||||
initialized = true;
|
||||
|
@ -137,7 +137,7 @@ _PUBLIC_ NTSTATUS sys_notify_init(void)
|
||||
static bool initialized = false;
|
||||
#define _MODULE_PROTO(init) extern NTSTATUS init(void);
|
||||
STATIC_sys_notify_MODULES_PROTO;
|
||||
init_module_fn static_init[] = { STATIC_sys_notify_MODULES };
|
||||
samba_init_module_fn static_init[] = { STATIC_sys_notify_MODULES };
|
||||
|
||||
if (initialized) return NT_STATUS_OK;
|
||||
initialized = true;
|
||||
|
@ -149,7 +149,7 @@ NTSTATUS share_init(void)
|
||||
{
|
||||
#define _MODULE_PROTO(init) extern NTSTATUS init(void);
|
||||
STATIC_share_MODULES_PROTO;
|
||||
init_module_fn static_init[] = { STATIC_share_MODULES };
|
||||
samba_init_module_fn static_init[] = { STATIC_share_MODULES };
|
||||
|
||||
run_init_functions(static_init);
|
||||
|
||||
|
@ -1228,8 +1228,8 @@ void dcerpc_server_init(struct loadparm_context *lp_ctx)
|
||||
static bool initialized;
|
||||
#define _MODULE_PROTO(init) extern NTSTATUS init(void);
|
||||
STATIC_dcerpc_server_MODULES_PROTO;
|
||||
init_module_fn static_init[] = { STATIC_dcerpc_server_MODULES };
|
||||
init_module_fn *shared_init;
|
||||
samba_init_module_fn static_init[] = { STATIC_dcerpc_server_MODULES };
|
||||
samba_init_module_fn *shared_init;
|
||||
|
||||
if (initialized) {
|
||||
return;
|
||||
|
@ -103,8 +103,8 @@ _PUBLIC_ NTSTATUS process_model_init(struct loadparm_context *lp_ctx)
|
||||
{
|
||||
#define _MODULE_PROTO(init) extern NTSTATUS init(void);
|
||||
STATIC_process_model_MODULES_PROTO;
|
||||
init_module_fn static_init[] = { STATIC_process_model_MODULES };
|
||||
init_module_fn *shared_init;
|
||||
samba_init_module_fn static_init[] = { STATIC_process_model_MODULES };
|
||||
samba_init_module_fn *shared_init;
|
||||
static bool initialised;
|
||||
|
||||
if (initialised) {
|
||||
|
@ -292,8 +292,8 @@ static int binary_smbd_main(const char *binary_name, int argc, const char *argv[
|
||||
poptContext pc;
|
||||
#define _MODULE_PROTO(init) extern NTSTATUS init(void);
|
||||
STATIC_service_MODULES_PROTO;
|
||||
init_module_fn static_init[] = { STATIC_service_MODULES };
|
||||
init_module_fn *shared_init;
|
||||
samba_init_module_fn static_init[] = { STATIC_service_MODULES };
|
||||
samba_init_module_fn *shared_init;
|
||||
struct tevent_context *event_ctx;
|
||||
uint16_t stdin_event_flags;
|
||||
NTSTATUS status;
|
||||
|
@ -602,7 +602,7 @@ int main(int argc,char *argv[])
|
||||
}
|
||||
|
||||
if (extra_module != NULL) {
|
||||
init_module_fn fn = load_module(poptGetOptArg(pc), false, NULL);
|
||||
samba_init_module_fn fn = load_module(poptGetOptArg(pc), false, NULL);
|
||||
|
||||
if (fn == NULL)
|
||||
d_printf("Unable to load module from %s\n", poptGetOptArg(pc));
|
||||
|
@ -48,8 +48,8 @@ _PUBLIC_ int torture_init(void)
|
||||
{
|
||||
#define _MODULE_PROTO(init) extern NTSTATUS init(void);
|
||||
STATIC_smbtorture_MODULES_PROTO;
|
||||
init_module_fn static_init[] = { STATIC_smbtorture_MODULES };
|
||||
init_module_fn *shared_init = load_samba_modules(NULL, "smbtorture");
|
||||
samba_init_module_fn static_init[] = { STATIC_smbtorture_MODULES };
|
||||
samba_init_module_fn *shared_init = load_samba_modules(NULL, "smbtorture");
|
||||
|
||||
run_init_functions(static_init);
|
||||
run_init_functions(shared_init);
|
||||
|
Loading…
x
Reference in New Issue
Block a user