diff options
Diffstat (limited to 'common.c')
-rw-r--r-- | common.c | 18 |
1 files changed, 16 insertions, 2 deletions
@@ -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 |