X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=blobdiff_plain;f=include%2Fbabeltrace%2Fvalues-const.h;h=7aec02782e4f2715c70c11f1b5d487eedf8fe0fb;hp=12e80209a87403d84079d218d78c47fc9638d6ba;hb=40f4ba76dd6f9508ca51b6220eaed57632281a07;hpb=05e2128659970c32648a01255ed870449f05d518 diff --git a/include/babeltrace/values-const.h b/include/babeltrace/values-const.h index 12e80209..7aec0278 100644 --- a/include/babeltrace/values-const.h +++ b/include/babeltrace/values-const.h @@ -30,15 +30,46 @@ /* For bt_bool */ #include -/* For enum bt_value_status, enum bt_value_type */ -#include - #ifdef __cplusplus extern "C" { #endif struct bt_value; +enum bt_value_status { + /// Operation canceled. + BT_VALUE_STATUS_CANCELED = 125, + + /// Cannot allocate memory. + BT_VALUE_STATUS_NOMEM = -12, + + /// Okay, no error. + BT_VALUE_STATUS_OK = 0, +}; + +enum bt_value_type { + /// Null value object. + BT_VALUE_TYPE_NULL = 0, + + /// Boolean value object (holds #BT_TRUE or #BT_FALSE). + BT_VALUE_TYPE_BOOL = 1, + + /// Integer value object (holds a signed 64-bit integer raw value). + BT_VALUE_TYPE_INTEGER = 2, + + /// Floating point number value object (holds a \c double raw value). + BT_VALUE_TYPE_REAL = 3, + + /// String value object. + BT_VALUE_TYPE_STRING = 4, + + /// Array value object. + BT_VALUE_TYPE_ARRAY = 5, + + /// Map value object. + BT_VALUE_TYPE_MAP = 6, +}; + extern enum bt_value_type bt_value_get_type(const struct bt_value *object); static inline @@ -119,12 +150,12 @@ bt_bool bt_value_map_is_empty(const struct bt_value *map_obj) extern const struct bt_value *bt_value_map_borrow_entry_value_const( const struct bt_value *map_obj, const char *key); -typedef bt_bool (* bt_value_map_foreach_entry_const_cb)(const char *key, +typedef bt_bool (* bt_value_map_foreach_entry_const_func)(const char *key, const struct bt_value *object, void *data); extern enum bt_value_status bt_value_map_foreach_entry_const( const struct bt_value *map_obj, - bt_value_map_foreach_entry_const_cb cb, void *data); + bt_value_map_foreach_entry_const_func func, void *data); extern bt_bool bt_value_map_has_entry(const struct bt_value *map_obj, const char *key);