Lines Matching refs:dst

36 **	string src to dst, nul terminating the result.  If size == 0,
37 ** the dst buffer is not modified.
51 ** dst -- destination buffer
60 sm_strlcpy(dst, src, size)
61 register char *dst;
69 for (i = 0; i < size && (dst[i] = src[i]) != 0; i++)
71 dst[i] = '\0';
82 ** If strlen(dst) < size, then append at most size - strlen(dst) - 1
84 ** nul terminating the result. Otherwise, dst is not modified.
86 ** The result is the initial length of dst + the length of src.
96 ** dst -- nul-terminated destination string buffer
102 ** (= initial length of dst + length of src)
106 sm_strlcat(dst, src, size)
107 register char *dst;
113 o = strlen(dst);
117 for (i = 0, j = o; i < size && (dst[j] = src[i]) != 0; i++, j++)
119 dst[j] = '\0';
126 ** SM_STRLCAT2 -- append two strings to dst obeying length and
129 ** strlcat2 will append at most len - strlen(dst) - 1 chars.
131 ** dst = dst "+" src1 "+" src2
132 ** use this instead of sm_strlcat(dst,src1); sm_strlcat(dst,src2);
136 ** dst -- "destination" string.
143 ** (= initial length of dst + length of src)
150 sm_strlcat2(dst, src1, src2, len)
151 register char *dst;
158 /* current size of dst */
159 o = strlen(dst);
165 len -= o + 1; /* space left in dst */
167 /* copy the first string; i: index in src1; j: index in dst */
168 for (i = 0, j = o; i < len && (dst[j] = src1[i]) != 0; i++, j++)
174 /* no: terminate dst; there is space since i < len */
175 dst[j] = '\0';
179 len -= i; /* space left in dst */
181 /* copy the second string; i: index in src2; j: index in dst */
182 for (i = 0; i < len && (dst[j] = src2[i]) != 0; i++, j++)
184 dst[j] = '\0'; /* terminate dst; there is space since i < len */
192 ** SM_STRLCPYN -- concatenate n strings and assign the result to dst
195 ** dst = src1 "+" src2 "+" ...
200 ** dst -- "destination" string.
207 ** (= initial length of dst + length of src)
214 sm_strlcpyn(char *dst, ssize_t len, int n, ...)
216 sm_strlcpyn(dst, len, n, va_alist)
217 register char *dst;
238 j = 0; /* index in dst */
245 /* copy string; i: index in str; j: index in dst */
246 for (i = 0; j < len && (dst[j] = str[i]) != 0; i++, j++)
252 /* no: terminate dst; there is space since j < len */
253 dst[j] = '\0';
263 dst[j] = '\0'; /* terminate dst; there is space since j < len */
272 ** string src to dst, nul terminating the result. If size == 0,
273 ** the dst buffer is not modified.
292 ** dst -- (pointer to) destination buffer
300 ** modifies dst if append succeeds (enough space).
304 sm_strlapp(dst, src, size)
305 register char **dst;
313 for (i = 0; i < size && ((*dst)[i] = src[i]) != '\0'; i++)
315 (*dst)[i] = '\0';
318 *dst += i;
323 (*dst)[0] = '\0';