-
- i->f2 = i->f1 + (i->e - i->s) - 1;
-
- /* Make sure that the string isn't too long. */
- if (i->format.w > fmt->Imax_w)
- {
- dls_error (i, _("Field too long (%d characters). Truncated after "
- "character %d."),
- i->format.w, fmt->Imax_w);
- i->format.w = fmt->Imax_w;
- }
-
- if (fmt->cat & FCAT_BLANKS_SYSMIS)
- {
- const char *cp;
-
- cp = i->s;
- for (;;)
- {
- if (!isspace ((unsigned char) *cp))
- break;
-
- if (++cp == i->e)
- {
- i->v->f = get_blanks();
- return true;
- }
- }
- }
-
- {
- typedef bool (*handler_t) (struct data_in *);
- static const handler_t handlers[FMT_NUMBER_OF_FORMATS] =
- {
- parse_numeric, parse_N, parse_numeric, parse_numeric,
- parse_numeric, parse_numeric, parse_numeric,
- parse_Z, parse_A, parse_AHEX, parse_IB, parse_P, parse_PIB,
- parse_PIBHEX, parse_PK, parse_RB, parse_RBHEX,
- NULL, NULL, NULL, NULL, NULL,
- parse_DATE, parse_EDATE, parse_SDATE, parse_ADATE, parse_JDATE,
- parse_QYR, parse_MOYR, parse_WKYR,
- parse_DATETIME, parse_TIME, parse_DTIME,
- parse_WKDAY, parse_MONTH,
- };
-
- handler_t handler;
- bool success;
-
- handler = handlers[i->format.type];
- assert (handler != NULL);
-
- success = handler (i);
- if (!success)
- default_result (i);
-
- return success;
- }