-#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>
/* 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,
/* 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;
/*
* 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.