Move to kernel style SPDX license identifiers
[babeltrace.git] / src / plugins / ctf / common / metadata / decoder.h
index f67548998751998555a92795e98c78f5bc06055d..58fccc016f39ffccc9c765bda4ae13f5261d7115 100644 (file)
@@ -1,20 +1,12 @@
-#ifndef _METADATA_DECODER_H
-#define _METADATA_DECODER_H
-
 /*
- * Copyright 2016-2017 - Philippe Proulx <pproulx@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:
+ * SPDX-License-Identifier: MIT
  *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
+ * Copyright 2016-2017 Philippe Proulx <pproulx@efficios.com>
  */
 
+#ifndef _METADATA_DECODER_H
+#define _METADATA_DECODER_H
+
 #include <stdint.h>
 #include <stdbool.h>
 
@@ -31,6 +23,7 @@ struct ctf_metadata_decoder;
 /* CTF metadata decoder status */
 enum ctf_metadata_decoder_status {
        CTF_METADATA_DECODER_STATUS_OK                  = 0,
+       CTF_METADATA_DECODER_STATUS_NONE                = 1,
        CTF_METADATA_DECODER_STATUS_ERROR               = -1,
        CTF_METADATA_DECODER_STATUS_INCOMPLETE          = -2,
        CTF_METADATA_DECODER_STATUS_INVAL_VERSION       = -3,
@@ -48,6 +41,7 @@ struct ctf_metadata_decoder_config {
        /* Additional clock class offset to apply */
        int64_t clock_class_offset_s;
        int64_t clock_class_offset_ns;
+       bool force_clock_class_origin_unix_epoch;
 
        /* True to create trace class objects */
        bool create_trace_class;
@@ -148,12 +142,23 @@ int ctf_metadata_decoder_get_byte_order(struct ctf_metadata_decoder *mdec);
 /*
  * Returns the UUID of the decoder's metadata stream as set by the last
  * call to ctf_metadata_decoder_append_content().
+ */
+BT_HIDDEN
+int ctf_metadata_decoder_get_uuid(
+               struct ctf_metadata_decoder *mdec, bt_uuid_t uuid);
+
+/*
+ * Returns the UUID of the decoder's trace class, if available.
  *
- * Returns -1 if unknown (plain text content).
+ * Returns:
+ *
+ * * `CTF_METADATA_DECODER_STATUS_OK`: success.
+ * * `CTF_METADATA_DECODER_STATUS_NONE`: no UUID.
+ * * `CTF_METADATA_DECODER_STATUS_INCOMPLETE`: missing metadata content.
  */
 BT_HIDDEN
-int ctf_metadata_decoder_get_uuid(struct ctf_metadata_decoder *mdec,
-               bt_uuid_t uuid);
+enum ctf_metadata_decoder_status ctf_metadata_decoder_get_trace_class_uuid(
+               struct ctf_metadata_decoder *mdec, bt_uuid_t uuid);
 
 /*
  * Returns the metadata decoder's current metadata text.
This page took 0.024085 seconds and 4 git commands to generate.