Values API: standardize parameters and return values
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Mon, 19 Nov 2018 19:50:47 +0000 (14:50 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 3 May 2019 22:19:35 +0000 (18:19 -0400)
commitb5cdc10665e0b8105ceb39d2b5549312702077b7
tree74f272bad675f3f904ceda31ca689df67ab4a1fd
parent17582c6d9f98ff5ce853169cec4f701da29164c4
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.027407 seconds and 4 git commands to generate.