{
static bool initialized = false;
- init_module_fn static_init[] = { STATIC_auth_MODULES, NULL };
+ init_module_fn static_init[] = { STATIC_auth_MODULES };
if (initialized) return NT_STATUS_OK;
initialized = true;
{
static bool initialized = false;
- init_module_fn static_init[] = { STATIC_gensec_MODULES, NULL };
+ init_module_fn static_init[] = { STATIC_gensec_MODULES };
init_module_fn *shared_init;
if (initialized) return NT_STATUS_OK;
"CFLAGS" => "list",
"LDFLAGS" => "list",
- "STANDARD_VISIBILITY" => "string"
+ "STANDARD_VISIBILITY" => "string",
+ "INIT_FUNCTION_SENTINEL" => "string"
},
"MODULE" => {
"SUBSYSTEM" => "string",
"LIBRARY_REALNAME" => "string",
"INIT_FUNCTION_TYPE" => "string",
+ "INIT_FUNCTION_SENTINEL" => "string",
"OUTPUT_TYPE" => "list",
"OBJ_FILES" => "list",
$DEFINE->{VAL} .= "\t$_, \\\n";
unless (/{/) {
my $fn = $key->{INIT_FUNCTION_TYPE};
- unless(defined($fn)) { $fn = "NTSTATUS (*) (void)"; }
$fn =~ s/\(\*\)/$_/;
$output .= "$fn;\n";
}
}
- $DEFINE->{VAL} =~ s/, \\\n$//g; # Remove the last comma
+ $DEFINE->{VAL} .= "\t$key->{INIT_FUNCTION_SENTINEL} \n";
push(@defines,$DEFINE);
}
unless(defined($subsys->{OUTPUT_TYPE})) {
$subsys->{OUTPUT_TYPE} = $default_ot;
}
+
+ unless (defined($subsys->{INIT_FUNCTION_TYPE})) { $subsys->{INIT_FUNCTION_TYPE} = "NTSTATUS (*) (void)"; }
+ unless (defined($subsys->{INIT_FUNCTION_SENTINEL})) { $subsys->{INIT_FUNCTION_SENTINEL} = "NULL"; }
+
add_libreplace($subsys);
}
return;
}
- unless (defined($lib->{INIT_FUNCTION_TYPE})) {
- $lib->{INIT_FUNCTION_TYPE} = "NTSTATUS (*) (void)";
- }
+ unless (defined($lib->{INIT_FUNCTION_TYPE})) { $lib->{INIT_FUNCTION_TYPE} = "NTSTATUS (*) (void)"; }
+
+ unless (defined($lib->{INIT_FUNCTION_SENTINEL})) { $lib->{INIT_FUNCTION_SENTINEL} = "NULL"; }
unless(defined($lib->{INSTALLDIR})) {
$lib->{INSTALLDIR} = "LIBDIR";
static void event_backend_init(void)
{
#if _SAMBA_BUILD_
- init_module_fn static_init[] = { STATIC_LIBEVENTS_MODULES, NULL };
+ init_module_fn static_init[] = { STATIC_LIBEVENTS_MODULES };
init_module_fn *shared_init;
if (event_backends) return;
shared_init = load_samba_modules(NULL, global_loadparm, "events");
ldb_rdn_name_init, \
ldb_paged_results_init, \
ldb_sort_init, \
- ldb_asq_init
+ ldb_asq_init, \
+ NULL
#endif
int ldb_global_init(void)
{
- int (*static_init_fns[])(void) = { STATIC_LIBLDB_MODULES, NULL };
+ int (*static_init_fns[])(void) = { STATIC_LIBLDB_MODULES };
static int initialized = 0;
int ret = 0, i;
NTSTATUS ntptr_init(struct loadparm_context *lp_ctx)
{
- init_module_fn static_init[] = { STATIC_ntptr_MODULES, NULL };
+ init_module_fn static_init[] = { STATIC_ntptr_MODULES };
init_module_fn *shared_init = load_samba_modules(NULL, lp_ctx, "ntptr");
run_init_functions(static_init);
NTSTATUS ntvfs_init(struct loadparm_context *lp_ctx)
{
static bool initialized = false;
- init_module_fn static_init[] = { STATIC_ntvfs_MODULES, NULL };
+ init_module_fn static_init[] = { STATIC_ntvfs_MODULES };
init_module_fn *shared_init;
if (initialized) return NT_STATUS_OK;
{
static bool initialized = false;
- init_module_fn static_init[] = { STATIC_sys_notify_MODULES, NULL };
+ init_module_fn static_init[] = { STATIC_sys_notify_MODULES };
init_module_fn *shared_init;
if (initialized) return NT_STATUS_OK;
*/
NTSTATUS share_init(void)
{
- init_module_fn static_init[] = { STATIC_share_MODULES, NULL };
+ init_module_fn static_init[] = { STATIC_share_MODULES };
run_init_functions(static_init);
NTSTATUS server_service_rpc_init(void)
{
- init_module_fn static_init[] = { STATIC_dcerpc_server_MODULES, NULL };
+ init_module_fn static_init[] = { STATIC_dcerpc_server_MODULES };
init_module_fn *shared_init = load_samba_modules(NULL, global_loadparm, "dcerpc_server");
run_init_functions(static_init);
*/
void smb_setup_ejs_functions(void (*exception_handler)(const char *))
{
- init_module_fn static_init[] = { STATIC_smbcalls_MODULES, NULL };
+ init_module_fn static_init[] = { STATIC_smbcalls_MODULES };
init_module_fn *shared_init;
ejs_exception_handler = exception_handler;
[SUBSYSTEM::LIBPYTHON]
PUBLIC_DEPENDENCIES = EXT_LIB_PYTHON
+INIT_FUNCTION_SENTINEL = { NULL, NULL }
OBJ_FILES = modules.o
[PYTHON::python_uuid]
NTSTATUS process_model_init(struct loadparm_context *lp_ctx)
{
- init_module_fn static_init[] = { STATIC_process_model_MODULES, NULL };
+ init_module_fn static_init[] = { STATIC_process_model_MODULES };
init_module_fn *shared_init = load_samba_modules(NULL, lp_ctx, "process_model");
run_init_functions(static_init);
bool opt_interactive = false;
int opt;
poptContext pc;
- init_module_fn static_init[] = { STATIC_service_MODULES, NULL };
+ init_module_fn static_init[] = { STATIC_service_MODULES };
init_module_fn *shared_init;
struct event_context *event_ctx;
NTSTATUS status;
int torture_init(void)
{
- init_module_fn static_init[] = { STATIC_torture_MODULES, NULL };
+ init_module_fn static_init[] = { STATIC_torture_MODULES };
init_module_fn *shared_init = load_samba_modules(NULL, cmdline_lp_ctx, "torture");
run_init_functions(static_init);