svn rev #24213: branches/plugins2/ pwqual_combo/ src/include/ src/include/krb5/ ...

ghudson@MIT.EDU ghudson at MIT.EDU
Mon Jul 26 18:14:21 EDT 2010


http://src.mit.edu/fisheye/changelog/krb5/?cs=24213
Commit By: ghudson
Log Message:
In the plugins2 branch, rename "init" to "initvt" in all reference to
module vtable initializer functions.



Changed Files:
U   branches/plugins2/README.BRANCH
U   branches/plugins2/pwqual_combo/combo.c
U   branches/plugins2/src/include/k5-int.h
U   branches/plugins2/src/include/krb5/plugin.h
U   branches/plugins2/src/lib/kadm5/server_internal.h
U   branches/plugins2/src/lib/kadm5/srv/pwqual.c
U   branches/plugins2/src/lib/kadm5/srv/pwqual_dict.c
U   branches/plugins2/src/lib/kadm5/srv/pwqual_policy.c
U   branches/plugins2/src/lib/kadm5/srv/server_misc.c
U   branches/plugins2/src/lib/krb5/krb/plugin.c
Modified: branches/plugins2/README.BRANCH
===================================================================
--- branches/plugins2/README.BRANCH	2010-07-26 21:28:49 UTC (rev 24212)
+++ branches/plugins2/README.BRANCH	2010-07-26 22:14:21 UTC (rev 24213)
@@ -50,17 +50,17 @@
 
 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 @@
 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 @@
   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

Modified: branches/plugins2/pwqual_combo/combo.c
===================================================================
--- branches/plugins2/pwqual_combo/combo.c	2010-07-26 21:28:49 UTC (rev 24212)
+++ branches/plugins2/pwqual_combo/combo.c	2010-07-26 22:14:21 UTC (rev 24213)
@@ -168,8 +168,8 @@
 }
 
 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;
 

Modified: branches/plugins2/src/include/k5-int.h
===================================================================
--- branches/plugins2/src/include/k5-int.h	2010-07-26 21:28:49 UTC (rev 24212)
+++ branches/plugins2/src/include/k5-int.h	2010-07-26 22:14:21 UTC (rev 24213)
@@ -1432,13 +1432,13 @@
 /* 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 @@
  * 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

Modified: branches/plugins2/src/include/krb5/plugin.h
===================================================================
--- branches/plugins2/src/include/krb5/plugin.h	2010-07-26 21:28:49 UTC (rev 24212)
+++ branches/plugins2/src/include/krb5/plugin.h	2010-07-26 22:14:21 UTC (rev 24213)
@@ -31,18 +31,18 @@
 #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 */

Modified: branches/plugins2/src/lib/kadm5/server_internal.h
===================================================================
--- branches/plugins2/src/lib/kadm5/server_internal.h	2010-07-26 21:28:49 UTC (rev 24212)
+++ branches/plugins2/src/lib/kadm5/server_internal.h	2010-07-26 22:14:21 UTC (rev 24213)
@@ -184,16 +184,16 @@
 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__ */

Modified: branches/plugins2/src/lib/kadm5/srv/pwqual.c
===================================================================
--- branches/plugins2/src/lib/kadm5/srv/pwqual.c	2010-07-26 21:28:49 UTC (rev 24212)
+++ branches/plugins2/src/lib/kadm5/srv/pwqual.c	2010-07-26 22:14:21 UTC (rev 24213)
@@ -41,7 +41,7 @@
 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;
 

Modified: branches/plugins2/src/lib/kadm5/srv/pwqual_dict.c
===================================================================
--- branches/plugins2/src/lib/kadm5/srv/pwqual_dict.c	2010-07-26 21:28:49 UTC (rev 24212)
+++ branches/plugins2/src/lib/kadm5/srv/pwqual_dict.c	2010-07-26 22:14:21 UTC (rev 24213)
@@ -229,8 +229,8 @@
 }
 
 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;
 

Modified: branches/plugins2/src/lib/kadm5/srv/pwqual_policy.c
===================================================================
--- branches/plugins2/src/lib/kadm5/srv/pwqual_policy.c	2010-07-26 21:28:49 UTC (rev 24212)
+++ branches/plugins2/src/lib/kadm5/srv/pwqual_policy.c	2010-07-26 22:14:21 UTC (rev 24213)
@@ -68,8 +68,8 @@
 }
 
 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;
 

Modified: branches/plugins2/src/lib/kadm5/srv/server_misc.c
===================================================================
--- branches/plugins2/src/lib/kadm5/srv/server_misc.c	2010-07-26 21:28:49 UTC (rev 24212)
+++ branches/plugins2/src/lib/kadm5/srv/server_misc.c	2010-07-26 22:14:21 UTC (rev 24213)
@@ -41,12 +41,12 @@
     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;
 

Modified: branches/plugins2/src/lib/krb5/krb/plugin.c
===================================================================
--- branches/plugins2/src/lib/krb5/krb/plugin.c	2010-07-26 21:28:49 UTC (rev 24212)
+++ branches/plugins2/src/lib/krb5/krb/plugin.c	2010-07-26 22:14:21 UTC (rev 24213)
@@ -62,8 +62,8 @@
  */
 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 @@
 {
     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 @@
 	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 @@
 
 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 @@
 
 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 @@
     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 @@
 }
 
 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);
 




More information about the cvs-krb5 mailing list