]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
In the plugins2 branch, rename "init" to "initvt" in all reference to
authorGreg Hudson <ghudson@mit.edu>
Mon, 26 Jul 2010 22:14:21 +0000 (22:14 +0000)
committerGreg Hudson <ghudson@mit.edu>
Mon, 26 Jul 2010 22:14:21 +0000 (22:14 +0000)
module vtable initializer functions.

git-svn-id: svn://anonsvn.mit.edu/krb5/branches/plugins2@24213 dc483132-0cff-0310-8789-dd5450dbe970

README.BRANCH
pwqual_combo/combo.c
src/include/k5-int.h
src/include/krb5/plugin.h
src/lib/kadm5/server_internal.h
src/lib/kadm5/srv/pwqual.c
src/lib/kadm5/srv/pwqual_dict.c
src/lib/kadm5/srv/pwqual_policy.c
src/lib/kadm5/srv/server_misc.c
src/lib/krb5/krb/plugin.c

index 8e21907962f78c29cd4fea719a0225eba9ab1788..cc6b2c65f860606d5bec6a369896a575837225b6 100644 (file)
@@ -50,17 +50,17 @@ API consists of:
 
 A dynamic object can implement one or more plugin modules.  To
 implement a plugin module, a dynamic object exports a symbol named
-<interfacename>_<modulename>_init.
+<interfacename>_<modulename>_initvt.
 
-Module init functions accept as arguments a krb5_context, a major
+Module initvt functions accept as arguments a krb5_context, a major
 version, a minor version, and a pointer to a caller-allocated vtable
 (passed as an abstract type).  Major versions correspond to complete
 revisions of the vtable, while minor versions indicate extensions of a
 vtable type.
 
-Based on the major version, the init function casts the vtable pointer
-to the correct interface-specific type, and then fills in fields of
-that vtable, stopping as indicated by the minor version.
+Based on the major version, the initvt function casts the vtable
+pointer to the correct interface-specific type, and then fills in
+fields of that vtable, stopping as indicated by the minor version.
 
 4. Framework
 
@@ -68,9 +68,9 @@ The following functions are used by interface-specific loader
 functions:
 
 * k5_plugin_load: Given a numeric interface ID and a module name,
-  return the init function for the named module.
+  return the initvt function for the named module.
 
-* k5_plugin_load_all: Given a numeric interface ID, return the init
+* k5_plugin_load_all: Given a numeric interface ID, return the initvt
   functions of all modules for that interface.
 
 The following function is used by pluggable interface consumers:
@@ -180,13 +180,6 @@ demonstration branch it is not perfect.  Problems include:
   revisited, the framework's data model will need to be made a little
   more complicated to allow it.
 
-* For brevity, vtable constructor functions are called "init"
-  functions in the code.  That name may be too vague, and may fool
-  module implementors into thinking the init function is responsible
-  for more than just vtable construction (such as the initialization
-  of private module data).  This may need to be renamed to something
-  more specific like "initvt".
-
 * The pwqual vtable declarations put function signatures directly into
   the vtable structure definition, with comments describing each
   function's contract alongside the signature.  This is consistent
index 5c756e48b6705e201837cea9d5bc3da2bfcbbabe..7f6613d9df7e578d7c1615b4aa80fbfd9342f87d 100644 (file)
@@ -168,8 +168,8 @@ combo_close(krb5_context context, krb5_pwqual_moddata data)
 }
 
 krb5_error_code
-pwqual_combo_init(krb5_context context, int maj_ver, int min_ver,
-                 krb5_plugin_vtable vtable)
+pwqual_combo_initvt(krb5_context context, int maj_ver, int min_ver,
+                    krb5_plugin_vtable vtable)
 {
     krb5_pwqual_vtable vt;
 
index cb7c5ae9e057cc60564b5298c6c579b33cb2b20b..89bc79d077730b30278c88c2c3d3f4187ce272d2 100644 (file)
@@ -1432,13 +1432,13 @@ krb5_authdata_free_internal(krb5_context kcontext,
 /* Plugin framework */
 
 /*
- * A linked list entry mapping a module name to a module init function.  The
+ * A linked list entry mapping a module name to a module initvt function.  The
  * entry may also include a dynamic object handle so that it can be released
  * when the context is destroyed.
  */
 struct plugin_mapping {
     char *modname;
-    krb5_plugin_init_fn module;
+    krb5_plugin_initvt_fn module;
     struct plugin_file_handle *dyn_handle;
     struct plugin_mapping *next;
 };
@@ -1458,22 +1458,22 @@ struct plugin_interface {
  * storing the result into module. */
 krb5_error_code
 k5_plugin_load(krb5_context context, int interface_id, const char *modname,
-               krb5_plugin_init_fn *module);
+               krb5_plugin_initvt_fn *module);
 
 /* Retrieve all plugin modules of type interface_id, storing the result
  * into modules.  Free the result with k5_plugin_free_handles. */
 krb5_error_code
 k5_plugin_load_all(krb5_context context, int interface_id,
-                   krb5_plugin_init_fn **modules);
+                   krb5_plugin_initvt_fn **modules);
 
 /* Release a module list allocated by k5_plugin_load_all. */
 void
-k5_plugin_free_modules(krb5_context context, krb5_plugin_init_fn *modules);
+k5_plugin_free_modules(krb5_context context, krb5_plugin_initvt_fn *modules);
 
 /* Register a plugin module of type interface_id and name modname. */
 krb5_error_code
 k5_plugin_register(krb5_context context, int interface_id, const char *modname,
-                   krb5_plugin_init_fn module);
+                   krb5_plugin_initvt_fn module);
 
 /* Destroy the module state within context; used by krb5_free_context. */
 void
index 9c6c0f448ef057f31a03304af423c384677cf498..f43406ab8ee40a15f6efe705773dfb8c63de4d41 100644 (file)
 #ifndef KRB5_PLUGIN_H
 #define KRB5_PLUGIN_H
 
-/* krb5_plugin_vtable is an abstract type.  Module init functions will cast it
- * to the appropriate interface-specific vtable type. */
+/* krb5_plugin_vtable is an abstract type.  Module initvt functions will cast
+ * it to the appropriate interface-specific vtable type. */
 typedef struct krb5_plugin_vtable_st *krb5_plugin_vtable;
 
 /*
-  krb5_plugin_init_fn is the type of a module init function.  Based on the
- * maj_ver argument, the init function should cast vtable to the appropriate
- * type and then fill it in.  If a vtable has been expanded, min_ver indicates
- * which version of the vtable is being filled in.
+ * krb5_plugin_initvt_fn is the type of all module initvt functions.  Based on
+ * the maj_ver argument, the initvt function should cast vtable to the
+ * appropriate type and then fill it in.  If a vtable has been expanded,
+ * min_ver indicates which version of the vtable is being filled in.
  */
 typedef krb5_error_code
-(*krb5_plugin_init_fn)(krb5_context context, int maj_ver, int min_ver,
-                       krb5_plugin_vtable vtable);
+(*krb5_plugin_initvt_fn)(krb5_context context, int maj_ver, int min_ver,
+                         krb5_plugin_vtable vtable);
 
 #endif /* KRB5_PLUGIN_H */
index 52f71e9e5a08b1d926a61719cdedba4ce96a1f9d..ceab3c965d1e554dd3cff7fd79ae3d93402ed883 100644 (file)
@@ -184,16 +184,16 @@ k5_pwqual_check(krb5_context context, pwqual_handle handle,
 void
 k5_pwqual_close(krb5_context context, pwqual_handle handle);
 
-/*** Init functions for built-in password quality modules ***/
+/*** initvt functions for built-in password quality modules ***/
 
 /* The dict module checks passwords against the realm's dictionary. */
 krb5_error_code
-pwqual_dict_init(krb5_context context, int maj_ver, int min_ver,
-                 krb5_plugin_vtable vtable);
+pwqual_dict_initvt(krb5_context context, int maj_ver, int min_ver,
+                   krb5_plugin_vtable vtable);
 
 /* The policy module enforces password policy constraints. */
 krb5_error_code
-pwqual_policy_init(krb5_context context, int maj_ver, int min_ver,
-                   krb5_plugin_vtable vtable);
+pwqual_policy_initvt(krb5_context context, int maj_ver, int min_ver,
+                     krb5_plugin_vtable vtable);
 
 #endif /* __KADM5_SERVER_INTERNAL_H__ */
index 4452376aea6d8cb6eae6748c94f765a7980f98bb..faece8efdc5f8a9afcef0832ff2e506689549eea 100644 (file)
@@ -41,7 +41,7 @@ krb5_error_code
 k5_pwqual_load(krb5_context context, pwqual_handle **handles)
 {
     krb5_error_code ret;
-    krb5_plugin_init_fn *modules = NULL, *mod;
+    krb5_plugin_initvt_fn *modules = NULL, *mod;
     size_t count;
     pwqual_handle *list = NULL, handle = NULL;
 
index dddd7f5f0585b0599960104a7807676e61999448..7fb05b4e323e94f650e8690f3cc89ba1d8c26f0b 100644 (file)
@@ -229,8 +229,8 @@ dict_close(krb5_context context, krb5_pwqual_moddata data)
 }
 
 krb5_error_code
-pwqual_dict_init(krb5_context context, int maj_ver, int min_ver,
-                 krb5_plugin_vtable vtable)
+pwqual_dict_initvt(krb5_context context, int maj_ver, int min_ver,
+                   krb5_plugin_vtable vtable)
 {
     krb5_pwqual_vtable vt;
 
index 978744da04f9bdfa45d6178778bf9d1d5f09f6f6..4bd8808b858a4023f7fa3be5860edcf7777c6853 100644 (file)
@@ -68,8 +68,8 @@ policy_check(krb5_context context, krb5_pwqual_moddata data,
 }
 
 krb5_error_code
-pwqual_policy_init(krb5_context context, int maj_ver, int min_ver,
-                  krb5_plugin_vtable vtable)
+pwqual_policy_initvt(krb5_context context, int maj_ver, int min_ver,
+                     krb5_plugin_vtable vtable)
 {
     krb5_pwqual_vtable vt;
 
index 38c060733f9451bd506fdd059a5176284d46e34b..9bea86f440049162df8f6ca76b2f8f7fc0076cde 100644 (file)
@@ -41,12 +41,12 @@ init_pwqual(kadm5_server_handle_t handle)
     const char *dict_file = NULL;
 
     ret = k5_plugin_register(handle->context, PLUGIN_INTERFACE_PWQUAL,
-                             "dict", pwqual_dict_init);
+                             "dict", pwqual_dict_initvt);
     if (ret != 0)
         return ret;
 
     ret = k5_plugin_register(handle->context, PLUGIN_INTERFACE_PWQUAL,
-                             "policy", pwqual_policy_init);
+                             "policy", pwqual_policy_initvt);
     if (ret != 0)
         return ret;
 
index aa9ac89d36d5b10b654708af03394628994b2e6a..dcc778d2d2391d1de53cb56195feebc69b8138ca 100644 (file)
@@ -62,8 +62,8 @@ free_plugin_mapping(struct plugin_mapping *map)
  */
 static krb5_error_code
 register_module(krb5_context context, struct plugin_interface *interface,
-               const char *modname, krb5_plugin_init_fn module,
-               struct plugin_file_handle *dyn_handle)
+                const char *modname, krb5_plugin_initvt_fn module,
+                struct plugin_file_handle *dyn_handle)
 {
     struct plugin_mapping *map, **pmap;
 
@@ -142,20 +142,20 @@ open_and_register(krb5_context context, struct plugin_interface *interface,
 {
     krb5_error_code ret;
     struct plugin_file_handle *handle;
-    void (*init_fn)();
+    void (*initvt_fn)();
 
     ret = krb5int_open_plugin(modpath, &handle, &context->err);
     if (ret != 0)
        return ret;
 
-    ret = krb5int_get_plugin_func(handle, symname, &init_fn, &context->err);
+    ret = krb5int_get_plugin_func(handle, symname, &initvt_fn, &context->err);
     if (ret != 0) {
        krb5int_close_plugin(handle);
        return ret;
     }
 
     ret = register_module(context, interface, modname,
-                         (krb5_plugin_init_fn)init_fn, handle);
+                          (krb5_plugin_initvt_fn)initvt_fn, handle);
     if (ret != 0)
        krb5int_close_plugin(handle);
     return ret;
@@ -173,7 +173,7 @@ register_dyn_modules(krb5_context context, struct plugin_interface *interface,
        ret = parse_modstr(context, *modules, &modname, &modpath);
        if (ret != 0)
            return ret;
-       if (asprintf(&symname, "%s_%s_init", iname, modname) < 0) {
+        if (asprintf(&symname, "%s_%s_initvt", iname, modname) < 0) {
            free(modname);
            free(modpath);
            return ENOMEM;
@@ -286,7 +286,7 @@ cleanup:
 
 krb5_error_code
 k5_plugin_load(krb5_context context, int interface_id, const char *modname,
-               krb5_plugin_init_fn *module)
+               krb5_plugin_initvt_fn *module)
 {
     krb5_error_code ret;
     struct plugin_interface *interface = get_interface(context, interface_id);
@@ -308,12 +308,12 @@ k5_plugin_load(krb5_context context, int interface_id, const char *modname,
 
 krb5_error_code
 k5_plugin_load_all(krb5_context context, int interface_id,
-                   krb5_plugin_init_fn **modules)
+                   krb5_plugin_initvt_fn **modules)
 {
     krb5_error_code ret;
     struct plugin_interface *interface = get_interface(context, interface_id);
     struct plugin_mapping *map;
-    krb5_plugin_init_fn *list;
+    krb5_plugin_initvt_fn *list;
     size_t count;
 
     if (interface == NULL)
@@ -330,7 +330,7 @@ k5_plugin_load_all(krb5_context context, int interface_id,
     if (list == NULL)
        return ENOMEM;
 
-    /* Place each module's init function into list. */
+    /* Place each module's initvt function into list. */
     count = 0;
     for (map = interface->modules; map != NULL; map = map->next)
        list[count++] = map->module;
@@ -341,14 +341,14 @@ k5_plugin_load_all(krb5_context context, int interface_id,
 }
 
 void
-k5_plugin_free_modules(krb5_context context, krb5_plugin_init_fn *modules)
+k5_plugin_free_modules(krb5_context context, krb5_plugin_initvt_fn *modules)
 {
     free(modules);
 }
 
 krb5_error_code
 k5_plugin_register(krb5_context context, int interface_id, const char *modname,
-                   krb5_plugin_init_fn module)
+                   krb5_plugin_initvt_fn module)
 {
     struct plugin_interface *interface = get_interface(context, interface_id);