Babeltrace wrapper update
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 1 Mar 2012 23:36:07 +0000 (18:36 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 1 Mar 2012 23:36:07 +0000 (18:36 -0500)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
converter/babeltrace-log.c
formats/bt-dummy/bt-dummy.c
formats/ctf-text/ctf-text.c
formats/ctf/ctf.c
formats/ctf/metadata/ctf-parser-test.c

index ac66a8b08d878e2be09548be0320d2a3bb0321fc..d3470774c589a22b143232b58add5df9f892c85b 100644 (file)
 #include <stdint.h>
 #include <unistd.h>
 #include <errno.h>
-#include <uuid/uuid.h>
 #include <string.h>
-#include <endian.h>
 
 #include <babeltrace/babeltrace-internal.h>
 #include <babeltrace/ctf/types.h>
 #include <babeltrace/uuid.h>
+#include <babeltrace/endian.h>
 
 #define USEC_PER_SEC 1000000UL
 
@@ -46,7 +45,7 @@ int babeltrace_debug, babeltrace_verbose;
 static char *s_outputname;
 static int s_timestamp;
 static int s_help;
-static uuid_t s_uuid;
+static unsigned char s_uuid[BABELTRACE_UUID_LEN];
 
 /* Metadata format string */
 static const char metadata_fmt[] =
@@ -104,7 +103,7 @@ void print_metadata(FILE *fp)
 }
 
 static
-void write_packet_header(struct ctf_stream_pos *pos, uuid_t uuid)
+void write_packet_header(struct ctf_stream_pos *pos, unsigned char *uuid)
 {
        struct ctf_stream_pos dummy;
 
@@ -125,8 +124,8 @@ void write_packet_header(struct ctf_stream_pos *pos, uuid_t uuid)
        assert(!ctf_pos_packet(&dummy));
 
        ctf_align_pos(pos, sizeof(uint8_t) * CHAR_BIT);
-       memcpy(ctf_get_pos_addr(pos), uuid, 16);
-       ctf_move_pos(pos, 16 * CHAR_BIT);
+       memcpy(ctf_get_pos_addr(pos), uuid, BABELTRACE_UUID_LEN);
+       ctf_move_pos(pos, BABELTRACE_UUID_LEN * CHAR_BIT);
 }
 
 static
@@ -337,7 +336,7 @@ int main(int argc, char **argv)
                goto error_closemetadatafd;
        }
 
-       uuid_generate(s_uuid);
+       babeltrace_uuid_generate(s_uuid);
        print_metadata(metadata_fp);
        trace_text(stdin, fd);
 
index e0a10c90d61c0767a390e7c94c4f045ca0db1278..5f7a1a5abc947f06304cadb35e3bc1d47c1cf470 100644 (file)
@@ -20,7 +20,6 @@
 #include <babeltrace/format.h>
 #include <babeltrace/babeltrace-internal.h>
 #include <inttypes.h>
-#include <uuid/uuid.h>
 #include <sys/mman.h>
 #include <errno.h>
 #include <sys/types.h>
index bf028615fd301fbfd922528bed6471eb14a8474d..273c9b72426145fd88400cde874c6c026ee789bc 100644 (file)
@@ -24,7 +24,6 @@
 #include <babeltrace/babeltrace-internal.h>
 #include <babeltrace/ctf/events-internal.h>
 #include <inttypes.h>
-#include <uuid/uuid.h>
 #include <sys/mman.h>
 #include <errno.h>
 #include <sys/types.h>
index 7c3df128c9b147dd86846e8d2aaed8c6170f6ee6..4f14d7a0b8a45a1994e46d355aabb7af0a930734 100644 (file)
 #include <babeltrace/ctf/metadata.h>
 #include <babeltrace/babeltrace-internal.h>
 #include <babeltrace/ctf/events-internal.h>
+#include <babeltrace/uuid.h>
+#include <babeltrace/endian.h>
 #include <inttypes.h>
 #include <stdio.h>
-#include <uuid/uuid.h>
 #include <sys/mman.h>
 #include <errno.h>
-#include <endian.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
@@ -48,7 +48,6 @@
  */
 #define MAX_PACKET_HEADER_LEN  (getpagesize() * CHAR_BIT)
 #define WRITE_PACKET_LEN       (getpagesize() * 8 * CHAR_BIT)
-#define UUID_LEN 16    /* uuid by value len */
 
 #ifndef min
 #define min(a, b)      (((a) < (b)) ? (a) : (b))
@@ -689,7 +688,7 @@ int ctf_open_trace_metadata_packet_read(struct ctf_trace *td, FILE *in,
                memcpy(td->uuid, header.uuid, sizeof(header.uuid));
                CTF_TRACE_SET_FIELD(td, uuid);
        } else {
-               if (uuid_compare(header.uuid, td->uuid))
+               if (babeltrace_uuid_compare(header.uuid, td->uuid))
                        return -EINVAL;
        }
 
@@ -1077,20 +1076,20 @@ int create_stream_packet_index(struct ctf_trace *td,
                                struct definition_array *defarray;
                                struct definition *field;
                                uint64_t i;
-                               uint8_t uuidval[UUID_LEN];
+                               uint8_t uuidval[BABELTRACE_UUID_LEN];
 
                                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) == UUID_LEN);
+                               assert(array_len(defarray) == BABELTRACE_UUID_LEN);
 
-                               for (i = 0; i < UUID_LEN; i++) {
+                               for (i = 0; i < BABELTRACE_UUID_LEN; i++) {
                                        struct definition *elem;
 
                                        elem = array_index(defarray, i);
                                        uuidval[i] = get_unsigned_int(elem);
                                }
-                               ret = uuid_compare(td->uuid, uuidval);
+                               ret = babeltrace_uuid_compare(td->uuid, uuidval);
                                if (ret) {
                                        fprintf(stderr, "[error] Unique Universal Identifiers do not match.\n");
                                        return -EINVAL;
index 7cddbf8411409cc73b7ea307a1f23337cb643838..72c45885dc939f62c1622fd0aea08e6ad7895d77 100644 (file)
@@ -20,7 +20,7 @@
 #include <stdio.h>
 #include <glib.h>
 #include <errno.h>
-#include <endian.h>
+#include <babeltrace/endian.h>
 #include <babeltrace/babeltrace-internal.h>
 #include <babeltrace/ctf/metadata.h>
 #include "ctf-scanner.h"
This page took 0.039297 seconds and 4 git commands to generate.