Lines Matching defs:pc

282 digits_to_date_time (parser_control *pc, textint text_int)
284 if (pc->dates_seen && ! pc->year.digits
285 && ! pc->rels_seen && (pc->times_seen || 2 < text_int.digits))
286 pc->year = text_int;
291 pc->dates_seen++;
292 pc->day = text_int.value % 100;
293 pc->month = (text_int.value / 100) % 100;
294 pc->year.value = text_int.value / 10000;
295 pc->year.digits = text_int.digits - 4;
299 pc->times_seen++;
302 pc->hour = text_int.value;
303 pc->minutes = 0;
307 pc->hour = text_int.value / 100;
308 pc->minutes = text_int.value % 100;
310 pc->seconds.tv_sec = 0;
311 pc->seconds.tv_nsec = 0;
312 pc->meridian = MER24;
319 apply_relative_time (parser_control *pc, relative_time rel, int factor)
321 pc->rel.ns += factor * rel.ns;
322 pc->rel.seconds += factor * rel.seconds;
323 pc->rel.minutes += factor * rel.minutes;
324 pc->rel.hour += factor * rel.hour;
325 pc->rel.day += factor * rel.day;
326 pc->rel.month += factor * rel.month;
327 pc->rel.year += factor * rel.year;
328 pc->rels_seen = true;
333 set_hhmmss (parser_control *pc, long int hour, long int minutes,
336 pc->hour = hour;
337 pc->minutes = minutes;
338 pc->seconds.tv_sec = sec;
339 pc->seconds.tv_nsec = nsec;
927 yyerror (pc, YY_("syntax error: cannot back up")); \
975 # define YYLEX yylex (&yylval, pc)
998 Type, Value, pc); \
1012 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, parser_control *pc)
1015 yy_symbol_value_print (yyoutput, yytype, yyvaluep, pc)
1019 parser_control *pc;
1024 YYUSE (pc);
1046 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, parser_control *pc)
1049 yy_symbol_print (yyoutput, yytype, yyvaluep, pc)
1053 parser_control *pc;
1061 yy_symbol_value_print (yyoutput, yytype, yyvaluep, pc);
1104 yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule, parser_control *pc)
1107 yy_reduce_print (yyssp, yyvsp, yyrule, pc)
1111 parser_control *pc;
1126 , pc);
1134 yy_reduce_print (yyssp, yyvsp, Rule, pc); \
1397 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, parser_control *pc)
1400 yydestruct (yymsg, yytype, yyvaluep, pc)
1404 parser_control *pc;
1408 YYUSE (pc);
1433 int yyparse (parser_control *pc);
1458 yyparse (parser_control *pc)
1461 yyparse (pc)
1462 parser_control *pc;
1718 pc->seconds = (yyvsp[0].timespec);
1719 pc->timespec_seen = true;
1728 { pc->times_seen++; }
1736 { pc->local_zones_seen++; }
1744 { pc->zones_seen++; }
1752 { pc->dates_seen++; }
1760 { pc->days_seen++; }
1769 set_hhmmss (pc, (yyvsp[-1].textintval).value, 0, 0, 0);
1770 pc->meridian = (yyvsp[0].intval);
1780 set_hhmmss (pc, (yyvsp[-3].textintval).value, (yyvsp[-1].textintval).value, 0, 0);
1781 pc->meridian = (yyvsp[0].intval);
1791 set_hhmmss (pc, (yyvsp[-4].textintval).value, (yyvsp[-2].textintval).value, 0, 0);
1792 pc->meridian = MER24;
1793 pc->zones_seen++;
1794 pc->time_zone = time_zone_hhmm (pc, (yyvsp[-1].textintval), (yyvsp[0].intval));
1804 set_hhmmss (pc, (yyvsp[-5].textintval).value, (yyvsp[-3].textintval).value, (yyvsp[-1].timespec).tv_sec, (yyvsp[-1].timespec).tv_nsec);
1805 pc->meridian = (yyvsp[0].intval);
1815 set_hhmmss (pc, (yyvsp[-6].textintval).value, (yyvsp[-4].textintval).value, (yyvsp[-2].timespec).tv_sec, (yyvsp[-2].timespec).tv_nsec);
1816 pc->meridian = MER24;
1817 pc->zones_seen++;
1818 pc->time_zone = time_zone_hhmm (pc, (yyvsp[-1].textintval), (yyvsp[0].intval));
1828 pc->local_isdst = (yyvsp[0].intval);
1829 pc->dsts_seen += (0 < (yyvsp[0].intval));
1839 pc->local_isdst = 1;
1840 pc->dsts_seen += (0 < (yyvsp[-1].intval)) + 1;
1849 { pc->time_zone = (yyvsp[0].intval); }
1857 { pc->time_zone = (yyvsp[-1].intval);
1858 apply_relative_time (pc, (yyvsp[0].rel), 1); }
1866 { pc->time_zone = (yyvsp[-2].intval) + time_zone_hhmm (pc, (yyvsp[-1].textintval), (yyvsp[0].intval)); }
1874 { pc->time_zone = (yyvsp[0].intval) + 60; }
1882 { pc->time_zone = (yyvsp[-1].intval) + 60; }
1891 pc->day_ordinal = 0;
1892 pc->day_number = (yyvsp[0].intval);
1902 pc->day_ordinal = 0;
1903 pc->day_number = (yyvsp[-1].intval);
1913 pc->day_ordinal = (yyvsp[-1].intval);
1914 pc->day_number = (yyvsp[0].intval);
1924 pc->day_ordinal = (yyvsp[-1].textintval).value;
1925 pc->day_number = (yyvsp[0].intval);
1935 pc->month = (yyvsp[-2].textintval).value;
1936 pc->day = (yyvsp[0].textintval).value;
1953 pc->year = (yyvsp[-4].textintval);
1954 pc->month = (yyvsp[-2].textintval).value;
1955 pc->day = (yyvsp[0].textintval).value;
1959 pc->month = (yyvsp[-4].textintval).value;
1960 pc->day = (yyvsp[-2].textintval).value;
1961 pc->year = (yyvsp[0].textintval);
1973 pc->year = (yyvsp[-2].textintval);
1974 pc->month = -(yyvsp[-1].textintval).value;
1975 pc->day = -(yyvsp[0].textintval).value;
1986 pc->day = (yyvsp[-2].textintval).value;
1987 pc->month = (yyvsp[-1].intval);
1988 pc->year.value = -(yyvsp[0].textintval).value;
1989 pc->year.digits = (yyvsp[0].textintval).digits;
2000 pc->month = (yyvsp[-2].intval);
2001 pc->day = -(yyvsp[-1].textintval).value;
2002 pc->year.value = -(yyvsp[0].textintval).value;
2003 pc->year.digits = (yyvsp[0].textintval).digits;
2013 pc->month = (yyvsp[-1].intval);
2014 pc->day = (yyvsp[0].textintval).value;
2024 pc->month = (yyvsp[-3].intval);
2025 pc->day = (yyvsp[-2].textintval).value;
2026 pc->year = (yyvsp[0].textintval);
2036 pc->day = (yyvsp[-1].textintval).value;
2037 pc->month = (yyvsp[0].intval);
2047 pc->day = (yyvsp[-2].textintval).value;
2048 pc->month = (yyvsp[-1].intval);
2049 pc->year = (yyvsp[0].textintval);
2058 { apply_relative_time (pc, (yyvsp[-1].rel), -1); }
2066 { apply_relative_time (pc, (yyvsp[0].rel), 1); }
2074 { apply_relative_time (pc, (yyvsp[0].rel), 1); }
2314 { digits_to_date_time (pc, (yyvsp[0].textintval)); }
2325 digits_to_date_time (pc, (yyvsp[-1].textintval));
2326 apply_relative_time (pc, (yyvsp[0].rel), 1);
2416 yyerror (pc, YY_("syntax error"));
2433 yyerror (pc, yymsg);
2435 yyerror (pc, YY_("syntax error"));
2459 yytoken, &yylval, pc);
2515 yystos[yystate], yyvsp, pc);
2550 yyerror (pc, YY_("memory exhausted"));
2562 yytoken, &yylval, pc);
2571 yystos[*yyssp], yyvsp, pc);
2784 time_zone_hhmm (parser_control *pc, textint s, long int mm)
2799 arrange to reject it by incrementing pc->zones_seen. Thus,
2802 pc->zones_seen++;
2839 lookup_zone (parser_control const *pc, char const *name)
2849 for (tp = pc->local_time_zone_table; tp->name; tp++)
2888 lookup_word (parser_control const *pc, char *word)
2916 if ((tp = lookup_zone (pc, word)))
2952 if (period_found && (tp = lookup_zone (pc, word)))
2959 yylex (YYSTYPE *lvalp, parser_control *pc)
2966 while (c = *pc->input, c_isspace (c))
2967 pc->input++;
2977 while (c = *++pc->input, c_isspace (c))
2985 p = pc->input;
3057 pc->input = p;
3075 lvalp->textintval.digits = p - pc->input;
3076 pc->input = p;
3091 c = *++pc->input;
3096 tp = lookup_word (pc, buff);
3104 return *pc->input++;
3108 c = *pc->input++;
3122 yyerror (parser_control const *pc _GL_UNUSED,
3185 parser_control pc;
3250 pc.input = p;
3251 pc.year.value = tmp->tm_year;
3252 pc.year.value += TM_YEAR_BASE;
3253 pc.year.digits = 0;
3254 pc.month = tmp->tm_mon + 1;
3255 pc.day = tmp->tm_mday;
3256 pc.hour = tmp->tm_hour;
3257 pc.minutes = tmp->tm_min;
3258 pc.seconds.tv_sec = tmp->tm_sec;
3259 pc.seconds.tv_nsec = Start_ns;
3262 pc.meridian = MER24;
3263 pc.rel = RELATIVE_TIME_0;
3264 pc.timespec_seen = false;
3265 pc.rels_seen = false;
3266 pc.dates_seen = 0;
3267 pc.days_seen = 0;
3268 pc.times_seen = 0;
3269 pc.local_zones_seen = 0;
3270 pc.dsts_seen = 0;
3271 pc.zones_seen = 0;
3274 pc.local_time_zone_table[0].name = tmp->tm_zone;
3275 pc.local_time_zone_table[0].type = tLOCAL_ZONE;
3276 pc.local_time_zone_table[0].value = tmp->tm_isdst;
3277 pc.local_time_zone_table[1].name = NULL;
3288 && probe_tm->tm_isdst != pc.local_time_zone_table[0].value)
3291 pc.local_time_zone_table[1].name = probe_tm->tm_zone;
3292 pc.local_time_zone_table[1].type = tLOCAL_ZONE;
3293 pc.local_time_zone_table[1].value = probe_tm->tm_isdst;
3294 pc.local_time_zone_table[2].name = NULL;
3309 pc.local_time_zone_table[i].name = tzname[i];
3310 pc.local_time_zone_table[i].type = tLOCAL_ZONE;
3311 pc.local_time_zone_table[i].value = i;
3313 pc.local_time_zone_table[i].name = NULL;
3316 pc.local_time_zone_table[0].name = NULL;
3320 if (pc.local_time_zone_table[0].name && pc.local_time_zone_table[1].name
3321 && ! strcmp (pc.local_time_zone_table[0].name,
3322 pc.local_time_zone_table[1].name))
3327 pc.local_time_zone_table[0].value = -1;
3328 pc.local_time_zone_table[1].name = NULL;
3331 if (yyparse (&pc) != 0)
3334 if (pc.timespec_seen)
3335 *result = pc.seconds;
3338 if (1 < (pc.times_seen | pc.dates_seen | pc.days_seen | pc.dsts_seen
3339 | (pc.local_zones_seen + pc.zones_seen)))
3342 tm.tm_year = to_year (pc.year) - TM_YEAR_BASE;
3343 tm.tm_mon = pc.month - 1;
3344 tm.tm_mday = pc.day;
3345 if (pc.times_seen || (pc.rels_seen && ! pc.dates_seen && ! pc.days_seen))
3347 tm.tm_hour = to_hour (pc.hour, pc.meridian);
3350 tm.tm_min = pc.minutes;
3351 tm.tm_sec = pc.seconds.tv_sec;
3356 pc.seconds.tv_nsec = 0;
3360 if (pc.dates_seen | pc.days_seen | pc.times_seen)
3365 if (pc.local_zones_seen)
3366 tm.tm_isdst = pc.local_isdst;
3374 if (! pc.zones_seen)
3388 long int time_zone = pc.time_zone;
3393 + sizeof pc.time_zone * CHAR_BIT / 3];
3408 if (pc.days_seen && ! pc.dates_seen)
3410 tm.tm_mday += ((pc.day_number - tm.tm_wday + 7) % 7
3411 + 7 * (pc.day_ordinal
3412 - (0 < pc.day_ordinal
3413 && tm.tm_wday != pc.day_number)));
3421 if (pc.rel.year | pc.rel.month | pc.rel.day)
3423 int year = tm.tm_year + pc.rel.year;
3424 int month = tm.tm_mon + pc.rel.month;
3425 int day = tm.tm_mday + pc.rel.day;
3426 if (((year < tm.tm_year) ^ (pc.rel.year < 0))
3427 | ((month < tm.tm_mon) ^ (pc.rel.month < 0))
3428 | ((day < tm.tm_mday) ^ (pc.rel.day < 0)))
3444 if (pc.zones_seen)
3446 long int delta = pc.time_zone * 60;
3471 long int sum_ns = pc.seconds.tv_nsec + pc.rel.ns;
3474 long int d1 = 60 * 60 * pc.rel.hour;
3476 long int d2 = 60 * pc.rel.minutes;
3478 long_time_t d3 = pc.rel.seconds;
3484 if ((d1 / (60 * 60) ^ pc.rel.hour)
3485 | (d2 / 60 ^ pc.rel.minutes)