• 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 /* Lisp format strings.
25 #include "format.h"
30 #include "format-invalid.h"
42 /* Lisp format strings are described in the Common Lisp HyperSpec,
45 /* Data structure describing format string derived constraints for an
51 FCT_REQUIRED, /* The format argument list cannot end before this argument. */
52 FCT_OPTIONAL /* The format argument list may end before this argument. */
94 (format t "~@{~:[-~;~S~]~}" nil t 1 t 3 nil t 4)
2016 /* ============= Subroutines used by the format string parser ============= */
2279 /* ================= Handling of format string directives ================= */
2281 /* Possible signatures of format directives. */
2311 list. Return false and fill in *invalid_reason if the format string is
2398 Return false and fill in *invalid_reason if the format string is
2419 /* ======================= The format string parser ======================= */
2421 /* Parse a piece of format string, until the matching terminating format
2423 format is the remainder of the format string.
2436 fdi is an array to be filled with format directive indicators, or NULL.
2437 If the format string is invalid, false is returned and *invalid_reason is
2446 const char *format = *formatp;
2447 const char *const format_start = format;
2452 for (; *format != '\0'; )
2453 if (*format++ == '~')
2460 FDI_SET (format - 1, FMTDIR_START);
2471 if (c_isdigit (*format))
2476 value = 10 * value + (*format - '0');
2477 format++;
2479 while (c_isdigit (*format));
2481 else if (*format == '+' || *format == '-')
2483 bool negative = (*format == '-');
2485 format++;
2486 if (!c_isdigit (*format))
2488 if (*format == '\0')
2491 FDI_SET (format - 1, FMTDIR_ERROR);
2496 xasprintf (_("In the directive number %u, '%c' is not followed by a digit."), spec->directives, format[-1]);
2497 FDI_SET (format, FMTDIR_ERROR);
2503 value = 10 * value + (*format - '0');
2504 format++;
2506 while (c_isdigit (*format));
2510 else if (*format == '\'')
2513 format++;
2514 if (*format == '\0')
2517 FDI_SET (format - 1, FMTDIR_ERROR);
2520 format++;
2522 else if (*format == 'V' || *format == 'v')
2525 format++;
2531 else if (*format == '#')
2534 format++;
2544 if (*format == ',')
2545 format++;
2553 if (*format == ':')
2555 format++;
2558 else if (*format == '@')
2560 format++;
2568 switch (*format++)
2575 FDI_SET (format - 1, FMTDIR_ERROR);
2586 FDI_SET (format - 1, FMTDIR_ERROR);
2600 FDI_SET (format - 1, FMTDIR_ERROR);
2611 FDI_SET (format - 1, FMTDIR_ERROR);
2622 FDI_SET (format - 1, FMTDIR_ERROR);
2639 FDI_SET (format - 1, FMTDIR_ERROR);
2650 FDI_SET (format - 1, FMTDIR_ERROR);
2662 FDI_SET (format - 1, FMTDIR_ERROR);
2673 FDI_SET (format - 1, FMTDIR_ERROR);
2688 FDI_SET (format - 1, FMTDIR_ERROR);
2698 FDI_SET (format - 1, FMTDIR_ERROR);
2707 FDI_SET (format - 1, FMTDIR_ERROR);
2716 FDI_SET (format - 1, FMTDIR_ERROR);
2737 FDI_SET (format - 1, FMTDIR_ERROR);
2774 FDI_SET (format - 1, FMTDIR_ERROR);
2795 FDI_SET (format - 1, FMTDIR_ERROR);
2800 while (*format != '\0' && *format != '/')
2801 format++;
2802 if (*format == '\0')
2806 FDI_SET (format - 1, FMTDIR_ERROR);
2809 format++;
2816 FDI_SET (format - 1, FMTDIR_ERROR);
2819 *formatp = format;
2833 format = *formatp;
2844 FDI_SET (format - 1, FMTDIR_ERROR);
2850 FDI_SET (format - 1, FMTDIR_ERROR);
2853 *formatp = format;
2864 FDI_SET (format - 1, FMTDIR_ERROR);
2875 FDI_SET (format - 1, FMTDIR_ERROR);
2879 *formatp = format;
2892 /* Second alternative: use sub-format. */
2925 format = *formatp;
2940 FDI_SET (format - 1, FMTDIR_ERROR);
2947 *formatp = format;
3010 format = *formatp;
3029 FDI_SET (format - 1, FMTDIR_ERROR);
3042 *formatp = format;
3093 format = *formatp;
3109 FDI_SET (format - 1, FMTDIR_ERROR);
3115 FDI_SET (format - 1, FMTDIR_ERROR);
3118 *formatp = format;
3128 FDI_SET (format - 1, FMTDIR_ERROR);
3131 *formatp = format;
3151 if (*format == '~' && sub_spec.directives == 1)
3218 format = *formatp;
3226 FDI_SET (format - 1, FMTDIR_ERROR);
3232 FDI_SET (format - 1, FMTDIR_ERROR);
3235 *formatp = format;
3245 FDI_SET (format - 1, FMTDIR_ERROR);
3251 *formatp = format;
3270 format = *formatp;
3286 FDI_SET (format - 1, FMTDIR_ERROR);
3292 FDI_SET (format - 1, FMTDIR_ERROR);
3295 *formatp = format;
3305 FDI_SET (format - 1, FMTDIR_ERROR);
3327 FDI_SET (format - 1, FMTDIR_ERROR);
3335 FDI_SET (format - 1, FMTDIR_ERROR);
3344 FDI_SET (format - 1, FMTDIR_ERROR);
3348 *formatp = format;
3359 FDI_SET (format - 1, FMTDIR_ERROR);
3370 --format;
3371 if (*format == '\0')
3374 FDI_SET (format - 1, FMTDIR_ERROR);
3379 INVALID_CONVERSION_SPECIFIER (spec->directives, *format);
3380 FDI_SET (format, FMTDIR_ERROR);
3385 FDI_SET (format - 1, FMTDIR_END);
3390 *formatp = format;
3404 /* ============== Top level format string handling functions ============== */
3407 format_parse (const char *format, bool translated, char *fdi,
3419 if (!parse_upto (&format, &position, &spec.list, &escape,
3422 /* Invalid format string. */
3474 error_logger (_("format specifications in 'msgid' and '%s' are not equivalent"),
3490 error_logger (_("format specifications in '%s' are not a subset of those in 'msgid'"),
3652 * 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-lisp.c ../gnulib-lib/libgettextlib.la"