* http://www.efficios.com/ctf
*/
+#include <babeltrace/types.h>
+
#ifdef __cplusplus
extern "C" {
#endif
or if it does not meet any other imposed requirement.
@param[in] identifier String to test.
-@returns 0 if \p identifier is a valid identifier, or
- a negative value otherwise or on error.
+@returns #BT_TRUE if \p identifier is a valid CTF
+ identifier, or #BT_FALSE otherwise.
@prenotnull{identifier}
*/
-extern int bt_ctf_validate_identifier(const char *identifier);
+extern bt_bool bt_ctf_identifier_is_valid(const char *identifier);
/** @} */
+/* Pre-2.0 CTF writer compatibility */
+extern int bt_ctf_validate_identifier(const char *identifier);
+
#ifdef __cplusplus
}
#endif
#include <string.h>
#include <stdlib.h>
#include <glib.h>
+#include <babeltrace/ctf-ir/utils.h>
static
const char * const reserved_keywords_str[] = {"align", "callsite",
free(string);
return ret;
}
+
+bt_bool bt_ctf_identifier_is_valid(const char *identifier)
+{
+ return bt_ctf_validate_identifier(identifier);
+}