ucx/string.h

changeset 67
27e67e725d35
parent 47
22fb97e9f58a
child 68
88dbea299440
equal deleted inserted replaced
66:fcfe8c5e9fe1 67:27e67e725d35
44 * 44 *
45 * n number of strings 45 * n number of strings
46 * s string 46 * s string
47 * ... strings 47 * ... strings
48 */ 48 */
49 size_t sstrnlen (size_t n, sstr_t s, ...); 49 size_t sstrnlen (size_t n, const sstr_t s, ...);
50 50
51 51
52 /* 52 /*
53 * concatenates n strings 53 * concatenates n strings
54 * 54 *
55 * n number of strings 55 * n number of strings
56 * s new string with enough memory allocated 56 * s new string with enough memory allocated
57 * ... strings 57 * ... strings
58 */ 58 */
59 sstr_t sstrncat (size_t n, sstr_t s, sstr_t c1, ...); 59 sstr_t sstrncat (size_t n, sstr_t s, const sstr_t c1, ...);
60 60
61 61
62 /* 62 /*
63 * 63 *
64 */ 64 */
65 sstr_t sstrsubs (sstr_t s, size_t start); 65 sstr_t sstrsubs (const sstr_t s, size_t start);
66 66
67 /* 67 /*
68 * 68 *
69 */ 69 */
70 sstr_t sstrsubsl (sstr_t s, size_t start, size_t length); 70 sstr_t sstrsubsl (const sstr_t s, size_t start, size_t length);
71 71
72 /* 72 /*
73 * splits s into n parts 73 * splits s into n parts
74 * 74 *
75 * s the string to split 75 * s the string to split
83 * Returns a list of the split strings 83 * Returns a list of the split strings
84 * NOTE: this list needs to be freed manually after usage 84 * NOTE: this list needs to be freed manually after usage
85 * 85 *
86 * Returns NULL on error 86 * Returns NULL on error
87 */ 87 */
88 sstr_t* sstrsplit(sstr_t s, sstr_t d, size_t *n); 88 sstr_t* sstrsplit(const sstr_t s, const sstr_t d, size_t *n);
89 89
90 int sstrcmp(sstr_t s1, sstr_t s2); 90 int sstrcmp(const sstr_t s1, const sstr_t s2);
91 91
92 sstr_t sstrdup(sstr_t s); 92 sstr_t sstrdup(const sstr_t s);
93 93
94 #ifdef __cplusplus 94 #ifdef __cplusplus
95 } 95 }
96 #endif 96 #endif
97 97

mercurial