Export utils_stream_file_path outside of common/utils.c
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 10 May 2019 16:41:26 +0000 (12:41 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 5 Sep 2019 20:39:13 +0000 (16:39 -0400)
commit38bdfdcae87a663009ef0fe7c8e43b672cddb618
tree2d207bc5282aa6b0de4d50553475d12cdb55d669
parenta4ee1b7e15b25e449c62a929e35850b2916f54cc
Export utils_stream_file_path outside of common/utils.c

utils_stream_file_name is used by the stream file creation and
unlinking utilities. Those utilities perform actions that
will be performed on a trace chunk in a future commit.

Making this util public allows the reuse of most of the code
of the utilities.

The function is renamed from utils_stream_file_name to
utils_stream_file_path since it returns a path and not a
name.

The function's output parameter is moved to the end of the argument
list to honor the convention used in most of the code base. A length
parameter is added rather than relying on an implicit assumption
that the buffer's length is >= PATH_MAX.

The existing callers' buffer size is changed from PATH_MAX to
the preferred LTTNG_PATH_MAX.

The implementation of the function has been reworked to eliminate
a number of unncessary copies and allocations. It is now simpler,
handles path truncations, and does not duplicate the path separator
if it is already contained in `path_name`.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/common/string-utils/Makefile.am
src/common/string-utils/format.h [new file with mode: 0644]
src/common/utils.c
src/common/utils.h
This page took 0.025513 seconds and 4 git commands to generate.