Lines Matching defs:dst
34 ** string src to dst, nul terminating the result. If size == 0,
35 ** the dst buffer is not modified.
49 ** dst -- destination buffer
58 sm_strlcpy(dst, src, size)
59 register char *dst;
67 for (i = 0; i < size && (dst[i] = src[i]) != 0; i++)
69 dst[i] = '\0';
80 ** If strlen(dst) < size, then append at most size - strlen(dst) - 1
82 ** nul terminating the result. Otherwise, dst is not modified.
84 ** The result is the initial length of dst + the length of src.
94 ** dst -- nul-terminated destination string buffer
100 ** (= initial length of dst + length of src)
104 sm_strlcat(dst, src, size)
105 register char *dst;
111 o = strlen(dst);
115 for (i = 0, j = o; i < size && (dst[j] = src[i]) != 0; i++, j++)
117 dst[j] = '\0';
124 ** SM_STRLCAT2 -- append two strings to dst obeying length and
127 ** strlcat2 will append at most len - strlen(dst) - 1 chars.
129 ** dst = dst "+" src1 "+" src2
130 ** use this instead of sm_strlcat(dst,src1); sm_strlcat(dst,src2);
134 ** dst -- "destination" string.
141 ** (= initial length of dst + length of src)
148 sm_strlcat2(dst, src1, src2, len)
149 register char *dst;
156 /* current size of dst */
157 o = strlen(dst);
163 len -= o + 1; /* space left in dst */
165 /* copy the first string; i: index in src1; j: index in dst */
166 for (i = 0, j = o; i < len && (dst[j] = src1[i]) != 0; i++, j++)
172 /* no: terminate dst; there is space since i < len */
173 dst[j] = '\0';
177 len -= i; /* space left in dst */
179 /* copy the second string; i: index in src2; j: index in dst */
180 for (i = 0; i < len && (dst[j] = src2[i]) != 0; i++, j++)
182 dst[j] = '\0'; /* terminate dst; there is space since i < len */
190 ** SM_STRLCPYN -- concatenate n strings and assign the result to dst
193 ** dst = src1 "+" src2 "+" ...
198 ** dst -- "destination" string.
205 ** (= initial length of dst + length of src)
212 sm_strlcpyn(char *dst, ssize_t len, int n, ...)
214 sm_strlcpyn(dst, len, n, va_alist)
215 register char *dst;
236 j = 0; /* index in dst */
243 /* copy string; i: index in str; j: index in dst */
244 for (i = 0; j < len && (dst[j] = str[i]) != 0; i++, j++)
250 /* no: terminate dst; there is space since j < len */
251 dst[j] = '\0';
261 dst[j] = '\0'; /* terminate dst; there is space since j < len */
270 ** string src to dst, nul terminating the result. If size == 0,
271 ** the dst buffer is not modified.
290 ** dst -- (pointer to) destination buffer
298 ** modifies dst if append succeeds (enough space).
302 sm_strlapp(dst, src, size)
303 register char **dst;
311 for (i = 0; i < size && ((*dst)[i] = src[i]) != '\0'; i++)
313 (*dst)[i] = '\0';
316 *dst += i;
321 (*dst)[0] = '\0';