bootstrap/include/string_utils.h

27 lines
595 B
C
Raw Normal View History

/**
@file
2023-11-25 22:29:35 +00:00
@brief String-related utility functions.
*/
2023-11-25 22:29:35 +00:00
#ifndef _BOOTSTRAP_STRING_UTILS_H
#define _BOOTSTRAP_STRING_UTILS_H
#include <stdlib.h>
/**
@brief Concatenate the list of segments into a Unix-style path.
This function assumes a forward slash path separator (i.e. `/`).
@param n
The number of segments to join together.
@param segments
The path components to join together.
@return
The concatenation of the path components via `/`. The caller takes ownership
of this value.
*/
2023-11-25 22:29:35 +00:00
char *join(size_t n, const char *segments[static n], char sep);
2023-11-25 22:29:35 +00:00
#endif /* _BOOTSTRAP_STRING_UTILS_H */