Avoid unnecessary inclusions in public headers
[deliverable/babeltrace.git] / plugins / ctf / common / btr / btr.h
index ee6695a19fbab0f839dad46a544234bb927269da..4b5e7bc78b814f22f46d1527a590bb3f27bbf55c 100644 (file)
@@ -29,7 +29,7 @@
 #include <stdint.h>
 #include <stddef.h>
 #include <stdio.h>
-#include <babeltrace/ctf-ir/field-types.h>
+#include <babeltrace/babeltrace.h>
 #include <babeltrace/babeltrace-internal.h>
 
 /**
@@ -63,7 +63,7 @@ enum bt_ctf_btr_status {
         * #BT_CTF_BTR_STATUS_EOF is returned to complete the decoding
         * process of a given type.
         */
-       BT_CTF_BTR_STATUS_EOF =         -4,
+       BT_CTF_BTR_STATUS_EOF =         1,
 
        /** Invalid argument. */
        BT_CTF_BTR_STATUS_INVAL =       -3,
@@ -275,11 +275,9 @@ struct bt_ctf_btr_cbs {
  *
  * @param cbs          User callback functions
  * @param data         User data (passed to user callback functions)
- * @param err_stream   Error stream (can be \c NULL to disable)
  * @returns            New binary type reader on success, or \c NULL on error
  */
-struct bt_ctf_btr *bt_ctf_btr_create(struct bt_ctf_btr_cbs cbs, void *data,
-               FILE *err_stream);
+struct bt_ctf_btr *bt_ctf_btr_create(struct bt_ctf_btr_cbs cbs, void *data);
 
 /**
  * Destroys a CTF binary type reader, freeing all internal resources.
@@ -351,4 +349,23 @@ size_t bt_ctf_btr_continue(struct bt_ctf_btr *btr,
                const uint8_t *buf, size_t sz,
                enum bt_ctf_btr_status *status);
 
+static inline
+const char *bt_ctf_btr_status_string(enum bt_ctf_btr_status status)
+{
+       switch (status) {
+       case BT_CTF_BTR_STATUS_ENOMEM:
+               return "BT_CTF_BTR_STATUS_ENOMEM";
+       case BT_CTF_BTR_STATUS_EOF:
+               return "BT_CTF_BTR_STATUS_EOF";
+       case BT_CTF_BTR_STATUS_INVAL:
+               return "BT_CTF_BTR_STATUS_INVAL";
+       case BT_CTF_BTR_STATUS_ERROR:
+               return "BT_CTF_BTR_STATUS_ERROR";
+       case BT_CTF_BTR_STATUS_OK:
+               return "BT_CTF_BTR_STATUS_OK";
+       default:
+               return "(unknown)";
+       }
+}
+
 #endif /* CTF_BTR_H */
This page took 0.025367 seconds and 5 git commands to generate.