PACKAGE_CFLAGS="$GMODULE_CFLAGS -Wall -Wformat"
AC_SUBST(PACKAGE_CFLAGS)
+babeltraceincludedir="${includedir}"
+AC_SUBST(babeltraceincludedir)
+
AC_CONFIG_FILES([
Makefile
types/Makefile
+++ /dev/null
-#ifndef _BABELTRACE_LIB_H
-#define _BABELTRACE_LIB_H
-
-/*
- * BabelTrace API
- *
- * Copyright 2010-2011 - Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- */
-
-#include <babeltrace/types.h>
-#include <babeltrace/format.h>
-#include <babeltrace/ctf/types.h>
-#include <babeltrace/ctf-ir/metadata.h>
-
-/*
- * struct babeltrace_iter: data structure representing an iterator on a trace
- * collection.
- */
-struct babeltrace_iter {
- struct ptr_heap *stream_heap;
- struct trace_collection *tc;
-};
-
-struct babeltrace_iter_pos {
- GPtrArray *pos; /* struct babeltrace_iter_stream_pos */
-};
-
-struct babeltrace_iter_stream_pos {
- struct stream_pos parent;
- ssize_t offset;
- size_t cur_index;
-};
-
-/*
- * Initialization/teardown.
- */
-struct babeltrace_iter *babeltrace_iter_create(struct trace_collection *tc);
-void babeltrace_iter_destroy(struct babeltrace_iter *iter);
-
-/*
- * Move within the trace.
- */
-/*
- * babeltrace_iter_next: Move stream position to the next event.
- *
- * Returns 0 on success, a negative value on error
- */
-int babeltrace_iter_next(struct babeltrace_iter *iter);
-
-/* Get the current position for each stream of the trace */
-struct babeltrace_iter_pos *
-babeltrace_iter_get_pos(struct babeltrace_iter *iter);
-
-/* The position needs to be freed after use */
-void babeltrace_iter_free_pos(struct babeltrace_iter_pos *pos);
-
-/* Seek the trace to the position */
-int babeltrace_iter_seek_pos(struct babeltrace_iter *iter,
- struct babeltrace_iter_pos *pos);
-
-/*
- * babeltrace_iter_seek_time: Seek the trace to the given timestamp.
- *
- * Return EOF if timestamp is after the last event of the trace.
- * Return other negative value for other errors.
- * Return 0 for success.
- */
-int babeltrace_iter_seek_time(struct babeltrace_iter *iter,
- uint64_t timestamp);
-
-/*
- * babeltrace_iter_read_event: Read the current event data.
- *
- * @iter: trace iterator (input)
- * @stream: stream containing event at current position (output)
- * @event: current event (output)
- * Return 0 on success, negative error value on error.
- */
-int babeltrace_iter_read_event(struct babeltrace_iter *iter,
- struct ctf_stream **stream,
- struct ctf_stream_event **event);
-
-#endif /* _BABELTRACE_LIB_H */
#include <errno.h>
#include <stdio.h>
#include <inttypes.h>
-#include <babeltrace/babeltrace.h>
+#include <babeltrace/babeltrace-internal.h>
#include <babeltrace/format.h>
#include <babeltrace/ctf/types.h>
#include <babeltrace/ctf/metadata.h>
#include <babeltrace/ctf-text/types.h>
#include <babeltrace/prio_heap.h>
+#include <babeltrace/babeltrace.h>
+#include <babeltrace/types.h>
+#include <babeltrace/ctf/types.h>
+#include <babeltrace/ctf-ir/metadata.h>
-#include "babeltrace-api.h"
+/*
+ * struct babeltrace_iter: data structure representing an iterator on a trace
+ * collection.
+ */
+struct babeltrace_iter {
+ struct ptr_heap *stream_heap;
+ struct trace_collection *tc;
+};
+
+struct babeltrace_iter_pos {
+ GPtrArray *pos; /* struct babeltrace_iter_stream_pos */
+};
+
+struct babeltrace_iter_stream_pos {
+ struct stream_pos parent;
+ ssize_t offset;
+ size_t cur_index;
+};
static int stream_read_event(struct ctf_file_stream *sin)
{
#include <string.h>
#include <endian.h>
-#include <babeltrace/babeltrace.h>
+#include <babeltrace/babeltrace-internal.h>
#include <babeltrace/ctf/types.h>
#define USEC_PER_SEC 1000000UL
#define _XOPEN_SOURCE 700
#include <config.h>
-#include <babeltrace/babeltrace.h>
+#include <babeltrace/babeltrace-internal.h>
#include <babeltrace/format.h>
#include <popt.h>
#include <errno.h>
#include <babeltrace/ctf-text/types.h>
#include <babeltrace/format.h>
-#include <babeltrace/babeltrace.h>
+#include <babeltrace/babeltrace-internal.h>
#include <inttypes.h>
#include <uuid/uuid.h>
#include <sys/mman.h>
#include <babeltrace/format.h>
#include <babeltrace/ctf-text/types.h>
#include <babeltrace/ctf/metadata.h>
-#include <babeltrace/babeltrace.h>
+#include <babeltrace/babeltrace-internal.h>
#include <inttypes.h>
#include <uuid/uuid.h>
#include <sys/mman.h>
#include <babeltrace/format.h>
#include <babeltrace/ctf/types.h>
#include <babeltrace/ctf/metadata.h>
-#include <babeltrace/babeltrace.h>
+#include <babeltrace/babeltrace-internal.h>
#include <inttypes.h>
#include <stdio.h>
#include <uuid/uuid.h>
*/
#include <stdio.h>
-#include <babeltrace/babeltrace.h>
+#include <babeltrace/babeltrace-internal.h>
#include "ctf-scanner.h"
#include "ctf-parser.h"
#include "ctf-ast.h"
#include <glib.h>
#include <errno.h>
#include <endian.h>
-#include <babeltrace/babeltrace.h>
+#include <babeltrace/babeltrace-internal.h>
#include <babeltrace/ctf/metadata.h>
#include "ctf-scanner.h"
#include "ctf-parser.h"
#include <errno.h>
#include <inttypes.h>
#include <babeltrace/list.h>
-#include <babeltrace/babeltrace.h>
+#include <babeltrace/babeltrace-internal.h>
#include "ctf-scanner.h"
#include "ctf-parser.h"
#include "ctf-ast.h"
#include <inttypes.h>
#include <endian.h>
#include <errno.h>
-#include <babeltrace/babeltrace.h>
+#include <babeltrace/babeltrace-internal.h>
#include <babeltrace/list.h>
#include <babeltrace/types.h>
#include <babeltrace/ctf/metadata.h>
#include <glib.h>
#include <inttypes.h>
#include <errno.h>
-#include <babeltrace/babeltrace.h>
+#include <babeltrace/babeltrace-internal.h>
#include <babeltrace/list.h>
#include "ctf-scanner.h"
#include "ctf-parser.h"
#include <glib.h>
#include <inttypes.h>
#include <errno.h>
-#include <babeltrace/babeltrace.h>
+#include <babeltrace/babeltrace-internal.h>
#include <babeltrace/list.h>
#include "ctf-scanner.h"
#include "ctf-parser.h"
#include <glib.h>
#include <inttypes.h>
#include <errno.h>
-#include <babeltrace/babeltrace.h>
+#include <babeltrace/babeltrace-internal.h>
#include <babeltrace/list.h>
#include "ctf-scanner.h"
#include "ctf-parser.h"
* all copies or substantial portions of the Software.
*/
-#include <babeltrace/babeltrace.h>
+#include <babeltrace/babeltrace-internal.h>
#include <babeltrace/ctf/types.h>
#include <limits.h> /* C99 limits */
#include <string.h>
+babeltraceinclude_HEADERS = babeltrace/babeltrace.h
+
noinst_HEADERS = \
babeltrace/align.h \
- babeltrace/babeltrace.h \
+ babeltrace/babeltrace-internal.h \
babeltrace/bitfield.h \
babeltrace/compiler.h \
babeltrace/format.h \
--- /dev/null
+#ifndef _BABELTRACE_INTERNAL_H
+#define _BABELTRACE_INTERNAL_H
+
+#include <stdio.h>
+#include <glib.h>
+
+extern int babeltrace_verbose, babeltrace_debug;
+
+#define printf_verbose(fmt, args...) \
+ do { \
+ if (babeltrace_verbose) \
+ printf("[verbose] " fmt, ## args); \
+ } while (0)
+
+#define printf_debug(fmt, args...) \
+ do { \
+ if (babeltrace_debug) \
+ printf("[debug] " fmt, ## args); \
+ } while (0)
+
+struct trace_descriptor;
+struct trace_collection {
+ GPtrArray *array;
+};
+
+int convert_trace(struct trace_descriptor *td_write,
+ struct trace_collection *trace_collection_read);
+
+extern int opt_field_names;
+
+#endif
#ifndef _BABELTRACE_H
#define _BABELTRACE_H
-#include <stdio.h>
-#include <glib.h>
+/*
+ * BabelTrace API
+ *
+ * Copyright 2010-2011 - Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ */
-extern int babeltrace_verbose, babeltrace_debug;
+/* Forward declarations */
+struct babeltrace_iter;
+struct babeltrace_iter_pos;
+struct babeltrace_iter_stream_pos;
+struct trace_collection;
+struct ctf_stream_event;
+struct ctf_stream;
-#define printf_verbose(fmt, args...) \
- do { \
- if (babeltrace_verbose) \
- printf("[verbose] " fmt, ## args); \
- } while (0)
+/*
+ * babeltrace_iter_create - Allocate a trace collection iterator.
+ */
+struct babeltrace_iter *babeltrace_iter_create(struct trace_collection *tc);
-#define printf_debug(fmt, args...) \
- do { \
- if (babeltrace_debug) \
- printf("[debug] " fmt, ## args); \
- } while (0)
+/*
+ * babeltrace_iter_destroy - Free a trace collection iterator.
+ */
+void babeltrace_iter_destroy(struct babeltrace_iter *iter);
-struct trace_descriptor;
-struct trace_collection {
- GPtrArray *array;
-};
+/*
+ * babeltrace_iter_next: Move trace collection position to the next event.
+ *
+ * Returns 0 on success, a negative value on error
+ */
+int babeltrace_iter_next(struct babeltrace_iter *iter);
-int convert_trace(struct trace_descriptor *td_write,
- struct trace_collection *trace_collection_read);
+/*
+ * babeltrace_iter_get_pos - Get the current trace collection position.
+ *
+ * The position returned by this function needs to be freed by
+ * babeltrace_iter_free_pos after use.
+ */
+struct babeltrace_iter_pos *
+ babeltrace_iter_get_pos(struct babeltrace_iter *iter);
-extern int opt_field_names;
+/*
+ * babeltrace_iter_free_pos - Free the position.
+ */
+void babeltrace_iter_free_pos(struct babeltrace_iter_pos *pos);
-#endif
+/*
+ * babeltrace_iter_seek_pos - Seek the trace collection to the position.
+ */
+int babeltrace_iter_seek_pos(struct babeltrace_iter *iter,
+ struct babeltrace_iter_pos *pos);
+
+/*
+ * babeltrace_iter_seek_time: Seek the trace collection to the given timestamp.
+ *
+ * Return EOF if timestamp is after the last event of the trace collection.
+ * Return other negative value for other errors.
+ * Return 0 for success.
+ */
+int babeltrace_iter_seek_time(struct babeltrace_iter *iter,
+ uint64_t timestamp);
+
+/*
+ * babeltrace_iter_read_event: Read the iterator's current event data.
+ *
+ * @iter: trace collection iterator (input)
+ * @stream: stream containing event at current position (output)
+ * @event: current event (output)
+ * Return 0 on success, negative error value on error.
+ */
+int babeltrace_iter_read_event(struct babeltrace_iter *iter,
+ struct ctf_stream **stream,
+ struct ctf_stream_event **event);
+
+#endif /* _BABELTRACE_H */
#include <stdint.h>
#include <unistd.h>
#include <glib.h>
-#include <babeltrace/babeltrace.h>
+#include <babeltrace/babeltrace-internal.h>
#include <babeltrace/types.h>
#include <babeltrace/format.h>
*/
#include <babeltrace/types.h>
-#include <babeltrace/babeltrace.h>
+#include <babeltrace/babeltrace-internal.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
*/
#include <babeltrace/format.h>
-#include <babeltrace/babeltrace.h>
+#include <babeltrace/babeltrace-internal.h>
#include <limits.h>
#include <glib.h>
#include <errno.h>