#include <assert.h>
#include <glib.h>
#include <inttypes.h>
-#include <endian.h>
#include <errno.h>
#include <babeltrace/babeltrace-internal.h>
#include <babeltrace/list.h>
#include <babeltrace/types.h>
#include <babeltrace/ctf/metadata.h>
#include <babeltrace/uuid.h>
+#include <babeltrace/endian.h>
#include "ctf-scanner.h"
#include "ctf-parser.h"
#include "ctf-ast.h"
}
static
-int get_unary_uuid(struct bt_list_head *head, uuid_t *uuid)
+int get_unary_uuid(struct bt_list_head *head, unsigned char *uuid)
{
struct ctf_node *node;
int i = 0;
assert(node->u.unary_expression.link == UNARY_LINK_UNKNOWN);
assert(i == 0);
src_string = node->u.unary_expression.u.string;
- ret = babeltrace_uuid_parse(src_string, *uuid);
+ ret = babeltrace_uuid_parse(src_string, uuid);
}
return ret;
}
static
-struct ctf_stream_class *trace_stream_lookup(struct ctf_trace *trace, uint64_t stream_id)
+struct ctf_stream_declaration *trace_stream_lookup(struct ctf_trace *trace, uint64_t stream_id)
{
if (trace->streams->len <= stream_id)
return NULL;
}
static
-int ctf_event_declaration_visit(FILE *fd, int depth, struct ctf_node *node, struct ctf_event *event, struct ctf_trace *trace)
+int ctf_event_declaration_visit(FILE *fd, int depth, struct ctf_node *node, struct ctf_event_declaration *event, struct ctf_trace *trace)
{
int ret = 0;
{
int ret = 0;
struct ctf_node *iter;
- struct ctf_event *event;
+ struct ctf_event_declaration *event;
- event = g_new0(struct ctf_event, 1);
+ event = g_new0(struct ctf_event_declaration, 1);
event->declaration_scope = new_declaration_scope(parent_declaration_scope);
event->loglevel = -1;
bt_list_for_each_entry(iter, &node->u.event.declaration_list, siblings) {
static
-int ctf_stream_declaration_visit(FILE *fd, int depth, struct ctf_node *node, struct ctf_stream_class *stream, struct ctf_trace *trace)
+int ctf_stream_declaration_visit(FILE *fd, int depth, struct ctf_node *node, struct ctf_stream_declaration *stream, struct ctf_trace *trace)
{
int ret = 0;
{
int ret = 0;
struct ctf_node *iter;
- struct ctf_stream_class *stream;
+ struct ctf_stream_declaration *stream;
- stream = g_new0(struct ctf_stream_class, 1);
+ stream = g_new0(struct ctf_stream_declaration, 1);
stream->declaration_scope = new_declaration_scope(parent_declaration_scope);
stream->events_by_id = g_ptr_array_new();
stream->event_quark_to_id = g_hash_table_new(g_direct_hash, g_direct_equal);
}
CTF_TRACE_SET_FIELD(trace, minor);
} else if (!strcmp(left, "uuid")) {
- uuid_t uuid;
+ unsigned char uuid[BABELTRACE_UUID_LEN];
- ret = get_unary_uuid(&node->u.ctf_expression.right, &uuid);
+ ret = get_unary_uuid(&node->u.ctf_expression.right, uuid);
if (ret) {
fprintf(fd, "[error] %s: unexpected unary expression for trace uuid\n", __func__);
ret = -EINVAL;
fprintf(fd, "[error] %s: missing minor field in trace declaration\n", __func__);
goto error;
}
- if (!CTF_TRACE_FIELD_IS_SET(trace, uuid)) {
- ret = -EPERM;
- fprintf(fd, "[error] %s: missing uuid field in trace declaration\n", __func__);
- goto error;
- }
if (!CTF_TRACE_FIELD_IS_SET(trace, byte_order)) {
ret = -EPERM;
fprintf(fd, "[error] %s: missing byte_order field in trace declaration\n", __func__);