aboutsummaryrefslogtreecommitdiff
path: root/common.c
diff options
context:
space:
mode:
Diffstat (limited to 'common.c')
-rw-r--r--common.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/common.c b/common.c
index b116266..95590f5 100644
--- a/common.c
+++ b/common.c
@@ -1911,8 +1911,6 @@ config_schema_initialize_item (struct config_schema *schema,
item->schema = schema;
item->user_data = user_data;
- if (schema->on_change)
- schema->on_change (item);
}
static void
@@ -1924,6 +1922,22 @@ config_schema_apply_to_object (struct config_schema *schema_array,
config_schema_initialize_item (schema_array++, object, user_data);
}
+static void
+config_schema_call_changed (struct config_item_ *item)
+{
+ if (item->type == CONFIG_ITEM_OBJECT)
+ {
+ struct str_map_iter iter;
+ str_map_iter_init (&iter, &item->value.object);
+
+ struct config_item_ *child;
+ while ((child = str_map_iter_next (&iter)))
+ config_schema_call_changed (child);
+ }
+ else if (item->schema && item->schema->on_change)
+ item->schema->on_change (item);
+}
+
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// XXX: this doesn't necessarily have to be well designed at all