assert-pre-internal.h: add BT_ASSERT_PRE_VALID_INDEX()
[babeltrace.git] / include / babeltrace / ctf-ir / utils.h
index de4a07ef635c4adc356ad31f639a6346f9b03046..c93b0d8442c8b2fdef4a799a5facc516e389f3d5 100644 (file)
  * http://www.efficios.com/ctf
  */
 
+/* For bt_bool */
+#include <babeltrace/types.h>
+
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-#include <babeltrace/babeltrace-internal.h>
-#include <babeltrace/objects.h>
-
-/*
- * bt_ctf_validate_identifier: validate an identifier against the CTF spec.
- *
- * Validate that an identifier meets the CTF specification's restrictions on
- * identifiers. An identifier will be rejected if it is a keyword defined
- * in the CTF specification or if it does not meet any other requirement imposed
- * on identifiers.
- *
- * Note that this will not check whether or not the identifier clashes with
- * identifiers used in a given trace.
- *
- * Returns 0 if the identifier is valid, a negative value on error.
- */
-extern int bt_ctf_validate_identifier(const char *identifier);
+/**
+@defgroup ctfirutils CTF IR utilities
+@ingroup ctfir
+@brief CTF IR utilities.
 
-BT_HIDDEN
-struct bt_object *bt_ctf_attributes_create(void);
+@code
+#include <babeltrace/ctf-ir/utils.h>
+@endcode
 
-BT_HIDDEN
-void bt_ctf_attributes_destroy(struct bt_object *attr_obj);
+@file
+@brief CTF IR utilities functions.
+@sa ctfirutils
 
-BT_HIDDEN
-int bt_ctf_attributes_get_count(struct bt_object *attr_obj);
+@addtogroup ctfirutils
+@{
+*/
 
-BT_HIDDEN
-const char *bt_ctf_attributes_get_field_name(struct bt_object *attr_obj,
-               int index);
+/**
+@brief Returns whether or not the string \p identifier is a valid
+       identifier according to CTF.
 
-BT_HIDDEN
-struct bt_object *bt_ctf_attributes_get_field_value(struct bt_object *attr_obj,
-               int index);
+This function returns a negative value if \p identifier is a CTF keyword
+or if it does not meet any other imposed requirement.
 
-BT_HIDDEN
-int bt_ctf_attributes_set_field_value(struct bt_object *attr_obj,
-               const char *name, struct bt_object *value_obj);
+@param[in] identifier  String to test.
+@returns               #BT_TRUE if \p identifier is a valid CTF
+                       identifier, or #BT_FALSE otherwise.
 
-BT_HIDDEN
-struct bt_object *bt_ctf_attributes_get_field_value_by_name(
-               struct bt_object *attr_obj, const char *name);
+@prenotnull{identifier}
+*/
+extern bt_bool bt_identifier_is_valid(const char *identifier);
 
-BT_HIDDEN
-int bt_ctf_attributes_freeze(struct bt_object *attr_obj);
+/** @} */
 
 #ifdef __cplusplus
 }
This page took 0.025293 seconds and 4 git commands to generate.