108:d2b1e67b2b48 | 109:75cb6590358b |
---|---|
28 | 28 |
29 #ifndef _SSTRING_H | 29 #ifndef _SSTRING_H |
30 #define _SSTRING_H | 30 #define _SSTRING_H |
31 | 31 |
32 #include "ucx.h" | 32 #include "ucx.h" |
33 #include "allocator.h" | |
33 #include <stddef.h> | 34 #include <stddef.h> |
34 | 35 |
35 /* use macros for literals only */ | 36 /* use macros for literals only */ |
36 #define S(s) { (char*)s, sizeof(s)-1 } | 37 #define S(s) { (char*)s, sizeof(s)-1 } |
37 #define ST(s) sstrn((char*)s, sizeof(s)-1) | 38 #define ST(s) sstrn((char*)s, sizeof(s)-1) |
115 sstr_t* sstrsplit(sstr_t s, sstr_t d, size_t *n); | 116 sstr_t* sstrsplit(sstr_t s, sstr_t d, size_t *n); |
116 | 117 |
117 int sstrcmp(sstr_t s1, sstr_t s2); | 118 int sstrcmp(sstr_t s1, sstr_t s2); |
118 | 119 |
119 sstr_t sstrdup(sstr_t s); | 120 sstr_t sstrdup(sstr_t s); |
121 sstr_t sstrdup_alloc(UcxAllocator *allocator, sstr_t s); | |
120 | 122 |
121 sstr_t sstrtrim(sstr_t string); | 123 sstr_t sstrtrim(sstr_t string); |
122 | 124 |
123 #ifdef __cplusplus | 125 #ifdef __cplusplus |
124 } | 126 } |