namespace the sequence functions
authorJulien Desfossez <jdesfossez@efficios.com>
Thu, 24 Jan 2013 22:23:19 +0000 (17:23 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 24 Jan 2013 22:23:19 +0000 (17:23 -0500)
Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
formats/ctf-text/types/sequence.c
formats/ctf/events.c
formats/ctf/metadata/ctf-visitor-generate-io-struct.c
formats/ctf/types/sequence.c
include/babeltrace/types.h
types/sequence.c

index 20345ccee135815dff488a4d719207d1bae225c1..12574eec844cfe42f127946d9e8a4d352c3604ac 100644 (file)
@@ -63,7 +63,7 @@ int ctf_text_sequence_write(struct stream_pos *ppos, struct definition *definiti
                            && integer_declaration->p.alignment == CHAR_BIT)) {
                                pos->string = sequence_definition->string;
                                g_string_assign(sequence_definition->string, "");
-                               ret = sequence_rw(ppos, definition);
+                               ret = bt_sequence_rw(ppos, definition);
                                pos->string = NULL;
                        }
                        fprintf(pos->fp, "\"%s\"", sequence_definition->string->str);
@@ -77,7 +77,7 @@ int ctf_text_sequence_write(struct stream_pos *ppos, struct definition *definiti
        }
        field_nr_saved = pos->field_nr;
        pos->field_nr = 0;
-       ret = sequence_rw(ppos, definition);
+       ret = bt_sequence_rw(ppos, definition);
        if (!pos->dummy) {
                pos->depth--;
                fprintf(pos->fp, " ]");
index 372fdd136a931aae985d983d4826616b2f127c9b..036ce46bd9ad7aae3103dc7dd6bacf89855babdd 100644 (file)
@@ -145,7 +145,7 @@ const struct definition *bt_ctf_get_index(const struct bt_ctf_event *ctf_event,
                struct definition_sequence *sequence_definition;
                sequence_definition = container_of(field,
                                struct definition_sequence, p);
-               ret = sequence_index(sequence_definition, index);
+               ret = bt_sequence_index(sequence_definition, index);
        }
        return ret;
 }
index 928262f351a199add6f526fb185921701f29a45b..94dd0c83dfb45a7980475772c16d0f77de2b30cc 100644 (file)
@@ -526,7 +526,7 @@ struct declaration *ctf_type_declarator_visit(FILE *fd, int depth,
                        char *length_name = concatenate_unary_strings(&node_type_declarator->u.type_declarator.u.nested.length);
                        struct declaration_sequence *sequence_declaration;
 
-                       sequence_declaration = sequence_declaration_new(length_name, nested_declaration, declaration_scope);
+                       sequence_declaration = bt_sequence_declaration_new(length_name, nested_declaration, declaration_scope);
                        if (!sequence_declaration) {
                                fprintf(fd, "[error] %s: cannot create sequence declaration.\n", __func__);
                                g_free(length_name);
index 7f12bbceade30ce1727504b3a8d36d9d2b1fc094..2ff31b7be0e65b2f1b7a8ec4c2ebff15fec3f017 100644 (file)
@@ -46,7 +46,7 @@ int ctf_sequence_read(struct stream_pos *ppos, struct definition *definition)
 
                        if (integer_declaration->len == CHAR_BIT
                            && integer_declaration->p.alignment == CHAR_BIT) {
-                               uint64_t len = sequence_len(sequence_definition);
+                               uint64_t len = bt_sequence_len(sequence_definition);
 
                                ctf_align_pos(pos, integer_declaration->p.alignment);
                                if (!ctf_pos_access_ok(pos, len * CHAR_BIT))
@@ -60,7 +60,7 @@ int ctf_sequence_read(struct stream_pos *ppos, struct definition *definition)
                        }
                }
        }
-       return sequence_rw(ppos, definition);
+       return bt_sequence_rw(ppos, definition);
 }
 
 int ctf_sequence_write(struct stream_pos *ppos, struct definition *definition)
@@ -81,7 +81,7 @@ int ctf_sequence_write(struct stream_pos *ppos, struct definition *definition)
 
                        if (integer_declaration->len == CHAR_BIT
                            && integer_declaration->p.alignment == CHAR_BIT) {
-                               uint64_t len = sequence_len(sequence_definition);
+                               uint64_t len = bt_sequence_len(sequence_definition);
 
                                ctf_align_pos(pos, integer_declaration->p.alignment);
                                if (!ctf_pos_access_ok(pos, len * CHAR_BIT))
@@ -94,5 +94,5 @@ int ctf_sequence_write(struct stream_pos *ppos, struct definition *definition)
                        }
                }
        }
-       return sequence_rw(ppos, definition);
+       return bt_sequence_rw(ppos, definition);
 }
index 7b3485d85db431bdcb7723e2e930fb8add927bc8..a0c5467ac992f906576222556109cb3e158bb469 100644 (file)
@@ -501,12 +501,12 @@ int bt_get_array_len(const struct definition *field);
  * to the sequence. No need to free them explicitly.
  */
 struct declaration_sequence *
-       sequence_declaration_new(const char *length_name,
+       bt_sequence_declaration_new(const char *length_name,
                struct declaration *elem_declaration,
                struct declaration_scope *parent_scope);
-uint64_t sequence_len(struct definition_sequence *sequence);
-struct definition *sequence_index(struct definition_sequence *sequence, uint64_t i);
-int sequence_rw(struct stream_pos *pos, struct definition *definition);
+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);
 
 /*
  * in: path (dot separated), out: q (GArray of GQuark)
index 736e866439bfbcf90b17df5be9a6ffe000da2eec..6ed168c7f96ce57692968d59fa5da8fa14b475c8 100644 (file)
@@ -39,7 +39,7 @@ struct definition *_sequence_definition_new(struct declaration *declaration,
 static
 void _sequence_definition_free(struct definition *definition);
 
-int sequence_rw(struct stream_pos *pos, struct definition *definition)
+int bt_sequence_rw(struct stream_pos *pos, struct definition *definition)
 {
        struct definition_sequence *sequence_definition =
                container_of(definition, struct definition_sequence, p);
@@ -100,7 +100,7 @@ void _sequence_declaration_free(struct declaration *declaration)
 }
 
 struct declaration_sequence *
-       sequence_declaration_new(const char *length,
+       bt_sequence_declaration_new(const char *length,
                          struct declaration *elem_declaration,
                          struct declaration_scope *parent_scope)
 {
@@ -222,12 +222,12 @@ void _sequence_definition_free(struct definition *definition)
        g_free(sequence);
 }
 
-uint64_t sequence_len(struct definition_sequence *sequence)
+uint64_t bt_sequence_len(struct definition_sequence *sequence)
 {
        return sequence->length->value._unsigned;
 }
 
-struct definition *sequence_index(struct definition_sequence *sequence, uint64_t i)
+struct definition *bt_sequence_index(struct definition_sequence *sequence, uint64_t i)
 {
        if (!sequence->elems)
                return NULL;
This page took 0.041012 seconds and 4 git commands to generate.