diff options
author | mrb0nk500 <b0nk@b0nk.xyz> | 2022-07-27 15:35:15 -0300 |
---|---|---|
committer | mrb0nk500 <b0nk@b0nk.xyz> | 2022-07-27 15:35:15 -0300 |
commit | a459d34d124a2993a313d29cf8b84a5d0df42e87 (patch) | |
tree | 155f8240e26e8410f606b99fe12d1a18b3adaf83 /misc.h | |
parent | e6e2b766afa7d92ef38b356a745a47b2047bba07 (diff) |
misc: Add `find_delm()`, and `get_str_delm_range()`
`find_delm()` finds the first matched delimiter of the supplied
delimiter(s), and either returns the pointer to the first non-delimiter
character after the match, or the match itself if `skip_delm` is true,
or false respectivly.
`get_str_delm_range()` finds, and returns the string in between the
supplied starting, and ending delimiter(s). It also returns the pointer
to the first non-delimiter character after the end of the range in
`rhs`.
Diffstat (limited to 'misc.h')
-rw-r--r-- | misc.h | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -2,6 +2,8 @@ #define MISC_H extern char *read_file(const char *filename, long *size); +extern char *find_delm(char *str, const char *delm, int skip_delm); +extern char *get_str_delm_range(char *str, const char *start_delm, const char *end_delm, char **rhs); extern char *get_line(char **str); extern char *make_str(const char *str); extern char *dir_path_num(const char *root, int num); |