+ (void) g_ptr_array_free(array->elems, TRUE);
+ free_definition_scope(array->p.scope);
+ declaration_unref(array->p.declaration);
+ g_free(array);
+ return NULL;
+}
+
+static
+void _array_definition_free(struct definition *definition)
+{
+ struct definition_array *array =
+ container_of(definition, struct definition_array, p);
+ uint64_t i;
+
+ if (array->string)
+ (void) g_string_free(array->string, TRUE);
+ if (array->elems) {
+ for (i = 0; i < array->elems->len; i++) {
+ struct definition *field;
+
+ field = g_ptr_array_index(array->elems, i);
+ field->declaration->definition_free(field);
+ }
+ (void) g_ptr_array_free(array->elems, TRUE);
+ }
+ free_definition_scope(array->p.scope);
+ declaration_unref(array->p.declaration);
+ g_free(array);
+}
+
+uint64_t array_len(struct definition_array *array)
+{
+ if (!array->elems)
+ return array->string->len;
+ return array->elems->len;
+}
+
+struct definition *array_index(struct definition_array *array, uint64_t i)
+{
+ if (!array->elems)
+ return NULL;
+ if (i >= array->elems->len)
+ return NULL;
+ return g_ptr_array_index(array->elems, i);
+}
+
+GString *get_char_array(struct definition *field)
+{
+ struct definition_array *array_definition;
+ struct declaration_array *array_declaration;
+ struct declaration *elem;
+
+ array_definition = container_of(field, struct definition_array, p);
+ array_declaration = array_definition->declaration;
+ elem = array_declaration->elem;
+ if (elem->id == CTF_TYPE_INTEGER) {
+ struct declaration_integer *integer_declaration =
+ container_of(elem, struct declaration_integer, p);
+
+ if (integer_declaration->encoding == CTF_STRING_UTF8
+ || integer_declaration->encoding == CTF_STRING_ASCII) {