diff options
Diffstat (limited to 'include/stringop.h')
-rw-r--r-- | include/stringop.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/include/stringop.h b/include/stringop.h index 7d17af95..dde50f13 100644 --- a/include/stringop.h +++ b/include/stringop.h @@ -2,17 +2,25 @@ #define _SWAY_STRINGOP_H #include "list.h" -char *strip_whitespace(char *str, int *trimmed_start); +// array of whitespace characters to use for delims +extern const char *whitespace; + +char *strip_whitespace(char *str); char *strip_comments(char *str); -// Must be freed with free_flat_list +// Simply split a string with delims, free with `free_flat_list` list_t *split_string(const char *str, const char *delims); void free_flat_list(list_t *list); +// Splits an argument string, keeping quotes intact +char **split_args(const char *str, int *argc); +void free_argv(int argc, char **argv); + char *code_strchr(const char *string, char delimiter); char *code_strstr(const char *haystack, const char *needle); int unescape_string(char *string); char *join_args(char **argv, int argc); char *join_list(list_t *list, char *separator); +char *strdup(const char *); #endif |