Lines Matching refs:fmt

96 	char *format, *fmt, *start;  in main()  local
126 fmt = format = *argv; in main()
127 (void) escape(fmt, 1, &len); /* backslash interpretation */ in main()
137 start = fmt; in main()
138 while (fmt < format + len) { in main()
139 if (fmt[0] == '%') { in main()
140 (void) fwrite(start, 1, PTRDIFF(fmt, start), in main()
142 if (fmt[1] == '%') { in main()
145 fmt += 2; in main()
147 fmt = doformat(fmt, &rval); in main()
148 if (fmt == NULL) in main()
152 start = fmt; in main()
154 fmt++; in main()
164 (void) fwrite(start, 1, PTRDIFF(fmt, start), stdout); in main()
168 fmt = format; in main()
176 doformat(char *fmt, int *rval) in doformat() argument
186 start = alloca(strlen(fmt) + 1); in doformat()
192 fmt++; in doformat()
195 l = strspn(fmt, digits); in doformat()
196 if ((l > 0) && (fmt[l] == '$')) { in doformat()
197 int idx = atoi(fmt); in doformat()
206 fmt += l + 1; in doformat()
215 while (*fmt && strchr(skip1, *fmt) != NULL) { in doformat()
216 *dptr++ = *fmt++; in doformat()
221 if (*fmt == '*') { in doformat()
223 fmt++; in doformat()
224 l = strspn(fmt, digits); in doformat()
225 if ((l > 0) && (fmt[l] == '$')) { in doformat()
226 int idx = atoi(fmt); in doformat()
236 fmt += l + 1; in doformat()
255 while (isdigit(*fmt)) { in doformat()
256 *dptr++ = *fmt++; in doformat()
261 if (*fmt == '.') { in doformat()
263 fmt++; in doformat()
266 if (*fmt == '*') { in doformat()
268 fmt++; in doformat()
269 l = strspn(fmt, digits); in doformat()
270 if ((l > 0) && (fmt[l] == '$')) { in doformat()
271 int idx = atoi(fmt); in doformat()
282 fmt += l + 1; in doformat()
300 while (isdigit(*fmt)) { in doformat()
301 *dptr++ = *fmt++; in doformat()
307 if (!*fmt) { in doformat()
311 *dptr++ = *fmt; in doformat()
324 if (*fmt == 'L') { in doformat()
326 fmt++; in doformat()
327 if (!strchr("aAeEfFgG", *fmt)) { in doformat()
328 warnx2(_("bad modifier L for %%%c"), *fmt, NULL); in doformat()
340 convch = *fmt; in doformat()
341 nextch = *++fmt; in doformat()
343 *fmt = '\0'; in doformat()
412 *fmt = nextch; in doformat()
415 return (fmt); in doformat()
445 escape(char *fmt, int percent, size_t *len) in escape() argument
450 for (save = store = fmt; ((c = *fmt) != 0); ++fmt, ++store) { in escape()
455 switch (*++fmt) { in escape()
463 *store = *fmt; in escape()
497 c = (!percent && *fmt == '0') ? 4 : 3; in escape()
499 c-- && *fmt >= '0' && *fmt <= '7'; ++fmt) { in escape()
501 value += *fmt - '0'; in escape()
503 --fmt; in escape()
511 *store = *fmt; in escape()