From aacd0c695fce3e2bcba4a1c6acd4c82346311b3e Mon Sep 17 00:00:00 2001 From: Julien Desfossez Date: Fri, 17 Feb 2012 12:00:01 -0500 Subject: [PATCH] fix : callback type, doc and links to libbabeltrace Signed-off-by: Julien Desfossez Signed-off-by: Mathieu Desnoyers --- include/babeltrace/babeltrace.h | 7 +------ include/babeltrace/callbacks-internal.h | 3 ++- include/babeltrace/ctf/events.h | 6 +++--- lib/Makefile.am | 2 ++ lib/callbacks.c | 5 +++-- lib/ctf-events.c | 2 +- 6 files changed, 12 insertions(+), 13 deletions(-) diff --git a/include/babeltrace/babeltrace.h b/include/babeltrace/babeltrace.h index 4d94a562..c77ea782 100644 --- a/include/babeltrace/babeltrace.h +++ b/include/babeltrace/babeltrace.h @@ -37,11 +37,6 @@ enum bt_cb_ret { BT_CB_ERROR_CONTINUE = 3, }; -struct bt_ctf_data { - struct ctf_stream_event *event; - struct ctf_stream *stream; -}; - /* * Receives a variable number of strings as parameter, ended with NULL. */ @@ -90,7 +85,7 @@ void babeltrace_dependencies_destroy(struct bt_dependencies *dep); */ int bt_iter_add_callback(struct bt_iter *iter, bt_intern_str event, void *private_data, int flags, - enum bt_cb_ret (*callback)(struct bt_ctf_data *ctf_data, + enum bt_cb_ret (*callback)(struct bt_ctf_event *ctf_data, void *caller_data), struct bt_dependencies *depends, struct bt_dependencies *weak_depends, diff --git a/include/babeltrace/callbacks-internal.h b/include/babeltrace/callbacks-internal.h index c9aeccdf..c1257065 100644 --- a/include/babeltrace/callbacks-internal.h +++ b/include/babeltrace/callbacks-internal.h @@ -22,6 +22,7 @@ */ #include +#include struct bt_callback { int prio; /* Callback order priority. Lower first. Dynamically assigned from dependency graph. */ @@ -30,7 +31,7 @@ struct bt_callback { struct bt_dependencies *depends; struct bt_dependencies *weak_depends; struct bt_dependencies *provides; - enum bt_cb_ret (*callback)(struct bt_ctf_data *ctf_data, + enum bt_cb_ret (*callback)(struct bt_ctf_event *ctf_data, void *private_data); }; diff --git a/include/babeltrace/ctf/events.h b/include/babeltrace/ctf/events.h index eb644125..f2ef22df 100644 --- a/include/babeltrace/ctf/events.h +++ b/include/babeltrace/ctf/events.h @@ -90,9 +90,9 @@ const char *bt_ctf_event_name(struct bt_ctf_event *event); uint64_t bt_ctf_get_timestamp(struct bt_ctf_event *event); /* - * bt_ctf_get_field_list: returns an array of *def pointing to each field of - * the event. The array is NULL terminated. - * On error : return NULL. + * bt_ctf_get_field_list: set list pointer to an array of definition + * pointers and set count to the number of elements in the array. + * Return 0 on success and a negative value on error. */ int bt_ctf_get_field_list(struct bt_ctf_event *event, struct definition *scope, diff --git a/lib/Makefile.am b/lib/Makefile.am index 079ed13e..0c421cdb 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -14,4 +14,6 @@ libbabeltrace_la_SOURCES = babeltrace.c \ libbabeltrace_la_LIBADD = \ $(top_builddir)/types/libbabeltrace_types.la \ + $(top_builddir)/formats/libbabeltrace_registry.la \ + $(top_builddir)/formats/ctf/libctf.la \ prio_heap/libprio_heap.la diff --git a/lib/callbacks.c b/lib/callbacks.c index 0dfb19c2..fa212c91 100644 --- a/lib/callbacks.c +++ b/lib/callbacks.c @@ -25,6 +25,7 @@ #include #include #include +#include #include static @@ -62,7 +63,7 @@ struct bt_dependencies *babeltrace_dependencies_create(const char *first, ...) */ int bt_iter_add_callback(struct bt_iter *iter, bt_intern_str event, void *private_data, int flags, - enum bt_cb_ret (*callback)(struct bt_ctf_data *ctf_data, + enum bt_cb_ret (*callback)(struct bt_ctf_event *ctf_data, void *private_data), struct bt_dependencies *depends, struct bt_dependencies *weak_depends, @@ -177,7 +178,7 @@ void process_callbacks(struct bt_iter *iter, struct bt_callback *cb; int i; enum bt_cb_ret ret; - struct bt_ctf_data ctf_data; + struct bt_ctf_event ctf_data; ctf_data.event = extract_ctf_stream_event(stream); ctf_data.stream = stream; diff --git a/lib/ctf-events.c b/lib/ctf-events.c index dbb0cd66..70513bfa 100644 --- a/lib/ctf-events.c +++ b/lib/ctf-events.c @@ -267,7 +267,7 @@ uint64_t bt_ctf_get_uint64(struct definition *field) return ret; } -int64_t bt_ctf_get_signed_int64(struct definition *field) +int64_t bt_ctf_get_int64(struct definition *field) { int ret = 0; -- 2.34.1