+ struct declaration_string *string_declaration =
+ container_of(declaration, struct declaration_string, p);
+ struct definition_string *string;
+ int ret;
+
+ string = g_new(struct definition_string, 1);
+ bt_declaration_ref(&string_declaration->p);
+ string->p.declaration = declaration;
+ string->declaration = string_declaration;
+ string->p.ref = 1;
+ /*
+ * Use INT_MAX order to ensure that all fields of the parent
+ * scope are seen as being prior to this scope.
+ */
+ string->p.index = root_name ? INT_MAX : index;
+ string->p.name = field_name;
+ string->p.path = bt_new_definition_path(parent_scope, field_name,
+ root_name);
+ string->p.scope = NULL;
+ string->value = NULL;
+ string->len = 0;
+ string->alloc_len = 0;
+ ret = bt_register_field_definition(field_name, &string->p,
+ parent_scope);
+ assert(!ret);
+ return &string->p;