summaryrefslogtreecommitdiff
path: root/common.c
diff options
context:
space:
mode:
Diffstat (limited to 'common.c')
-rw-r--r--common.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/common.c b/common.c
index 102cbd6..52245b7 100644
--- a/common.c
+++ b/common.c
@@ -1865,11 +1865,9 @@ config_item_clone (struct config_item_ *self)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-// TODO: maybe also make it possible to assign the "user_data" pointer
-
static void
config_schema_fix_value
- (struct config_schema *schema, struct config_item_ *object)
+ (struct config_schema *schema, struct config_item_ *object, void *user_data)
{
struct config_item_ *item =
str_map_find (&object->value.object, schema->name);
@@ -1912,17 +1910,18 @@ config_schema_fix_value
item->type = schema->type;
item->schema = schema;
+ item->user_data = user_data;
if (schema->on_change)
schema->on_change (item);
}
static void
-config_schema_apply_to_object
- (struct config_schema *schema_array, struct config_item_ *object)
+config_schema_apply_to_object (struct config_schema *schema_array,
+ struct config_item_ *object, void *user_data)
{
hard_assert (object->type == CONFIG_ITEM_OBJECT);
while (schema_array->name)
- config_schema_fix_value (schema_array++, object);
+ config_schema_fix_value (schema_array++, object, user_data);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -