Namespace struct stream_pos
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 2/7 Namespace struct stream_pos
This struct is exposed by the API, so we need to namespace it.
--- converter/babeltrace.c | 2 +- formats/bt-dummy/bt-dummy.c | 4 ++-- formats/ctf-text/ctf-text.c | 6 +++--- formats/ctf-text/types/array.c | 2 +- formats/ctf-text/types/enum.c | 2 +- formats/ctf-text/types/float.c | 2 +- formats/ctf-text/types/integer.c | 2 +- formats/ctf-text/types/sequence.c | 2 +- formats/ctf-text/types/string.c | 2 +- formats/ctf-text/types/struct.c | 2 +- formats/ctf-text/types/variant.c | 2 +- formats/ctf/ctf.c | 24 +++++++++++------------ formats/ctf/types/array.c | 4 ++-- formats/ctf/types/enum.c | 4 ++-- formats/ctf/types/float.c | 8 ++++---- formats/ctf/types/integer.c | 8 ++++---- formats/ctf/types/sequence.c | 4 ++-- formats/ctf/types/string.c | 4 ++-- formats/ctf/types/struct.c | 2 +- formats/ctf/types/variant.c | 2 +- include/babeltrace/context.h | 4 ++-- include/babeltrace/ctf-text/types.h | 22 ++++++++++----------- include/babeltrace/ctf/types.h | 36 +++++++++++++++++------------------ include/babeltrace/format.h | 6 +++--- include/babeltrace/types.h | 18 +++++++++--------- lib/context.c | 2 +- types/array.c | 2 +- types/sequence.c | 2 +- types/struct.c | 2 +- types/variant.c | 2 +- 30 files changed, 92 insertions(+), 92 deletions(-)
converter/babeltrace.c +1 -1
@@ -461,7 +461,7 @@ static int traverse_trace_dir(const char *fpath, const struct stat *sb,*/ int bt_context_add_traces_recursive (struct bt_context *ctx,const char *path,const char *format_str, -void (*packet_seek)(struct stream_pos *pos, +void (*packet_seek)(struct bt_stream_pos *pos,size_t offset,int whence)) {
formats/bt-dummy/bt-dummy.c +2 -2
@@ -39,14 +39,14 @@#include <stdlib.h> static -int bt_dummy_write_event (struct stream_pos *ppos,struct ctf_stream_definition *stream) +int bt_dummy_write_event (struct bt_stream_pos *ppos,struct ctf_stream_definition *stream) {return 0 ; }static struct trace_descriptor *bt_dummy_open_trace (const char *path,int flags, -void (*packet_seek)(struct stream_pos *pos,size_t index, +void (*packet_seek)(struct bt_stream_pos *pos,size_t index,int whence),FILE *metadata_fp) {struct ctf_text_stream_pos *pos;
formats/ctf-text/ctf-text.c +3 -3
@@ -88,7 +88,7 @@ enum bt_loglevel {static struct trace_descriptor *ctf_text_open_trace (const char *path,int flags, -void (*packet_seek)(struct stream_pos *pos,size_t index, +void (*packet_seek)(struct bt_stream_pos *pos,size_t index,int whence),FILE *metadata_fp);static int ctf_text_close_trace (struct trace_descriptor *descriptor);
@@ -232,7 +232,7 @@ const char *print_loglevel(int value) }static -int ctf_text_write_event (struct stream_pos *ppos,struct ctf_stream_definition *stream) +int ctf_text_write_event (struct bt_stream_pos *ppos,struct ctf_stream_definition *stream) { struct ctf_text_stream_pos *pos =
@@ -556,7 +556,7 @@ error:static struct trace_descriptor *ctf_text_open_trace (const char *path,int flags, -void (*packet_seek)(struct stream_pos *pos,size_t index, +void (*packet_seek)(struct bt_stream_pos *pos,size_t index,int whence),FILE *metadata_fp) {struct ctf_text_stream_pos *pos;
formats/ctf-text/types/array.c +1 -1
@@ -29,7 +29,7 @@#include <babeltrace/ctf-text/types.h> #include <stdio.h> -int ctf_text_array_write (struct stream_pos *ppos,struct definition *definition) +int ctf_text_array_write (struct bt_stream_pos *ppos,struct definition *definition) {struct ctf_text_stream_pos *pos =ctf_text_pos (ppos); struct definition_array *array_definition =
formats/ctf-text/types/enum.c +1 -1
@@ -30,7 +30,7 @@#include <stdio.h> #include <stdint.h> -int ctf_text_enum_write (struct stream_pos *ppos,struct definition *definition) +int ctf_text_enum_write (struct bt_stream_pos *ppos,struct definition *definition) {struct definition_enum *enum_definition = container_of(definition, struct definition_enum, p);
formats/ctf-text/types/float.c +1 -1
@@ -31,7 +31,7 @@#include <babeltrace/ctf-text/types.h> #include <stdio.h> -int ctf_text_float_write (struct stream_pos *ppos,struct definition *definition) +int ctf_text_float_write (struct bt_stream_pos *ppos,struct definition *definition) {struct definition_float *float_definition = container_of(definition, struct definition_float, p);
formats/ctf-text/types/integer.c +1 -1
@@ -32,7 +32,7 @@#include <stdint.h> #include <babeltrace/bitfield.h> -int ctf_text_integer_write (struct stream_pos *ppos,struct definition *definition) +int ctf_text_integer_write (struct bt_stream_pos *ppos,struct definition *definition) {struct definition_integer *integer_definition = container_of(definition, struct definition_integer, p);
formats/ctf-text/types/sequence.c +1 -1
@@ -29,7 +29,7 @@#include <babeltrace/ctf-text/types.h> #include <stdio.h> -int ctf_text_sequence_write (struct stream_pos *ppos,struct definition *definition) +int ctf_text_sequence_write (struct bt_stream_pos *ppos,struct definition *definition) {struct ctf_text_stream_pos *pos =ctf_text_pos (ppos); struct definition_sequence *sequence_definition =
formats/ctf-text/types/string.c +1 -1
@@ -31,7 +31,7 @@#include <limits.h> /* C99 limits */ #include <string.h> -int ctf_text_string_write (struct stream_pos *ppos, +int ctf_text_string_write (struct bt_stream_pos *ppos,struct definition *definition) { struct definition_string *string_definition =
formats/ctf-text/types/struct.c +1 -1
@@ -29,7 +29,7 @@#include <babeltrace/ctf-text/types.h> #include <stdio.h> -int ctf_text_struct_write (struct stream_pos *ppos,struct definition *definition) +int ctf_text_struct_write (struct bt_stream_pos *ppos,struct definition *definition) {struct declaration *declaration = definition->declaration; struct declaration_struct *struct_declaration =
formats/ctf-text/types/variant.c +1 -1
@@ -29,7 +29,7 @@#include <babeltrace/ctf-text/types.h> #include <stdio.h> -int ctf_text_variant_write (struct stream_pos *ppos,struct definition *definition) +int ctf_text_variant_write (struct bt_stream_pos *ppos,struct definition *definition) {struct ctf_text_stream_pos *pos =ctf_text_pos (ppos);int field_nr_saved;
formats/ctf/ctf.c +12 -12
@@ -77,13 +77,13 @@ extern int yydebug;static struct trace_descriptor *ctf_open_trace (const char *path,int flags, -void (*packet_seek)(struct stream_pos *pos,size_t index, +void (*packet_seek)(struct bt_stream_pos *pos,size_t index,int whence),FILE *metadata_fp);static struct trace_descriptor *ctf_open_mmap_trace (struct mmap_stream_list *mmap_list, -void (*packet_seek)(struct stream_pos *pos,size_t index, +void (*packet_seek)(struct bt_stream_pos *pos,size_t index,int whence),FILE *metadata_fp); static
@@ -392,7 +392,7 @@ void ctf_print_timestamp(FILE *fp, }static -int ctf_read_event (struct stream_pos *ppos,struct ctf_stream_definition *stream) +int ctf_read_event (struct bt_stream_pos *ppos,struct ctf_stream_definition *stream) {struct ctf_stream_pos *pos = container_of(ppos, struct ctf_stream_pos, parent);
@@ -504,7 +504,7 @@ error: }static -int ctf_write_event (struct stream_pos *pos,struct ctf_stream_definition *stream) +int ctf_write_event (struct bt_stream_pos *pos,struct ctf_stream_definition *stream) {struct ctf_stream_declaration *stream_class = stream->stream_class;struct ctf_event_definition *event;
@@ -617,7 +617,7 @@ int ctf_fini_pos(struct ctf_stream_pos *pos)* for SEEK_CUR: go to next packet. * for SEEK_POS: go to packet numer (index). */ -void ctf_packet_seek (struct stream_pos *stream_pos,size_t index,int whence) +void ctf_packet_seek (struct bt_stream_pos *stream_pos,size_t index,int whence) {struct ctf_stream_pos *pos = container_of(stream_pos, struct ctf_stream_pos, parent);
@@ -1018,7 +1018,7 @@ int ctf_open_trace_metadata_stream_read(struct ctf_trace *td, FILE **fp,static int ctf_open_trace_metadata_read (struct ctf_trace *td, -void (*packet_seek)(struct stream_pos *pos,size_t index, +void (*packet_seek)(struct bt_stream_pos *pos,size_t index,int whence),FILE *metadata_fp) {struct ctf_scanner *scanner;
@@ -1523,7 +1523,7 @@ error:*/ static int ctf_open_file_stream_read (struct ctf_trace *td,const char *path,int flags, -void (*packet_seek)(struct stream_pos *pos,size_t index, +void (*packet_seek)(struct bt_stream_pos *pos,size_t index,int whence)) {int ret, fd, closeret;
@@ -1600,7 +1600,7 @@ error:static int ctf_open_trace_read (struct ctf_trace *td,const char *path,int flags, -void (*packet_seek)(struct stream_pos *pos,size_t index, +void (*packet_seek)(struct bt_stream_pos *pos,size_t index,int whence),FILE *metadata_fp) {int ret, closeret;
@@ -1696,7 +1696,7 @@ error:*/ static struct trace_descriptor *ctf_open_trace (const char *path,int flags, -void (*packet_seek)(struct stream_pos *pos,size_t index, +void (*packet_seek)(struct bt_stream_pos *pos,size_t index,int whence),FILE *metadata_fp) {struct ctf_trace *td;
@@ -1786,7 +1786,7 @@ end:static int ctf_open_mmap_stream_read (struct ctf_trace *td,struct mmap_stream *mmap_info, -void (*packet_seek)(struct stream_pos *pos,size_t index, +void (*packet_seek)(struct bt_stream_pos *pos,size_t index,int whence)) {int ret;
@@ -1828,7 +1828,7 @@ error_def:static int ctf_open_mmap_trace_read (struct ctf_trace *td,struct mmap_stream_list *mmap_list, -void (*packet_seek)(struct stream_pos *pos,size_t index, +void (*packet_seek)(struct bt_stream_pos *pos,size_t index,int whence),FILE *metadata_fp) {
@@ -1861,7 +1861,7 @@ error:static struct trace_descriptor *ctf_open_mmap_trace (struct mmap_stream_list *mmap_list, -void (*packet_seek)(struct stream_pos *pos,size_t index, +void (*packet_seek)(struct bt_stream_pos *pos,size_t index,int whence),FILE *metadata_fp) {
formats/ctf/types/array.c +2 -2
@@ -28,7 +28,7 @@#include <babeltrace/ctf/types.h> -int ctf_array_read (struct stream_pos *ppos,struct definition *definition) +int ctf_array_read (struct bt_stream_pos *ppos,struct definition *definition) {struct definition_array *array_definition = container_of(definition, struct definition_array, p);
@@ -64,7 +64,7 @@ int ctf_array_read(struct stream_pos *ppos, struct definition *definition)return bt_array_rw (ppos, definition); } -int ctf_array_write (struct stream_pos *ppos,struct definition *definition) +int ctf_array_write (struct bt_stream_pos *ppos,struct definition *definition) {struct definition_array *array_definition = container_of(definition, struct definition_array, p);
formats/ctf/types/enum.c +2 -2
@@ -31,7 +31,7 @@#include <stdint.h> #include <glib.h> -int ctf_enum_read (struct stream_pos *ppos,struct definition *definition) +int ctf_enum_read (struct bt_stream_pos *ppos,struct definition *definition) {struct definition_enum *enum_definition = container_of(definition, struct definition_enum, p);
@@ -69,7 +69,7 @@ int ctf_enum_read(struct stream_pos *ppos, struct definition *definition)return 0 ; } -int ctf_enum_write (struct stream_pos *pos,struct definition *definition) +int ctf_enum_write (struct bt_stream_pos *pos,struct definition *definition) {struct definition_enum *enum_definition = container_of(definition, struct definition_enum, p);
formats/ctf/types/float.c +4 -4
@@ -96,9 +96,9 @@ static void float_unlock(void)assert (!ret); } -static int _ctf_float_copy (struct stream_pos *destp, +static int _ctf_float_copy (struct bt_stream_pos *destp,struct definition_float *dest_definition, -struct stream_pos *srcp, +struct bt_stream_pos *srcp,const struct definition_float *src_definition) {int ret;
@@ -165,7 +165,7 @@ static int _ctf_float_copy(struct stream_pos *destp,return 0 ; } -int ctf_float_read (struct stream_pos *ppos,struct definition *definition) +int ctf_float_read (struct bt_stream_pos *ppos,struct definition *definition) {struct definition_float *float_definition = container_of(definition, struct definition_float, p);
@@ -222,7 +222,7 @@ end:return ret; } -int ctf_float_write (struct stream_pos *ppos,struct definition *definition) +int ctf_float_write (struct bt_stream_pos *ppos,struct definition *definition) {struct definition_float *float_definition = container_of(definition, struct definition_float, p);
formats/ctf/types/integer.c +4 -4
@@ -39,7 +39,7 @@*/ static -int _aligned_integer_read (struct stream_pos *ppos, +int _aligned_integer_read (struct bt_stream_pos *ppos,struct definition *definition) { struct definition_integer *integer_definition =
@@ -141,7 +141,7 @@ int _aligned_integer_read(struct stream_pos *ppos, }static -int _aligned_integer_write (struct stream_pos *ppos, +int _aligned_integer_write (struct bt_stream_pos *ppos,struct definition *definition) { struct definition_integer *integer_definition =
@@ -211,7 +211,7 @@ end:return 0 ; } -int ctf_integer_read (struct stream_pos *ppos,struct definition *definition) +int ctf_integer_read (struct bt_stream_pos *ppos,struct definition *definition) {struct definition_integer *integer_definition = container_of(definition, struct definition_integer, p);
@@ -256,7 +256,7 @@ int ctf_integer_read(struct stream_pos *ppos, struct definition *definition)return 0 ; } -int ctf_integer_write (struct stream_pos *ppos,struct definition *definition) +int ctf_integer_write (struct bt_stream_pos *ppos,struct definition *definition) {struct definition_integer *integer_definition = container_of(definition, struct definition_integer, p);
formats/ctf/types/sequence.c +2 -2
@@ -28,7 +28,7 @@#include <babeltrace/ctf/types.h> -int ctf_sequence_read (struct stream_pos *ppos,struct definition *definition) +int ctf_sequence_read (struct bt_stream_pos *ppos,struct definition *definition) {struct definition_sequence *sequence_definition = container_of(definition, struct definition_sequence, p);
@@ -63,7 +63,7 @@ int ctf_sequence_read(struct stream_pos *ppos, struct definition *definition)return bt_sequence_rw (ppos, definition); } -int ctf_sequence_write (struct stream_pos *ppos,struct definition *definition) +int ctf_sequence_write (struct bt_stream_pos *ppos,struct definition *definition) {struct definition_sequence *sequence_definition = container_of(definition, struct definition_sequence, p);
formats/ctf/types/string.c +2 -2
@@ -31,7 +31,7 @@#include <limits.h> /* C99 limits */ #include <string.h> -int ctf_string_read (struct stream_pos *ppos,struct definition *definition) +int ctf_string_read (struct bt_stream_pos *ppos,struct definition *definition) {struct definition_string *string_definition = container_of(definition, struct definition_string, p);
@@ -68,7 +68,7 @@ int ctf_string_read(struct stream_pos *ppos, struct definition *definition)return 0 ; } -int ctf_string_write (struct stream_pos *ppos, +int ctf_string_write (struct bt_stream_pos *ppos,struct definition *definition) { struct definition_string *string_definition =
formats/ctf/types/struct.c +1 -1
@@ -28,7 +28,7 @@#include <babeltrace/ctf/types.h> -int ctf_struct_rw (struct stream_pos *ppos,struct definition *definition) +int ctf_struct_rw (struct bt_stream_pos *ppos,struct definition *definition) {struct declaration *declaration = definition->declaration;struct ctf_stream_pos *pos =ctf_pos (ppos);
formats/ctf/types/variant.c +1 -1
@@ -28,7 +28,7 @@#include <babeltrace/ctf/types.h> -int ctf_variant_rw (struct stream_pos *ppos,struct definition *definition) +int ctf_variant_rw (struct bt_stream_pos *ppos,struct definition *definition) {struct declaration *declaration = definition->declaration;struct ctf_stream_pos *pos =ctf_pos (ppos);
include/babeltrace/context.h +2 -2
@@ -40,7 +40,7 @@ extern "C" {/* struct bt_context is opaque to the user */ struct bt_context ; -struct stream_pos ; +struct bt_stream_pos ;struct bt_ctf_event ;/*
@@ -82,7 +82,7 @@ struct bt_context *bt_context_create(void);*/ int bt_context_add_trace (struct bt_context *ctx,const char *path,const char *format, -void (*packet_seek)(struct stream_pos *pos, +void (*packet_seek)(struct bt_stream_pos *pos,size_t index,int whence),struct mmap_stream_list *stream_list,FILE *metadata);
include/babeltrace/ctf-text/types.h +11 -11
@@ -37,10 +37,10 @@#include <babeltrace/format.h> /* -* Inherit from both struct stream_pos and struct trace_descriptor. +* Inherit from both struct bt_stream_pos and struct trace_descriptor. */ struct ctf_text_stream_pos { -struct stream_pos parent; +struct bt_stream_pos parent;struct trace_descriptor trace_descriptor;FILE *fp;/* File pointer. NULL if unset. */ int depth;
@@ -53,7 +53,7 @@ struct ctf_text_stream_pos { };static inline -struct ctf_text_stream_pos *ctf_text_pos (struct stream_pos *pos) +struct ctf_text_stream_pos *ctf_text_pos (struct bt_stream_pos *pos) { return container_of(pos, struct ctf_text_stream_pos, parent); }
@@ -62,21 +62,21 @@ struct ctf_text_stream_pos *ctf_text_pos(struct stream_pos *pos)* Write only is supported for now. */ BT_HIDDEN -int ctf_text_integer_write(struct stream_pos *pos, struct definition *definition); +int ctf_text_integer_write(struct bt_stream_pos *pos, struct definition *definition);BT_HIDDEN -int ctf_text_float_write(struct stream_pos *pos, struct definition *definition); +int ctf_text_float_write(struct bt_stream_pos *pos, struct definition *definition);BT_HIDDEN -int ctf_text_string_write(struct stream_pos *pos, struct definition *definition); +int ctf_text_string_write(struct bt_stream_pos *pos, struct definition *definition);BT_HIDDEN -int ctf_text_enum_write(struct stream_pos *pos, struct definition *definition); +int ctf_text_enum_write(struct bt_stream_pos *pos, struct definition *definition);BT_HIDDEN -int ctf_text_struct_write(struct stream_pos *pos, struct definition *definition); +int ctf_text_struct_write(struct bt_stream_pos *pos, struct definition *definition);BT_HIDDEN -int ctf_text_variant_write(struct stream_pos *pos, struct definition *definition); +int ctf_text_variant_write(struct bt_stream_pos *pos, struct definition *definition);BT_HIDDEN -int ctf_text_array_write(struct stream_pos *pos, struct definition *definition); +int ctf_text_array_write(struct bt_stream_pos *pos, struct definition *definition);BT_HIDDEN -int ctf_text_sequence_write(struct stream_pos *pos, struct definition *definition); +int ctf_text_sequence_write(struct bt_stream_pos *pos, struct definition *definition);static inline void print_pos_tabs (struct ctf_text_stream_pos *pos)
include/babeltrace/ctf/types.h +18 -18
@@ -59,7 +59,7 @@ struct packet_index {* Always update ctf_stream_pos with ctf_move_pos and ctf_init_pos. */ struct ctf_stream_pos { -struct stream_pos parent; +struct bt_stream_pos parent;int fd;/* backing file fd. -1 if unset. */ GArray *packet_cycles_index;/* contains struct packet_index in cycles */ GArray *packet_real_index;/* contains struct packet_index in ns */
@@ -77,7 +77,7 @@ struct ctf_stream_pos {int64_t last_offset;/* offset before the last read_event */ uint64_t cur_index;/* current index in packet index */ uint64_t last_events_discarded;/* last known amount of event discarded */ -void (*packet_seek)(struct stream_pos *pos,size_t index, +void (*packet_seek)(struct bt_stream_pos *pos,size_t index,int whence);/* function called to switch packet */ int dummy;/* dummy position, for length calculation */
@@ -85,41 +85,41 @@ struct ctf_stream_pos { };static inline -struct ctf_stream_pos *ctf_pos (struct stream_pos *pos) +struct ctf_stream_pos *ctf_pos (struct bt_stream_pos *pos) { return container_of(pos, struct ctf_stream_pos, parent); }BT_HIDDEN -int ctf_integer_read(struct stream_pos *pos, struct definition *definition); +int ctf_integer_read(struct bt_stream_pos *pos, struct definition *definition);BT_HIDDEN -int ctf_integer_write(struct stream_pos *pos, struct definition *definition); +int ctf_integer_write(struct bt_stream_pos *pos, struct definition *definition);BT_HIDDEN -int ctf_float_read(struct stream_pos *pos, struct definition *definition); +int ctf_float_read(struct bt_stream_pos *pos, struct definition *definition);BT_HIDDEN -int ctf_float_write(struct stream_pos *pos, struct definition *definition); +int ctf_float_write(struct bt_stream_pos *pos, struct definition *definition);BT_HIDDEN -int ctf_string_read(struct stream_pos *pos, struct definition *definition); +int ctf_string_read(struct bt_stream_pos *pos, struct definition *definition);BT_HIDDEN -int ctf_string_write(struct stream_pos *pos, struct definition *definition); +int ctf_string_write(struct bt_stream_pos *pos, struct definition *definition);BT_HIDDEN -int ctf_enum_read(struct stream_pos *pos, struct definition *definition); +int ctf_enum_read(struct bt_stream_pos *pos, struct definition *definition);BT_HIDDEN -int ctf_enum_write(struct stream_pos *pos, struct definition *definition); +int ctf_enum_write(struct bt_stream_pos *pos, struct definition *definition);BT_HIDDEN -int ctf_struct_rw(struct stream_pos *pos, struct definition *definition); +int ctf_struct_rw(struct bt_stream_pos *pos, struct definition *definition);BT_HIDDEN -int ctf_variant_rw(struct stream_pos *pos, struct definition *definition); +int ctf_variant_rw(struct bt_stream_pos *pos, struct definition *definition);BT_HIDDEN -int ctf_array_read(struct stream_pos *pos, struct definition *definition); +int ctf_array_read(struct bt_stream_pos *pos, struct definition *definition);BT_HIDDEN -int ctf_array_write(struct stream_pos *pos, struct definition *definition); +int ctf_array_write(struct bt_stream_pos *pos, struct definition *definition);BT_HIDDEN -int ctf_sequence_read(struct stream_pos *pos, struct definition *definition); +int ctf_sequence_read(struct bt_stream_pos *pos, struct definition *definition);BT_HIDDEN -int ctf_sequence_write(struct stream_pos *pos, struct definition *definition); +int ctf_sequence_write(struct bt_stream_pos *pos, struct definition *definition); -void ctf_packet_seek (struct stream_pos *pos,size_t index,int whence); +void ctf_packet_seek (struct bt_stream_pos *pos,size_t index,int whence);int ctf_init_pos (struct ctf_stream_pos *pos,int fd,int open_flags);int ctf_fini_pos (struct ctf_stream_pos *pos);
include/babeltrace/format.h +3 -3
@@ -41,7 +41,7 @@ extern "C" {typedef int bt_intern_str ;/* forward declaration */ -struct stream_pos ; +struct bt_stream_pos ;struct bt_context ;struct bt_trace_handle ;
@@ -62,12 +62,12 @@ struct format {bt_intern_str name;struct trace_descriptor *(*open_trace)(const char *path,int flags, -void (*packet_seek)(struct stream_pos *pos, +void (*packet_seek)(struct bt_stream_pos *pos,size_t index,int whence),FILE *metadata_fp);struct trace_descriptor *(*open_mmap_trace)(struct mmap_stream_list *mmap_list, -void (*packet_seek)(struct stream_pos *pos, +void (*packet_seek)(struct bt_stream_pos *pos,size_t index,int whence),FILE *metadata_fp);int (*close_trace)(struct trace_descriptor *descriptor);
include/babeltrace/types.h +9 -9
@@ -43,7 +43,7 @@#define DEFAULT_NR_STRUCT_FIELDS 8struct ctf_stream_definition ; -struct stream_pos ; +struct bt_stream_pos ;struct format ;struct definition ;struct ctf_clock ;
@@ -106,19 +106,19 @@ struct definition {struct definition_scope *scope; }; -typedef int (*rw_dispatch )(struct stream_pos *pos, +typedef int (*rw_dispatch )(struct bt_stream_pos *pos,struct definition *definition);/* Parent of per-plugin positions */ -struct stream_pos { +struct bt_stream_pos {/* read/write dispatch table. Specific to plugin used for stream. */ rw_dispatch *rw_table;/* rw dispatch table */ -int (*event_cb)(struct stream_pos *pos, +int (*event_cb)(struct bt_stream_pos *pos,struct ctf_stream_definition *stream); };static inline -int generic_rw (struct stream_pos *pos,struct definition *definition) +int generic_rw (struct bt_stream_pos *pos,struct definition *definition) {enum ctf_type_id dispatch_id = definition->declaration->id;rw_dispatch call;
@@ -450,7 +450,7 @@ bt_struct_declaration_get_field_from_index(struct declaration_struct *struct_decstruct definition *bt_struct_definition_get_field_from_index (struct definition_struct *struct_definition,int index); -int bt_struct_rw (struct stream_pos *pos,struct definition *definition); +int bt_struct_rw (struct bt_stream_pos *pos,struct definition *definition);uint64_t bt_struct_declaration_len (struct declaration_struct *struct_declaration);/*
@@ -480,7 +480,7 @@ int variant_definition_set_tag(struct definition_variant *variant,* to. */ struct definition *bt_variant_get_current_field (struct definition_variant *variant); -int bt_variant_rw (struct stream_pos *pos,struct definition *definition); +int bt_variant_rw (struct bt_stream_pos *pos,struct definition *definition);/* * elem_declaration passed as parameter now belongs to the array. No
@@ -492,7 +492,7 @@ struct declaration_array * 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 stream_pos *pos,struct definition *definition); +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);
@@ -506,7 +506,7 @@ struct declaration_sequence * 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 stream_pos *pos,struct definition *definition); +int bt_sequence_rw (struct bt_stream_pos *pos,struct definition *definition);/* * in: path (dot separated), out: q (GArray of GQuark)
lib/context.c +1 -1
@@ -67,7 +67,7 @@ struct bt_context *bt_context_create(void)int bt_context_add_trace (struct bt_context *ctx,const char *path,const char *format_name, -void (*packet_seek)(struct stream_pos *pos,size_t index, +void (*packet_seek)(struct bt_stream_pos *pos,size_t index,int whence),struct mmap_stream_list *stream_list,FILE *metadata)
types/array.c +1 -1
@@ -38,7 +38,7 @@ struct definition *_array_definition_new(struct declaration *declaration,static void _array_definition_free (struct definition *definition); -int bt_array_rw (struct stream_pos *pos,struct definition *definition) +int bt_array_rw (struct bt_stream_pos *pos,struct definition *definition) {struct definition_array *array_definition = container_of(definition, struct definition_array, p);
types/sequence.c +1 -1
@@ -39,7 +39,7 @@ struct definition *_sequence_definition_new(struct declaration *declaration,static void _sequence_definition_free (struct definition *definition); -int bt_sequence_rw (struct stream_pos *pos,struct definition *definition) +int bt_sequence_rw (struct bt_stream_pos *pos,struct definition *definition) {struct definition_sequence *sequence_definition = container_of(definition, struct definition_sequence, p);
types/struct.c +1 -1
@@ -43,7 +43,7 @@ struct definition *_struct_definition_new(struct declaration *declaration,static void _struct_definition_free (struct definition *definition); -int bt_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);
types/variant.c +1 -1
@@ -39,7 +39,7 @@ struct definition *_variant_definition_new(struct declaration *declaration,static void _variant_definition_free (struct definition *definition); -int bt_variant_rw (struct stream_pos *ppos,struct definition *definition) +int bt_variant_rw (struct bt_stream_pos *ppos,struct definition *definition) {struct definition_variant *variant_definition = container_of(definition, struct definition_variant, p);
Signature · 1 line
1.7.10.4
PATCH 3/7 Namespace the struct trace_descriptor
In reply to a message not in the archiveThis struct is exposed in the public API so we need to namespace it.
--- converter/babeltrace.c | 4 ++-- formats/bt-dummy/bt-dummy.c | 4 ++-- formats/ctf-text/ctf-text.c | 8 +++---- formats/ctf/callbacks.c | 2 +- formats/ctf/ctf.c | 32 ++++++++++++++-------------- formats/ctf/events.c | 2 +- include/babeltrace/babeltrace-internal.h | 4 ++-- include/babeltrace/ctf-ir/metadata.h | 2 +- include/babeltrace/ctf-text/types.h | 4 ++-- include/babeltrace/format.h | 18 ++++++++-------- include/babeltrace/trace-collection.h | 4 ++-- include/babeltrace/trace-handle-internal.h | 2 +- lib/context.c | 2 +- lib/iterator.c | 8 +++---- lib/trace-collection.c | 4 ++-- 15 files changed, 50 insertions(+), 50 deletions(-)
converter/babeltrace.c +2 -2
@@ -516,7 +516,7 @@ int bt_context_add_traces_recursive(struct bt_context *ctx, const char *path,return ret; } -int convert_trace (struct trace_descriptor *td_write, +int convert_trace (struct bt_trace_descriptor *td_write,struct bt_context *ctx) {struct bt_ctf_iter *iter;
@@ -556,7 +556,7 @@ int main(int argc, char **argv) {int ret, partial_error =0 , open_success =0 ;struct format *fmt_write; -struct trace_descriptor *td_write; +struct bt_trace_descriptor *td_write;struct bt_context *ctx;int i;
formats/bt-dummy/bt-dummy.c +2 -2
@@ -45,7 +45,7 @@ int bt_dummy_write_event(struct bt_stream_pos *ppos, struct ctf_stream_definitio }static -struct trace_descriptor *bt_dummy_open_trace (const char *path,int flags, +struct bt_trace_descriptor *bt_dummy_open_trace (const char *path,int flags,void (*packet_seek)(struct bt_stream_pos *pos,size_t index,int whence),FILE *metadata_fp) {
@@ -58,7 +58,7 @@ struct trace_descriptor *bt_dummy_open_trace(const char *path, int flags, }static -int bt_dummy_close_trace (struct trace_descriptor *td) +int bt_dummy_close_trace (struct bt_trace_descriptor *td) {struct ctf_text_stream_pos *pos = container_of(td, struct ctf_text_stream_pos,
formats/ctf-text/ctf-text.c +4 -4
@@ -87,11 +87,11 @@ enum bt_loglevel { };static -struct trace_descriptor *ctf_text_open_trace (const char *path,int flags, +struct bt_trace_descriptor *ctf_text_open_trace (const char *path,int flags,void (*packet_seek)(struct bt_stream_pos *pos,size_t index,int whence),FILE *metadata_fp);static -int ctf_text_close_trace (struct trace_descriptor *descriptor); +int ctf_text_close_trace (struct bt_trace_descriptor *descriptor);static rw_dispatch write_dispatch_table[] = {
@@ -555,7 +555,7 @@ error: }static -struct trace_descriptor *ctf_text_open_trace (const char *path,int flags, +struct bt_trace_descriptor *ctf_text_open_trace (const char *path,int flags,void (*packet_seek)(struct bt_stream_pos *pos,size_t index,int whence),FILE *metadata_fp) {
@@ -592,7 +592,7 @@ error: }static -int ctf_text_close_trace (struct trace_descriptor *td) +int ctf_text_close_trace (struct bt_trace_descriptor *td) {int ret; struct ctf_text_stream_pos *pos =
formats/ctf/callbacks.c +1 -1
@@ -89,7 +89,7 @@ int bt_ctf_iter_add_callback(struct bt_ctf_iter *iter, tc = iter->parent.ctx->tc;for (i =0 ; i < tc->array->len; i++) {struct ctf_trace *tin; -struct trace_descriptor *td_read; +struct bt_trace_descriptor *td_read; td_read =g_ptr_array_index (tc->array, i); tin = container_of(td_read, struct ctf_trace, parent);
formats/ctf/ctf.c +16 -16
@@ -76,33 +76,33 @@ uint64_t opt_clock_offset;extern int yydebug;static -struct trace_descriptor *ctf_open_trace (const char *path,int flags, +struct bt_trace_descriptor *ctf_open_trace (const char *path,int flags,void (*packet_seek)(struct bt_stream_pos *pos,size_t index,int whence),FILE *metadata_fp);static -struct trace_descriptor *ctf_open_mmap_trace ( +struct bt_trace_descriptor *ctf_open_mmap_trace (struct mmap_stream_list *mmap_list,void (*packet_seek)(struct bt_stream_pos *pos,size_t index,int whence),FILE *metadata_fp);static -void ctf_set_context (struct trace_descriptor *descriptor, +void ctf_set_context (struct bt_trace_descriptor *descriptor,struct bt_context *ctx);static -void ctf_set_handle (struct trace_descriptor *descriptor, +void ctf_set_handle (struct bt_trace_descriptor *descriptor,struct bt_trace_handle *handle);static -int ctf_close_trace (struct trace_descriptor *descriptor); +int ctf_close_trace (struct bt_trace_descriptor *descriptor);static -uint64_t ctf_timestamp_begin (struct trace_descriptor *descriptor, +uint64_t ctf_timestamp_begin (struct bt_trace_descriptor *descriptor,struct bt_trace_handle *handle,enum bt_clock_type type);static -uint64_t ctf_timestamp_end (struct trace_descriptor *descriptor, +uint64_t ctf_timestamp_end (struct bt_trace_descriptor *descriptor,struct bt_trace_handle *handle,enum bt_clock_type type);static -int ctf_convert_index_timestamp (struct trace_descriptor *tdp); +int ctf_convert_index_timestamp (struct bt_trace_descriptor *tdp);static rw_dispatch read_dispatch_table[] = {
@@ -141,7 +141,7 @@ struct format ctf_format = { };static -uint64_t ctf_timestamp_begin (struct trace_descriptor *descriptor, +uint64_t ctf_timestamp_begin (struct bt_trace_descriptor *descriptor,struct bt_trace_handle *handle,enum bt_clock_type type) {struct ctf_trace *tin;
@@ -202,7 +202,7 @@ error: }static -uint64_t ctf_timestamp_end (struct trace_descriptor *descriptor, +uint64_t ctf_timestamp_end (struct bt_trace_descriptor *descriptor,struct bt_trace_handle *handle,enum bt_clock_type type) {struct ctf_trace *tin;
@@ -1695,7 +1695,7 @@ error:* since the index creation read it entirely. */ static -struct trace_descriptor *ctf_open_trace (const char *path,int flags, +struct bt_trace_descriptor *ctf_open_trace (const char *path,int flags,void (*packet_seek)(struct bt_stream_pos *pos,size_t index,int whence),FILE *metadata_fp) {
@@ -1859,7 +1859,7 @@ error: }static -struct trace_descriptor *ctf_open_mmap_trace( +struct bt_trace_descriptor *ctf_open_mmap_trace( struct mmap_stream_list *mmap_list, void (*packet_seek)(struct bt_stream_pos *pos, size_t index, int whence),
@@ -1891,7 +1891,7 @@ error: }static -int ctf_convert_index_timestamp (struct trace_descriptor *tdp) +int ctf_convert_index_timestamp (struct bt_trace_descriptor *tdp) {int i, j, k; struct ctf_trace *td = container_of(tdp, struct ctf_trace, parent);
@@ -1959,7 +1959,7 @@ int ctf_close_file_stream(struct ctf_file_stream *file_stream) }static -int ctf_close_trace (struct trace_descriptor *tdp) +int ctf_close_trace (struct bt_trace_descriptor *tdp) { struct ctf_trace *td = container_of(tdp, struct ctf_trace, parent);int ret;
@@ -2000,7 +2000,7 @@ int ctf_close_trace(struct trace_descriptor *tdp) }static -void ctf_set_context (struct trace_descriptor *descriptor, +void ctf_set_context (struct bt_trace_descriptor *descriptor,struct bt_context *ctx) { struct ctf_trace *td = container_of(descriptor, struct ctf_trace,
@@ -2010,7 +2010,7 @@ void ctf_set_context(struct trace_descriptor *descriptor, }static -void ctf_set_handle (struct trace_descriptor *descriptor, +void ctf_set_handle (struct bt_trace_descriptor *descriptor,struct bt_trace_handle *handle) { struct ctf_trace *td = container_of(descriptor, struct ctf_trace,
formats/ctf/events.c +1 -1
@@ -613,7 +613,7 @@ int bt_ctf_get_event_decl_list(int handle_id, struct bt_context *ctx, unsigned int *count) {struct bt_trace_handle *handle; -struct trace_descriptor *td; +struct bt_trace_descriptor *td;struct ctf_trace *tin;if (!ctx || !list || !count)
include/babeltrace/babeltrace-internal.h +2 -2
@@ -50,9 +50,9 @@ extern int babeltrace_verbose, babeltrace_debug;*/ #define BT_HIDDEN __attribute__((visibility("hidden"))) -struct trace_descriptor ; +struct bt_trace_descriptor ;struct trace_collection { -GPtrArray *array;/* struct trace_descriptor */ +GPtrArray *array;/* struct bt_trace_descriptor */ GHashTable *clocks;/* struct ctf_clock */ uint64_t single_clock_offset_avg;
include/babeltrace/ctf-ir/metadata.h +1 -1
@@ -174,7 +174,7 @@ struct ctf_tracer_env { };struct ctf_trace { -struct trace_descriptor parent; +struct bt_trace_descriptor parent;/* root scope */ struct declaration_scope *root_declaration_scope;
include/babeltrace/ctf-text/types.h +2 -2
@@ -37,11 +37,11 @@#include <babeltrace/format.h> /* -* Inherit from both struct bt_stream_pos and struct trace_descriptor. +* Inherit from both struct bt_stream_pos and struct bt_trace_descriptor. */ struct ctf_text_stream_pos {struct bt_stream_pos parent; -struct trace_descriptor trace_descriptor; +struct bt_trace_descriptor trace_descriptor;FILE *fp;/* File pointer. NULL if unset. */ int depth;int dummy;/* disable output */
include/babeltrace/format.h +9 -9
@@ -46,7 +46,7 @@ struct bt_context;struct bt_trace_handle ;/* Parent trace descriptor */ -struct trace_descriptor { +struct bt_trace_descriptor { };struct mmap_stream {
@@ -61,25 +61,25 @@ struct mmap_stream_list {struct format {bt_intern_str name; -struct trace_descriptor *(*open_trace)(const char *path,int flags, +struct bt_trace_descriptor *(*open_trace)(const char *path,int flags,void (*packet_seek)(struct bt_stream_pos *pos,size_t index,int whence),FILE *metadata_fp); -struct trace_descriptor *(*open_mmap_trace)( +struct bt_trace_descriptor *(*open_mmap_trace)(struct mmap_stream_list *mmap_list,void (*packet_seek)(struct bt_stream_pos *pos,size_t index,int whence),FILE *metadata_fp); -int (*close_trace)(struct trace_descriptor *descriptor); -void (*set_context)(struct trace_descriptor *descriptor, +int (*close_trace)(struct bt_trace_descriptor *descriptor); +void (*set_context)(struct bt_trace_descriptor *descriptor,struct bt_context *ctx); -void (*set_handle)(struct trace_descriptor *descriptor, +void (*set_handle)(struct bt_trace_descriptor *descriptor,struct bt_trace_handle *handle); -uint64_t (*timestamp_begin)(struct trace_descriptor *descriptor, +uint64_t (*timestamp_begin)(struct bt_trace_descriptor *descriptor,struct bt_trace_handle *handle,enum bt_clock_type type); -uint64_t (*timestamp_end)(struct trace_descriptor *descriptor, +uint64_t (*timestamp_end)(struct bt_trace_descriptor *descriptor,struct bt_trace_handle *handle,enum bt_clock_type type); -int (*convert_index_timestamp)(struct trace_descriptor *descriptor); +int (*convert_index_timestamp)(struct bt_trace_descriptor *descriptor); };extern struct format *bt_lookup_format (bt_intern_str qname);
include/babeltrace/trace-collection.h +2 -2
@@ -38,9 +38,9 @@ struct trace_collection;void bt_init_trace_collection (struct trace_collection *tc);void bt_finalize_trace_collection (struct trace_collection *tc);int bt_trace_collection_add (struct trace_collection *tc, -struct trace_descriptor *td); +struct bt_trace_descriptor *td);int bt_trace_collection_remove (struct trace_collection *tc, -struct trace_descriptor *td); +struct bt_trace_descriptor *td); #ifdef __cplusplus }
include/babeltrace/trace-handle-internal.h +1 -1
@@ -43,7 +43,7 @@*/ struct bt_trace_handle {int id; -struct trace_descriptor *td; +struct bt_trace_descriptor *td;struct format *format;char path[PATH_MAX ];uint64_t real_timestamp_begin;
lib/context.c +1 -1
@@ -72,7 +72,7 @@ int bt_context_add_trace(struct bt_context *ctx, const char *path,struct mmap_stream_list *stream_list, FILE *metadata) { - struct trace_descriptor *td; + struct bt_trace_descriptor *td;struct format *fmt;struct bt_trace_handle *handle;int ret, closeret;
lib/iterator.c +4 -4
@@ -309,7 +309,7 @@ static int seek_last_ctf_trace_collection(struct trace_collection *tc,/* For each trace in the trace_collection */ for (i =0 ; i < tc->array->len; i++) {struct ctf_trace *tin; -struct trace_descriptor *td_read; +struct bt_trace_descriptor *td_read; td_read =g_ptr_array_index (tc->array, i);if (!td_read)
@@ -421,7 +421,7 @@ int bt_iter_set_pos(struct bt_iter *iter, const struct bt_iter_pos *iter_pos)/* for each trace in the trace_collection */ for (i =0 ; i < tc->array->len; i++) {struct ctf_trace *tin; -struct trace_descriptor *td_read; +struct bt_trace_descriptor *td_read; td_read =g_ptr_array_index (tc->array, i);if (!td_read)
@@ -451,7 +451,7 @@ int bt_iter_set_pos(struct bt_iter *iter, const struct bt_iter_pos *iter_pos)for (i =0 ; i < tc->array->len; i++) {struct ctf_trace *tin; -struct trace_descriptor *td_read; +struct bt_trace_descriptor *td_read;int stream_id; td_read =g_ptr_array_index (tc->array, i);
@@ -675,7 +675,7 @@ int bt_iter_init(struct bt_iter *iter,for (i =0 ; i < ctx->tc->array->len; i++) {struct ctf_trace *tin; -struct trace_descriptor *td_read; +struct bt_trace_descriptor *td_read; td_read =g_ptr_array_index (ctx->tc->array, i);if (!td_read)
lib/trace-collection.c +2 -2
@@ -156,7 +156,7 @@ static void clock_add(gpointer key, gpointer value, gpointer user_data)* convert the index from cycles to real time. */ int bt_trace_collection_add (struct trace_collection *tc, -struct trace_descriptor *td) +struct bt_trace_descriptor *td) {struct ctf_trace *trace;
@@ -209,7 +209,7 @@ error: }int bt_trace_collection_remove (struct trace_collection *tc, -struct trace_descriptor *td) +struct bt_trace_descriptor *td) {if (!tc || !td)return -EINVAL ;
Signature · 1 line
1.7.10.4
PATCH 4/7 Namespace the struct mmap_stream
In reply to a message not in the archiveThis struct is exposed in the public API so we need to namespace it.
--- formats/ctf/ctf.c | 12 ++++++------ include/babeltrace/context.h | 2 +- include/babeltrace/format.h | 6 +++--- lib/context.c | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-)
formats/ctf/ctf.c +6 -6
@@ -82,7 +82,7 @@ struct bt_trace_descriptor *ctf_open_trace(const char *path, int flags, FILE *metadata_fp);static struct bt_trace_descriptor *ctf_open_mmap_trace ( -struct mmap_stream_list *mmap_list, +struct bt_mmap_stream_list *mmap_list,void (*packet_seek)(struct bt_stream_pos *pos,size_t index,int whence),FILE *metadata_fp);
@@ -1736,7 +1736,7 @@ error:static void ctf_init_mmap_pos (struct ctf_stream_pos *pos, -struct mmap_stream *mmap_info) +struct bt_mmap_stream *mmap_info) { pos->mmap_offset =0 ; pos->packet_size =0 ;
@@ -1785,7 +1785,7 @@ end:static int ctf_open_mmap_stream_read (struct ctf_trace *td, -struct mmap_stream *mmap_info, +struct bt_mmap_stream *mmap_info,void (*packet_seek)(struct bt_stream_pos *pos,size_t index,int whence)) {
@@ -1827,13 +1827,13 @@ error_def:static int ctf_open_mmap_trace_read (struct ctf_trace *td, -struct mmap_stream_list *mmap_list, +struct bt_mmap_stream_list *mmap_list,void (*packet_seek)(struct bt_stream_pos *pos,size_t index,int whence),FILE *metadata_fp) {int ret; -struct mmap_stream *mmap_info; +struct bt_mmap_stream *mmap_info; ret =ctf_open_trace_metadata_read (td, ctf_packet_seek, metadata_fp);if (ret) {
@@ -1860,7 +1860,7 @@ error:static struct bt_trace_descriptor *ctf_open_mmap_trace ( -struct mmap_stream_list *mmap_list, +struct bt_mmap_stream_list *mmap_list,void (*packet_seek)(struct bt_stream_pos *pos,size_t index,int whence),FILE *metadata_fp)
include/babeltrace/context.h +1 -1
@@ -84,7 +84,7 @@ int bt_context_add_trace(struct bt_context *ctx, const char *path,const char *format, void (*packet_seek)(struct bt_stream_pos *pos,size_t index,int whence), - struct mmap_stream_list *stream_list, + struct bt_mmap_stream_list *stream_list, FILE *metadata);/*
include/babeltrace/format.h +3 -3
@@ -49,12 +49,12 @@ struct bt_trace_handle;struct bt_trace_descriptor { }; -struct mmap_stream { +struct bt_mmap_stream {int fd;struct bt_list_head list; }; -struct mmap_stream_list { +struct bt_mmap_stream_list {struct bt_list_head head; };
@@ -66,7 +66,7 @@ struct format { size_t index, int whence), FILE *metadata_fp);struct bt_trace_descriptor *(*open_mmap_trace)( -struct mmap_stream_list *mmap_list, +struct bt_mmap_stream_list *mmap_list,void (*packet_seek)(struct bt_stream_pos *pos,size_t index,int whence),FILE *metadata_fp);
lib/context.c +1 -1
@@ -69,7 +69,7 @@ int bt_context_add_trace(struct bt_context *ctx, const char *path,const char *format_name, void (*packet_seek)(struct bt_stream_pos *pos, size_t index,int whence), - struct mmap_stream_list *stream_list, + struct bt_mmap_stream_list *stream_list, FILE *metadata) { struct bt_trace_descriptor *td;
Signature · 1 line
1.7.10.4
PATCH 5/7 Namespace the struct format
In reply to a message not in the archiveThis struct is exposed in the public API, we need to namespace it.
--- converter/babeltrace.c | 4 ++-- formats/bt-dummy/bt-dummy.c | 2 +- formats/ctf-text/ctf-text.c | 2 +- formats/ctf/ctf.c | 2 +- include/babeltrace/format.h | 8 ++++---- include/babeltrace/trace-handle-internal.h | 2 +- include/babeltrace/types.h | 2 +- lib/context.c | 2 +- lib/registry.c | 6 +++--- 9 files changed, 15 insertions(+), 15 deletions(-)
converter/babeltrace.c +2 -2
@@ -68,7 +68,7 @@ static char *opt_input_format, *opt_output_format;static GPtrArray *opt_input_paths;static char *opt_output_path; -static struct format *fmt_read; +static struct bt_format *fmt_read;static void strlower (char *str)
@@ -555,7 +555,7 @@ error_iter:int main (int argc,char **argv) {int ret, partial_error =0 , open_success =0 ; -struct format *fmt_write; +struct bt_format *fmt_write;struct bt_trace_descriptor *td_write;struct bt_context *ctx;int i;
formats/bt-dummy/bt-dummy.c +1 -1
@@ -68,7 +68,7 @@ int bt_dummy_close_trace(struct bt_trace_descriptor *td) }static -struct format bt_dummy_format = { +struct bt_format bt_dummy_format = { .open_trace = bt_dummy_open_trace, .close_trace = bt_dummy_close_trace, };
formats/ctf-text/ctf-text.c +1 -1
@@ -106,7 +106,7 @@ rw_dispatch write_dispatch_table[] = { };static -struct format ctf_text_format = { +struct bt_format ctf_text_format = { .open_trace = ctf_text_open_trace, .close_trace = ctf_text_close_trace, };
formats/ctf/ctf.c +1 -1
@@ -129,7 +129,7 @@ rw_dispatch write_dispatch_table[] = { };static -struct format ctf_format = { +struct bt_format ctf_format = { .open_trace = ctf_open_trace, .open_mmap_trace = ctf_open_mmap_trace, .close_trace = ctf_close_trace,
include/babeltrace/format.h +4 -4
@@ -58,7 +58,7 @@ struct bt_mmap_stream_list {struct bt_list_head head; }; -struct format { +struct bt_format {bt_intern_str name; struct bt_trace_descriptor *(*open_trace)(const char *path, int flags,
@@ -82,10 +82,10 @@ struct format {int (*convert_index_timestamp)(struct bt_trace_descriptor *descriptor); }; -extern struct format *bt_lookup_format (bt_intern_str qname); +extern struct bt_format *bt_lookup_format (bt_intern_str qname);extern void bt_fprintf_format_list (FILE *fp); -extern int bt_register_format (struct format *format); -extern void bt_unregister_format (struct format *format); +extern int bt_register_format (struct bt_format *format); +extern void bt_unregister_format (struct bt_format *format); #ifdef __cplusplus }
include/babeltrace/trace-handle-internal.h +1 -1
@@ -44,7 +44,7 @@struct bt_trace_handle {int id;struct bt_trace_descriptor *td; -struct format *format; +struct bt_format *format;char path[PATH_MAX ];uint64_t real_timestamp_begin;uint64_t real_timestamp_end;
include/babeltrace/types.h +1 -1
@@ -44,7 +44,7 @@struct ctf_stream_definition ;struct bt_stream_pos ; -struct format ; +struct bt_format ;struct definition ;struct ctf_clock ;
lib/context.c +1 -1
@@ -73,7 +73,7 @@ int bt_context_add_trace(struct bt_context *ctx, const char *path, FILE *metadata) {struct bt_trace_descriptor *td; -struct format *fmt; +struct bt_format *fmt;struct bt_trace_handle *handle;int ret, closeret;
lib/registry.c +3 -3
@@ -67,7 +67,7 @@ void format_refcount_dec(void)format_cleanup (); } -struct format *bt_lookup_format (bt_intern_str name) +struct bt_format *bt_lookup_format (bt_intern_str name) {if (!init_done)return NULL ;
@@ -103,7 +103,7 @@ void bt_fprintf_format_list(FILE *fp)fprintf (fp,".\n" ); } -int bt_register_format (struct format *format) +int bt_register_format (struct bt_format *format) {if (!format)return -EINVAL ;
@@ -121,7 +121,7 @@ int bt_register_format(struct format *format)return 0 ; } -void bt_unregister_format (struct format *format) +void bt_unregister_format (struct bt_format *format) {assert (bt_lookup_format (format->name)); g_hash_table_remove(format_registry,
Signature · 1 line
1.7.10.4
PATCH 6/7 Namespace the struct definition
In reply to a message not in the archiveThis struct is exposed in the public API, so we need to namespace it.
--- formats/ctf-text/ctf-text.c | 2 +- formats/ctf-text/types/array.c | 2 +- formats/ctf-text/types/enum.c | 2 +- formats/ctf-text/types/float.c | 2 +- formats/ctf-text/types/integer.c | 2 +- formats/ctf-text/types/sequence.c | 2 +- formats/ctf-text/types/string.c | 2 +- formats/ctf-text/types/struct.c | 2 +- formats/ctf-text/types/variant.c | 2 +- formats/ctf/ctf.c | 32 ++++++------ formats/ctf/events.c | 44 ++++++++-------- formats/ctf/types/array.c | 4 +- formats/ctf/types/enum.c | 4 +- formats/ctf/types/float.c | 8 +-- formats/ctf/types/integer.c | 8 +-- formats/ctf/types/sequence.c | 4 +- formats/ctf/types/string.c | 4 +- formats/ctf/types/struct.c | 2 +- formats/ctf/types/variant.c | 2 +- include/babeltrace/ctf-text/types.h | 18 +++---- include/babeltrace/ctf/events.h | 32 ++++++------ include/babeltrace/ctf/types.h | 28 +++++----- include/babeltrace/types.h | 98 +++++++++++++++++------------------ types/array.c | 26 +++++----- types/enum.c | 10 ++-- types/float.c | 10 ++-- types/integer.c | 22 ++++---- types/sequence.c | 26 +++++----- types/string.c | 12 ++--- types/struct.c | 22 ++++---- types/types.c | 28 +++++----- types/variant.c | 22 ++++---- 32 files changed, 242 insertions(+), 242 deletions(-)
formats/ctf-text/ctf-text.c +1 -1
@@ -135,7 +135,7 @@ struct ctf_callsite_dups *ctf_trace_callsite_lookup(struct ctf_trace *trace, (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)
formats/ctf-text/types/array.c +1 -1
@@ -29,7 +29,7 @@#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 =
formats/ctf-text/types/enum.c +1 -1
@@ -30,7 +30,7 @@#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);
formats/ctf-text/types/float.c +1 -1
@@ -31,7 +31,7 @@#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);
formats/ctf-text/types/integer.c +1 -1
@@ -32,7 +32,7 @@#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);
formats/ctf-text/types/sequence.c +1 -1
@@ -29,7 +29,7 @@#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 =
formats/ctf-text/types/string.c +1 -1
@@ -32,7 +32,7 @@#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);
formats/ctf-text/types/struct.c +1 -1
@@ -29,7 +29,7 @@#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 =
formats/ctf-text/types/variant.c +1 -1
@@ -29,7 +29,7 @@#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;
formats/ctf/ctf.c +16 -16
@@ -421,7 +421,7 @@ int ctf_read_event(struct bt_stream_pos *ppos, struct ctf_stream_definition *str/* 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))
@@ -1150,7 +1150,7 @@ struct ctf_event_definition *create_event_definitions(struct ctf_trace *td, 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) {
@@ -1161,7 +1161,7 @@ struct ctf_event_definition *create_event_definitions(struct ctf_trace *td, 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) {
@@ -1195,7 +1195,7 @@ int create_stream_definitions(struct ctf_trace *td, struct ctf_stream_definition 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) {
@@ -1207,7 +1207,7 @@ int create_stream_definitions(struct ctf_trace *td, struct ctf_stream_definition 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) {
@@ -1219,7 +1219,7 @@ int create_stream_definitions(struct ctf_trace *td, struct ctf_stream_definition 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) {
@@ -1321,7 +1321,7 @@ int create_stream_packet_index(struct ctf_trace *td,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);
@@ -1339,7 +1339,7 @@ int create_stream_packet_index(struct ctf_trace *td, 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 ];
@@ -1349,7 +1349,7 @@ int create_stream_packet_index(struct ctf_trace *td,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);
@@ -1364,7 +1364,7 @@ int create_stream_packet_index(struct ctf_trace *td, 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);
@@ -1401,7 +1401,7 @@ int create_stream_packet_index(struct ctf_trace *td,/* 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);
@@ -1413,7 +1413,7 @@ int create_stream_packet_index(struct ctf_trace *td,/* 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);
@@ -1425,7 +1425,7 @@ int create_stream_packet_index(struct ctf_trace *td,/* 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);
@@ -1440,7 +1440,7 @@ int create_stream_packet_index(struct ctf_trace *td,/* 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);
@@ -1455,7 +1455,7 @@ int create_stream_packet_index(struct ctf_trace *td,/* 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);
@@ -1499,7 +1499,7 @@ int create_trace_definitions(struct ctf_trace *td, struct ctf_stream_definitionint 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) {
formats/ctf/events.c +22 -22
146 lines not on this page · raw message
formats/ctf/types/array.c +2 -2
@@ -28,7 +28,7 @@#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);
@@ -64,7 +64,7 @@ int ctf_array_read(struct bt_stream_pos *ppos, struct definition *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);
formats/ctf/types/enum.c +2 -2
@@ -31,7 +31,7 @@#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);
@@ -69,7 +69,7 @@ int ctf_enum_read(struct bt_stream_pos *ppos, struct definition *definition)return 0 ; } -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);
formats/ctf/types/float.c +4 -4
@@ -165,7 +165,7 @@ static int _ctf_float_copy(struct bt_stream_pos *destp,return 0 ; } -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);
@@ -173,7 +173,7 @@ int ctf_float_read(struct bt_stream_pos *ppos, struct definition *definition) 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;
@@ -222,7 +222,7 @@ end:return ret; } -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);
@@ -230,7 +230,7 @@ int ctf_float_write(struct bt_stream_pos *ppos, struct definition *definition) 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;
formats/ctf/types/integer.c +4 -4
@@ -40,7 +40,7 @@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);
@@ -142,7 +142,7 @@ int _aligned_integer_read(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);
@@ -211,7 +211,7 @@ end:return 0 ; } -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);
@@ -256,7 +256,7 @@ int ctf_integer_read(struct bt_stream_pos *ppos, struct definition *definition)return 0 ; } -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);
formats/ctf/types/sequence.c +2 -2
@@ -28,7 +28,7 @@#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);
@@ -63,7 +63,7 @@ int ctf_sequence_read(struct bt_stream_pos *ppos, struct definition *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);
formats/ctf/types/string.c +2 -2
@@ -31,7 +31,7 @@#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);
@@ -69,7 +69,7 @@ int ctf_string_read(struct bt_stream_pos *ppos, struct definition *definition) }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);
formats/ctf/types/struct.c +1 -1
@@ -28,7 +28,7 @@#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);
formats/ctf/types/variant.c +1 -1
@@ -28,7 +28,7 @@#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);
include/babeltrace/ctf-text/types.h +9 -9
@@ -62,21 +62,21 @@ struct ctf_text_stream_pos *ctf_text_pos(struct bt_stream_pos *pos)* 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);BT_HIDDEN -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);BT_HIDDEN -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);BT_HIDDEN -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);BT_HIDDEN -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);BT_HIDDEN -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);BT_HIDDEN -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);BT_HIDDEN -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)
@@ -91,6 +91,6 @@ void print_pos_tabs(struct ctf_text_stream_pos *pos)* 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 */
include/babeltrace/ctf/events.h +16 -16
@@ -39,7 +39,7 @@extern "C" {#endif -struct definition ; +struct bt_definition ;struct declaration ;struct bt_ctf_event ;struct bt_ctf_event_decl ;
@@ -94,7 +94,7 @@ enum ctf_string_encoding {* 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);/*
@@ -130,35 +130,35 @@ uint64_t bt_ctf_get_timestamp(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 */ -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 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 */ -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 */ -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
@@ -225,12 +225,12 @@ int bt_ctf_get_array_len(const struct declaration *decl);* 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
include/babeltrace/ctf/types.h +14 -14
@@ -91,33 +91,33 @@ struct ctf_stream_pos *ctf_pos(struct bt_stream_pos *pos) }BT_HIDDEN -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);BT_HIDDEN -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);BT_HIDDEN -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);BT_HIDDEN -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);BT_HIDDEN -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);BT_HIDDEN -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);BT_HIDDEN -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);BT_HIDDEN -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);BT_HIDDEN -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);BT_HIDDEN -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);BT_HIDDEN -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);BT_HIDDEN -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);BT_HIDDEN -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);BT_HIDDEN -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);
include/babeltrace/types.h +49 -49
258 lines not on this page · raw message
types/array.c +13 -13
@@ -32,13 +32,13 @@#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 -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);
@@ -49,7 +49,7 @@ int bt_array_rw(struct bt_stream_pos *pos, struct definition *definition)/* 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)
@@ -93,7 +93,7 @@ struct declaration_array * }static -struct definition * +struct bt_definition *_array_definition_new (struct declaration *declaration,struct definition_scope *parent_scope,GQuark field_name,int index,const char *root_name)
@@ -142,7 +142,7 @@ struct definition * 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;
@@ -151,7 +151,7 @@ struct definition * 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 );
@@ -163,7 +163,7 @@ struct definition * 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);
@@ -176,7 +176,7 @@ error: }static -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);
@@ -186,7 +186,7 @@ void _array_definition_free(struct definition *definition) (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);
@@ -205,7 +205,7 @@ uint64_t bt_array_len(struct definition_array *array)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 ;
@@ -214,7 +214,7 @@ struct definition *bt_array_index(struct definition_array *array, uint64_t 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;
@@ -225,7 +225,7 @@ int bt_get_array_len(const struct definition *field)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;
types/enum.c +5 -5
@@ -41,12 +41,12 @@#endif static -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 -void _enum_definition_free (struct definition *definition); +void _enum_definition_free (struct bt_definition *definition);static void enum_range_set_free (void *ptr)
@@ -417,7 +417,7 @@ struct declaration_enum * }static -struct definition * +struct bt_definition * _enum_definition_new(struct declaration *declaration, struct definition_scope *parent_scope, GQuark field_name, int index,
@@ -426,7 +426,7 @@ struct definition *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);
@@ -456,7 +456,7 @@ struct definition * }static -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);
types/float.c +5 -5
@@ -32,12 +32,12 @@#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 -void _float_definition_free (struct definition *definition); +void _float_definition_free (struct bt_definition *definition);static void _float_declaration_free (struct declaration *declaration)
@@ -81,7 +81,7 @@ struct declaration_float * }static -struct definition * +struct bt_definition * _float_definition_new(struct declaration *declaration, struct definition_scope *parent_scope, GQuark field_name, int index,
@@ -90,7 +90,7 @@ struct definition *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);
@@ -138,7 +138,7 @@ struct definition * }static -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);
types/integer.c +11 -11
@@ -33,12 +33,12 @@#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 -void _integer_definition_free (struct definition *definition); +void _integer_definition_free (struct bt_definition *definition);static void _integer_declaration_free (struct declaration *declaration)
@@ -73,7 +73,7 @@ struct declaration_integer * }static -struct definition * +struct bt_definition * _integer_definition_new(struct declaration *declaration, struct definition_scope *parent_scope, GQuark field_name, int index,
@@ -106,7 +106,7 @@ struct definition * }static -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);
@@ -115,7 +115,7 @@ void _integer_definition_free(struct definition *definition)g_free (integer); } -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;
@@ -126,7 +126,7 @@ enum ctf_string_encoding bt_get_int_encoding(const struct definition *field)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;
@@ -137,7 +137,7 @@ int bt_get_int_base(const struct definition *field)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;
@@ -148,7 +148,7 @@ size_t bt_get_int_len(const struct definition *field)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;
@@ -159,7 +159,7 @@ int bt_get_int_byte_order(const struct definition *field)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;
@@ -170,7 +170,7 @@ int bt_get_int_signedness(const struct definition *field)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;
@@ -186,7 +186,7 @@ uint64_t bt_get_unsigned_int(const struct definition *field)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;
types/sequence.c +13 -13
@@ -32,14 +32,14 @@#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 -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);
@@ -62,7 +62,7 @@ int bt_sequence_rw(struct bt_stream_pos *pos, struct definition *definition)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;
@@ -71,15 +71,15 @@ int bt_sequence_rw(struct bt_stream_pos *pos, struct definition *definition) 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++) { -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;
@@ -126,7 +126,7 @@ struct declaration_sequence * }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)
@@ -134,7 +134,7 @@ struct definition *_sequence_definition_new(struct declaration *declaration,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);
@@ -198,18 +198,18 @@ error: }static -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 *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++) { -struct definition *field; +struct bt_definition *field; field =g_ptr_array_index (sequence->elems, i); field->declaration->definition_free (field);
@@ -227,7 +227,7 @@ uint64_t bt_sequence_len(struct definition_sequence *sequence)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 ;
types/string.c +6 -6
@@ -32,12 +32,12 @@#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 -void _string_definition_free (struct definition *definition); +void _string_definition_free (struct bt_definition *definition);static void _string_declaration_free (struct declaration *declaration)
@@ -64,7 +64,7 @@ struct declaration_string * }static -struct definition * +struct bt_definition * _string_definition_new(struct declaration *declaration, struct definition_scope *parent_scope, GQuark field_name, int index,
@@ -99,7 +99,7 @@ struct definition * }static -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);
@@ -109,7 +109,7 @@ void _string_definition_free(struct definition *definition)g_free (string); } -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;
@@ -120,7 +120,7 @@ enum ctf_string_encoding bt_get_string_encoding(const struct definition *field)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);
types/struct.c +11 -11
@@ -36,14 +36,14 @@#endif static -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 -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);
@@ -51,7 +51,7 @@ int bt_struct_rw(struct bt_stream_pos *ppos, struct definition *definition)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)
@@ -105,7 +105,7 @@ struct declaration_struct * }static -struct definition * +struct bt_definition * _struct_definition_new(struct declaration *declaration, struct definition_scope *parent_scope, GQuark field_name, int index,
@@ -141,8 +141,8 @@ struct definition *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,
@@ -154,7 +154,7 @@ struct definition * 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);
@@ -164,7 +164,7 @@ error: }static -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);
@@ -172,7 +172,7 @@ void _struct_definition_free(struct definition *definition)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);
@@ -241,7 +241,7 @@ struct declaration_field */* * field returned only valid as long as the field structure is not appended to. */ -struct definition * +struct bt_definition *bt_struct_definition_get_field_from_index (struct definition_struct *_struct,int index) {
types/types.c +14 -14
@@ -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 * +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 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)
@@ -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 ;
@@ -612,7 +612,7 @@ void bt_free_definition_scope(struct definition_scope *scope)g_free (scope); } -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);
@@ -624,11 +624,11 @@ struct definition *bt_lookup_definition(const struct definition *definition, scope); } -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) { -struct definition *lookup; +struct bt_definition *lookup;struct definition_integer *lookup_integer; lookup =bt_lookup_definition (definition, field_name);
@@ -642,11 +642,11 @@ struct definition_integer *bt_lookup_integer(const struct definition *definitionreturn 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 =bt_lookup_definition (definition, field_name);
@@ -660,10 +660,10 @@ struct definition_enum *bt_lookup_enum(const struct definition *definition,return lookup_enum; } -struct definition *bt_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 bt_definition *lookup;struct definition_variant *bt_lookup_variant; lookup =bt_lookup_definition (definition, field_name);
types/variant.c +11 -11
@@ -32,18 +32,18 @@#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 -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 *field; +struct bt_definition *field; field =bt_variant_get_current_field (variant_definition);return generic_rw (ppos, field);
@@ -130,7 +130,7 @@ struct declaration_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);
@@ -172,7 +172,7 @@ int check_enum_tag(struct definition_variant *variant,static -struct definition * +struct bt_definition * _variant_definition_new(struct declaration *declaration, struct definition_scope *parent_scope, GQuark field_name, int index,
@@ -216,8 +216,8 @@ struct definition *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
@@ -239,7 +239,7 @@ error: }static -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);
@@ -247,7 +247,7 @@ void _variant_definition_free(struct definition *definition)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);
@@ -301,7 +301,7 @@ bt_untagged_variant_declaration_get_field_from_tag(struct declaration_untagged_v/* * 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);
Signature · 1 line
1.7.10.4
PATCH 7/7 Namespace the struct declaration
In reply to a message not in the archiveThis struct is exposed in the public API so we need to namespace it.
--- formats/ctf-text/types/array.c | 2 +- formats/ctf-text/types/sequence.c | 2 +- formats/ctf-text/types/struct.c | 2 +- formats/ctf/events.c | 26 +++++----- .../ctf/metadata/ctf-visitor-generate-io-struct.c | 54 ++++++++++---------- formats/ctf/types/array.c | 4 +- formats/ctf/types/sequence.c | 4 +- formats/ctf/types/struct.c | 2 +- formats/ctf/types/variant.c | 2 +- include/babeltrace/ctf/events.h | 20 ++++---- include/babeltrace/types.h | 48 ++++++++--------- types/array.c | 12 ++--- types/enum.c | 6 +-- types/float.c | 8 +-- types/integer.c | 6 +-- types/sequence.c | 10 ++-- types/string.c | 6 +-- types/struct.c | 10 ++-- types/types.c | 12 ++--- types/variant.c | 14 ++--- 20 files changed, 125 insertions(+), 125 deletions(-)
formats/ctf-text/types/array.c +1 -1
@@ -36,7 +36,7 @@ int ctf_text_array_write(struct bt_stream_pos *ppos, struct bt_definition *defin container_of(definition, struct definition_array, p);struct declaration_array *array_declaration = array_definition->declaration; -struct declaration *elem = array_declaration->elem; +struct bt_declaration *elem = array_declaration->elem;int field_nr_saved;int ret =0 ;
formats/ctf-text/types/sequence.c +1 -1
@@ -36,7 +36,7 @@ int ctf_text_sequence_write(struct bt_stream_pos *ppos, struct bt_definition *de container_of(definition, struct definition_sequence, p);struct declaration_sequence *sequence_declaration = sequence_definition->declaration; -struct declaration *elem = sequence_declaration->elem; +struct bt_declaration *elem = sequence_declaration->elem;int field_nr_saved;int ret =0 ;
formats/ctf-text/types/struct.c +1 -1
@@ -31,7 +31,7 @@int ctf_text_struct_write (struct bt_stream_pos *ppos,struct bt_definition *definition) { -struct declaration *declaration = definition->declaration; +struct bt_declaration *declaration = definition->declaration;struct declaration_struct *struct_declaration = container_of(declaration, struct declaration_struct, p);struct ctf_text_stream_pos *pos =ctf_text_pos (ppos);
formats/ctf/events.c +13 -13
@@ -174,7 +174,7 @@ const char *bt_ctf_field_name(const struct bt_definition *def)return rem_ (g_quark_to_string (def->name)); } -enum ctf_type_id bt_ctf_field_type (const struct declaration *decl) +enum ctf_type_id bt_ctf_field_type (const struct bt_declaration *decl) {if (!decl)return CTF_TYPE_UNKNOWN ;
@@ -358,7 +358,7 @@ int bt_ctf_field_get_error(void) }static const struct declaration_integer * -get_declaration_integer (const struct declaration *decl) +get_declaration_integer (const struct bt_declaration *decl) {if (!decl ||bt_ctf_field_type (decl) !=CTF_TYPE_INTEGER )return NULL ;
@@ -366,7 +366,7 @@ get_declaration_integer(const struct declaration *decl) }static const struct declaration_string * -get_declaration_string (const struct declaration *decl) +get_declaration_string (const struct bt_declaration *decl) {if (!decl ||bt_ctf_field_type (decl) !=CTF_TYPE_STRING )return NULL ;
@@ -374,7 +374,7 @@ get_declaration_string(const struct declaration *decl) }static const struct declaration_array * -get_declaration_array (const struct declaration *decl) +get_declaration_array (const struct bt_declaration *decl) {if (!decl ||bt_ctf_field_type (decl) !=CTF_TYPE_ARRAY )return NULL ;
@@ -382,14 +382,14 @@ get_declaration_array(const struct declaration *decl) }static const struct declaration_sequence * -get_declaration_sequence (const struct declaration *decl) +get_declaration_sequence (const struct bt_declaration *decl) {if (!decl ||bt_ctf_field_type (decl) !=CTF_TYPE_SEQUENCE )return NULL ; return container_of(decl, const struct declaration_sequence, p); } -int bt_ctf_get_int_signedness (const struct declaration *decl) +int bt_ctf_get_int_signedness (const struct bt_declaration *decl) {const struct declaration_integer *integer;
@@ -401,7 +401,7 @@ int bt_ctf_get_int_signedness(const struct declaration *decl)return integer->signedness; } -int bt_ctf_get_int_base (const struct declaration *decl) +int bt_ctf_get_int_base (const struct bt_declaration *decl) {const struct declaration_integer *integer;
@@ -413,7 +413,7 @@ int bt_ctf_get_int_base(const struct declaration *decl)return integer->base; } -int bt_ctf_get_int_byte_order (const struct declaration *decl) +int bt_ctf_get_int_byte_order (const struct bt_declaration *decl) {const struct declaration_integer *integer;
@@ -425,7 +425,7 @@ int bt_ctf_get_int_byte_order(const struct declaration *decl)return integer->byte_order; } -ssize_t bt_ctf_get_int_len (const struct declaration *decl) +ssize_t bt_ctf_get_int_len (const struct bt_declaration *decl) {const struct declaration_integer *integer;
@@ -485,7 +485,7 @@ const char *bt_ctf_get_enum_str(const struct bt_definition *field)return ret; } -enum ctf_string_encoding bt_ctf_get_encoding (const struct declaration *decl) +enum ctf_string_encoding bt_ctf_get_encoding (const struct bt_declaration *decl) {enum ctf_string_encoding ret =0 ;enum ctf_type_id type;
@@ -540,7 +540,7 @@ error:return -1 ; } -int bt_ctf_get_array_len (const struct declaration *decl) +int bt_ctf_get_array_len (const struct bt_declaration *decl) {const struct declaration_array *array;
@@ -767,7 +767,7 @@ const char *bt_ctf_get_decl_field_name(const struct bt_ctf_field_decl *field)return rem_ (g_quark_to_string (((struct declaration_field *) field)->name)); } -const struct declaration *bt_ctf_get_decl_from_def (const struct bt_definition *def) +const struct bt_declaration *bt_ctf_get_decl_from_def (const struct bt_definition *def) {if (def)return def->declaration;
@@ -775,7 +775,7 @@ const struct declaration *bt_ctf_get_decl_from_def(const struct bt_definition *dreturn NULL ; } -const struct declaration *bt_ctf_get_decl_from_field_decl ( +const struct bt_declaration *bt_ctf_get_decl_from_field_decl (const struct bt_ctf_field_decl *field) {if (field)
formats/ctf/metadata/ctf-visitor-generate-io-struct.c +27 -27
212 lines not on this page · raw message
formats/ctf/types/array.c +2 -2
@@ -34,7 +34,7 @@ int ctf_array_read(struct bt_stream_pos *ppos, struct bt_definition *definition) container_of(definition, struct definition_array, p);struct declaration_array *array_declaration = array_definition->declaration; -struct declaration *elem = array_declaration->elem; +struct bt_declaration *elem = array_declaration->elem;struct ctf_stream_pos *pos = container_of(ppos, struct ctf_stream_pos, parent);
@@ -70,7 +70,7 @@ int ctf_array_write(struct bt_stream_pos *ppos, struct bt_definition *definition container_of(definition, struct definition_array, p);struct declaration_array *array_declaration = array_definition->declaration; -struct declaration *elem = array_declaration->elem; +struct bt_declaration *elem = array_declaration->elem;struct ctf_stream_pos *pos = container_of(ppos, struct ctf_stream_pos, parent);
formats/ctf/types/sequence.c +2 -2
@@ -34,7 +34,7 @@ int ctf_sequence_read(struct bt_stream_pos *ppos, struct bt_definition *definiti container_of(definition, struct definition_sequence, p);struct declaration_sequence *sequence_declaration = sequence_definition->declaration; -struct declaration *elem = sequence_declaration->elem; +struct bt_declaration *elem = sequence_declaration->elem;struct ctf_stream_pos *pos =ctf_pos (ppos);if (elem->id ==CTF_TYPE_INTEGER ) {
@@ -69,7 +69,7 @@ int ctf_sequence_write(struct bt_stream_pos *ppos, struct bt_definition *definit container_of(definition, struct definition_sequence, p);struct declaration_sequence *sequence_declaration = sequence_definition->declaration; -struct declaration *elem = sequence_declaration->elem; +struct bt_declaration *elem = sequence_declaration->elem;struct ctf_stream_pos *pos =ctf_pos (ppos);if (elem->id ==CTF_TYPE_INTEGER ) {
formats/ctf/types/struct.c +1 -1
@@ -30,7 +30,7 @@int ctf_struct_rw (struct bt_stream_pos *ppos,struct bt_definition *definition) { -struct declaration *declaration = definition->declaration; +struct bt_declaration *declaration = definition->declaration;struct ctf_stream_pos *pos =ctf_pos (ppos);ctf_align_pos (pos, declaration->alignment);
formats/ctf/types/variant.c +1 -1
@@ -30,7 +30,7 @@int ctf_variant_rw (struct bt_stream_pos *ppos,struct bt_definition *definition) { -struct declaration *declaration = definition->declaration; +struct bt_declaration *declaration = definition->declaration;struct ctf_stream_pos *pos =ctf_pos (ppos);ctf_align_pos (pos, declaration->alignment);
include/babeltrace/ctf/events.h +10 -10
@@ -40,7 +40,7 @@ extern "C" {#endif struct bt_definition ; -struct declaration ; +struct bt_declaration ;struct bt_ctf_event ;struct bt_ctf_event_decl ;struct bt_ctf_field_decl ;
@@ -158,19 +158,19 @@ 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 */ -const struct declaration *bt_ctf_get_decl_from_def (const struct bt_definition *def); +const struct bt_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 * a field_decl or NULL on error */ -const struct declaration *bt_ctf_get_decl_from_field_decl ( +const struct bt_declaration *bt_ctf_get_decl_from_field_decl (const struct bt_ctf_field_decl *field);/* * bt_ctf_field_type: returns the type of a field or -1 if unknown */ -enum ctf_type_id bt_ctf_field_type (const struct declaration *decl); +enum ctf_type_id bt_ctf_field_type (const struct bt_declaration *decl);/* * bt_ctf_get_int_signedness: return the signedness of an integer
@@ -179,37 +179,37 @@ enum ctf_type_id bt_ctf_field_type(const struct declaration *decl);* return 1 if signed * return -1 on error */ -int bt_ctf_get_int_signedness (const struct declaration *decl); +int bt_ctf_get_int_signedness (const struct bt_declaration *decl);/* * bt_ctf_get_int_base: return the base of an int or a negative value on error */ -int bt_ctf_get_int_base (const struct declaration *decl); +int bt_ctf_get_int_base (const struct bt_declaration *decl);/* * bt_ctf_get_int_byte_order: return the byte order of an int or a negative * value on error */ -int bt_ctf_get_int_byte_order (const struct declaration *decl); +int bt_ctf_get_int_byte_order (const struct bt_declaration *decl);/* * bt_ctf_get_int_len: return the size, in bits, of an int or a negative * value on error */ -ssize_t bt_ctf_get_int_len (const struct declaration *decl); +ssize_t bt_ctf_get_int_len (const struct bt_declaration *decl);/* * bt_ctf_get_encoding: return the encoding of an int, a string, or of * the integer contained in a char array or a sequence. * return a negative value on error */ -enum ctf_string_encoding bt_ctf_get_encoding (const struct declaration *decl); +enum ctf_string_encoding bt_ctf_get_encoding (const struct bt_declaration *decl);/* * bt_ctf_get_array_len: return the len of an array or a negative * value on error */ -int bt_ctf_get_array_len (const struct declaration *decl); +int bt_ctf_get_array_len (const struct bt_declaration *decl);/* * Field access functions
include/babeltrace/types.h +24 -24
163 lines not on this page · raw message
types/array.c +6 -6
@@ -32,7 +32,7 @@#include <inttypes.h> static -struct bt_definition *_array_definition_new (struct declaration *declaration, +struct bt_definition *_array_definition_new (struct bt_declaration *declaration,struct definition_scope *parent_scope,GQuark field_name,int index,const char *root_name); static
@@ -59,7 +59,7 @@ int bt_array_rw(struct bt_stream_pos *pos, struct bt_definition *definition) }static -void _array_declaration_free (struct declaration *declaration) +void _array_declaration_free (struct bt_declaration *declaration) {struct declaration_array *array_declaration = container_of(declaration, struct declaration_array, p);
@@ -71,11 +71,11 @@ void _array_declaration_free(struct declaration *declaration)struct declaration_array *bt_array_declaration_new (size_t len, -struct declaration *elem_declaration, +struct bt_declaration *elem_declaration,struct declaration_scope *parent_scope) {struct declaration_array *array_declaration; -struct declaration *declaration; +struct bt_declaration *declaration; array_declaration = g_new(struct declaration_array, 1); declaration = &array_declaration->p;
@@ -94,7 +94,7 @@ struct declaration_array *static struct bt_definition * -_array_definition_new (struct declaration *declaration, +_array_definition_new (struct bt_declaration *declaration,struct definition_scope *parent_scope,GQuark field_name,int index,const char *root_name) {
@@ -229,7 +229,7 @@ GString *bt_get_char_array(const struct bt_definition *field) {struct definition_array *array_definition;struct declaration_array *array_declaration; -struct declaration *elem; +struct bt_declaration *elem; array_definition = container_of(field, struct definition_array, p); array_declaration = array_definition->declaration;
types/enum.c +3 -3
@@ -41,7 +41,7 @@#endif static -struct bt_definition *_enum_definition_new (struct declaration *declaration, +struct bt_definition *_enum_definition_new (struct bt_declaration *declaration,struct definition_scope *parent_scope,GQuark field_name,int index,const char *root_name);
@@ -374,7 +374,7 @@ size_t bt_enum_get_nr_enumerators(struct declaration_enum *enum_declaration) }static -void _enum_declaration_free (struct declaration *declaration) +void _enum_declaration_free (struct bt_declaration *declaration) {struct declaration_enum *enum_declaration = container_of(declaration, struct declaration_enum, p);
@@ -418,7 +418,7 @@ struct declaration_enum *static struct bt_definition * -_enum_definition_new (struct declaration *declaration, +_enum_definition_new (struct bt_declaration *declaration,struct definition_scope *parent_scope,GQuark field_name,int index,const char *root_name)
types/float.c +4 -4
@@ -32,7 +32,7 @@#include <babeltrace/endian.h> static -struct bt_definition *_float_definition_new (struct declaration *declaration, +struct bt_definition *_float_definition_new (struct bt_declaration *declaration,struct definition_scope *parent_scope,GQuark field_name,int index,const char *root_name);
@@ -40,7 +40,7 @@ staticvoid _float_definition_free (struct bt_definition *definition);static -void _float_declaration_free (struct declaration *declaration) +void _float_declaration_free (struct bt_declaration *declaration) {struct declaration_float *float_declaration = container_of(declaration, struct declaration_float, p);
@@ -56,7 +56,7 @@ struct declaration_float * size_t exp_len, int byte_order, size_t alignment) { struct declaration_float *float_declaration; -struct declaration *declaration; +struct bt_declaration *declaration; float_declaration = g_new(struct declaration_float, 1); declaration = &float_declaration->p;
@@ -82,7 +82,7 @@ struct declaration_float *static struct bt_definition * -_float_definition_new (struct declaration *declaration, +_float_definition_new (struct bt_declaration *declaration,struct definition_scope *parent_scope,GQuark field_name,int index,const char *root_name)
types/integer.c +3 -3
@@ -33,7 +33,7 @@#include <stdint.h> static -struct bt_definition *_integer_definition_new (struct declaration *declaration, +struct bt_definition *_integer_definition_new (struct bt_declaration *declaration,struct definition_scope *parent_scope,GQuark field_name,int index,const char *root_name);
@@ -41,7 +41,7 @@ staticvoid _integer_definition_free (struct bt_definition *definition);static -void _integer_declaration_free (struct declaration *declaration) +void _integer_declaration_free (struct bt_declaration *declaration) {struct declaration_integer *integer_declaration = container_of(declaration, struct declaration_integer, p);
@@ -74,7 +74,7 @@ struct declaration_integer *static struct bt_definition * -_integer_definition_new (struct declaration *declaration, +_integer_definition_new (struct bt_declaration *declaration,struct definition_scope *parent_scope,GQuark field_name,int index,const char *root_name)
types/sequence.c +5 -5
@@ -32,7 +32,7 @@#include <inttypes.h> static -struct bt_definition *_sequence_definition_new (struct declaration *declaration, +struct bt_definition *_sequence_definition_new (struct bt_declaration *declaration,struct definition_scope *parent_scope,GQuark field_name,int index,const char *root_name);
@@ -88,7 +88,7 @@ int bt_sequence_rw(struct bt_stream_pos *pos, struct bt_definition *definition) }static -void _sequence_declaration_free (struct declaration *declaration) +void _sequence_declaration_free (struct bt_declaration *declaration) {struct declaration_sequence *sequence_declaration = container_of(declaration, struct declaration_sequence, p);
@@ -101,11 +101,11 @@ void _sequence_declaration_free(struct declaration *declaration)struct declaration_sequence *bt_sequence_declaration_new (const char *length, -struct declaration *elem_declaration, +struct bt_declaration *elem_declaration,struct declaration_scope *parent_scope) {struct declaration_sequence *sequence_declaration; -struct declaration *declaration; +struct bt_declaration *declaration; sequence_declaration = g_new(struct declaration_sequence, 1); declaration = &sequence_declaration->p;
@@ -126,7 +126,7 @@ struct declaration_sequence * }static -struct bt_definition *_sequence_definition_new (struct declaration *declaration, +struct bt_definition *_sequence_definition_new (struct bt_declaration *declaration,struct definition_scope *parent_scope,GQuark field_name,int index,const char *root_name)
types/string.c +3 -3
@@ -32,7 +32,7 @@#include <babeltrace/types.h> static -struct bt_definition *_string_definition_new (struct declaration *declaration, +struct bt_definition *_string_definition_new (struct bt_declaration *declaration,struct definition_scope *parent_scope,GQuark field_name,int index,const char *root_name);
@@ -40,7 +40,7 @@ staticvoid _string_definition_free (struct bt_definition *definition);static -void _string_declaration_free (struct declaration *declaration) +void _string_declaration_free (struct bt_declaration *declaration) {struct declaration_string *string_declaration = container_of(declaration, struct declaration_string, p);
@@ -65,7 +65,7 @@ struct declaration_string *static struct bt_definition * -_string_definition_new (struct declaration *declaration, +_string_definition_new (struct bt_declaration *declaration,struct definition_scope *parent_scope,GQuark field_name,int index,const char *root_name)
types/struct.c +5 -5
@@ -36,7 +36,7 @@#endif static -struct bt_definition *_struct_definition_new (struct declaration *declaration, +struct bt_definition *_struct_definition_new (struct bt_declaration *declaration,struct definition_scope *parent_scope,GQuark field_name,int index,const char *root_name);
@@ -61,7 +61,7 @@ int bt_struct_rw(struct bt_stream_pos *ppos, struct bt_definition *definition) }static -void _struct_declaration_free (struct declaration *declaration) +void _struct_declaration_free (struct bt_declaration *declaration) {struct declaration_struct *struct_declaration = container_of(declaration, struct declaration_struct, p);
@@ -85,7 +85,7 @@ struct declaration_struct * uint64_t min_align) {struct declaration_struct *struct_declaration; -struct declaration *declaration; +struct bt_declaration *declaration; struct_declaration = g_new(struct declaration_struct, 1); declaration = &struct_declaration->p;
@@ -106,7 +106,7 @@ struct declaration_struct *static struct bt_definition * -_struct_definition_new (struct declaration *declaration, +_struct_definition_new (struct bt_declaration *declaration,struct definition_scope *parent_scope,GQuark field_name,int index,const char *root_name)
@@ -183,7 +183,7 @@ void _struct_definition_free(struct bt_definition *definition)void bt_struct_declaration_add_field (struct declaration_struct *struct_declaration,const char *field_name, -struct declaration *field_declaration) +struct bt_declaration *field_declaration) {struct declaration_field *field;unsigned long index;
types/types.c +6 -6
@@ -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)
@@ -279,12 +279,12 @@ int bt_register_field_definition(GQuark field_name, struct bt_definition *definireturn 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 ;
types/variant.c +7 -7
@@ -32,7 +32,7 @@#include <errno.h> static -struct bt_definition *_variant_definition_new (struct declaration *declaration, +struct bt_definition *_variant_definition_new (struct bt_declaration *declaration,struct definition_scope *parent_scope,GQuark field_name,int index,const char *root_name);
@@ -50,7 +50,7 @@ int bt_variant_rw(struct bt_stream_pos *ppos, struct bt_definition *definition) }static -void _untagged_variant_declaration_free (struct declaration *declaration) +void _untagged_variant_declaration_free (struct bt_declaration *declaration) {struct declaration_untagged_variant *untagged_variant_declaration = container_of(declaration, struct declaration_untagged_variant, p);
@@ -73,7 +73,7 @@ struct declaration_untagged_variant *bt_untagged_bt_variant_declaration_new( struct declaration_scope *parent_scope) {struct declaration_untagged_variant *untagged_variant_declaration; -struct declaration *declaration; +struct bt_declaration *declaration; untagged_variant_declaration = g_new(struct declaration_untagged_variant, 1); declaration = &untagged_variant_declaration->p;
@@ -93,7 +93,7 @@ struct declaration_untagged_variant *bt_untagged_bt_variant_declaration_new( }static -void _variant_declaration_free (struct declaration *declaration) +void _variant_declaration_free (struct bt_declaration *declaration) {struct declaration_variant *variant_declaration = container_of(declaration, struct declaration_variant, p);
@@ -107,7 +107,7 @@ struct declaration_variant * bt_variant_declaration_new(struct declaration_untagged_variant *untagged_variant, const char *tag) { struct declaration_variant *variant_declaration; -struct declaration *declaration; +struct bt_declaration *declaration; variant_declaration = g_new(struct declaration_variant, 1); declaration = &variant_declaration->p;
@@ -173,7 +173,7 @@ int check_enum_tag(struct definition_variant *variant,static struct bt_definition * -_variant_definition_new (struct declaration *declaration, +_variant_definition_new (struct bt_declaration *declaration,struct definition_scope *parent_scope,GQuark field_name,int index,const char *root_name)
@@ -259,7 +259,7 @@ void _variant_definition_free(struct bt_definition *definition)void bt_untagged_variant_declaration_add_field (struct declaration_untagged_variant *untagged_variant_declaration,const char *field_name, -struct declaration *field_declaration) +struct bt_declaration *field_declaration) {struct declaration_field *field;unsigned long index;
Signature · 1 line
1.7.10.4
Re: [BABELTRACE PATCH 1/7] Namespace compliance for dependencies function
In reply to a message not in the archiveQuoted 1 line · * Julien Desfossez ([email protected]) wrote:
Use the
bt_prefix instead ofbabeltrace_
patches 1 to 7 merged, thanks !
Mathieu
Quoted 59 lines
Signed-off-by Julien Desfossez <[email protected]>--- formats/ctf/callbacks.c | 6 +++--- include/babeltrace/ctf/callbacks.h | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-)formats/ctf/callbacks.c +3
-3@@ -38,7 +38,7 @@#include <inttypes.h> static -struct bt_dependencies *_babeltrace_dependencies_create (const char *first, +struct bt_dependencies *_bt_dependencies_create (const char *first,va_list ap) {const char *iter;@@ -56,13 +56,13 @@ struct bt_dependencies *_babeltrace_dependencies_create(const char *first,return dep; } -struct bt_dependencies *babeltrace_dependencies_create (const char *first, ...) +struct bt_dependencies *bt_dependencies_create (const char *first, ...) {va_list ap;struct bt_dependencies *deps;va_start (ap, first); - deps =_babeltrace_dependencies_create (first, ap); + deps =_bt_dependencies_create (first, ap);va_end (ap);return deps; }include/babeltrace/ctf/callbacks.h +2
-2@@ -51,13 +51,13 @@ enum bt_cb_ret {/* * Receives a variable number of strings as parameter, ended with NULL. */ -struct bt_dependencies *babeltrace_dependencies_create (const char *first, ...); +struct bt_dependencies *bt_dependencies_create (const char *first, ...);/* * struct bt_dependencies must be destroyed explicitly if not passed as * parameter to a bt_ctf_iter_add_callback(). */ -void babeltrace_dependencies_destroy (struct bt_dependencies *dep); +void bt_dependencies_destroy (struct bt_dependencies *dep);/* * bt_ctf_iter_add_callback: Add a callback to iterator. Signature · 1 line
1.7.10.4
Signature · 3 lines
Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com