-void string_copy(struct stream_pos *dest, const struct format *fdest,
- struct stream_pos *src, const struct format *fsrc,
- const struct type_class *type_class)
+static
+struct bt_definition *_string_definition_new(struct bt_declaration *declaration,
+ struct definition_scope *parent_scope,
+ GQuark field_name, int index,
+ const char *root_name);
+static
+void _string_definition_free(struct bt_definition *definition);
+
+static
+void _string_declaration_free(struct bt_declaration *declaration)
+{
+ struct declaration_string *string_declaration =
+ container_of(declaration, struct declaration_string, p);
+ g_free(string_declaration);
+}
+
+struct declaration_string *
+ bt_string_declaration_new(enum ctf_string_encoding encoding)
+{
+ struct declaration_string *string_declaration;
+
+ string_declaration = g_new(struct declaration_string, 1);
+ string_declaration->p.id = CTF_TYPE_STRING;
+ string_declaration->p.alignment = CHAR_BIT;
+ string_declaration->p.declaration_free = _string_declaration_free;
+ string_declaration->p.definition_new = _string_definition_new;
+ string_declaration->p.definition_free = _string_definition_free;
+ string_declaration->p.ref = 1;
+ string_declaration->encoding = encoding;
+ return string_declaration;
+}
+
+static
+struct bt_definition *
+ _string_definition_new(struct bt_declaration *declaration,
+ struct definition_scope *parent_scope,
+ GQuark field_name, int index,
+ const char *root_name)