-
- {
- static const char *months[12] =
- {
- "january", "february", "march", "april", "may", "june",
- "july", "august", "september", "october", "november", "december",
- };
-
- char month_buf[32];
- char *mp;
-
- int j;
-
- for (mp = month_buf;
- have_char (i) && isalpha (*i->s) && mp < &month_buf[31];
- i->s++)
- *mp++ = tolower (*i->s);
- *mp = '\0';
-
- if (have_char (i) && isalpha (*i->s))
- {
- dls_error (i, _("Month name (%s...) is too long."), month_buf);
- return 0;
- }
-
- for (j = 0; j < 12; j++)
- if (lex_id_match (months[j], month_buf))
- {
- *month = j + 1;
- return 1;
- }
-
- dls_error (i, _("Bad month name (%s)."), month_buf);
- return 0;
- }
+ else
+ return parse_enum (i, _("month"), month_names, month);