mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-11-26 06:53:37 +00:00
Backport from xs.
This commit is contained in:
parent
061291cabf
commit
d2eae2b369
2 changed files with 14 additions and 1 deletions
13
xs.h
13
xs.h
|
@ -64,6 +64,7 @@ d_char *xs_crop(d_char *str, int start, int end);
|
||||||
d_char *xs_strip_chars(d_char *str, const char *chars);
|
d_char *xs_strip_chars(d_char *str, const char *chars);
|
||||||
#define xs_strip(str) xs_strip_chars(str, " \r\n\t\v\f")
|
#define xs_strip(str) xs_strip_chars(str, " \r\n\t\v\f")
|
||||||
d_char *xs_tolower(d_char *str);
|
d_char *xs_tolower(d_char *str);
|
||||||
|
d_char *xs_str_prepend(d_char *str, const char *prefix);
|
||||||
d_char *xs_list_new(void);
|
d_char *xs_list_new(void);
|
||||||
d_char *xs_list_append_m(d_char *list, const char *mem, int dsz);
|
d_char *xs_list_append_m(d_char *list, const char *mem, int dsz);
|
||||||
#define xs_list_append(list, data) xs_list_append_m(list, data, xs_size(data))
|
#define xs_list_append(list, data) xs_list_append_m(list, data, xs_size(data))
|
||||||
|
@ -489,6 +490,18 @@ d_char *xs_tolower(d_char *str)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
d_char *xs_str_prepend(d_char *str, const char *prefix)
|
||||||
|
/* prepends prefix into string */
|
||||||
|
{
|
||||||
|
int sz = strlen(prefix);
|
||||||
|
|
||||||
|
str = xs_expand(str, 0, sz);
|
||||||
|
memcpy(str, prefix, sz);
|
||||||
|
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/** lists **/
|
/** lists **/
|
||||||
|
|
||||||
d_char *xs_list_new(void)
|
d_char *xs_list_new(void)
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
/* e8f087f6b185939256227ea21b69f5f16f25a2dd */
|
/* 38b055a19829fb788f1bb6917f76cc4830388e35 */
|
||||||
|
|
Loading…
Reference in a new issue