• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /freebsd-13-stable/usr.bin/printf/

Lines Matching defs:fmt

113 	char *format, *fmt, *start;
152 fmt = format = *argv;
153 escape(fmt, 1, &len); /* backslash interpretation */
163 start = fmt;
164 while (fmt < format + len) {
165 if (fmt[0] == '%') {
166 fwrite(start, 1, fmt - start, stdout);
167 if (fmt[1] == '%') {
170 fmt += 2;
172 fmt = printf_doformat(fmt, &rval);
173 if (fmt == NULL || fmt == end_fmt) {
177 return (fmt == NULL ? 1 : rval);
181 start = fmt;
183 fmt++;
196 fwrite(start, 1, fmt - start, stdout);
204 fmt = format;
212 printf_doformat(char *fmt, int *rval)
217 char start[strlen(fmt) + 1];
226 fmt++;
229 l = strspn(fmt, digits);
230 if ((l > 0) && (fmt[l] == '$')) {
231 int idx = atoi(fmt);
239 fmt += l + 1;
248 while (*fmt && strchr(skip1, *fmt) != NULL) {
249 *dptr++ = *fmt++;
253 if (*fmt == '*') {
255 fmt++;
256 l = strspn(fmt, digits);
257 if ((l > 0) && (fmt[l] == '$')) {
258 int idx = atoi(fmt);
268 fmt += l + 1;
286 while (isdigit(*fmt)) {
287 *dptr++ = *fmt++;
292 if (*fmt == '.') {
294 fmt++;
297 if (*fmt == '*') {
299 fmt++;
300 l = strspn(fmt, digits);
301 if ((l > 0) && (fmt[l] == '$')) {
302 int idx = atoi(fmt);
312 fmt += l + 1;
329 while (isdigit(*fmt)) {
330 *dptr++ = *fmt++;
336 if (!*fmt) {
340 *dptr++ = *fmt;
353 if (*fmt == 'L') {
355 fmt++;
356 if (!strchr("aAeEfFgG", *fmt)) {
357 warnx("bad modifier L for %%%c", *fmt);
369 convch = *fmt;
370 nextch = *++fmt;
372 *fmt = '\0';
444 *fmt = nextch;
446 return (fmt);
476 escape(char *fmt, int percent, size_t *len)
481 for (save = store = fmt; ((c = *fmt) != 0); ++fmt, ++store) {
486 switch (*++fmt) {
494 *store = *fmt;
528 c = (!percent && *fmt == '0') ? 4 : 3;
530 c-- && *fmt >= '0' && *fmt <= '7'; ++fmt) {
532 value += *fmt - '0';
534 --fmt;
542 *store = *fmt;