Values API: standardize parameters and return values
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Mon, 19 Nov 2018 19:50:47 +0000 (14:50 -0500)
committerFrancis Deslauriers <francis.deslauriers@efficios.com>
Thu, 2 May 2019 20:50:15 +0000 (20:50 +0000)
commit601b0d3c9a6bf91274d0f01ccdec7fecfe3ed310
treef42ee14e58af798c031f7cc0448805db5cf850a4
parentda91b29ad2964b85601e25843f1dca92f6c97406
Values API: standardize parameters and return values

Changes:

* Remove `BT_VALUE_STATUS_ERROR`: the only possible error in this API is
  `BT_VALUE_STATUS_NOMEM`.

* `BT_VALUE_STATUS_CANCELED` is not considered an error: the loop did
  not finish, but it was explicitly canceled by the user.

* bt_value_copy(): return by parameter (first one, like strcpy()), and
  return status.

* bt_value_bool_get(), bt_value_integer_get(), bt_value_real_get(), and
  bt_value_string_get(): return value directly. Those functions cannot
  fail.

* bt_value_array_get_size() and bt_value_map_get_size(): return
  `uint64_t`.

* bt_value_array_is_empty() and bt_value_map_is_empty(): make them
  `static inline`.

* bt_value_map_extend(): return by parameter (like bt_value_copy()), and
  return status.

* bt_private_value_bool_set(), bt_private_value_integer_set(), and
  bt_private_value_real_set(): return `void`. Those functions cannot
  fail.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
28 files changed:
cli/babeltrace-cfg-cli-args-connect.c
cli/babeltrace-cfg-cli-args.c
cli/babeltrace-cfg.c
cli/babeltrace-cfg.h
cli/babeltrace.c
include/babeltrace/private-values.h
include/babeltrace/values.h
lib/ctf-writer/attributes.c
lib/ctf-writer/trace.c
lib/lib-logging.c
lib/trace-ir/attributes.c
lib/values.c
plugins/ctf/fs-sink/writer.c
plugins/ctf/fs-src/fs.c
plugins/ctf/fs-src/query.c
plugins/ctf/lttng-live/lttng-live.c
plugins/ctf/lttng-live/viewer-connection.c
plugins/lttng-utils/copy.c
plugins/lttng-utils/plugin.c
plugins/text/dmesg/dmesg.c
plugins/text/pretty/pretty.c
plugins/text/pretty/print.c
plugins/utils/counter/counter.c
plugins/utils/muxer/muxer.c
plugins/utils/trimmer/trimmer.c
tests/lib/test_bt_values.c
tests/lib/test_ctf_writer.c
tests/lib/test_plugin.c
This page took 0.032181 seconds and 4 git commands to generate.