lib/util Rename samba_init_module_fns_run -> samba_module_init_fns_run
[kai/samba.git] / source4 / ntptr / ntptr_base.c
index ccd29b4ca349aca988b6e9899a50fad3cc2b5a81..04114e9af5c71472994db6517559497dda43abeb 100644 (file)
@@ -7,7 +7,7 @@
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
+   the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
    
    This program is distributed in the hope that it will be useful,
@@ -16,8 +16,7 @@
    GNU General Public License for more details.
    
    You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 /*
   this implements the core code for all NTPTR modules. Backends register themselves here.
@@ -25,7 +24,8 @@
 
 #include "includes.h"
 #include "ntptr/ntptr.h"
-#include "build.h"
+#include "param/param.h"
+#include "lib/util/samba_module.h"
 
 /* the list of currently registered NTPTR backends */
 static struct ntptr_backend {
@@ -71,11 +71,13 @@ NTSTATUS ntptr_register(const void *_ops)
 
 NTSTATUS ntptr_init(void)
 {
-       init_module_fn static_init[] = STATIC_ntptr_MODULES;
-       init_module_fn *shared_init = load_samba_modules(NULL, "ntptr");
+#define _MODULE_PROTO(init) extern NTSTATUS init(void);
+       STATIC_ntptr_MODULES_PROTO;
+       samba_module_init_fn static_init[] = { STATIC_ntptr_MODULES };
+       samba_module_init_fn *shared_init = samba_modules_load(NULL, "ntptr");
 
-       run_init_functions(static_init);
-       run_init_functions(shared_init);
+       samba_module_init_fns_run(static_init);
+       samba_module_init_fns_run(shared_init);
 
        talloc_free(shared_init);
        
@@ -119,7 +121,9 @@ const struct ntptr_critical_sizes *ntptr_interface_version(void)
 /*
   create a ntptr_context with a specified NTPTR backend
 */
-NTSTATUS ntptr_init_context(TALLOC_CTX *mem_ctx, const char *providor, struct ntptr_context **_ntptr)
+NTSTATUS ntptr_init_context(TALLOC_CTX *mem_ctx, struct tevent_context *ev_ctx,
+                           struct loadparm_context *lp_ctx,
+                           const char *providor, struct ntptr_context **_ntptr)
 {
        NTSTATUS status;
        struct ntptr_context *ntptr;
@@ -132,6 +136,8 @@ NTSTATUS ntptr_init_context(TALLOC_CTX *mem_ctx, const char *providor, struct nt
        NT_STATUS_HAVE_NO_MEMORY(ntptr);
        ntptr->private_data     = NULL;
        ntptr->ops              = ntptr_backend_byname(providor);
+       ntptr->ev_ctx           = ev_ctx;
+       ntptr->lp_ctx           = lp_ctx;
 
        if (!ntptr->ops) {
                DEBUG(1,("ntptr_init_context: failed to find NTPTR providor='%s'\n",