Lines Matching refs:dst

153 do_hvis(char *dst, int c, int flag, int nextc, const char *extra)
156 *dst++ = '%';
157 *dst++ = xtoa(((unsigned int)c >> 4) & 0xf);
158 *dst++ = xtoa((unsigned int)c & 0xf);
160 dst = do_svis(dst, c, flag, nextc, extra);
162 return dst;
167 * dst: Pointer to the destination buffer
175 do_svis(char *dst, int c, int flag, int nextc, const char *extra)
181 *dst++ = c;
182 return dst;
187 *dst++ = '\\'; *dst++ = 'n';
188 return dst;
190 *dst++ = '\\'; *dst++ = 'r';
191 return dst;
193 *dst++ = '\\'; *dst++ = 'b';
194 return dst;
196 *dst++ = '\\'; *dst++ = 'a';
197 return dst;
199 *dst++ = '\\'; *dst++ = 'v';
200 return dst;
202 *dst++ = '\\'; *dst++ = 't';
203 return dst;
205 *dst++ = '\\'; *dst++ = 'f';
206 return dst;
208 *dst++ = '\\'; *dst++ = 's';
209 return dst;
211 *dst++ = '\\'; *dst++ = '0';
213 *dst++ = '0';
214 *dst++ = '0';
216 return dst;
219 *dst++ = '\\'; *dst++ = c;
220 return dst;
225 *dst++ = '\\';
226 *dst++ = (u_char)(((unsigned int)(u_char)c >> 6) & 03) + '0';
227 *dst++ = (u_char)(((unsigned int)(u_char)c >> 3) & 07) + '0';
228 *dst++ = (u_char)( c & 07) + '0';
230 if ((flag & VIS_NOSLASH) == 0) *dst++ = '\\';
232 c &= 0177; *dst++ = 'M';
235 *dst++ = '^';
237 *dst++ = '?';
239 *dst++ = c + '@';
241 *dst++ = '-'; *dst++ = c;
244 return dst;
253 rk_svis(char *dst, int c, int flag, int nextc, const char *extra)
257 _DIAGASSERT(dst != NULL);
261 *dst = '\0'; /* can't create nextra, return "" */
262 return dst;
265 dst = do_hvis(dst, c, flag, nextc, nextra);
267 dst = do_svis(dst, c, flag, nextc, nextra);
269 *dst = '\0';
270 return dst;
275 * strsvis, strsvisx - visually encode characters from src into dst
283 * expansion. The length of dst, not including the trailing NULL,
286 * Strsvisx encodes exactly len bytes from src into dst.
291 rk_strsvis(char *dst, const char *csrc, int flag, const char *extra)
298 _DIAGASSERT(dst != NULL);
303 *dst = '\0'; /* can't create nextra, return "" */
307 for (start = dst; (c = *src++) != '\0'; /* empty */)
308 dst = do_hvis(dst, c, flag, *src, nextra);
310 for (start = dst; (c = *src++) != '\0'; /* empty */)
311 dst = do_svis(dst, c, flag, *src, nextra);
314 *dst = '\0';
315 return (dst - start);
320 rk_strsvisx(char *dst, const char *csrc, size_t len, int flag, const char *extra)
327 _DIAGASSERT(dst != NULL);
332 *dst = '\0'; /* can't create nextra, return "" */
337 for (start = dst; len > 0; len--) {
339 dst = do_hvis(dst, c, flag, len ? *src : '\0', nextra);
342 for (start = dst; len > 0; len--) {
344 dst = do_svis(dst, c, flag, len ? *src : '\0', nextra);
348 *dst = '\0';
349 return (dst - start);
358 rk_vis(char *dst, int c, int flag, int nextc)
363 _DIAGASSERT(dst != NULL);
367 *dst = '\0'; /* can't create extra, return "" */
368 return dst;
371 dst = do_hvis(dst, uc, flag, nextc, extra);
373 dst = do_svis(dst, uc, flag, nextc, extra);
375 *dst = '\0';
376 return dst;
381 * strvis, strvisx - visually encode characters from src into dst
384 * expansion. The length of dst, not including the trailing NULL,
387 * Strvisx encodes exactly len bytes from src into dst.
391 rk_strvis(char *dst, const char *src, int flag)
398 *dst = '\0'; /* can't create extra, return "" */
401 rv = strsvis(dst, src, flag, extra);
408 rk_strvisx(char *dst, const char *src, size_t len, int flag)
415 *dst = '\0'; /* can't create extra, return "" */
418 rv = strsvisx(dst, src, len, flag, extra);