static
void _struct_definition_free(struct definition *definition);
-int struct_rw(struct stream_pos *ppos, struct definition *definition)
+int bt_struct_rw(struct bt_stream_pos *ppos, struct definition *definition)
{
struct definition_struct *struct_definition =
container_of(definition, struct definition_struct, p);
container_of(declaration, struct declaration_struct, p);
unsigned long i;
- free_declaration_scope(struct_declaration->scope);
+ bt_free_declaration_scope(struct_declaration->scope);
g_hash_table_destroy(struct_declaration->fields_by_name);
for (i = 0; i < struct_declaration->fields->len; i++) {
}
struct declaration_struct *
- struct_declaration_new(struct declaration_scope *parent_scope,
+ bt_struct_declaration_new(struct declaration_scope *parent_scope,
uint64_t min_align)
{
struct declaration_struct *struct_declaration;
struct_declaration->fields = g_array_sized_new(FALSE, TRUE,
sizeof(struct declaration_field),
DEFAULT_NR_STRUCT_FIELDS);
- struct_declaration->scope = new_declaration_scope(parent_scope);
+ struct_declaration->scope = bt_new_declaration_scope(parent_scope);
declaration->id = CTF_TYPE_STRUCT;
declaration->alignment = max(1, min_align);
declaration->declaration_free = _struct_declaration_free;
*/
_struct->p.index = root_name ? INT_MAX : index;
_struct->p.name = field_name;
- _struct->p.path = new_definition_path(parent_scope, field_name, root_name);
- _struct->p.scope = new_definition_scope(parent_scope, field_name, root_name);
+ _struct->p.path = bt_new_definition_path(parent_scope, field_name, root_name);
+ _struct->p.scope = bt_new_definition_scope(parent_scope, field_name, root_name);
- ret = register_field_definition(field_name, &_struct->p,
+ ret = bt_register_field_definition(field_name, &_struct->p,
parent_scope);
assert(!ret || ret == -EPERM);
struct definition *field = g_ptr_array_index(_struct->fields, i);
bt_definition_unref(field);
}
- free_definition_scope(_struct->p.scope);
+ bt_free_definition_scope(_struct->p.scope);
bt_declaration_unref(&struct_declaration->p);
g_free(_struct);
return NULL;
struct definition *field = g_ptr_array_index(_struct->fields, i);
bt_definition_unref(field);
}
- free_definition_scope(_struct->p.scope);
+ bt_free_definition_scope(_struct->p.scope);
bt_declaration_unref(_struct->p.declaration);
g_ptr_array_free(_struct->fields, TRUE);
g_free(_struct);
}
-void struct_declaration_add_field(struct declaration_struct *struct_declaration,
+void bt_struct_declaration_add_field(struct declaration_struct *struct_declaration,
const char *field_name,
struct declaration *field_declaration)
{
}
/*
- * struct_declaration_lookup_field_index - returns field index
+ * bt_struct_declaration_lookup_field_index - returns field index
*
* Returns the index of a field in a structure, or -1 if it does not
* exist.
*/
-int struct_declaration_lookup_field_index(struct declaration_struct *struct_declaration,
+int bt_struct_declaration_lookup_field_index(struct declaration_struct *struct_declaration,
GQuark field_name)
{
gpointer index;
* field returned only valid as long as the field structure is not appended to.
*/
struct declaration_field *
- struct_declaration_get_field_from_index(struct declaration_struct *struct_declaration,
+ bt_struct_declaration_get_field_from_index(struct declaration_struct *struct_declaration,
int index)
{
if (index < 0)
* field returned only valid as long as the field structure is not appended to.
*/
struct definition *
-struct_definition_get_field_from_index(struct definition_struct *_struct,
+bt_struct_definition_get_field_from_index(struct definition_struct *_struct,
int index)
{
if (index < 0)
return g_ptr_array_index(_struct->fields, index);
}
-uint64_t struct_declaration_len(struct declaration_struct *struct_declaration)
+uint64_t bt_struct_declaration_len(struct declaration_struct *struct_declaration)
{
return struct_declaration->fields->len;
}