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, 25 Jul 2019 19:45:26 +0000 (15:45 -0400)
commit40804255e7a6acd6fa76c41ee8e4e1cc2cefa49c
tree3462f42d025240f5a1cffff6f287ed96b34945d7
parent2912cead42803e75e41157418d264d7b5ff6c69f
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.026836 seconds and 5 git commands to generate.