core-util: Add a pa_split_in_place() string utility function

For specialised uses of pa_split() such as finding substrings for
comparison, this avoids the need to repeatedly allocate and deallocate
memory.
This commit is contained in:
Arun Raghavan 2012-06-13 16:31:59 +05:30
parent 51c8d5a477
commit b942af65fe
2 changed files with 24 additions and 0 deletions

View file

@ -100,6 +100,7 @@ static inline const char *pa_strna(const char *x) {
}
char *pa_split(const char *c, const char*delimiters, const char **state);
const char *pa_split_in_place(const char *c, const char*delimiters, int *n, const char **state);
char *pa_split_spaces(const char *c, const char **state);
char *pa_strip_nl(char *s);