• 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 /* Scheme format strings.
25 #include "format.h"
30 #include "format-invalid.h"
44 /* Scheme format strings are described in the GNU guile documentation,
46 guile-1.6.4/ice-9/format.scm. */
48 /* Data structure describing format string derived constraints for an
54 FCT_REQUIRED, /* The format argument list cannot end before this argument. */
55 FCT_OPTIONAL /* The format argument list may end before this argument. */
97 (format t "~@{~:[-~;~S~]~}" nil t 1 t 3 nil t 4)
2039 /* ============= Subroutines used by the format string parser ============= */
2302 /* ================= Handling of format string directives ================= */
2304 /* Possible signatures of format directives. */
2337 list. Return false and fill in *invalid_reason if the format string is
2422 /* ======================= The format string parser ======================= */
2424 /* Parse a piece of format string, until the matching terminating format
2426 format is the remainder of the format string.
2439 fdi is an array to be filled with format directive indicators, or NULL.
2440 If the format string is invalid, false is returned and *invalid_reason is
2449 const char *format = *formatp;
2450 const char *const format_start = format;
2455 for (; *format != '\0'; )
2456 if (*format++ == '~')
2463 FDI_SET (format - 1, FMTDIR_START);
2474 if (c_isdigit (*format))
2479 value = 10 * value + (*format - '0');
2480 format++;
2482 while (c_isdigit (*format));
2484 else if (*format == '+' || *format == '-')
2486 bool negative = (*format == '-');
2488 format++;
2489 if (!c_isdigit (*format))
2491 if (*format == '\0')
2494 FDI_SET (format - 1, FMTDIR_ERROR);
2499 xasprintf (_("In the directive number %u, '%c' is not followed by a digit."), spec->directives, format[-1]);
2500 FDI_SET (format, FMTDIR_ERROR);
2506 value = 10 * value + (*format - '0');
2507 format++;
2509 while (c_isdigit (*format));
2513 else if (*format == '\'')
2516 format++;
2517 if (*format == '\0')
2520 FDI_SET (format - 1, FMTDIR_ERROR);
2523 format++;
2525 else if (*format == 'V' || *format == 'v')
2528 format++;
2534 else if (*format == '#')
2537 format++;
2547 if (*format == ',')
2548 format++;
2556 if (*format == ':')
2558 format++;
2561 else if (*format == '@')
2563 format++;
2571 switch (*format++)
2578 FDI_SET (format - 1, FMTDIR_ERROR);
2589 FDI_SET (format - 1, FMTDIR_ERROR);
2605 FDI_SET (format - 1, FMTDIR_ERROR);
2616 FDI_SET (format - 1, FMTDIR_ERROR);
2627 FDI_SET (format - 1, FMTDIR_ERROR);
2644 FDI_SET (format - 1, FMTDIR_ERROR);
2656 FDI_SET (format - 1, FMTDIR_ERROR);
2667 FDI_SET (format - 1, FMTDIR_ERROR);
2678 FDI_SET (format - 1, FMTDIR_ERROR);
2689 FDI_SET (format - 1, FMTDIR_ERROR);
2705 FDI_SET (format - 1, FMTDIR_ERROR);
2716 FDI_SET (format - 1, FMTDIR_ERROR);
2725 FDI_SET (format - 1, FMTDIR_ERROR);
2734 FDI_SET (format - 1, FMTDIR_ERROR);
2755 FDI_SET (format - 1, FMTDIR_ERROR);
2792 FDI_SET (format - 1, FMTDIR_ERROR);
2813 FDI_SET (format - 1, FMTDIR_ERROR);
2816 *formatp = format;
2830 format = *formatp;
2841 FDI_SET (format - 1, FMTDIR_ERROR);
2847 FDI_SET (format - 1, FMTDIR_ERROR);
2850 *formatp = format;
2861 FDI_SET (format - 1, FMTDIR_ERROR);
2872 FDI_SET (format - 1, FMTDIR_ERROR);
2876 *formatp = format;
2889 /* Second alternative: use sub-format. */
2922 format = *formatp;
2937 FDI_SET (format - 1, FMTDIR_ERROR);
2944 *formatp = format;
3007 format = *formatp;
3026 FDI_SET (format - 1, FMTDIR_ERROR);
3039 *formatp = format;
3090 format = *formatp;
3106 FDI_SET (format - 1, FMTDIR_ERROR);
3112 FDI_SET (format - 1, FMTDIR_ERROR);
3115 *formatp = format;
3125 FDI_SET (format - 1, FMTDIR_ERROR);
3128 *formatp = format;
3148 if (*format == '~' && sub_spec.directives == 1)
3215 format = *formatp;
3223 FDI_SET (format - 1, FMTDIR_ERROR);
3229 FDI_SET (format - 1, FMTDIR_ERROR);
3232 *formatp = format;
3242 FDI_SET (format - 1, FMTDIR_ERROR);
3264 FDI_SET (format - 1, FMTDIR_ERROR);
3272 FDI_SET (format - 1, FMTDIR_ERROR);
3281 FDI_SET (format - 1, FMTDIR_ERROR);
3285 *formatp = format;
3293 --format;
3294 if (*format == '\0')
3297 FDI_SET (format - 1, FMTDIR_ERROR);
3302 INVALID_CONVERSION_SPECIFIER (spec->directives, *format);
3303 FDI_SET (format, FMTDIR_ERROR);
3308 FDI_SET (format - 1, FMTDIR_END);
3313 *formatp = format;
3327 /* ============== Top level format string handling functions ============== */
3330 format_parse (const char *format, bool translated, char *fdi,
3342 if (!parse_upto (&format, &position, &spec.list, &escape,
3345 /* Invalid format string. */
3397 error_logger (_("format specifications in 'msgid' and '%s' are not equivalent"),
3413 error_logger (_("format specifications in '%s' are not a subset of those in 'msgid'"),
3575 * 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-scheme.c ../gnulib-lib/libgettextlib.la"