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

index 97b557f1498806b6f4b8e8e9bef1bfc26882360d..e2ed7b331e5dd94faa46305f143755f9501087f6 100644 (file)
@@ -63,7 +63,7 @@ int ctf_text_array_write(struct stream_pos *ppos, struct definition *definition)
                            && integer_declaration->p.alignment == CHAR_BIT)) {
                                pos->string = array_definition->string;
                                g_string_assign(array_definition->string, "");
-                               ret = array_rw(ppos, definition);
+                               ret = bt_array_rw(ppos, definition);
                                pos->string = NULL;
                        }
                        fprintf(pos->fp, "\"%s\"", array_definition->string->str);
@@ -77,7 +77,7 @@ int ctf_text_array_write(struct stream_pos *ppos, struct definition *definition)
        }
        field_nr_saved = pos->field_nr;
        pos->field_nr = 0;
-       ret = array_rw(ppos, definition);
+       ret = bt_array_rw(ppos, definition);
        if (!pos->dummy) {
                pos->depth--;
                fprintf(pos->fp, " ]");
index a55f5e4e07a7068e1056fbcafbafbdabbe0e842f..e18fffb1fa43030bb725f62cca380c8f51748f69 100644 (file)
@@ -1338,12 +1338,12 @@ int create_stream_packet_index(struct ctf_trace *td,
                                field = struct_definition_get_field_from_index(file_stream->parent.trace_packet_header, len_index);
                                assert(field->declaration->id == CTF_TYPE_ARRAY);
                                defarray = container_of(field, struct definition_array, p);
-                               assert(array_len(defarray) == BABELTRACE_UUID_LEN);
+                               assert(bt_array_len(defarray) == BABELTRACE_UUID_LEN);
 
                                for (i = 0; i < BABELTRACE_UUID_LEN; i++) {
                                        struct definition *elem;
 
-                                       elem = array_index(defarray, i);
+                                       elem = bt_array_index(defarray, i);
                                        uuidval[i] = get_unsigned_int(elem);
                                }
                                ret = babeltrace_uuid_compare(td->uuid, uuidval);
index ac7dce46828daf103adea381e30e2c84f31f50ab..b530cd5dc9d4d0c00ec4e1bb8ad587d16ad4c5ee 100644 (file)
@@ -140,7 +140,7 @@ const struct definition *bt_ctf_get_index(const struct bt_ctf_event *ctf_event,
                struct definition_array *array_definition;
                array_definition = container_of(field,
                                struct definition_array, p);
-               ret = array_index(array_definition, index);
+               ret = bt_array_index(array_definition, index);
        } else if (bt_ctf_field_type(bt_ctf_get_decl_from_def(field)) == CTF_TYPE_SEQUENCE) {
                struct definition_sequence *sequence_definition;
                sequence_definition = container_of(field,
@@ -584,7 +584,7 @@ char *bt_ctf_get_char_array(const struct definition *field)
        GString *char_array;
 
        if (field && bt_ctf_field_type(bt_ctf_get_decl_from_def(field)) == CTF_TYPE_ARRAY) {
-               char_array = get_char_array(field);
+               char_array = bt_get_char_array(field);
                if (char_array) {
                        ret = char_array->str;
                        goto end;
index c32aa990fc23b952f9e5c827532796e1d22c28d1..97d15e77ccddf08231906cf81182236876eebaf1 100644 (file)
@@ -509,7 +509,7 @@ struct declaration *ctf_type_declarator_visit(FILE *fd, int depth,
                        size_t len;
 
                        len = first->u.unary_expression.u.unsigned_constant;
-                       array_declaration = array_declaration_new(len, nested_declaration,
+                       array_declaration = bt_array_declaration_new(len, nested_declaration,
                                                declaration_scope);
 
                        if (!array_declaration) {
index d5b6ed46b44d25d81e87840cb1675e17bea612c7..006f0cecffd6c1763e4a7cc0cf7702785a15d1a3 100644 (file)
@@ -61,7 +61,7 @@ int ctf_array_read(struct stream_pos *ppos, struct definition *definition)
                        }
                }
        }
-       return array_rw(ppos, definition);
+       return bt_array_rw(ppos, definition);
 }
 
 int ctf_array_write(struct stream_pos *ppos, struct definition *definition)
@@ -96,5 +96,5 @@ int ctf_array_write(struct stream_pos *ppos, struct definition *definition)
                        }
                }
        }
-       return array_rw(ppos, definition);
+       return bt_array_rw(ppos, definition);
 }
index 772abb2a9197437a620b1db38a28ce0c1d488f0f..3b45fd5596c858048ec64f8cded0bd697c5a5043 100644 (file)
@@ -488,13 +488,13 @@ int variant_rw(struct stream_pos *pos, struct definition *definition);
  * array.
  */
 struct declaration_array *
-       array_declaration_new(size_t len, struct declaration *elem_declaration,
+       bt_array_declaration_new(size_t len, struct declaration *elem_declaration,
                struct declaration_scope *parent_scope);
-uint64_t array_len(struct definition_array *array);
-struct definition *array_index(struct definition_array *array, uint64_t i);
-int array_rw(struct stream_pos *pos, struct definition *definition);
-GString *get_char_array(const struct definition *field);
-int get_array_len(const struct definition *field);
+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);
+GString *bt_get_char_array(const struct definition *field);
+int bt_get_array_len(const struct definition *field);
 
 /*
  * int_declaration and elem_declaration passed as parameter now belong
index 494210827ff80ab301479b6aa4537d49c24684b7..d2db46ff1306010bf6cf3a69002fe57295768b91 100644 (file)
@@ -38,7 +38,7 @@ struct definition *_array_definition_new(struct declaration *declaration,
 static
 void _array_definition_free(struct definition *definition);
 
-int array_rw(struct stream_pos *pos, struct definition *definition)
+int bt_array_rw(struct stream_pos *pos, struct definition *definition)
 {
        struct definition_array *array_definition =
                container_of(definition, struct definition_array, p);
@@ -70,7 +70,7 @@ void _array_declaration_free(struct declaration *declaration)
 }
 
 struct declaration_array *
-       array_declaration_new(size_t len,
+       bt_array_declaration_new(size_t len,
                              struct declaration *elem_declaration,
                              struct declaration_scope *parent_scope)
 {
@@ -198,14 +198,14 @@ void _array_definition_free(struct definition *definition)
        g_free(array);
 }
 
-uint64_t array_len(struct definition_array *array)
+uint64_t bt_array_len(struct definition_array *array)
 {
        if (!array->elems)
                return array->string->len;
        return array->elems->len;
 }
 
-struct definition *array_index(struct definition_array *array, uint64_t i)
+struct definition *bt_array_index(struct definition_array *array, uint64_t i)
 {
        if (!array->elems)
                return NULL;
@@ -214,7 +214,7 @@ struct definition *array_index(struct definition_array *array, uint64_t i)
        return g_ptr_array_index(array->elems, i);
 }
 
-int get_array_len(const struct definition *field)
+int bt_get_array_len(const struct definition *field)
 {
        struct definition_array *array_definition;
        struct declaration_array *array_declaration;
@@ -225,7 +225,7 @@ int get_array_len(const struct definition *field)
        return array_declaration->len;
 }
 
-GString *get_char_array(const struct definition *field)
+GString *bt_get_char_array(const struct definition *field)
 {
        struct definition_array *array_definition;
        struct declaration_array *array_declaration;
This page took 0.042676 seconds and 4 git commands to generate.