X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=include%2Fbabeltrace%2Fvalues-const.h;h=f78915b7b8fecf4a0e64b113abf52e9ceed3cc98;hb=35294e839bb0dd4287b520e68a5ef0362d62092c;hp=12e80209a87403d84079d218d78c47fc9638d6ba;hpb=05e2128659970c32648a01255ed870449f05d518;p=babeltrace.git diff --git a/include/babeltrace/values-const.h b/include/babeltrace/values-const.h index 12e80209..f78915b7 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,20 +150,20 @@ 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); extern enum bt_value_status bt_value_map_extend( - struct bt_value **extended_map_obj, const struct bt_value *base_map_obj, - const struct bt_value *extension_map_obj); + const struct bt_value *extension_map_obj, + struct bt_value **extended_map_obj); #ifdef __cplusplus }