namespace the int functions
authorJulien Desfossez <jdesfossez@efficios.com>
Thu, 24 Jan 2013 22:22:59 +0000 (17:22 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 24 Jan 2013 22:22:59 +0000 (17:22 -0500)
Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
formats/ctf/ctf.c
formats/ctf/events.c
include/babeltrace/types.h
types/integer.c

index 6a24087447b6fb5738f643ef6f24f51df0211904..45ab65ef92db54f365ec57b7655e0606e2291093 100644 (file)
@@ -1317,7 +1317,7 @@ int create_stream_packet_index(struct ctf_trace *td,
                                uint64_t magic;
 
                                field = struct_definition_get_field_from_index(file_stream->parent.trace_packet_header, len_index);
-                               magic = get_unsigned_int(field);
+                               magic = bt_get_unsigned_int(field);
                                if (magic != CTF_MAGIC) {
                                        fprintf(stderr, "[error] Invalid magic number 0x%" PRIX64 " at packet %u (file offset %zd).\n",
                                                        magic,
@@ -1344,7 +1344,7 @@ int create_stream_packet_index(struct ctf_trace *td,
                                        struct definition *elem;
 
                                        elem = bt_array_index(defarray, i);
-                                       uuidval[i] = get_unsigned_int(elem);
+                                       uuidval[i] = bt_get_unsigned_int(elem);
                                }
                                ret = babeltrace_uuid_compare(td->uuid, uuidval);
                                if (ret) {
@@ -1359,7 +1359,7 @@ int create_stream_packet_index(struct ctf_trace *td,
                                struct definition *field;
 
                                field = struct_definition_get_field_from_index(file_stream->parent.trace_packet_header, len_index);
-                               stream_id = get_unsigned_int(field);
+                               stream_id = bt_get_unsigned_int(field);
                        }
                }
 
@@ -1396,7 +1396,7 @@ int create_stream_packet_index(struct ctf_trace *td,
                                struct definition *field;
 
                                field = struct_definition_get_field_from_index(file_stream->parent.stream_packet_context, len_index);
-                               packet_index.content_size = get_unsigned_int(field);
+                               packet_index.content_size = bt_get_unsigned_int(field);
                        } else {
                                /* Use file size for packet size */
                                packet_index.content_size = filestats.st_size * CHAR_BIT;
@@ -1408,7 +1408,7 @@ int create_stream_packet_index(struct ctf_trace *td,
                                struct definition *field;
 
                                field = struct_definition_get_field_from_index(file_stream->parent.stream_packet_context, len_index);
-                               packet_index.packet_size = get_unsigned_int(field);
+                               packet_index.packet_size = bt_get_unsigned_int(field);
                        } else {
                                /* Use content size if non-zero, else file size */
                                packet_index.packet_size = packet_index.content_size ? : filestats.st_size * CHAR_BIT;
@@ -1420,7 +1420,7 @@ int create_stream_packet_index(struct ctf_trace *td,
                                struct definition *field;
 
                                field = struct_definition_get_field_from_index(file_stream->parent.stream_packet_context, len_index);
-                               packet_index.timestamp_begin = get_unsigned_int(field);
+                               packet_index.timestamp_begin = bt_get_unsigned_int(field);
                                if (file_stream->parent.stream_class->trace->collection) {
                                        packet_index.timestamp_begin =
                                                ctf_get_real_timestamp(
@@ -1435,7 +1435,7 @@ int create_stream_packet_index(struct ctf_trace *td,
                                struct definition *field;
 
                                field = struct_definition_get_field_from_index(file_stream->parent.stream_packet_context, len_index);
-                               packet_index.timestamp_end = get_unsigned_int(field);
+                               packet_index.timestamp_end = bt_get_unsigned_int(field);
                                if (file_stream->parent.stream_class->trace->collection) {
                                        packet_index.timestamp_end =
                                                ctf_get_real_timestamp(
@@ -1450,8 +1450,8 @@ int create_stream_packet_index(struct ctf_trace *td,
                                struct definition *field;
 
                                field = struct_definition_get_field_from_index(file_stream->parent.stream_packet_context, len_index);
-                               packet_index.events_discarded = get_unsigned_int(field);
-                               packet_index.events_discarded_len = get_int_len(field);
+                               packet_index.events_discarded = bt_get_unsigned_int(field);
+                               packet_index.events_discarded_len = bt_get_int_len(field);
                        }
                } else {
                        /* Use file size for packet size */
index 1d1ef6f1c5cab5b4631a41b921457b106ead1fc8..372fdd136a931aae985d983d4826616b2f127c9b 100644 (file)
@@ -462,12 +462,12 @@ const char *bt_ctf_get_enum_str(const struct definition *field)
        }
        def_enum = container_of(field, const struct definition_enum, p);
        decl_enum = def_enum->declaration;
-       if (get_int_signedness(&def_enum->integer->p)) {
+       if (bt_get_int_signedness(&def_enum->integer->p)) {
                array = bt_enum_int_to_quark_set(decl_enum,
-                       get_signed_int(&def_enum->integer->p));
+                       bt_get_signed_int(&def_enum->integer->p));
        } else {
                array = bt_enum_uint_to_quark_set(decl_enum,
-                       get_unsigned_int(&def_enum->integer->p));
+                       bt_get_unsigned_int(&def_enum->integer->p));
        }
        if (!array) {
                bt_ctf_field_set_error(-ENOENT);
@@ -559,7 +559,7 @@ uint64_t bt_ctf_get_uint64(const struct definition *field)
        uint64_t ret = 0;
 
        if (field && bt_ctf_field_type(bt_ctf_get_decl_from_def(field)) == CTF_TYPE_INTEGER)
-               ret = get_unsigned_int(field);
+               ret = bt_get_unsigned_int(field);
        else
                bt_ctf_field_set_error(-EINVAL);
 
@@ -571,7 +571,7 @@ int64_t bt_ctf_get_int64(const struct definition *field)
        int64_t ret = 0;
 
        if (field && bt_ctf_field_type(bt_ctf_get_decl_from_def(field)) == CTF_TYPE_INTEGER)
-               ret = get_signed_int(field);
+               ret = bt_get_signed_int(field);
        else
                bt_ctf_field_set_error(-EINVAL);
 
index 15bbef36c328ffcb970d6027d8dafc62bc86c214..7b3485d85db431bdcb7723e2e930fb8add927bc8 100644 (file)
@@ -374,13 +374,13 @@ struct declaration_integer *integer_declaration_new(size_t len, int byte_order,
                                  int signedness, size_t alignment,
                                  int base, enum ctf_string_encoding encoding,
                                  struct ctf_clock *clock);
-uint64_t get_unsigned_int(const struct definition *field);
-int64_t get_signed_int(const struct definition *field);
-int get_int_signedness(const struct definition *field);
-int get_int_byte_order(const struct definition *field);
-int get_int_base(const struct definition *field);
-size_t get_int_len(const struct definition *field);    /* in bits */
-enum ctf_string_encoding get_int_encoding(const struct definition *field);
+uint64_t bt_get_unsigned_int(const struct definition *field);
+int64_t bt_get_signed_int(const struct definition *field);
+int bt_get_int_signedness(const struct definition *field);
+int bt_get_int_byte_order(const struct definition *field);
+int bt_get_int_base(const struct definition *field);
+size_t bt_get_int_len(const struct definition *field); /* in bits */
+enum ctf_string_encoding bt_get_int_encoding(const struct definition *field);
 
 /*
  * mantissa_len is the length of the number of bytes represented by the mantissa
index 20e7688d80ebb17fe91a36eff3280776c109982b..58b6104f9f08c73e78a9730796afd155962ead7d 100644 (file)
@@ -115,7 +115,7 @@ void _integer_definition_free(struct definition *definition)
        g_free(integer);
 }
 
-enum ctf_string_encoding get_int_encoding(const struct definition *field)
+enum ctf_string_encoding bt_get_int_encoding(const struct definition *field)
 {
        struct definition_integer *integer_definition;
        const struct declaration_integer *integer_declaration;
@@ -126,7 +126,7 @@ enum ctf_string_encoding get_int_encoding(const struct definition *field)
        return integer_declaration->encoding;
 }
 
-int get_int_base(const struct definition *field)
+int bt_get_int_base(const struct definition *field)
 {
        struct definition_integer *integer_definition;
        const struct declaration_integer *integer_declaration;
@@ -137,7 +137,7 @@ int get_int_base(const struct definition *field)
        return integer_declaration->base;
 }
 
-size_t get_int_len(const struct definition *field)
+size_t bt_get_int_len(const struct definition *field)
 {
        struct definition_integer *integer_definition;
        const struct declaration_integer *integer_declaration;
@@ -148,7 +148,7 @@ size_t get_int_len(const struct definition *field)
        return integer_declaration->len;
 }
 
-int get_int_byte_order(const struct definition *field)
+int bt_get_int_byte_order(const struct definition *field)
 {
        struct definition_integer *integer_definition;
        const struct declaration_integer *integer_declaration;
@@ -159,7 +159,7 @@ int get_int_byte_order(const struct definition *field)
        return integer_declaration->byte_order;
 }
 
-int get_int_signedness(const struct definition *field)
+int bt_get_int_signedness(const struct definition *field)
 {
        struct definition_integer *integer_definition;
        const struct declaration_integer *integer_declaration;
@@ -170,7 +170,7 @@ int get_int_signedness(const struct definition *field)
        return integer_declaration->signedness;
 }
 
-uint64_t get_unsigned_int(const struct definition *field)
+uint64_t bt_get_unsigned_int(const struct definition *field)
 {
        struct definition_integer *integer_definition;
        const struct declaration_integer *integer_declaration;
@@ -186,7 +186,7 @@ uint64_t get_unsigned_int(const struct definition *field)
        return (uint64_t)integer_definition->value._signed;
 }
 
-int64_t get_signed_int(const struct definition *field)
+int64_t bt_get_signed_int(const struct definition *field)
 {
        struct definition_integer *integer_definition;
        const struct declaration_integer *integer_declaration;
This page took 0.041247 seconds and 4 git commands to generate.