X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=blobdiff_plain;f=types%2Ftypes.c;h=0d1a89d1946c0146e08ba28ffafcb09fabfa84fc;hp=912c8d53ab67f922208560125020c6f7a8269e17;hb=54d1c81f52d1f8ac081a4b06996cc69db9294ce6;hpb=becd02a104b8c1634ce914d1d2cd36be932b9b16 diff --git a/types/types.c b/types/types.c index 912c8d53..0d1a89d1 100644 --- a/types/types.c +++ b/types/types.c @@ -51,7 +51,7 @@ GQuark prefix_quark(const char *prefix, GQuark quark) } static -struct declaration * +struct bt_declaration * bt_lookup_declaration_scope(GQuark declaration_name, struct declaration_scope *scope) { @@ -59,10 +59,10 @@ struct declaration * (gconstpointer) (unsigned long) declaration_name); } -struct declaration *bt_lookup_declaration(GQuark declaration_name, +struct bt_declaration *bt_lookup_declaration(GQuark declaration_name, struct declaration_scope *scope) { - struct declaration *declaration; + struct bt_declaration *declaration; while (scope) { declaration = bt_lookup_declaration_scope(declaration_name, @@ -74,7 +74,7 @@ struct declaration *bt_lookup_declaration(GQuark declaration_name, return NULL; } -int bt_register_declaration(GQuark name, struct declaration *declaration, +int bt_register_declaration(GQuark name, struct bt_declaration *declaration, struct declaration_scope *scope) { if (!name) @@ -92,7 +92,7 @@ int bt_register_declaration(GQuark name, struct declaration *declaration, } static -struct definition * +struct bt_definition * lookup_field_definition_scope(GQuark field_name, struct definition_scope *scope) { @@ -158,7 +158,7 @@ end: } static struct definition_scope * - get_definition_scope(const struct definition *definition) + get_definition_scope(const struct bt_definition *definition) { return definition->scope; } @@ -183,12 +183,12 @@ static struct definition_scope * * lookup_path: the path leading to the enum we want to look for. * scope: the definition scope containing the variant definition. */ -struct definition * - lookup_path_definition(GArray *cur_path, +struct bt_definition * + bt_lookup_path_definition(GArray *cur_path, GArray *lookup_path, struct definition_scope *scope) { - struct definition *definition, *lookup_definition; + struct bt_definition *definition, *lookup_definition; GQuark last; int index; @@ -262,7 +262,7 @@ lookup: return NULL; } -int register_field_definition(GQuark field_name, struct definition *definition, +int bt_register_field_definition(GQuark field_name, struct bt_definition *definition, struct definition_scope *scope) { if (!scope || !field_name) @@ -279,12 +279,12 @@ int register_field_definition(GQuark field_name, struct definition *definition, return 0; } -void bt_declaration_ref(struct declaration *declaration) +void bt_declaration_ref(struct bt_declaration *declaration) { declaration->ref++; } -void bt_declaration_unref(struct declaration *declaration) +void bt_declaration_unref(struct bt_declaration *declaration) { if (!declaration) return; @@ -292,12 +292,12 @@ void bt_declaration_unref(struct declaration *declaration) declaration->declaration_free(declaration); } -void bt_definition_ref(struct definition *definition) +void bt_definition_ref(struct bt_definition *definition) { definition->ref++; } -void bt_definition_unref(struct definition *definition) +void bt_definition_unref(struct bt_definition *definition) { if (!definition) return; @@ -485,7 +485,7 @@ int bt_register_enum_declaration(GQuark enum_name, } static struct definition_scope * - _new_definition_scope(struct definition_scope *parent_scope, + _bt_new_definition_scope(struct definition_scope *parent_scope, int scope_path_len) { struct definition_scope *scope = g_new(struct definition_scope, 1); @@ -499,7 +499,7 @@ static struct definition_scope * return scope; } -GQuark new_definition_path(struct definition_scope *parent_scope, +GQuark bt_new_definition_path(struct definition_scope *parent_scope, GQuark field_name, const char *root_name) { GQuark path; @@ -540,20 +540,20 @@ GQuark new_definition_path(struct definition_scope *parent_scope, } struct definition_scope * - new_definition_scope(struct definition_scope *parent_scope, + bt_new_definition_scope(struct definition_scope *parent_scope, GQuark field_name, const char *root_name) { struct definition_scope *scope; if (root_name) { - scope = _new_definition_scope(parent_scope, 0); + scope = _bt_new_definition_scope(parent_scope, 0); bt_append_scope_path(root_name, scope->scope_path); } else { int scope_path_len = 1; assert(parent_scope); scope_path_len += parent_scope->scope_path->len; - scope = _new_definition_scope(parent_scope, scope_path_len); + scope = _bt_new_definition_scope(parent_scope, scope_path_len); memcpy(scope->scope_path->data, parent_scope->scope_path->data, sizeof(GQuark) * (scope_path_len - 1)); g_array_index(scope->scope_path, GQuark, scope_path_len - 1) = @@ -605,14 +605,14 @@ void bt_append_scope_path(const char *path, GArray *q) } } -void free_definition_scope(struct definition_scope *scope) +void bt_free_definition_scope(struct definition_scope *scope) { g_array_free(scope->scope_path, TRUE); g_hash_table_destroy(scope->definitions); g_free(scope); } -struct definition *lookup_definition(const struct definition *definition, +struct bt_definition *bt_lookup_definition(const struct bt_definition *definition, const char *field_name) { struct definition_scope *scope = get_definition_scope(definition); @@ -624,14 +624,14 @@ struct definition *lookup_definition(const struct definition *definition, scope); } -struct definition_integer *lookup_integer(const struct definition *definition, +struct definition_integer *bt_lookup_integer(const struct bt_definition *definition, const char *field_name, int signedness) { - struct definition *lookup; + struct bt_definition *lookup; struct definition_integer *lookup_integer; - lookup = lookup_definition(definition, field_name); + lookup = bt_lookup_definition(definition, field_name); if (!lookup) return NULL; if (lookup->declaration->id != CTF_TYPE_INTEGER) @@ -642,14 +642,14 @@ struct definition_integer *lookup_integer(const struct definition *definition, return lookup_integer; } -struct definition_enum *bt_lookup_enum(const struct definition *definition, +struct definition_enum *bt_lookup_enum(const struct bt_definition *definition, const char *field_name, int signedness) { - struct definition *lookup; + struct bt_definition *lookup; struct definition_enum *lookup_enum; - lookup = lookup_definition(definition, field_name); + lookup = bt_lookup_definition(definition, field_name); if (!lookup) return NULL; if (lookup->declaration->id != CTF_TYPE_ENUM) @@ -660,19 +660,19 @@ struct definition_enum *bt_lookup_enum(const struct definition *definition, return lookup_enum; } -struct definition *lookup_variant(const struct definition *definition, +struct bt_definition *bt_lookup_variant(const struct bt_definition *definition, const char *field_name) { - struct definition *lookup; - struct definition_variant *lookup_variant; + struct bt_definition *lookup; + struct definition_variant *bt_lookup_variant; - lookup = lookup_definition(definition, field_name); + lookup = bt_lookup_definition(definition, field_name); if (!lookup) return NULL; if (lookup->declaration->id != CTF_TYPE_VARIANT) return NULL; - lookup_variant = container_of(lookup, struct definition_variant, p); - lookup = variant_get_current_field(lookup_variant); + bt_lookup_variant = container_of(lookup, struct definition_variant, p); + lookup = bt_variant_get_current_field(bt_lookup_variant); assert(lookup); return lookup; }