}
/**
- * zak_form_get_form_validator:
+ * _zak_form_get_module_new:
* @zakform:
* @namespace:
*
- * Returns:
+ * Returns: the constructor (_new) function for the module.
*/
-ZakFormElementValidatorConstructorFunc
-zak_form_get_form_element_validator (ZakFormForm *zakform, const gchar *namespace)
+static gpointer
+_zak_form_get_module_new (ZakFormForm *zakform, const gchar *namespace)
{
- ZakFormFormPrivate *priv;
+ gpointer ret;
- ZakFormElementValidatorConstructorFunc validator_constructor;
+ ZakFormFormPrivate *priv;
guint i;
- g_return_val_if_fail (ZAK_FORM_IS_FORM (zakform), NULL);
-
priv = zak_form_form_get_instance_private (zakform);
- validator_constructor = NULL;
-
for (i = 0; i < priv->ar_modules->len; i++)
{
if (g_module_symbol ((GModule *)g_ptr_array_index (priv->ar_modules, i),
g_strconcat (namespace, "_new", NULL),
- (gpointer *)&validator_constructor))
+ (gpointer *)&ret))
{
break;
}
}
+ return ret;
+}
+
+/**
+ * zak_form_get_form_element_validator:
+ * @zakform:
+ * @namespace:
+ *
+ * Returns:
+ */
+ZakFormElementValidatorConstructorFunc
+zak_form_get_form_element_validator (ZakFormForm *zakform, const gchar *namespace)
+{
+ ZakFormElementValidatorConstructorFunc validator_constructor;
+
+ g_return_val_if_fail (ZAK_FORM_IS_FORM (zakform), NULL);
+
+ validator_constructor = (ZakFormElementValidatorConstructorFunc)_zak_form_get_module_new (zakform, namespace);
+
return validator_constructor;
}