• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/ap/gpl/timemachine/gettext-0.17/gettext-tools/src/

Lines Matching defs:format

1 /* C format strings.
25 #include "format.h"
29 #include "format-invalid.h"
34 /* C format strings are described in POSIX (IEEE P1003.1 2001), section
59 is an ISO C 99 section 7.8.1 format directive.
63 from the first to the (N-1)th, are specified in the format string.
181 xasprintf (_("In the directive number %u, the token after '<' is not the name of a format specifier macro. The valid macro names are listed in ISO C 99 section 7.8.1."), directive_number)
184 format_parse (const char *format, bool translated, bool objc_extensions,
187 const char *const format_start = format;
203 for (; *format != '\0';)
204 if (*format++ == '%')
211 FDI_SET (format - 1, FMTDIR_START);
214 if (isdigit (*format))
216 const char *f = format;
235 format = ++f;
242 if (*format == ' ' || *format == '+' || *format == '-'
243 || *format == '#' || *format == '0' || *format == '\'')
244 format++;
245 else if (translated && *format == 'I')
252 spec.sysdep_directives[2 * spec.sysdep_directives_count] = format;
253 spec.sysdep_directives[2 * spec.sysdep_directives_count + 1] = format + 1;
255 format++;
262 if (*format == '*')
266 format++;
268 if (isdigit (*format))
270 const char *f = format;
290 format = ++f;
302 FDI_SET (format - 1, FMTDIR_ERROR);
323 FDI_SET (format - 1, FMTDIR_ERROR);
336 else if (isdigit (*format))
338 do format++; while (isdigit (*format));
342 if (*format == '.')
344 format++;
346 if (*format == '*')
350 format++;
352 if (isdigit (*format))
354 const char *f = format;
374 format = ++f;
386 FDI_SET (format - 1, FMTDIR_ERROR);
407 FDI_SET (format - 1, FMTDIR_ERROR);
420 else if (isdigit (*format))
422 do format++; while (isdigit (*format));
426 if (*format == '<')
433 spec.sysdep_directives[2 * spec.sysdep_directives_count] = format;
435 format++;
436 /* Parse ISO C 99 section 7.8.1 format string directive.
440 if (*format != 'P')
443 FDI_SET (*format == '\0' ? format - 1 : format, FMTDIR_ERROR);
446 format++;
447 if (*format != 'R')
450 FDI_SET (*format == '\0' ? format - 1 : format, FMTDIR_ERROR);
453 format++;
454 if (*format != 'I')
457 FDI_SET (*format == '\0' ? format - 1 : format, FMTDIR_ERROR);
460 format++;
462 switch (*format)
472 FDI_SET (*format == '\0' ? format - 1 : format, FMTDIR_ERROR);
475 format++;
477 if (format[0] == 'M' && format[1] == 'A' && format[2] == 'X')
480 format += 3;
482 else if (format[0] == 'P' && format[1] == 'T' && format[2] == 'R')
485 format += 3;
489 if (format[0] == 'L' && format[1] == 'E' && format[2] == 'A'
490 && format[3] == 'S' && format[4] == 'T')
492 format += 5;
493 if (format[0] == '8')
496 format++;
498 else if (format[0] == '1' && format[1] == '6')
501 format += 2;
503 else if (format[0] == '3' && format[1] == '2')
506 format += 2;
508 else if (format[0] == '6' && format[1] == '4')
511 format += 2;
516 FDI_SET (*format == '\0' ? format - 1 : format,
521 else if (format[0] == 'F' && format[1] == 'A'
522 && format[2] == 'S' && format[3] == 'T')
524 format += 4;
525 if (format[0] == '8')
528 format++;
530 else if (format[0] == '1' && format[1] == '6')
533 format += 2;
535 else if (format[0] == '3' && format[1] == '2')
538 format += 2;
540 else if (format[0] == '6' && format[1] == '4')
543 format += 2;
548 FDI_SET (*format == '\0' ? format - 1 : format,
555 if (format[0] == '8')
558 format++;
560 else if (format[0] == '1' && format[1] == '6')
563 format += 2;
565 else if (format[0] == '3' && format[1] == '2')
568 format += 2;
570 else if (format[0] == '6' && format[1] == '4')
573 format += 2;
578 FDI_SET (*format == '\0' ? format - 1 : format,
585 if (*format != '>')
589 FDI_SET (*format == '\0' ? format - 1 : format, FMTDIR_ERROR);
593 spec.sysdep_directives[2 * spec.sysdep_directives_count + 1] = format + 1;
600 for (;; format++)
602 if (*format == 'h')
609 else if (*format == 'l')
616 else if (*format == 'L')
618 else if (*format == 'q')
621 else if (*format == 'j')
623 else if (*format == 'z' || *format == 'Z')
628 else if (*format == 't')
634 switch (*format)
638 use this string as a c-format string, but rather as a
639 literal or as a different kind of format string. */
640 if (format[-1] != '%')
692 if (*format == '\0')
695 FDI_SET (format - 1, FMTDIR_ERROR);
700 INVALID_CONVERSION_SPECIFIER (spec.directives, *format);
701 FDI_SET (format, FMTDIR_ERROR);
717 FDI_SET (format, FMTDIR_ERROR);
738 FDI_SET (format, FMTDIR_ERROR);
752 FDI_SET (format, FMTDIR_END);
754 format++;
804 /* Verify that the format strings uses all arguments up to the highest
844 format_c_parse (const char *format, bool translated, char *fdi,
847 return format_parse (format, translated, false, fdi, invalid_reason);
851 format_objc_parse (const char *format, bool translated, char *fdi,
854 return format_parse (format, translated, true, fdi, invalid_reason);
901 error_logger (_("number of format specifications in 'msgid' and '%s' does not match"),
910 error_logger (_("format specifications in 'msgid' and '%s' for argument %u are not the same"),
943 /* Parse the format string with all possible extensions turned on. (The
944 caller has already verified that the format string is valid for the
1136 * compile-command: "/bin/sh ../libtool --tag=CC --mode=link gcc -o a.out -static -O -g -Wall -I.. -I../gnulib-lib -I../intl -DHAVE_CONFIG_H -DTEST format-c.c ../gnulib-lib/libgettextlib.la"