Lines Matching defs:fmt

115 	char *format, *fmt, *start;
154 fmt = format = *argv;
155 escape(fmt, 1, &len); /* backslash interpretation */
165 start = fmt;
166 while (fmt < format + len) {
167 if (fmt[0] == '%') {
168 fwrite(start, 1, fmt - start, stdout);
169 if (fmt[1] == '%') {
172 fmt += 2;
174 fmt = printf_doformat(fmt, &rval);
175 if (fmt == NULL || fmt == end_fmt) {
179 return (fmt == NULL ? 1 : rval);
183 start = fmt;
185 fmt++;
198 fwrite(start, 1, fmt - start, stdout);
206 fmt = format;
214 printf_doformat(char *fmt, int *rval)
219 char start[strlen(fmt) + 1];
228 fmt++;
231 l = strspn(fmt, digits);
232 if ((l > 0) && (fmt[l] == '$')) {
233 int idx = atoi(fmt);
241 fmt += l + 1;
250 while (*fmt && strchr(skip1, *fmt) != NULL) {
251 *dptr++ = *fmt++;
255 if (*fmt == '*') {
257 fmt++;
258 l = strspn(fmt, digits);
259 if ((l > 0) && (fmt[l] == '$')) {
260 int idx = atoi(fmt);
270 fmt += l + 1;
288 while (isdigit(*fmt)) {
289 *dptr++ = *fmt++;
294 if (*fmt == '.') {
296 fmt++;
299 if (*fmt == '*') {
301 fmt++;
302 l = strspn(fmt, digits);
303 if ((l > 0) && (fmt[l] == '$')) {
304 int idx = atoi(fmt);
314 fmt += l + 1;
331 while (isdigit(*fmt)) {
332 *dptr++ = *fmt++;
338 if (!*fmt) {
342 *dptr++ = *fmt;
355 if (*fmt == 'L') {
357 fmt++;
358 if (!strchr("aAeEfFgG", *fmt)) {
359 warnx("bad modifier L for %%%c", *fmt);
371 convch = *fmt;
372 nextch = *++fmt;
374 *fmt = '\0';
442 *fmt = nextch;
444 return (fmt);
474 escape(char *fmt, int percent, size_t *len)
479 for (save = store = fmt; ((c = *fmt) != 0); ++fmt, ++store) {
484 switch (*++fmt) {
492 *store = *fmt;
526 c = (!percent && *fmt == '0') ? 4 : 3;
528 c-- && *fmt >= '0' && *fmt <= '7'; ++fmt) {
530 value += *fmt - '0';
532 --fmt;
540 *store = *fmt;