src/server/ucx/string.h

changeset 88
73b3485e96f1
parent 71
069c152f6272
equal deleted inserted replaced
87:bdec069d2239 88:73b3485e96f1
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 "mempool.h" 34 #include "mempool.h"
34 #include "../public/nsapi.h" 35 #include "../public/nsapi.h"
35 #include <stddef.h> 36 #include <stddef.h>
36 37
37 /* use macros for literals only */ 38 /* use macros for literals only */
92 * 93 *
93 */ 94 */
94 sstr_t sstrsubsl(sstr_t s, size_t start, size_t length); 95 sstr_t sstrsubsl(sstr_t s, size_t start, size_t length);
95 96
96 /* 97 /*
98 *
99 */
100 sstr_t sstrchr(sstr_t s, int c);
101
102 /*
97 * splits s into n parts 103 * splits s into n parts
98 * 104 *
99 * s the string to split 105 * s the string to split
100 * d the delimiter string 106 * d the delimiter string
101 * n the maximum size of the resulting list 107 * n the maximum size of the resulting list
112 sstr_t* sstrsplit(sstr_t s, sstr_t d, size_t *n); 118 sstr_t* sstrsplit(sstr_t s, sstr_t d, size_t *n);
113 119
114 int sstrcmp(sstr_t s1, sstr_t s2); 120 int sstrcmp(sstr_t s1, sstr_t s2);
115 121
116 sstr_t sstrdup(sstr_t s); 122 sstr_t sstrdup(sstr_t s);
123 sstr_t sstrdup_alloc(UcxAllocator *allocator, sstr_t s);
117 124
118 sstr_t sstrtrim(sstr_t string); 125 sstr_t sstrtrim(sstr_t string);
119 126
120 // webserver extension 127 // webserver extension
121 int sstr_startswith(sstr_t string, sstr_t cmp); 128 int sstr_startswith(sstr_t string, sstr_t cmp);
122 sstr_t sstrdup_mp(UcxMempool *pool, sstr_t s); 129 sstr_t sstrdup_mp(UcxMempool *pool, sstr_t s);
123 sstr_t sstrdup_pool(pool_handle_t *pool, sstr_t s); 130 sstr_t sstrdup_pool(pool_handle_t *pool, sstr_t s);
124 131
125 #ifdef __cplusplus 132 #ifdef __cplusplus
126 } 133 }
127 #endif 134 #endif
128 135

mercurial