ucx/string.h

changeset 179
ee25d79a4187
parent 177
11ad03783baf
child 180
2185f19dcc45
equal deleted inserted replaced
178:8c89e454000f 179:ee25d79a4187
117 * @param ... all other strings 117 * @param ... all other strings
118 * @return the cumulated length of all strings 118 * @return the cumulated length of all strings
119 */ 119 */
120 size_t sstrnlen(size_t count, sstr_t string, ...); 120 size_t sstrnlen(size_t count, sstr_t string, ...);
121 121
122
123 /**
124 * Concatenates strings.
125 *
126 * At least one string must be specified and there must be enough memory
127 * available referenced by the destination sstr_t.ptr for this function to
128 * successfully concatenate all specified strings.
129 *
130 * The sstr_t.length of the destination string specifies the capacity and
131 * should match the total memory available referenced by the destination
132 * sstr_t.ptr. This function <i>never</i> copies data beyond the capacity and
133 * does not modify any of the source strings.
134 *
135 * <b>Attention:</b>
136 * <ul>
137 * <li>Any content in the destination string will be overwritten</li>
138 * <li>The destination sstr_t.ptr is <b>NOT</b>
139 * <code>NULL</code>-terminated</li>
140 * <li>The destination sstr_t.length is set to the total length of the
141 * concatenated strings</li>
142 * <li><i>Hint:</i> get a <code>NULL</code>-terminated string by performing
143 * <code>mystring.ptr[mystring.length]='\0'</code> after calling this
144 * function</li>
145 * </ul>
146 *
147 * @param dest new sstr_t with capacity information and allocated memory
148 * @param count the total number of strings to concatenate
149 * @param src the first string
150 * @param ... all other strings
151 * @return the argument for <code>dest</code> is returned
152 */
153 sstr_t sstrncat(sstr_t dest, size_t count, sstr_t src, ...);
154
155
156 /** 122 /**
157 * Returns a substring starting at the specified location. 123 * Returns a substring starting at the specified location.
158 * 124 *
159 * <b>Attention:</b> the new string references the same memory area as the 125 * <b>Attention:</b> the new string references the same memory area as the
160 * input string and will <b>NOT</b> be <code>NULL</code>-terminated. 126 * input string and will <b>NOT</b> be <code>NULL</code>-terminated.

mercurial