This struct is exposed in the public API, so we need to namespace it.
Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
32 files changed:
(gpointer) (unsigned long) callsite_name);
}
(gpointer) (unsigned long) callsite_name);
}
-int print_field(struct definition *definition)
+int print_field(struct bt_definition *definition)
{
/* Print all fields in verbose mode */
if (babeltrace_verbose)
{
/* Print all fields in verbose mode */
if (babeltrace_verbose)
#include <babeltrace/ctf-text/types.h>
#include <stdio.h>
#include <babeltrace/ctf-text/types.h>
#include <stdio.h>
-int ctf_text_array_write(struct bt_stream_pos *ppos, struct definition *definition)
+int ctf_text_array_write(struct bt_stream_pos *ppos, struct bt_definition *definition)
{
struct ctf_text_stream_pos *pos = ctf_text_pos(ppos);
struct definition_array *array_definition =
{
struct ctf_text_stream_pos *pos = ctf_text_pos(ppos);
struct definition_array *array_definition =
#include <stdio.h>
#include <stdint.h>
#include <stdio.h>
#include <stdint.h>
-int ctf_text_enum_write(struct bt_stream_pos *ppos, struct definition *definition)
+int ctf_text_enum_write(struct bt_stream_pos *ppos, struct bt_definition *definition)
{
struct definition_enum *enum_definition =
container_of(definition, struct definition_enum, p);
{
struct definition_enum *enum_definition =
container_of(definition, struct definition_enum, p);
#include <babeltrace/ctf-text/types.h>
#include <stdio.h>
#include <babeltrace/ctf-text/types.h>
#include <stdio.h>
-int ctf_text_float_write(struct bt_stream_pos *ppos, struct definition *definition)
+int ctf_text_float_write(struct bt_stream_pos *ppos, struct bt_definition *definition)
{
struct definition_float *float_definition =
container_of(definition, struct definition_float, p);
{
struct definition_float *float_definition =
container_of(definition, struct definition_float, p);
#include <stdint.h>
#include <babeltrace/bitfield.h>
#include <stdint.h>
#include <babeltrace/bitfield.h>
-int ctf_text_integer_write(struct bt_stream_pos *ppos, struct definition *definition)
+int ctf_text_integer_write(struct bt_stream_pos *ppos, struct bt_definition *definition)
{
struct definition_integer *integer_definition =
container_of(definition, struct definition_integer, p);
{
struct definition_integer *integer_definition =
container_of(definition, struct definition_integer, p);
#include <babeltrace/ctf-text/types.h>
#include <stdio.h>
#include <babeltrace/ctf-text/types.h>
#include <stdio.h>
-int ctf_text_sequence_write(struct bt_stream_pos *ppos, struct definition *definition)
+int ctf_text_sequence_write(struct bt_stream_pos *ppos, struct bt_definition *definition)
{
struct ctf_text_stream_pos *pos = ctf_text_pos(ppos);
struct definition_sequence *sequence_definition =
{
struct ctf_text_stream_pos *pos = ctf_text_pos(ppos);
struct definition_sequence *sequence_definition =
#include <string.h>
int ctf_text_string_write(struct bt_stream_pos *ppos,
#include <string.h>
int ctf_text_string_write(struct bt_stream_pos *ppos,
- struct definition *definition)
+ struct bt_definition *definition)
{
struct definition_string *string_definition =
container_of(definition, struct definition_string, p);
{
struct definition_string *string_definition =
container_of(definition, struct definition_string, p);
#include <babeltrace/ctf-text/types.h>
#include <stdio.h>
#include <babeltrace/ctf-text/types.h>
#include <stdio.h>
-int ctf_text_struct_write(struct bt_stream_pos *ppos, struct definition *definition)
+int ctf_text_struct_write(struct bt_stream_pos *ppos, struct bt_definition *definition)
{
struct declaration *declaration = definition->declaration;
struct declaration_struct *struct_declaration =
{
struct declaration *declaration = definition->declaration;
struct declaration_struct *struct_declaration =
#include <babeltrace/ctf-text/types.h>
#include <stdio.h>
#include <babeltrace/ctf-text/types.h>
#include <stdio.h>
-int ctf_text_variant_write(struct bt_stream_pos *ppos, struct definition *definition)
+int ctf_text_variant_write(struct bt_stream_pos *ppos, struct bt_definition *definition)
{
struct ctf_text_stream_pos *pos = ctf_text_pos(ppos);
int field_nr_saved;
{
struct ctf_text_stream_pos *pos = ctf_text_pos(ppos);
int field_nr_saved;
/* Read event header */
if (likely(stream->stream_event_header)) {
struct definition_integer *integer_definition;
/* Read event header */
if (likely(stream->stream_event_header)) {
struct definition_integer *integer_definition;
- struct definition *variant;
+ struct bt_definition *variant;
ret = generic_rw(ppos, &stream->stream_event_header->p);
if (unlikely(ret))
ret = generic_rw(ppos, &stream->stream_event_header->p);
if (unlikely(ret))
struct ctf_event_definition *stream_event = g_new0(struct ctf_event_definition, 1);
if (event->context_decl) {
struct ctf_event_definition *stream_event = g_new0(struct ctf_event_definition, 1);
if (event->context_decl) {
- struct definition *definition =
+ struct bt_definition *definition =
event->context_decl->p.definition_new(&event->context_decl->p,
stream->parent_def_scope, 0, 0, "event.context");
if (!definition) {
event->context_decl->p.definition_new(&event->context_decl->p,
stream->parent_def_scope, 0, 0, "event.context");
if (!definition) {
stream->parent_def_scope = stream_event->event_context->p.scope;
}
if (event->fields_decl) {
stream->parent_def_scope = stream_event->event_context->p.scope;
}
if (event->fields_decl) {
- struct definition *definition =
+ struct bt_definition *definition =
event->fields_decl->p.definition_new(&event->fields_decl->p,
stream->parent_def_scope, 0, 0, "event.fields");
if (!definition) {
event->fields_decl->p.definition_new(&event->fields_decl->p,
stream->parent_def_scope, 0, 0, "event.fields");
if (!definition) {
stream_class = stream->stream_class;
if (stream_class->packet_context_decl) {
stream_class = stream->stream_class;
if (stream_class->packet_context_decl) {
- struct definition *definition =
+ struct bt_definition *definition =
stream_class->packet_context_decl->p.definition_new(&stream_class->packet_context_decl->p,
stream->parent_def_scope, 0, 0, "stream.packet.context");
if (!definition) {
stream_class->packet_context_decl->p.definition_new(&stream_class->packet_context_decl->p,
stream->parent_def_scope, 0, 0, "stream.packet.context");
if (!definition) {
stream->parent_def_scope = stream->stream_packet_context->p.scope;
}
if (stream_class->event_header_decl) {
stream->parent_def_scope = stream->stream_packet_context->p.scope;
}
if (stream_class->event_header_decl) {
- struct definition *definition =
+ struct bt_definition *definition =
stream_class->event_header_decl->p.definition_new(&stream_class->event_header_decl->p,
stream->parent_def_scope, 0, 0, "stream.event.header");
if (!definition) {
stream_class->event_header_decl->p.definition_new(&stream_class->event_header_decl->p,
stream->parent_def_scope, 0, 0, "stream.event.header");
if (!definition) {
stream->parent_def_scope = stream->stream_event_header->p.scope;
}
if (stream_class->event_context_decl) {
stream->parent_def_scope = stream->stream_event_header->p.scope;
}
if (stream_class->event_context_decl) {
- struct definition *definition =
+ struct bt_definition *definition =
stream_class->event_context_decl->p.definition_new(&stream_class->event_context_decl->p,
stream->parent_def_scope, 0, 0, "stream.event.context");
if (!definition) {
stream_class->event_context_decl->p.definition_new(&stream_class->event_context_decl->p,
stream->parent_def_scope, 0, 0, "stream.event.context");
if (!definition) {
return ret;
len_index = bt_struct_declaration_lookup_field_index(file_stream->parent.trace_packet_header->declaration, g_quark_from_static_string("magic"));
if (len_index >= 0) {
return ret;
len_index = bt_struct_declaration_lookup_field_index(file_stream->parent.trace_packet_header->declaration, g_quark_from_static_string("magic"));
if (len_index >= 0) {
- struct definition *field;
+ struct bt_definition *field;
uint64_t magic;
field = bt_struct_definition_get_field_from_index(file_stream->parent.trace_packet_header, len_index);
uint64_t magic;
field = bt_struct_definition_get_field_from_index(file_stream->parent.trace_packet_header, len_index);
len_index = bt_struct_declaration_lookup_field_index(file_stream->parent.trace_packet_header->declaration, g_quark_from_static_string("uuid"));
if (len_index >= 0) {
struct definition_array *defarray;
len_index = bt_struct_declaration_lookup_field_index(file_stream->parent.trace_packet_header->declaration, g_quark_from_static_string("uuid"));
if (len_index >= 0) {
struct definition_array *defarray;
- struct definition *field;
+ struct bt_definition *field;
uint64_t i;
uint8_t uuidval[BABELTRACE_UUID_LEN];
uint64_t i;
uint8_t uuidval[BABELTRACE_UUID_LEN];
assert(bt_array_len(defarray) == BABELTRACE_UUID_LEN);
for (i = 0; i < BABELTRACE_UUID_LEN; i++) {
assert(bt_array_len(defarray) == BABELTRACE_UUID_LEN);
for (i = 0; i < BABELTRACE_UUID_LEN; i++) {
- struct definition *elem;
+ struct bt_definition *elem;
elem = bt_array_index(defarray, i);
uuidval[i] = bt_get_unsigned_int(elem);
elem = bt_array_index(defarray, i);
uuidval[i] = bt_get_unsigned_int(elem);
len_index = bt_struct_declaration_lookup_field_index(file_stream->parent.trace_packet_header->declaration, g_quark_from_static_string("stream_id"));
if (len_index >= 0) {
len_index = bt_struct_declaration_lookup_field_index(file_stream->parent.trace_packet_header->declaration, g_quark_from_static_string("stream_id"));
if (len_index >= 0) {
- struct definition *field;
+ struct bt_definition *field;
field = bt_struct_definition_get_field_from_index(file_stream->parent.trace_packet_header, len_index);
stream_id = bt_get_unsigned_int(field);
field = bt_struct_definition_get_field_from_index(file_stream->parent.trace_packet_header, len_index);
stream_id = bt_get_unsigned_int(field);
/* read content size from header */
len_index = bt_struct_declaration_lookup_field_index(file_stream->parent.stream_packet_context->declaration, g_quark_from_static_string("content_size"));
if (len_index >= 0) {
/* read content size from header */
len_index = bt_struct_declaration_lookup_field_index(file_stream->parent.stream_packet_context->declaration, g_quark_from_static_string("content_size"));
if (len_index >= 0) {
- struct definition *field;
+ struct bt_definition *field;
field = bt_struct_definition_get_field_from_index(file_stream->parent.stream_packet_context, len_index);
packet_index.content_size = bt_get_unsigned_int(field);
field = bt_struct_definition_get_field_from_index(file_stream->parent.stream_packet_context, len_index);
packet_index.content_size = bt_get_unsigned_int(field);
/* read packet size from header */
len_index = bt_struct_declaration_lookup_field_index(file_stream->parent.stream_packet_context->declaration, g_quark_from_static_string("packet_size"));
if (len_index >= 0) {
/* read packet size from header */
len_index = bt_struct_declaration_lookup_field_index(file_stream->parent.stream_packet_context->declaration, g_quark_from_static_string("packet_size"));
if (len_index >= 0) {
- struct definition *field;
+ struct bt_definition *field;
field = bt_struct_definition_get_field_from_index(file_stream->parent.stream_packet_context, len_index);
packet_index.packet_size = bt_get_unsigned_int(field);
field = bt_struct_definition_get_field_from_index(file_stream->parent.stream_packet_context, len_index);
packet_index.packet_size = bt_get_unsigned_int(field);
/* read timestamp begin from header */
len_index = bt_struct_declaration_lookup_field_index(file_stream->parent.stream_packet_context->declaration, g_quark_from_static_string("timestamp_begin"));
if (len_index >= 0) {
/* read timestamp begin from header */
len_index = bt_struct_declaration_lookup_field_index(file_stream->parent.stream_packet_context->declaration, g_quark_from_static_string("timestamp_begin"));
if (len_index >= 0) {
- struct definition *field;
+ struct bt_definition *field;
field = bt_struct_definition_get_field_from_index(file_stream->parent.stream_packet_context, len_index);
packet_index.timestamp_begin = bt_get_unsigned_int(field);
field = bt_struct_definition_get_field_from_index(file_stream->parent.stream_packet_context, len_index);
packet_index.timestamp_begin = bt_get_unsigned_int(field);
/* read timestamp end from header */
len_index = bt_struct_declaration_lookup_field_index(file_stream->parent.stream_packet_context->declaration, g_quark_from_static_string("timestamp_end"));
if (len_index >= 0) {
/* read timestamp end from header */
len_index = bt_struct_declaration_lookup_field_index(file_stream->parent.stream_packet_context->declaration, g_quark_from_static_string("timestamp_end"));
if (len_index >= 0) {
- struct definition *field;
+ struct bt_definition *field;
field = bt_struct_definition_get_field_from_index(file_stream->parent.stream_packet_context, len_index);
packet_index.timestamp_end = bt_get_unsigned_int(field);
field = bt_struct_definition_get_field_from_index(file_stream->parent.stream_packet_context, len_index);
packet_index.timestamp_end = bt_get_unsigned_int(field);
/* read events discarded from header */
len_index = bt_struct_declaration_lookup_field_index(file_stream->parent.stream_packet_context->declaration, g_quark_from_static_string("events_discarded"));
if (len_index >= 0) {
/* read events discarded from header */
len_index = bt_struct_declaration_lookup_field_index(file_stream->parent.stream_packet_context->declaration, g_quark_from_static_string("events_discarded"));
if (len_index >= 0) {
- struct definition *field;
+ struct bt_definition *field;
field = bt_struct_definition_get_field_from_index(file_stream->parent.stream_packet_context, len_index);
packet_index.events_discarded = bt_get_unsigned_int(field);
field = bt_struct_definition_get_field_from_index(file_stream->parent.stream_packet_context, len_index);
packet_index.events_discarded = bt_get_unsigned_int(field);
int ret;
if (td->packet_header_decl) {
int ret;
if (td->packet_header_decl) {
- struct definition *definition =
+ struct bt_definition *definition =
td->packet_header_decl->p.definition_new(&td->packet_header_decl->p,
stream->parent_def_scope, 0, 0, "trace.packet.header");
if (!definition) {
td->packet_header_decl->p.definition_new(&td->packet_header_decl->p,
stream->parent_def_scope, 0, 0, "trace.packet.header");
if (!definition) {
*/
__thread int bt_ctf_last_field_error = 0;
*/
__thread int bt_ctf_last_field_error = 0;
-const struct definition *bt_ctf_get_top_level_scope(const struct bt_ctf_event *ctf_event,
+const struct bt_definition *bt_ctf_get_top_level_scope(const struct bt_ctf_event *ctf_event,
enum bt_ctf_scope scope)
{
enum bt_ctf_scope scope)
{
- const struct definition *tmp = NULL;
+ const struct bt_definition *tmp = NULL;
const struct ctf_event_definition *event;
if (!ctf_event)
const struct ctf_event_definition *event;
if (!ctf_event)
-const struct definition *bt_ctf_get_field(const struct bt_ctf_event *ctf_event,
- const struct definition *scope,
+const struct bt_definition *bt_ctf_get_field(const struct bt_ctf_event *ctf_event,
+ const struct bt_definition *scope,
- const struct definition *def;
+ const struct bt_definition *def;
char *field_underscore;
if (!ctf_event || !scope || !field)
char *field_underscore;
if (!ctf_event || !scope || !field)
-const struct definition *bt_ctf_get_index(const struct bt_ctf_event *ctf_event,
- const struct definition *field,
+const struct bt_definition *bt_ctf_get_index(const struct bt_ctf_event *ctf_event,
+ const struct bt_definition *field,
- struct definition *ret = NULL;
+ struct bt_definition *ret = NULL;
if (!ctf_event || !field)
return NULL;
if (!ctf_event || !field)
return NULL;
return g_quark_to_string(event_class->name);
}
return g_quark_to_string(event_class->name);
}
-const char *bt_ctf_field_name(const struct definition *def)
+const char *bt_ctf_field_name(const struct bt_definition *def)
{
if (!def || !def->name)
return NULL;
{
if (!def || !def->name)
return NULL;
}
int bt_ctf_get_field_list(const struct bt_ctf_event *ctf_event,
}
int bt_ctf_get_field_list(const struct bt_ctf_event *ctf_event,
- const struct definition *scope,
- struct definition const * const **list,
+ const struct bt_definition *scope,
+ struct bt_definition const * const **list,
unsigned int *count)
{
if (!ctf_event || !scope || !list || !count)
unsigned int *count)
{
if (!ctf_event || !scope || !list || !count)
if (!def_struct)
goto error;
if (def_struct->fields->pdata) {
if (!def_struct)
goto error;
if (def_struct->fields->pdata) {
- *list = (struct definition const* const*) def_struct->fields->pdata;
+ *list = (struct bt_definition const* const*) def_struct->fields->pdata;
*count = def_struct->fields->len;
goto end;
} else {
*count = def_struct->fields->len;
goto end;
} else {
if (!def_variant)
goto error;
if (def_variant->fields->pdata) {
if (!def_variant)
goto error;
if (def_variant->fields->pdata) {
- *list = (struct definition const* const*) def_variant->fields->pdata;
+ *list = (struct bt_definition const* const*) def_variant->fields->pdata;
*count = def_variant->fields->len;
goto end;
} else {
*count = def_variant->fields->len;
goto end;
} else {
if (!def_array)
goto error;
if (def_array->elems->pdata) {
if (!def_array)
goto error;
if (def_array->elems->pdata) {
- *list = (struct definition const* const*) def_array->elems->pdata;
+ *list = (struct bt_definition const* const*) def_array->elems->pdata;
*count = def_array->elems->len;
goto end;
} else {
*count = def_array->elems->len;
goto end;
} else {
if (!def_sequence)
goto error;
if (def_sequence->elems->pdata) {
if (!def_sequence)
goto error;
if (def_sequence->elems->pdata) {
- *list = (struct definition const* const*) def_sequence->elems->pdata;
+ *list = (struct bt_definition const* const*) def_sequence->elems->pdata;
*count = def_sequence->elems->len;
goto end;
} else {
*count = def_sequence->elems->len;
goto end;
} else {
return (ssize_t) integer->len;
}
return (ssize_t) integer->len;
}
-const struct definition *bt_ctf_get_enum_int(const struct definition *field)
+const struct bt_definition *bt_ctf_get_enum_int(const struct bt_definition *field)
{
const struct definition_enum *def_enum;
{
const struct definition_enum *def_enum;
return &def_enum->integer->p;
}
return &def_enum->integer->p;
}
-const char *bt_ctf_get_enum_str(const struct definition *field)
+const char *bt_ctf_get_enum_str(const struct bt_definition *field)
{
const struct definition_enum *def_enum;
const struct declaration_enum *decl_enum;
{
const struct definition_enum *def_enum;
const struct declaration_enum *decl_enum;
-uint64_t bt_ctf_get_uint64(const struct definition *field)
+uint64_t bt_ctf_get_uint64(const struct bt_definition *field)
-int64_t bt_ctf_get_int64(const struct definition *field)
+int64_t bt_ctf_get_int64(const struct bt_definition *field)
-char *bt_ctf_get_char_array(const struct definition *field)
+char *bt_ctf_get_char_array(const struct bt_definition *field)
{
char *ret = NULL;
GString *char_array;
{
char *ret = NULL;
GString *char_array;
-char *bt_ctf_get_string(const struct definition *field)
+char *bt_ctf_get_string(const struct bt_definition *field)
return rem_(g_quark_to_string(((struct declaration_field *) field)->name));
}
return rem_(g_quark_to_string(((struct declaration_field *) field)->name));
}
-const struct declaration *bt_ctf_get_decl_from_def(const struct definition *def)
+const struct declaration *bt_ctf_get_decl_from_def(const struct bt_definition *def)
{
if (def)
return def->declaration;
{
if (def)
return def->declaration;
#include <babeltrace/ctf/types.h>
#include <babeltrace/ctf/types.h>
-int ctf_array_read(struct bt_stream_pos *ppos, struct definition *definition)
+int ctf_array_read(struct bt_stream_pos *ppos, struct bt_definition *definition)
{
struct definition_array *array_definition =
container_of(definition, struct definition_array, p);
{
struct definition_array *array_definition =
container_of(definition, struct definition_array, p);
return bt_array_rw(ppos, definition);
}
return bt_array_rw(ppos, definition);
}
-int ctf_array_write(struct bt_stream_pos *ppos, struct definition *definition)
+int ctf_array_write(struct bt_stream_pos *ppos, struct bt_definition *definition)
{
struct definition_array *array_definition =
container_of(definition, struct definition_array, p);
{
struct definition_array *array_definition =
container_of(definition, struct definition_array, p);
#include <stdint.h>
#include <glib.h>
#include <stdint.h>
#include <glib.h>
-int ctf_enum_read(struct bt_stream_pos *ppos, struct definition *definition)
+int ctf_enum_read(struct bt_stream_pos *ppos, struct bt_definition *definition)
{
struct definition_enum *enum_definition =
container_of(definition, struct definition_enum, p);
{
struct definition_enum *enum_definition =
container_of(definition, struct definition_enum, p);
-int ctf_enum_write(struct bt_stream_pos *pos, struct definition *definition)
+int ctf_enum_write(struct bt_stream_pos *pos, struct bt_definition *definition)
{
struct definition_enum *enum_definition =
container_of(definition, struct definition_enum, p);
{
struct definition_enum *enum_definition =
container_of(definition, struct definition_enum, p);
-int ctf_float_read(struct bt_stream_pos *ppos, struct definition *definition)
+int ctf_float_read(struct bt_stream_pos *ppos, struct bt_definition *definition)
{
struct definition_float *float_definition =
container_of(definition, struct definition_float, p);
{
struct definition_float *float_definition =
container_of(definition, struct definition_float, p);
float_definition->declaration;
struct ctf_stream_pos *pos = ctf_pos(ppos);
union doubleIEEE754 u;
float_definition->declaration;
struct ctf_stream_pos *pos = ctf_pos(ppos);
union doubleIEEE754 u;
- struct definition *tmpdef;
+ struct bt_definition *tmpdef;
struct definition_float *tmpfloat;
struct ctf_stream_pos destp;
struct mmap_align mma;
struct definition_float *tmpfloat;
struct ctf_stream_pos destp;
struct mmap_align mma;
-int ctf_float_write(struct bt_stream_pos *ppos, struct definition *definition)
+int ctf_float_write(struct bt_stream_pos *ppos, struct bt_definition *definition)
{
struct definition_float *float_definition =
container_of(definition, struct definition_float, p);
{
struct definition_float *float_definition =
container_of(definition, struct definition_float, p);
float_definition->declaration;
struct ctf_stream_pos *pos = ctf_pos(ppos);
union doubleIEEE754 u;
float_definition->declaration;
struct ctf_stream_pos *pos = ctf_pos(ppos);
union doubleIEEE754 u;
- struct definition *tmpdef;
+ struct bt_definition *tmpdef;
struct definition_float *tmpfloat;
struct ctf_stream_pos srcp;
struct mmap_align mma;
struct definition_float *tmpfloat;
struct ctf_stream_pos srcp;
struct mmap_align mma;
static
int _aligned_integer_read(struct bt_stream_pos *ppos,
static
int _aligned_integer_read(struct bt_stream_pos *ppos,
- struct definition *definition)
+ struct bt_definition *definition)
{
struct definition_integer *integer_definition =
container_of(definition, struct definition_integer, p);
{
struct definition_integer *integer_definition =
container_of(definition, struct definition_integer, p);
static
int _aligned_integer_write(struct bt_stream_pos *ppos,
static
int _aligned_integer_write(struct bt_stream_pos *ppos,
- struct definition *definition)
+ struct bt_definition *definition)
{
struct definition_integer *integer_definition =
container_of(definition, struct definition_integer, p);
{
struct definition_integer *integer_definition =
container_of(definition, struct definition_integer, p);
-int ctf_integer_read(struct bt_stream_pos *ppos, struct definition *definition)
+int ctf_integer_read(struct bt_stream_pos *ppos, struct bt_definition *definition)
{
struct definition_integer *integer_definition =
container_of(definition, struct definition_integer, p);
{
struct definition_integer *integer_definition =
container_of(definition, struct definition_integer, p);
-int ctf_integer_write(struct bt_stream_pos *ppos, struct definition *definition)
+int ctf_integer_write(struct bt_stream_pos *ppos, struct bt_definition *definition)
{
struct definition_integer *integer_definition =
container_of(definition, struct definition_integer, p);
{
struct definition_integer *integer_definition =
container_of(definition, struct definition_integer, p);
#include <babeltrace/ctf/types.h>
#include <babeltrace/ctf/types.h>
-int ctf_sequence_read(struct bt_stream_pos *ppos, struct definition *definition)
+int ctf_sequence_read(struct bt_stream_pos *ppos, struct bt_definition *definition)
{
struct definition_sequence *sequence_definition =
container_of(definition, struct definition_sequence, p);
{
struct definition_sequence *sequence_definition =
container_of(definition, struct definition_sequence, p);
return bt_sequence_rw(ppos, definition);
}
return bt_sequence_rw(ppos, definition);
}
-int ctf_sequence_write(struct bt_stream_pos *ppos, struct definition *definition)
+int ctf_sequence_write(struct bt_stream_pos *ppos, struct bt_definition *definition)
{
struct definition_sequence *sequence_definition =
container_of(definition, struct definition_sequence, p);
{
struct definition_sequence *sequence_definition =
container_of(definition, struct definition_sequence, p);
#include <limits.h> /* C99 limits */
#include <string.h>
#include <limits.h> /* C99 limits */
#include <string.h>
-int ctf_string_read(struct bt_stream_pos *ppos, struct definition *definition)
+int ctf_string_read(struct bt_stream_pos *ppos, struct bt_definition *definition)
{
struct definition_string *string_definition =
container_of(definition, struct definition_string, p);
{
struct definition_string *string_definition =
container_of(definition, struct definition_string, p);
}
int ctf_string_write(struct bt_stream_pos *ppos,
}
int ctf_string_write(struct bt_stream_pos *ppos,
- struct definition *definition)
+ struct bt_definition *definition)
{
struct definition_string *string_definition =
container_of(definition, struct definition_string, p);
{
struct definition_string *string_definition =
container_of(definition, struct definition_string, p);
#include <babeltrace/ctf/types.h>
#include <babeltrace/ctf/types.h>
-int ctf_struct_rw(struct bt_stream_pos *ppos, struct definition *definition)
+int ctf_struct_rw(struct bt_stream_pos *ppos, struct bt_definition *definition)
{
struct declaration *declaration = definition->declaration;
struct ctf_stream_pos *pos = ctf_pos(ppos);
{
struct declaration *declaration = definition->declaration;
struct ctf_stream_pos *pos = ctf_pos(ppos);
#include <babeltrace/ctf/types.h>
#include <babeltrace/ctf/types.h>
-int ctf_variant_rw(struct bt_stream_pos *ppos, struct definition *definition)
+int ctf_variant_rw(struct bt_stream_pos *ppos, struct bt_definition *definition)
{
struct declaration *declaration = definition->declaration;
struct ctf_stream_pos *pos = ctf_pos(ppos);
{
struct declaration *declaration = definition->declaration;
struct ctf_stream_pos *pos = ctf_pos(ppos);
* Write only is supported for now.
*/
BT_HIDDEN
* Write only is supported for now.
*/
BT_HIDDEN
-int ctf_text_integer_write(struct bt_stream_pos *pos, struct definition *definition);
+int ctf_text_integer_write(struct bt_stream_pos *pos, struct bt_definition *definition);
-int ctf_text_float_write(struct bt_stream_pos *pos, struct definition *definition);
+int ctf_text_float_write(struct bt_stream_pos *pos, struct bt_definition *definition);
-int ctf_text_string_write(struct bt_stream_pos *pos, struct definition *definition);
+int ctf_text_string_write(struct bt_stream_pos *pos, struct bt_definition *definition);
-int ctf_text_enum_write(struct bt_stream_pos *pos, struct definition *definition);
+int ctf_text_enum_write(struct bt_stream_pos *pos, struct bt_definition *definition);
-int ctf_text_struct_write(struct bt_stream_pos *pos, struct definition *definition);
+int ctf_text_struct_write(struct bt_stream_pos *pos, struct bt_definition *definition);
-int ctf_text_variant_write(struct bt_stream_pos *pos, struct definition *definition);
+int ctf_text_variant_write(struct bt_stream_pos *pos, struct bt_definition *definition);
-int ctf_text_array_write(struct bt_stream_pos *pos, struct definition *definition);
+int ctf_text_array_write(struct bt_stream_pos *pos, struct bt_definition *definition);
-int ctf_text_sequence_write(struct bt_stream_pos *pos, struct definition *definition);
+int ctf_text_sequence_write(struct bt_stream_pos *pos, struct bt_definition *definition);
static inline
void print_pos_tabs(struct ctf_text_stream_pos *pos)
static inline
void print_pos_tabs(struct ctf_text_stream_pos *pos)
* Check if the field must be printed.
*/
BT_HIDDEN
* Check if the field must be printed.
*/
BT_HIDDEN
-int print_field(struct definition *definition);
+int print_field(struct bt_definition *definition);
#endif /* _BABELTRACE_CTF_TEXT_TYPES_H */
#endif /* _BABELTRACE_CTF_TEXT_TYPES_H */
struct declaration;
struct bt_ctf_event;
struct bt_ctf_event_decl;
struct declaration;
struct bt_ctf_event;
struct bt_ctf_event_decl;
* between the enum and the actual definition of top-level scopes.
* On error return NULL.
*/
* between the enum and the actual definition of top-level scopes.
* On error return NULL.
*/
-const struct definition *bt_ctf_get_top_level_scope(const struct bt_ctf_event *event,
+const struct bt_definition *bt_ctf_get_top_level_scope(const struct bt_ctf_event *event,
enum bt_ctf_scope scope);
/*
enum bt_ctf_scope scope);
/*
* from which the event is extracted is unchanged).
*/
int bt_ctf_get_field_list(const struct bt_ctf_event *event,
* from which the event is extracted is unchanged).
*/
int bt_ctf_get_field_list(const struct bt_ctf_event *event,
- const struct definition *scope,
- struct definition const * const **list,
+ const struct bt_definition *scope,
+ struct bt_definition const * const **list,
unsigned int *count);
/*
* bt_ctf_get_field: returns the definition of a specific field
*/
unsigned int *count);
/*
* bt_ctf_get_field: returns the definition of a specific field
*/
-const struct definition *bt_ctf_get_field(const struct bt_ctf_event *event,
- const struct definition *scope,
+const struct bt_definition *bt_ctf_get_field(const struct bt_ctf_event *event,
+ const struct bt_definition *scope,
const char *field);
/*
* bt_ctf_get_index: if the field is an array or a sequence, return the element
* at position index, otherwise return NULL;
*/
const char *field);
/*
* bt_ctf_get_index: if the field is an array or a sequence, return the element
* at position index, otherwise return NULL;
*/
-const struct definition *bt_ctf_get_index(const struct bt_ctf_event *event,
- const struct definition *field,
+const struct bt_definition *bt_ctf_get_index(const struct bt_ctf_event *event,
+ const struct bt_definition *field,
unsigned int index);
/*
* bt_ctf_field_name: returns the name of a field or NULL on error
*/
unsigned int index);
/*
* bt_ctf_field_name: returns the name of a field or NULL on error
*/
-const char *bt_ctf_field_name(const struct definition *def);
+const char *bt_ctf_field_name(const struct bt_definition *def);
/*
* bt_ctf_get_decl_from_def: return the declaration of a field from
* its definition or NULL on error
*/
/*
* bt_ctf_get_decl_from_def: return the declaration of a field from
* its definition or NULL on error
*/
-const struct declaration *bt_ctf_get_decl_from_def(const struct definition *def);
+const struct declaration *bt_ctf_get_decl_from_def(const struct bt_definition *def);
/*
* bt_ctf_get_decl_from_field_decl: return the declaration of a field from
/*
* bt_ctf_get_decl_from_field_decl: return the declaration of a field from
* bt_ctf_get_enum_str gets the string matching the current enumeration
* value, or NULL if the current value does not match any string.
*/
* bt_ctf_get_enum_str gets the string matching the current enumeration
* value, or NULL if the current value does not match any string.
*/
-uint64_t bt_ctf_get_uint64(const struct definition *field);
-int64_t bt_ctf_get_int64(const struct definition *field);
-const struct definition *bt_ctf_get_enum_int(const struct definition *field);
-const char *bt_ctf_get_enum_str(const struct definition *field);
-char *bt_ctf_get_char_array(const struct definition *field);
-char *bt_ctf_get_string(const struct definition *field);
+uint64_t bt_ctf_get_uint64(const struct bt_definition *field);
+int64_t bt_ctf_get_int64(const struct bt_definition *field);
+const struct bt_definition *bt_ctf_get_enum_int(const struct bt_definition *field);
+const char *bt_ctf_get_enum_str(const struct bt_definition *field);
+char *bt_ctf_get_char_array(const struct bt_definition *field);
+char *bt_ctf_get_string(const struct bt_definition *field);
/*
* bt_ctf_field_get_error: returns the last error code encountered while
/*
* bt_ctf_field_get_error: returns the last error code encountered while
-int ctf_integer_read(struct bt_stream_pos *pos, struct definition *definition);
+int ctf_integer_read(struct bt_stream_pos *pos, struct bt_definition *definition);
-int ctf_integer_write(struct bt_stream_pos *pos, struct definition *definition);
+int ctf_integer_write(struct bt_stream_pos *pos, struct bt_definition *definition);
-int ctf_float_read(struct bt_stream_pos *pos, struct definition *definition);
+int ctf_float_read(struct bt_stream_pos *pos, struct bt_definition *definition);
-int ctf_float_write(struct bt_stream_pos *pos, struct definition *definition);
+int ctf_float_write(struct bt_stream_pos *pos, struct bt_definition *definition);
-int ctf_string_read(struct bt_stream_pos *pos, struct definition *definition);
+int ctf_string_read(struct bt_stream_pos *pos, struct bt_definition *definition);
-int ctf_string_write(struct bt_stream_pos *pos, struct definition *definition);
+int ctf_string_write(struct bt_stream_pos *pos, struct bt_definition *definition);
-int ctf_enum_read(struct bt_stream_pos *pos, struct definition *definition);
+int ctf_enum_read(struct bt_stream_pos *pos, struct bt_definition *definition);
-int ctf_enum_write(struct bt_stream_pos *pos, struct definition *definition);
+int ctf_enum_write(struct bt_stream_pos *pos, struct bt_definition *definition);
-int ctf_struct_rw(struct bt_stream_pos *pos, struct definition *definition);
+int ctf_struct_rw(struct bt_stream_pos *pos, struct bt_definition *definition);
-int ctf_variant_rw(struct bt_stream_pos *pos, struct definition *definition);
+int ctf_variant_rw(struct bt_stream_pos *pos, struct bt_definition *definition);
-int ctf_array_read(struct bt_stream_pos *pos, struct definition *definition);
+int ctf_array_read(struct bt_stream_pos *pos, struct bt_definition *definition);
-int ctf_array_write(struct bt_stream_pos *pos, struct definition *definition);
+int ctf_array_write(struct bt_stream_pos *pos, struct bt_definition *definition);
-int ctf_sequence_read(struct bt_stream_pos *pos, struct definition *definition);
+int ctf_sequence_read(struct bt_stream_pos *pos, struct bt_definition *definition);
-int ctf_sequence_write(struct bt_stream_pos *pos, struct definition *definition);
+int ctf_sequence_write(struct bt_stream_pos *pos, struct bt_definition *definition);
void ctf_packet_seek(struct bt_stream_pos *pos, size_t index, int whence);
void ctf_packet_seek(struct bt_stream_pos *pos, size_t index, int whence);
struct ctf_stream_definition;
struct bt_stream_pos;
struct bt_format;
struct ctf_stream_definition;
struct bt_stream_pos;
struct bt_format;
struct ctf_clock;
/* type scope */
struct ctf_clock;
/* type scope */
* declaration_free called with declaration ref is decremented to 0.
*/
void (*declaration_free)(struct declaration *declaration);
* declaration_free called with declaration ref is decremented to 0.
*/
void (*declaration_free)(struct declaration *declaration);
(*definition_new)(struct declaration *declaration,
struct definition_scope *parent_scope,
GQuark field_name, int index,
(*definition_new)(struct declaration *declaration,
struct definition_scope *parent_scope,
GQuark field_name, int index,
/*
* definition_free called with definition ref is decremented to 0.
*/
/*
* definition_free called with definition ref is decremented to 0.
*/
- void (*definition_free)(struct definition *definition);
+ void (*definition_free)(struct bt_definition *definition);
struct declaration *declaration;
int index; /* Position of the definition in its container */
GQuark name; /* Field name in its container (or 0 if unset) */
struct declaration *declaration;
int index; /* Position of the definition in its container */
GQuark name; /* Field name in its container (or 0 if unset) */
};
typedef int (*rw_dispatch)(struct bt_stream_pos *pos,
};
typedef int (*rw_dispatch)(struct bt_stream_pos *pos,
- struct definition *definition);
+ struct bt_definition *definition);
/* Parent of per-plugin positions */
struct bt_stream_pos {
/* Parent of per-plugin positions */
struct bt_stream_pos {
-int generic_rw(struct bt_stream_pos *pos, struct definition *definition)
+int generic_rw(struct bt_stream_pos *pos, struct bt_definition *definition)
{
enum ctf_type_id dispatch_id = definition->declaration->id;
rw_dispatch call;
{
enum ctf_type_id dispatch_id = definition->declaration->id;
rw_dispatch call;
};
struct definition_integer {
};
struct definition_integer {
+ struct bt_definition p;
struct declaration_integer *declaration;
/* Last values read */
union {
struct declaration_integer *declaration;
/* Last values read */
union {
};
struct definition_float {
};
struct definition_float {
+ struct bt_definition p;
struct declaration_float *declaration;
struct definition_integer *sign;
struct definition_integer *mantissa;
struct declaration_float *declaration;
struct definition_integer *sign;
struct definition_integer *mantissa;
};
struct definition_enum {
};
struct definition_enum {
+ struct bt_definition p;
struct definition_integer *integer;
struct declaration_enum *declaration;
/* Last GQuark values read. Keeping a reference on the GQuark array. */
struct definition_integer *integer;
struct declaration_enum *declaration;
/* Last GQuark values read. Keeping a reference on the GQuark array. */
};
struct definition_string {
};
struct definition_string {
+ struct bt_definition p;
struct declaration_string *declaration;
char *value; /* freed at definition_string teardown */
size_t len, alloc_len;
struct declaration_string *declaration;
char *value; /* freed at definition_string teardown */
size_t len, alloc_len;
};
struct definition_struct {
};
struct definition_struct {
+ struct bt_definition p;
struct declaration_struct *declaration;
struct declaration_struct *declaration;
- GPtrArray *fields; /* Array of pointers to struct definition */
+ GPtrArray *fields; /* Array of pointers to struct bt_definition */
};
struct declaration_untagged_variant {
};
struct declaration_untagged_variant {
/* A variant needs to be tagged to be defined. */
struct definition_variant {
/* A variant needs to be tagged to be defined. */
struct definition_variant {
+ struct bt_definition p;
struct declaration_variant *declaration;
struct declaration_variant *declaration;
- struct definition *enum_tag;
- GPtrArray *fields; /* Array of pointers to struct definition */
- struct definition *current_field; /* Last field read */
+ struct bt_definition *enum_tag;
+ GPtrArray *fields; /* Array of pointers to struct bt_definition */
+ struct bt_definition *current_field; /* Last field read */
};
struct declaration_array {
};
struct declaration_array {
};
struct definition_array {
};
struct definition_array {
+ struct bt_definition p;
struct declaration_array *declaration;
struct declaration_array *declaration;
- GPtrArray *elems; /* Array of pointers to struct definition */
+ GPtrArray *elems; /* Array of pointers to struct bt_definition */
GString *string; /* String for encoded integer children */
};
GString *string; /* String for encoded integer children */
};
};
struct definition_sequence {
};
struct definition_sequence {
+ struct bt_definition p;
struct declaration_sequence *declaration;
struct definition_integer *length;
struct declaration_sequence *declaration;
struct definition_integer *length;
- GPtrArray *elems; /* Array of pointers to struct definition */
+ GPtrArray *elems; /* Array of pointers to struct bt_definition */
GString *string; /* String for encoded integer children */
};
GString *string; /* String for encoded integer children */
};
* field_definition is for field definitions. They are registered into
* definition scopes.
*/
* field_definition is for field definitions. They are registered into
* definition scopes.
*/
bt_lookup_path_definition(GArray *cur_path, /* array of GQuark */
GArray *lookup_path, /* array of GQuark */
struct definition_scope *scope);
int bt_register_field_definition(GQuark field_name,
bt_lookup_path_definition(GArray *cur_path, /* array of GQuark */
GArray *lookup_path, /* array of GQuark */
struct definition_scope *scope);
int bt_register_field_definition(GQuark field_name,
- struct definition *definition,
+ struct bt_definition *definition,
struct definition_scope *scope);
struct definition_scope *
bt_new_definition_scope(struct definition_scope *parent_scope,
struct definition_scope *scope);
struct definition_scope *
bt_new_definition_scope(struct definition_scope *parent_scope,
GQuark field_name, const char *root_name);
static inline
GQuark field_name, const char *root_name);
static inline
-int compare_definition_path(struct definition *definition, GQuark path)
+int compare_definition_path(struct bt_definition *definition, GQuark path)
{
return definition->path == path;
}
{
return definition->path == path;
}
void bt_declaration_ref(struct declaration *declaration);
void bt_declaration_unref(struct declaration *declaration);
void bt_declaration_ref(struct declaration *declaration);
void bt_declaration_unref(struct declaration *declaration);
-void bt_definition_ref(struct definition *definition);
-void bt_definition_unref(struct definition *definition);
+void bt_definition_ref(struct bt_definition *definition);
+void bt_definition_unref(struct bt_definition *definition);
struct declaration_integer *bt_integer_declaration_new(size_t len, int byte_order,
int signedness, size_t alignment,
int base, enum ctf_string_encoding encoding,
struct ctf_clock *clock);
struct declaration_integer *bt_integer_declaration_new(size_t len, int byte_order,
int signedness, size_t alignment,
int base, enum ctf_string_encoding encoding,
struct ctf_clock *clock);
-uint64_t bt_get_unsigned_int(const struct definition *field);
-int64_t bt_get_signed_int(const struct definition *field);
-int bt_get_int_signedness(const struct definition *field);
-int bt_get_int_byte_order(const struct definition *field);
-int bt_get_int_base(const struct definition *field);
-size_t bt_get_int_len(const struct definition *field); /* in bits */
-enum ctf_string_encoding bt_get_int_encoding(const struct definition *field);
+uint64_t bt_get_unsigned_int(const struct bt_definition *field);
+int64_t bt_get_signed_int(const struct bt_definition *field);
+int bt_get_int_signedness(const struct bt_definition *field);
+int bt_get_int_byte_order(const struct bt_definition *field);
+int bt_get_int_base(const struct bt_definition *field);
+size_t bt_get_int_len(const struct bt_definition *field); /* in bits */
+enum ctf_string_encoding bt_get_int_encoding(const struct bt_definition *field);
/*
* mantissa_len is the length of the number of bytes represented by the mantissa
/*
* mantissa_len is the length of the number of bytes represented by the mantissa
struct declaration_string *
bt_string_declaration_new(enum ctf_string_encoding encoding);
struct declaration_string *
bt_string_declaration_new(enum ctf_string_encoding encoding);
-char *bt_get_string(const struct definition *field);
-enum ctf_string_encoding bt_get_string_encoding(const struct definition *field);
+char *bt_get_string(const struct bt_definition *field);
+enum ctf_string_encoding bt_get_string_encoding(const struct bt_definition *field);
struct declaration_struct *
bt_struct_declaration_new(struct declaration_scope *parent_scope,
struct declaration_struct *
bt_struct_declaration_new(struct declaration_scope *parent_scope,
struct declaration_field *
bt_struct_declaration_get_field_from_index(struct declaration_struct *struct_declaration,
int index);
struct declaration_field *
bt_struct_declaration_get_field_from_index(struct declaration_struct *struct_declaration,
int index);
bt_struct_definition_get_field_from_index(struct definition_struct *struct_definition,
int index);
bt_struct_definition_get_field_from_index(struct definition_struct *struct_definition,
int index);
-int bt_struct_rw(struct bt_stream_pos *pos, struct definition *definition);
+int bt_struct_rw(struct bt_stream_pos *pos, struct bt_definition *definition);
uint64_t bt_struct_declaration_len(struct declaration_struct *struct_declaration);
/*
uint64_t bt_struct_declaration_len(struct declaration_struct *struct_declaration);
/*
* Returns 0 on success, -EPERM on error.
*/
int variant_definition_set_tag(struct definition_variant *variant,
* Returns 0 on success, -EPERM on error.
*/
int variant_definition_set_tag(struct definition_variant *variant,
- struct definition *enum_tag);
+ struct bt_definition *enum_tag);
/*
* Returns the field selected by the current tag value.
* field returned only valid as long as the variant structure is not appended
* to.
*/
/*
* Returns the field selected by the current tag value.
* field returned only valid as long as the variant structure is not appended
* to.
*/
-struct definition *bt_variant_get_current_field(struct definition_variant *variant);
-int bt_variant_rw(struct bt_stream_pos *pos, struct definition *definition);
+struct bt_definition *bt_variant_get_current_field(struct definition_variant *variant);
+int bt_variant_rw(struct bt_stream_pos *pos, struct bt_definition *definition);
/*
* elem_declaration passed as parameter now belongs to the array. No
/*
* elem_declaration passed as parameter now belongs to the array. No
bt_array_declaration_new(size_t len, struct declaration *elem_declaration,
struct declaration_scope *parent_scope);
uint64_t bt_array_len(struct definition_array *array);
bt_array_declaration_new(size_t len, struct declaration *elem_declaration,
struct declaration_scope *parent_scope);
uint64_t bt_array_len(struct definition_array *array);
-struct definition *bt_array_index(struct definition_array *array, uint64_t i);
-int bt_array_rw(struct bt_stream_pos *pos, struct definition *definition);
-GString *bt_get_char_array(const struct definition *field);
-int bt_get_array_len(const struct definition *field);
+struct bt_definition *bt_array_index(struct definition_array *array, uint64_t i);
+int bt_array_rw(struct bt_stream_pos *pos, struct bt_definition *definition);
+GString *bt_get_char_array(const struct bt_definition *field);
+int bt_get_array_len(const struct bt_definition *field);
/*
* int_declaration and elem_declaration passed as parameter now belong
/*
* int_declaration and elem_declaration passed as parameter now belong
struct declaration *elem_declaration,
struct declaration_scope *parent_scope);
uint64_t bt_sequence_len(struct definition_sequence *sequence);
struct declaration *elem_declaration,
struct declaration_scope *parent_scope);
uint64_t bt_sequence_len(struct definition_sequence *sequence);
-struct definition *bt_sequence_index(struct definition_sequence *sequence, uint64_t i);
-int bt_sequence_rw(struct bt_stream_pos *pos, struct definition *definition);
+struct bt_definition *bt_sequence_index(struct definition_sequence *sequence, uint64_t i);
+int bt_sequence_rw(struct bt_stream_pos *pos, struct bt_definition *definition);
/*
* in: path (dot separated), out: q (GArray of GQuark)
/*
* in: path (dot separated), out: q (GArray of GQuark)
-struct definition *bt_lookup_definition(const struct definition *definition,
+struct bt_definition *bt_lookup_definition(const struct bt_definition *definition,
-struct definition_integer *bt_lookup_integer(const struct definition *definition,
+struct definition_integer *bt_lookup_integer(const struct bt_definition *definition,
const char *field_name,
int signedness);
const char *field_name,
int signedness);
-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);
const char *field_name,
int signedness);
-struct definition *bt_lookup_variant(const struct definition *definition,
+struct bt_definition *bt_lookup_variant(const struct bt_definition *definition,
const char *field_name);
static inline
const char *field_name);
static inline
#include <inttypes.h>
static
#include <inttypes.h>
static
-struct definition *_array_definition_new(struct declaration *declaration,
+struct bt_definition *_array_definition_new(struct declaration *declaration,
struct definition_scope *parent_scope,
GQuark field_name, int index, const char *root_name);
static
struct definition_scope *parent_scope,
GQuark field_name, int index, const char *root_name);
static
-void _array_definition_free(struct definition *definition);
+void _array_definition_free(struct bt_definition *definition);
-int bt_array_rw(struct bt_stream_pos *pos, struct definition *definition)
+int bt_array_rw(struct bt_stream_pos *pos, struct bt_definition *definition)
{
struct definition_array *array_definition =
container_of(definition, struct definition_array, p);
{
struct definition_array *array_definition =
container_of(definition, struct definition_array, p);
/* No need to align, because the first field will align itself. */
for (i = 0; i < array_declaration->len; i++) {
/* No need to align, because the first field will align itself. */
for (i = 0; i < array_declaration->len; i++) {
- struct definition *field =
+ struct bt_definition *field =
g_ptr_array_index(array_definition->elems, i);
ret = generic_rw(pos, field);
if (ret)
g_ptr_array_index(array_definition->elems, i);
ret = generic_rw(pos, field);
if (ret)
_array_definition_new(struct declaration *declaration,
struct definition_scope *parent_scope,
GQuark field_name, int index, const char *root_name)
_array_definition_new(struct declaration *declaration,
struct definition_scope *parent_scope,
GQuark field_name, int index, const char *root_name)
array->elems = g_ptr_array_sized_new(array_declaration->len);
g_ptr_array_set_size(array->elems, array_declaration->len);
for (i = 0; i < array_declaration->len; i++) {
array->elems = g_ptr_array_sized_new(array_declaration->len);
g_ptr_array_set_size(array->elems, array_declaration->len);
for (i = 0; i < array_declaration->len; i++) {
- struct definition **field;
+ struct bt_definition **field;
GString *str;
GQuark name;
GString *str;
GQuark name;
name = g_quark_from_string(str->str);
(void) g_string_free(str, TRUE);
name = g_quark_from_string(str->str);
(void) g_string_free(str, TRUE);
- field = (struct definition **) &g_ptr_array_index(array->elems, i);
+ field = (struct bt_definition **) &g_ptr_array_index(array->elems, i);
*field = array_declaration->elem->definition_new(array_declaration->elem,
array->p.scope,
name, i, NULL);
*field = array_declaration->elem->definition_new(array_declaration->elem,
array->p.scope,
name, i, NULL);
error:
for (i--; i >= 0; i--) {
error:
for (i--; i >= 0; i--) {
- struct definition *field;
+ struct bt_definition *field;
field = g_ptr_array_index(array->elems, i);
field->declaration->definition_free(field);
field = g_ptr_array_index(array->elems, i);
field->declaration->definition_free(field);
-void _array_definition_free(struct definition *definition)
+void _array_definition_free(struct bt_definition *definition)
{
struct definition_array *array =
container_of(definition, struct definition_array, p);
{
struct definition_array *array =
container_of(definition, struct definition_array, p);
(void) g_string_free(array->string, TRUE);
if (array->elems) {
for (i = 0; i < array->elems->len; i++) {
(void) g_string_free(array->string, TRUE);
if (array->elems) {
for (i = 0; i < array->elems->len; i++) {
- struct definition *field;
+ struct bt_definition *field;
field = g_ptr_array_index(array->elems, i);
field->declaration->definition_free(field);
field = g_ptr_array_index(array->elems, i);
field->declaration->definition_free(field);
return array->elems->len;
}
return array->elems->len;
}
-struct definition *bt_array_index(struct definition_array *array, uint64_t i)
+struct bt_definition *bt_array_index(struct definition_array *array, uint64_t i)
{
if (!array->elems)
return NULL;
{
if (!array->elems)
return NULL;
return g_ptr_array_index(array->elems, i);
}
return g_ptr_array_index(array->elems, i);
}
-int bt_get_array_len(const struct definition *field)
+int bt_get_array_len(const struct bt_definition *field)
{
struct definition_array *array_definition;
struct declaration_array *array_declaration;
{
struct definition_array *array_definition;
struct declaration_array *array_declaration;
return array_declaration->len;
}
return array_declaration->len;
}
-GString *bt_get_char_array(const struct definition *field)
+GString *bt_get_char_array(const struct bt_definition *field)
{
struct definition_array *array_definition;
struct declaration_array *array_declaration;
{
struct definition_array *array_definition;
struct declaration_array *array_declaration;
-struct definition *_enum_definition_new(struct declaration *declaration,
+struct bt_definition *_enum_definition_new(struct declaration *declaration,
struct definition_scope *parent_scope,
GQuark field_name, int index,
const char *root_name);
static
struct definition_scope *parent_scope,
GQuark field_name, int index,
const char *root_name);
static
-void _enum_definition_free(struct definition *definition);
+void _enum_definition_free(struct bt_definition *definition);
static
void enum_range_set_free(void *ptr)
static
void enum_range_set_free(void *ptr)
_enum_definition_new(struct declaration *declaration,
struct definition_scope *parent_scope,
GQuark field_name, int index,
_enum_definition_new(struct declaration *declaration,
struct definition_scope *parent_scope,
GQuark field_name, int index,
struct declaration_enum *enum_declaration =
container_of(declaration, struct declaration_enum, p);
struct definition_enum *_enum;
struct declaration_enum *enum_declaration =
container_of(declaration, struct declaration_enum, p);
struct definition_enum *_enum;
- struct definition *definition_integer_parent;
+ struct bt_definition *definition_integer_parent;
int ret;
_enum = g_new(struct definition_enum, 1);
int ret;
_enum = g_new(struct definition_enum, 1);
-void _enum_definition_free(struct definition *definition)
+void _enum_definition_free(struct bt_definition *definition)
{
struct definition_enum *_enum =
container_of(definition, struct definition_enum, p);
{
struct definition_enum *_enum =
container_of(definition, struct definition_enum, p);
#include <babeltrace/endian.h>
static
#include <babeltrace/endian.h>
static
-struct definition *_float_definition_new(struct declaration *declaration,
+struct bt_definition *_float_definition_new(struct declaration *declaration,
struct definition_scope *parent_scope,
GQuark field_name, int index,
const char *root_name);
static
struct definition_scope *parent_scope,
GQuark field_name, int index,
const char *root_name);
static
-void _float_definition_free(struct definition *definition);
+void _float_definition_free(struct bt_definition *definition);
static
void _float_declaration_free(struct declaration *declaration)
static
void _float_declaration_free(struct declaration *declaration)
_float_definition_new(struct declaration *declaration,
struct definition_scope *parent_scope,
GQuark field_name, int index,
_float_definition_new(struct declaration *declaration,
struct definition_scope *parent_scope,
GQuark field_name, int index,
struct declaration_float *float_declaration =
container_of(declaration, struct declaration_float, p);
struct definition_float *_float;
struct declaration_float *float_declaration =
container_of(declaration, struct declaration_float, p);
struct definition_float *_float;
- struct definition *tmp;
+ struct bt_definition *tmp;
_float = g_new(struct definition_float, 1);
bt_declaration_ref(&float_declaration->p);
_float = g_new(struct definition_float, 1);
bt_declaration_ref(&float_declaration->p);
-void _float_definition_free(struct definition *definition)
+void _float_definition_free(struct bt_definition *definition)
{
struct definition_float *_float =
container_of(definition, struct definition_float, p);
{
struct definition_float *_float =
container_of(definition, struct definition_float, p);
#include <stdint.h>
static
#include <stdint.h>
static
-struct definition *_integer_definition_new(struct declaration *declaration,
+struct bt_definition *_integer_definition_new(struct declaration *declaration,
struct definition_scope *parent_scope,
GQuark field_name, int index,
const char *root_name);
static
struct definition_scope *parent_scope,
GQuark field_name, int index,
const char *root_name);
static
-void _integer_definition_free(struct definition *definition);
+void _integer_definition_free(struct bt_definition *definition);
static
void _integer_declaration_free(struct declaration *declaration)
static
void _integer_declaration_free(struct declaration *declaration)
_integer_definition_new(struct declaration *declaration,
struct definition_scope *parent_scope,
GQuark field_name, int index,
_integer_definition_new(struct declaration *declaration,
struct definition_scope *parent_scope,
GQuark field_name, int index,
-void _integer_definition_free(struct definition *definition)
+void _integer_definition_free(struct bt_definition *definition)
{
struct definition_integer *integer =
container_of(definition, struct definition_integer, p);
{
struct definition_integer *integer =
container_of(definition, struct definition_integer, p);
-enum ctf_string_encoding bt_get_int_encoding(const struct definition *field)
+enum ctf_string_encoding bt_get_int_encoding(const struct bt_definition *field)
{
struct definition_integer *integer_definition;
const struct declaration_integer *integer_declaration;
{
struct definition_integer *integer_definition;
const struct declaration_integer *integer_declaration;
return integer_declaration->encoding;
}
return integer_declaration->encoding;
}
-int bt_get_int_base(const struct definition *field)
+int bt_get_int_base(const struct bt_definition *field)
{
struct definition_integer *integer_definition;
const struct declaration_integer *integer_declaration;
{
struct definition_integer *integer_definition;
const struct declaration_integer *integer_declaration;
return integer_declaration->base;
}
return integer_declaration->base;
}
-size_t bt_get_int_len(const struct definition *field)
+size_t bt_get_int_len(const struct bt_definition *field)
{
struct definition_integer *integer_definition;
const struct declaration_integer *integer_declaration;
{
struct definition_integer *integer_definition;
const struct declaration_integer *integer_declaration;
return integer_declaration->len;
}
return integer_declaration->len;
}
-int bt_get_int_byte_order(const struct definition *field)
+int bt_get_int_byte_order(const struct bt_definition *field)
{
struct definition_integer *integer_definition;
const struct declaration_integer *integer_declaration;
{
struct definition_integer *integer_definition;
const struct declaration_integer *integer_declaration;
return integer_declaration->byte_order;
}
return integer_declaration->byte_order;
}
-int bt_get_int_signedness(const struct definition *field)
+int bt_get_int_signedness(const struct bt_definition *field)
{
struct definition_integer *integer_definition;
const struct declaration_integer *integer_declaration;
{
struct definition_integer *integer_definition;
const struct declaration_integer *integer_declaration;
return integer_declaration->signedness;
}
return integer_declaration->signedness;
}
-uint64_t bt_get_unsigned_int(const struct definition *field)
+uint64_t bt_get_unsigned_int(const struct bt_definition *field)
{
struct definition_integer *integer_definition;
const struct declaration_integer *integer_declaration;
{
struct definition_integer *integer_definition;
const struct declaration_integer *integer_declaration;
return (uint64_t)integer_definition->value._signed;
}
return (uint64_t)integer_definition->value._signed;
}
-int64_t bt_get_signed_int(const struct definition *field)
+int64_t bt_get_signed_int(const struct bt_definition *field)
{
struct definition_integer *integer_definition;
const struct declaration_integer *integer_declaration;
{
struct definition_integer *integer_definition;
const struct declaration_integer *integer_declaration;
#include <inttypes.h>
static
#include <inttypes.h>
static
-struct definition *_sequence_definition_new(struct declaration *declaration,
+struct bt_definition *_sequence_definition_new(struct declaration *declaration,
struct definition_scope *parent_scope,
GQuark field_name, int index,
const char *root_name);
static
struct definition_scope *parent_scope,
GQuark field_name, int index,
const char *root_name);
static
-void _sequence_definition_free(struct definition *definition);
+void _sequence_definition_free(struct bt_definition *definition);
-int bt_sequence_rw(struct bt_stream_pos *pos, struct definition *definition)
+int bt_sequence_rw(struct bt_stream_pos *pos, struct bt_definition *definition)
{
struct definition_sequence *sequence_definition =
container_of(definition, struct definition_sequence, p);
{
struct definition_sequence *sequence_definition =
container_of(definition, struct definition_sequence, p);
g_ptr_array_set_size(sequence_definition->elems, len);
for (i = oldlen; i < len; i++) {
g_ptr_array_set_size(sequence_definition->elems, len);
for (i = oldlen; i < len; i++) {
- struct definition **field;
+ struct bt_definition **field;
GString *str;
GQuark name;
GString *str;
GQuark name;
name = g_quark_from_string(str->str);
(void) g_string_free(str, TRUE);
name = g_quark_from_string(str->str);
(void) g_string_free(str, TRUE);
- field = (struct definition **) &g_ptr_array_index(sequence_definition->elems, i);
+ field = (struct bt_definition **) &g_ptr_array_index(sequence_definition->elems, i);
*field = sequence_declaration->elem->definition_new(sequence_declaration->elem,
sequence_definition->p.scope,
name, i, NULL);
}
for (i = 0; i < len; i++) {
*field = sequence_declaration->elem->definition_new(sequence_declaration->elem,
sequence_definition->p.scope,
name, i, NULL);
}
for (i = 0; i < len; i++) {
- struct definition **field;
+ struct bt_definition **field;
- field = (struct definition **) &g_ptr_array_index(sequence_definition->elems, i);
+ field = (struct bt_definition **) &g_ptr_array_index(sequence_definition->elems, i);
ret = generic_rw(pos, *field);
if (ret)
return ret;
ret = generic_rw(pos, *field);
if (ret)
return ret;
-struct definition *_sequence_definition_new(struct declaration *declaration,
+struct bt_definition *_sequence_definition_new(struct declaration *declaration,
struct definition_scope *parent_scope,
GQuark field_name, int index,
const char *root_name)
struct definition_scope *parent_scope,
GQuark field_name, int index,
const char *root_name)
struct declaration_sequence *sequence_declaration =
container_of(declaration, struct declaration_sequence, p);
struct definition_sequence *sequence;
struct declaration_sequence *sequence_declaration =
container_of(declaration, struct declaration_sequence, p);
struct definition_sequence *sequence;
- struct definition *len_parent;
+ struct bt_definition *len_parent;
int ret;
sequence = g_new(struct definition_sequence, 1);
int ret;
sequence = g_new(struct definition_sequence, 1);
-void _sequence_definition_free(struct definition *definition)
+void _sequence_definition_free(struct bt_definition *definition)
{
struct definition_sequence *sequence =
container_of(definition, struct definition_sequence, p);
{
struct definition_sequence *sequence =
container_of(definition, struct definition_sequence, p);
- struct definition *len_definition = &sequence->length->p;
+ struct bt_definition *len_definition = &sequence->length->p;
uint64_t i;
if (sequence->string)
(void) g_string_free(sequence->string, TRUE);
if (sequence->elems) {
for (i = 0; i < sequence->elems->len; i++) {
uint64_t i;
if (sequence->string)
(void) g_string_free(sequence->string, TRUE);
if (sequence->elems) {
for (i = 0; i < sequence->elems->len; i++) {
- struct definition *field;
+ struct bt_definition *field;
field = g_ptr_array_index(sequence->elems, i);
field->declaration->definition_free(field);
field = g_ptr_array_index(sequence->elems, i);
field->declaration->definition_free(field);
return sequence->length->value._unsigned;
}
return sequence->length->value._unsigned;
}
-struct definition *bt_sequence_index(struct definition_sequence *sequence, uint64_t i)
+struct bt_definition *bt_sequence_index(struct definition_sequence *sequence, uint64_t i)
{
if (!sequence->elems)
return NULL;
{
if (!sequence->elems)
return NULL;
#include <babeltrace/types.h>
static
#include <babeltrace/types.h>
static
-struct definition *_string_definition_new(struct declaration *declaration,
+struct bt_definition *_string_definition_new(struct declaration *declaration,
struct definition_scope *parent_scope,
GQuark field_name, int index,
const char *root_name);
static
struct definition_scope *parent_scope,
GQuark field_name, int index,
const char *root_name);
static
-void _string_definition_free(struct definition *definition);
+void _string_definition_free(struct bt_definition *definition);
static
void _string_declaration_free(struct declaration *declaration)
static
void _string_declaration_free(struct declaration *declaration)
_string_definition_new(struct declaration *declaration,
struct definition_scope *parent_scope,
GQuark field_name, int index,
_string_definition_new(struct declaration *declaration,
struct definition_scope *parent_scope,
GQuark field_name, int index,
-void _string_definition_free(struct definition *definition)
+void _string_definition_free(struct bt_definition *definition)
{
struct definition_string *string =
container_of(definition, struct definition_string, p);
{
struct definition_string *string =
container_of(definition, struct definition_string, p);
-enum ctf_string_encoding bt_get_string_encoding(const struct definition *field)
+enum ctf_string_encoding bt_get_string_encoding(const struct bt_definition *field)
{
struct definition_string *string_definition;
const struct declaration_string *string_declaration;
{
struct definition_string *string_definition;
const struct declaration_string *string_declaration;
return string_declaration->encoding;
}
return string_declaration->encoding;
}
-char *bt_get_string(const struct definition *field)
+char *bt_get_string(const struct bt_definition *field)
{
struct definition_string *string_definition =
container_of(field, struct definition_string, p);
{
struct definition_string *string_definition =
container_of(field, struct definition_string, p);
-struct definition *_struct_definition_new(struct declaration *declaration,
+struct bt_definition *_struct_definition_new(struct declaration *declaration,
struct definition_scope *parent_scope,
GQuark field_name, int index,
const char *root_name);
static
struct definition_scope *parent_scope,
GQuark field_name, int index,
const char *root_name);
static
-void _struct_definition_free(struct definition *definition);
+void _struct_definition_free(struct bt_definition *definition);
-int bt_struct_rw(struct bt_stream_pos *ppos, struct definition *definition)
+int bt_struct_rw(struct bt_stream_pos *ppos, struct bt_definition *definition)
{
struct definition_struct *struct_definition =
container_of(definition, struct definition_struct, p);
{
struct definition_struct *struct_definition =
container_of(definition, struct definition_struct, p);
int ret;
for (i = 0; i < struct_definition->fields->len; i++) {
int ret;
for (i = 0; i < struct_definition->fields->len; i++) {
- struct definition *field =
+ struct bt_definition *field =
g_ptr_array_index(struct_definition->fields, i);
ret = generic_rw(ppos, field);
if (ret)
g_ptr_array_index(struct_definition->fields, i);
ret = generic_rw(ppos, field);
if (ret)
_struct_definition_new(struct declaration *declaration,
struct definition_scope *parent_scope,
GQuark field_name, int index,
_struct_definition_new(struct declaration *declaration,
struct definition_scope *parent_scope,
GQuark field_name, int index,
struct declaration_field *declaration_field =
&g_array_index(struct_declaration->fields,
struct declaration_field, i);
struct declaration_field *declaration_field =
&g_array_index(struct_declaration->fields,
struct declaration_field, i);
- struct definition **field =
- (struct definition **) &g_ptr_array_index(_struct->fields, i);
+ struct bt_definition **field =
+ (struct bt_definition **) &g_ptr_array_index(_struct->fields, i);
*field = declaration_field->declaration->definition_new(declaration_field->declaration,
_struct->p.scope,
*field = declaration_field->declaration->definition_new(declaration_field->declaration,
_struct->p.scope,
error:
for (i--; i >= 0; i--) {
error:
for (i--; i >= 0; i--) {
- struct definition *field = g_ptr_array_index(_struct->fields, i);
+ struct bt_definition *field = g_ptr_array_index(_struct->fields, i);
bt_definition_unref(field);
}
bt_free_definition_scope(_struct->p.scope);
bt_definition_unref(field);
}
bt_free_definition_scope(_struct->p.scope);
-void _struct_definition_free(struct definition *definition)
+void _struct_definition_free(struct bt_definition *definition)
{
struct definition_struct *_struct =
container_of(definition, struct definition_struct, p);
{
struct definition_struct *_struct =
container_of(definition, struct definition_struct, p);
assert(_struct->fields->len == _struct->declaration->fields->len);
for (i = 0; i < _struct->fields->len; i++) {
assert(_struct->fields->len == _struct->declaration->fields->len);
for (i = 0; i < _struct->fields->len; i++) {
- struct definition *field = g_ptr_array_index(_struct->fields, i);
+ struct bt_definition *field = g_ptr_array_index(_struct->fields, i);
bt_definition_unref(field);
}
bt_free_definition_scope(_struct->p.scope);
bt_definition_unref(field);
}
bt_free_definition_scope(_struct->p.scope);
/*
* field returned only valid as long as the field structure is not appended to.
*/
/*
* field returned only valid as long as the field structure is not appended to.
*/
bt_struct_definition_get_field_from_index(struct definition_struct *_struct,
int index)
{
bt_struct_definition_get_field_from_index(struct definition_struct *_struct,
int index)
{
lookup_field_definition_scope(GQuark field_name,
struct definition_scope *scope)
{
lookup_field_definition_scope(GQuark field_name,
struct definition_scope *scope)
{
}
static struct definition_scope *
}
static struct definition_scope *
- get_definition_scope(const struct definition *definition)
+ get_definition_scope(const struct bt_definition *definition)
{
return definition->scope;
}
{
return definition->scope;
}
* lookup_path: the path leading to the enum we want to look for.
* scope: the definition scope containing the variant definition.
*/
* lookup_path: the path leading to the enum we want to look for.
* scope: the definition scope containing the variant definition.
*/
bt_lookup_path_definition(GArray *cur_path,
GArray *lookup_path,
struct definition_scope *scope)
{
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;
-int bt_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)
struct definition_scope *scope)
{
if (!scope || !field_name)
declaration->declaration_free(declaration);
}
declaration->declaration_free(declaration);
}
-void bt_definition_ref(struct definition *definition)
+void bt_definition_ref(struct bt_definition *definition)
-void bt_definition_unref(struct definition *definition)
+void bt_definition_unref(struct bt_definition *definition)
{
if (!definition)
return;
{
if (!definition)
return;
-struct definition *bt_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);
const char *field_name)
{
struct definition_scope *scope = get_definition_scope(definition);
-struct definition_integer *bt_lookup_integer(const struct definition *definition,
+struct definition_integer *bt_lookup_integer(const struct bt_definition *definition,
const char *field_name,
int signedness)
{
const char *field_name,
int signedness)
{
- struct definition *lookup;
+ struct bt_definition *lookup;
struct definition_integer *lookup_integer;
lookup = bt_lookup_definition(definition, field_name);
struct definition_integer *lookup_integer;
lookup = bt_lookup_definition(definition, field_name);
-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)
{
const char *field_name,
int signedness)
{
- struct definition *lookup;
+ struct bt_definition *lookup;
struct definition_enum *lookup_enum;
lookup = bt_lookup_definition(definition, field_name);
struct definition_enum *lookup_enum;
lookup = bt_lookup_definition(definition, field_name);
-struct definition *bt_lookup_variant(const struct definition *definition,
+struct bt_definition *bt_lookup_variant(const struct bt_definition *definition,
const char *field_name)
{
const char *field_name)
{
- struct definition *lookup;
+ struct bt_definition *lookup;
struct definition_variant *bt_lookup_variant;
lookup = bt_lookup_definition(definition, field_name);
struct definition_variant *bt_lookup_variant;
lookup = bt_lookup_definition(definition, field_name);
#include <errno.h>
static
#include <errno.h>
static
-struct definition *_variant_definition_new(struct declaration *declaration,
+struct bt_definition *_variant_definition_new(struct declaration *declaration,
struct definition_scope *parent_scope,
GQuark field_name, int index,
const char *root_name);
static
struct definition_scope *parent_scope,
GQuark field_name, int index,
const char *root_name);
static
-void _variant_definition_free(struct definition *definition);
+void _variant_definition_free(struct bt_definition *definition);
-int bt_variant_rw(struct bt_stream_pos *ppos, struct definition *definition)
+int bt_variant_rw(struct bt_stream_pos *ppos, struct bt_definition *definition)
{
struct definition_variant *variant_definition =
container_of(definition, struct definition_variant, p);
{
struct definition_variant *variant_definition =
container_of(definition, struct definition_variant, p);
- struct definition *field;
+ struct bt_definition *field;
field = bt_variant_get_current_field(variant_definition);
return generic_rw(ppos, field);
field = bt_variant_get_current_field(variant_definition);
return generic_rw(ppos, field);
*/
static
int check_enum_tag(struct definition_variant *variant,
*/
static
int check_enum_tag(struct definition_variant *variant,
- struct definition *enum_tag)
+ struct bt_definition *enum_tag)
{
struct definition_enum *_enum =
container_of(enum_tag, struct definition_enum, p);
{
struct definition_enum *_enum =
container_of(enum_tag, struct definition_enum, p);
_variant_definition_new(struct declaration *declaration,
struct definition_scope *parent_scope,
GQuark field_name, int index,
_variant_definition_new(struct declaration *declaration,
struct definition_scope *parent_scope,
GQuark field_name, int index,
struct declaration_field *declaration_field =
&g_array_index(variant_declaration->untagged_variant->fields,
struct declaration_field, i);
struct declaration_field *declaration_field =
&g_array_index(variant_declaration->untagged_variant->fields,
struct declaration_field, i);
- struct definition **field =
- (struct definition **) &g_ptr_array_index(variant->fields, i);
+ struct bt_definition **field =
+ (struct bt_definition **) &g_ptr_array_index(variant->fields, i);
/*
* All child definition are at index 0, because they are
/*
* All child definition are at index 0, because they are
-void _variant_definition_free(struct definition *definition)
+void _variant_definition_free(struct bt_definition *definition)
{
struct definition_variant *variant =
container_of(definition, struct definition_variant, p);
{
struct definition_variant *variant =
container_of(definition, struct definition_variant, p);
assert(variant->fields->len == variant->declaration->untagged_variant->fields->len);
for (i = 0; i < variant->fields->len; i++) {
assert(variant->fields->len == variant->declaration->untagged_variant->fields->len);
for (i = 0; i < variant->fields->len; i++) {
- struct definition *field = g_ptr_array_index(variant->fields, i);
+ struct bt_definition *field = g_ptr_array_index(variant->fields, i);
bt_definition_unref(field);
}
bt_definition_unref(variant->enum_tag);
bt_definition_unref(field);
}
bt_definition_unref(variant->enum_tag);
/*
* field returned only valid as long as the field structure is not appended to.
*/
/*
* field returned only valid as long as the field structure is not appended to.
*/
-struct definition *bt_variant_get_current_field(struct definition_variant *variant)
+struct bt_definition *bt_variant_get_current_field(struct definition_variant *variant)
{
struct definition_enum *_enum =
container_of(variant->enum_tag, struct definition_enum, p);
{
struct definition_enum *_enum =
container_of(variant->enum_tag, struct definition_enum, p);