static int get_rise_set(date_t todayGreg, double *h_rise, double *h_set, double *gmt_offset) { double latitude, longitude; timelib_sll rise, set, transit; int rs; timelib_time *t; latitude = (double) latdeg + (latmin / 60.0); longitude = (longdeg * -1.0) + ((longmin * -1.0) / 60.0); t = timelib_time_ctor(); t->y = todayGreg.yy; t->m = todayGreg.mm; t->d = todayGreg.dd; t->h = 17; /* assume 5pm */ timelib_set_timezone(t, TZ_INFO); /* t->tz_info = TZ_INFO; */ /* t->zone_type = TIMELIB_ZONETYPE_ID; */ /* t->is_localtime = 1; */ /* t->have_zone = 1; */ timelib_update_ts(t, TZ_INFO); *gmt_offset = timelib_get_current_offset(t) / 3600.0; rs = timelib_astro_rise_set_altitude(t, longitude, latitude, SUNRISE_SUNSET_ALTITUDE, 1, h_rise, h_set, &rise, &set, &transit); timelib_time_dtor(t); return rs; }
timelib_time* timelib_time_clone(timelib_time *orig) { timelib_time *tmp = timelib_time_ctor(); memcpy(tmp, orig, sizeof(timelib_time)); if (orig->tz_abbr) { tmp->tz_abbr = strdup(orig->tz_abbr); } if (orig->tz_info) { tmp->tz_info = orig->tz_info; } return tmp; }
TEST(issues, issue0019_test4) { timelib_sll ts = -12622953600; timelib_time *t = timelib_time_ctor(); timelib_set_timezone_from_offset(t, 0); timelib_unixtime2local(t, ts); LONGS_EQUAL(1569, t->y); LONGS_EQUAL(12, t->m); LONGS_EQUAL(30, t->d); timelib_time_dtor(t); }
TEST(issues, issue0019_test3) { timelib_sll ts = 0; timelib_time *t = timelib_time_ctor(); timelib_set_timezone_from_offset(t, 0); timelib_unixtime2local(t, ts); LONGS_EQUAL(1970, t->y); LONGS_EQUAL(1, t->m); LONGS_EQUAL(1, t->d); timelib_time_dtor(t); }
TEST(issues, issue0017_test1) { timelib_sll ts = 12622608000; timelib_time *t = timelib_time_ctor(); timelib_set_timezone_from_offset(t, 0); timelib_unixtime2local(t, ts); LONGS_EQUAL(2369, t->y); LONGS_EQUAL(12, t->m); LONGS_EQUAL(30, t->d); timelib_time_dtor(t); }
TEST(issues, issue0053_test3) { int dummy_error; timelib_tzinfo *tzi; timelib_sll ts = -1822500432; timelib_time *t = timelib_time_ctor(); tzi = timelib_parse_tzfile((char*) "America/Belize", timelib_builtin_db(), &dummy_error); t->tz_info = tzi; t->zone_type = TIMELIB_ZONETYPE_ID; timelib_unixtime2local(t, ts); LONGS_EQUAL(-21600, t->z); timelib_time_dtor(t); timelib_tzinfo_dtor(tzi); }
TEST(issues, issue0053_test1) { int dummy_error; timelib_tzinfo *tzi; timelib_sll ts = -61626506832; timelib_time *t = timelib_time_ctor(); tzi = timelib_parse_tzfile((char*) "America/Belize", timelib_builtin_db(), &dummy_error); t->tz_info = tzi; t->zone_type = TIMELIB_ZONETYPE_ID; timelib_unixtime2local(t, ts); LONGS_EQUAL(17, t->y); LONGS_EQUAL(2, t->m); LONGS_EQUAL(18, t->d); LONGS_EQUAL(0, t->h); LONGS_EQUAL(0, t->i); LONGS_EQUAL(0, t->s); LONGS_EQUAL(-21168, t->z); timelib_time_dtor(t); timelib_tzinfo_dtor(tzi); }
/** * Note: timestamp = unixtimestamp (NEEDS to be 00:00:00 UT) * Eastern longitude positive, Western longitude negative * Northern latitude positive, Southern latitude negative * The longitude value IS critical in this function! * altit = the altitude which the Sun should cross * Set to -35/60 degrees for rise/set, -6 degrees * for civil, -12 degrees for nautical and -18 * degrees for astronomical twilight. * upper_limb: non-zero -> upper limb, zero -> center * Set to non-zero (e.g. 1) when computing rise/set * times, and to zero when computing start/end of * twilight. * *rise = where to store the rise time * *set = where to store the set time * Both times are relative to the specified altitude, * and thus this function can be used to compute * various twilight times, as well as rise/set times * Return value: 0 = sun rises/sets this day, times stored at * *trise and *tset. * +1 = sun above the specified "horizon" 24 hours. * *trise set to time when the sun is at south, * minus 12 hours while *tset is set to the south * time plus 12 hours. "Day" length = 24 hours * -1 = sun is below the specified "horizon" 24 hours * "Day" length = 0 hours, *trise and *tset are * both set to the time when the sun is at south. * */ int timelib_astro_rise_set_altitude(timelib_time *t_loc, double lon, double lat, double altit, int upper_limb, double *h_rise, double *h_set, timelib_sll *ts_rise, timelib_sll *ts_set, timelib_sll *ts_transit) { double d, /* Days since 2000 Jan 0.0 (negative before) */ sr, /* Solar distance, astronomical units */ sRA, /* Sun's Right Ascension */ sdec, /* Sun's declination */ sradius, /* Sun's apparent radius */ t, /* Diurnal arc */ tsouth, /* Time when Sun is at south */ sidtime; /* Local sidereal time */ timelib_time *t_utc; timelib_sll timestamp, old_sse; int rc = 0; /* Return cde from function - usually 0 */ /* Normalize time */ old_sse = t_loc->sse; t_loc->h = 12; t_loc->i = t_loc->s = 0; timelib_update_ts(t_loc, NULL); /* Calculate TS belonging to UTC 00:00 of the current day */ t_utc = timelib_time_ctor(); t_utc->y = t_loc->y; t_utc->m = t_loc->m; t_utc->d = t_loc->d; t_utc->h = t_utc->i = t_utc->s = 0; timelib_update_ts(t_utc, NULL); /* Compute d of 12h local mean solar time */ timestamp = t_loc->sse; d = timelib_ts_to_juliandate(timestamp) - lon/360.0; /* Compute local sidereal time of this moment */ sidtime = astro_revolution(astro_GMST0(d) + 180.0 + lon); /* Compute Sun's RA + Decl at this moment */ astro_sun_RA_dec( d, &sRA, &sdec, &sr ); /* Compute time when Sun is at south - in hours UT */ tsouth = 12.0 - astro_rev180(sidtime - sRA) / 15.0; /* Compute the Sun's apparent radius, degrees */ sradius = 0.2666 / sr; /* Do correction to upper limb, if necessary */ if (upper_limb) { altit -= sradius; } /* Compute the diurnal arc that the Sun traverses to reach */ /* the specified altitude altit: */ { double cost; cost = (sind(altit) - sind(lat) * sind(sdec)) / (cosd(lat) * cosd(sdec)); *ts_transit = t_utc->sse + (tsouth * 3600); if (cost >= 1.0) { rc = -1; t = 0.0; /* Sun always below altit */ *ts_rise = *ts_set = t_utc->sse + (tsouth * 3600); } else if (cost <= -1.0) { rc = +1; t = 12.0; /* Sun always above altit */ *ts_rise = t_loc->sse - (12 * 3600); *ts_set = t_loc->sse + (12 * 3600); } else { t = acosd(cost) / 15.0; /* The diurnal arc, hours */ /* Store rise and set times - as Unix Timestamp */ *ts_rise = ((tsouth - t) * 3600) + t_utc->sse; *ts_set = ((tsouth + t) * 3600) + t_utc->sse; *h_rise = (tsouth - t); *h_set = (tsouth + t); } } /* Kill temporary time and restore original sse */ timelib_time_dtor(t_utc); t_loc->sse = old_sse; return rc; }
void timelib_strtointerval(char *s, int len, timelib_time **begin, timelib_time **end, timelib_rel_time **period, int *recurrences, struct timelib_error_container **errors) { Scanner in; int t; char *e = s + len - 1; memset(&in, 0, sizeof(in)); in.errors = malloc(sizeof(struct timelib_error_container)); in.errors->warning_count = 0; in.errors->warning_messages = NULL; in.errors->error_count = 0; in.errors->error_messages = NULL; if (len > 0) { while (isspace(*s) && s < e) { s++; } while (isspace(*e) && e > s) { e--; } } if (e - s < 0) { add_error(&in, "Empty string"); if (errors) { *errors = in.errors; } else { timelib_error_container_dtor(in.errors); } return; } e++; /* init cursor */ in.str = malloc((e - s) + YYMAXFILL); memset(in.str, 0, (e - s) + YYMAXFILL); memcpy(in.str, s, (e - s)); in.lim = in.str + (e - s) + YYMAXFILL; in.cur = in.str; /* init value containers */ in.begin = timelib_time_ctor(); in.begin->y = TIMELIB_UNSET; in.begin->d = TIMELIB_UNSET; in.begin->m = TIMELIB_UNSET; in.begin->h = TIMELIB_UNSET; in.begin->i = TIMELIB_UNSET; in.begin->s = TIMELIB_UNSET; in.begin->f = 0; in.begin->z = 0; in.begin->dst = 0; in.begin->is_localtime = 0; in.begin->zone_type = TIMELIB_ZONETYPE_OFFSET; in.end = timelib_time_ctor(); in.end->y = TIMELIB_UNSET; in.end->d = TIMELIB_UNSET; in.end->m = TIMELIB_UNSET; in.end->h = TIMELIB_UNSET; in.end->i = TIMELIB_UNSET; in.end->s = TIMELIB_UNSET; in.end->f = 0; in.end->z = 0; in.end->dst = 0; in.end->is_localtime = 0; in.end->zone_type = TIMELIB_ZONETYPE_OFFSET; in.period = timelib_rel_time_ctor(); in.period->y = 0; in.period->d = 0; in.period->m = 0; in.period->h = 0; in.period->i = 0; in.period->s = 0; in.period->weekday = 0; in.period->weekday_behavior = 0; in.period->first_last_day_of = 0; in.period->days = TIMELIB_UNSET; in.recurrences = 1; do { t = scan(&in); #ifdef DEBUG_PARSER printf("%d\n", t); #endif } while(t != EOI); free(in.str); if (errors) { *errors = in.errors; } else { timelib_error_container_dtor(in.errors); } if (in.have_begin_date) { *begin = in.begin; } else { timelib_time_dtor(in.begin); } if (in.have_end_date) { *end = in.end; } else { timelib_time_dtor(in.end); } if (in.have_period) { *period = in.period; } else { timelib_rel_time_dtor(in.period); } if (in.have_recurrences) { *recurrences = in.recurrences; } }
static int scan(Scanner *s) { uchar *cursor = s->cur; char *str, *ptr = NULL; std: s->tok = cursor; s->len = 0; { YYCTYPE yych; unsigned int yyaccept = 0; static const unsigned char yybm[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; if ((YYLIMIT - YYCURSOR) < 20) YYFILL(20); yych = *YYCURSOR; { static void *yytarget[256] = { &&yy2, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy6, &&yy2, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy6, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy6, &&yy4, &&yy6, &&yy6, &&yy8, &&yy8, &&yy8, &&yy8, &&yy8, &&yy8, &&yy8, &&yy8, &&yy8, &&yy8, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy9, &&yy4, &&yy11, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4 }; goto *yytarget[yych]; } yy2: ++YYCURSOR; { s->pos = cursor; s->line++; goto std; } yy4: ++YYCURSOR; yy5: { add_error(s, "Unexpected character"); goto std; } yy6: ++YYCURSOR; { goto std; } yy8: yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '/') goto yy5; if (yych <= '9') goto yy12; goto yy5; yy9: yyaccept = 1; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '/') goto yy10; if (yych <= '9') goto yy14; if (yych == 'T') goto yy15; yy10: { timelib_sll nr; int in_time = 0; DEBUG_OUTPUT("period"); TIMELIB_INIT; ptr++; do { if ( *ptr == 'T' ) { in_time = 1; ptr++; } if ( *ptr == '\0' ) { add_error(s, "Missing expected time part"); break; } nr = timelib_get_unsigned_nr((char **) &ptr, 12); switch (*ptr) { case 'Y': s->period->y = nr; break; case 'W': s->period->d = nr * 7; break; case 'D': s->period->d = nr; break; case 'H': s->period->h = nr; break; case 'S': s->period->s = nr; break; case 'M': if (in_time) { s->period->i = nr; } else { s->period->m = nr; } break; default: add_error(s, "Undefined period specifier"); break; } ptr++; } while (!s->errors->error_count && *ptr); s->have_period = 1; TIMELIB_DEINIT; return TIMELIB_PERIOD; } yy11: yych = *++YYCURSOR; if (yybm[0+yych] & 128) { goto yy16; } goto yy5; yy12: yych = *++YYCURSOR; if (yych <= '/') goto yy13; if (yych <= '9') goto yy19; yy13: YYCURSOR = YYMARKER; if (yyaccept == 0) { goto yy5; } else { goto yy10; } yy14: yych = *++YYCURSOR; { static void *yytarget[256] = { &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy20, &&yy20, &&yy20, &&yy20, &&yy20, &&yy20, &&yy20, &&yy20, &&yy20, &&yy20, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy21, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy22, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy23, &&yy13, &&yy24, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13 }; goto *yytarget[yych]; } yy15: yyaccept = 1; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '/') goto yy10; if (yych <= '9') goto yy25; goto yy10; yy16: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yybm[0+yych] & 128) { goto yy16; } { DEBUG_OUTPUT("recurrences"); TIMELIB_INIT; ptr++; s->recurrences = timelib_get_unsigned_nr((char **) &ptr, 9); TIMELIB_DEINIT; s->have_recurrences = 1; return TIMELIB_PERIOD; } yy19: yych = *++YYCURSOR; if (yych <= '/') goto yy13; if (yych <= '9') goto yy27; goto yy13; yy20: yych = *++YYCURSOR; { static void *yytarget[256] = { &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy28, &&yy28, &&yy28, &&yy28, &&yy28, &&yy28, &&yy28, &&yy28, &&yy28, &&yy28, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy21, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy22, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy23, &&yy13, &&yy24, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13 }; goto *yytarget[yych]; } yy21: yych = *++YYCURSOR; if (yych == 'T') goto yy15; goto yy10; yy22: yyaccept = 1; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '/') goto yy10; if (yych <= '9') goto yy29; if (yych == 'T') goto yy15; goto yy10; yy23: yyaccept = 1; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '/') goto yy10; if (yych <= '9') goto yy31; if (yych == 'T') goto yy15; goto yy10; yy24: yyaccept = 1; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '/') goto yy10; if (yych <= '9') goto yy33; if (yych == 'T') goto yy15; goto yy10; yy25: ++YYCURSOR; if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); yych = *YYCURSOR; { static void *yytarget[256] = { &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy25, &&yy25, &&yy25, &&yy25, &&yy25, &&yy25, &&yy25, &&yy25, &&yy25, &&yy25, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy35, &&yy13, &&yy13, &&yy13, &&yy13, &&yy36, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy37, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13 }; goto *yytarget[yych]; } yy27: yych = *++YYCURSOR; if (yych <= '/') { if (yych == '-') goto yy38; goto yy13; } else { if (yych <= '0') goto yy39; if (yych <= '1') goto yy40; goto yy13; } yy28: yych = *++YYCURSOR; { static void *yytarget[256] = { &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy41, &&yy41, &&yy41, &&yy41, &&yy41, &&yy41, &&yy41, &&yy41, &&yy41, &&yy41, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy21, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy22, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy23, &&yy13, &&yy24, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13 }; goto *yytarget[yych]; } yy29: ++YYCURSOR; if ((YYLIMIT - YYCURSOR) < 3) YYFILL(3); yych = *YYCURSOR; if (yych <= 'C') { if (yych <= '/') goto yy13; if (yych <= '9') goto yy29; goto yy13; } else { if (yych <= 'D') goto yy21; if (yych == 'W') goto yy23; goto yy13; } yy31: ++YYCURSOR; if ((YYLIMIT - YYCURSOR) < 3) YYFILL(3); yych = *YYCURSOR; if (yych <= '/') goto yy13; if (yych <= '9') goto yy31; if (yych == 'D') goto yy21; goto yy13; yy33: ++YYCURSOR; if ((YYLIMIT - YYCURSOR) < 3) YYFILL(3); yych = *YYCURSOR; { static void *yytarget[256] = { &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy33, &&yy33, &&yy33, &&yy33, &&yy33, &&yy33, &&yy33, &&yy33, &&yy33, &&yy33, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy21, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy22, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy23, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13 }; goto *yytarget[yych]; } yy35: yyaccept = 1; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '/') goto yy10; if (yych <= '9') goto yy42; goto yy10; yy36: yyaccept = 1; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '/') goto yy10; if (yych <= '9') goto yy44; goto yy10; yy37: ++YYCURSOR; goto yy10; yy38: yych = *++YYCURSOR; if (yych <= '/') goto yy13; if (yych <= '0') goto yy46; if (yych <= '1') goto yy47; goto yy13; yy39: yych = *++YYCURSOR; if (yych <= '0') goto yy13; if (yych <= '9') goto yy48; goto yy13; yy40: yych = *++YYCURSOR; if (yych <= '/') goto yy13; if (yych <= '2') goto yy48; goto yy13; yy41: yych = *++YYCURSOR; if (yych == '-') goto yy49; goto yy51; yy42: ++YYCURSOR; if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); yych = *YYCURSOR; if (yych <= 'L') { if (yych <= '/') goto yy13; if (yych <= '9') goto yy42; goto yy13; } else { if (yych <= 'M') goto yy36; if (yych == 'S') goto yy37; goto yy13; } yy44: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '/') goto yy13; if (yych <= '9') goto yy44; if (yych == 'S') goto yy37; goto yy13; yy46: yych = *++YYCURSOR; if (yych <= '0') goto yy13; if (yych <= '9') goto yy52; goto yy13; yy47: yych = *++YYCURSOR; if (yych <= '/') goto yy13; if (yych <= '2') goto yy52; goto yy13; yy48: yych = *++YYCURSOR; if (yych <= '/') goto yy13; if (yych <= '0') goto yy53; if (yych <= '2') goto yy54; if (yych <= '3') goto yy55; goto yy13; yy49: yych = *++YYCURSOR; if (yych <= '/') goto yy13; if (yych <= '0') goto yy56; if (yych <= '1') goto yy57; goto yy13; yy50: ++YYCURSOR; if ((YYLIMIT - YYCURSOR) < 3) YYFILL(3); yych = *YYCURSOR; yy51: { static void *yytarget[256] = { &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy50, &&yy50, &&yy50, &&yy50, &&yy50, &&yy50, &&yy50, &&yy50, &&yy50, &&yy50, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy21, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy22, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy23, &&yy13, &&yy24, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13, &&yy13 }; goto *yytarget[yych]; } yy52: yych = *++YYCURSOR; if (yych == '-') goto yy58; goto yy13; yy53: yych = *++YYCURSOR; if (yych <= '0') goto yy13; if (yych <= '9') goto yy59; goto yy13; yy54: yych = *++YYCURSOR; if (yych <= '/') goto yy13; if (yych <= '9') goto yy59; goto yy13; yy55: yych = *++YYCURSOR; if (yych <= '/') goto yy13; if (yych <= '1') goto yy59; goto yy13; yy56: yych = *++YYCURSOR; if (yych <= '/') goto yy13; if (yych <= '9') goto yy60; goto yy13; yy57: yych = *++YYCURSOR; if (yych <= '/') goto yy13; if (yych <= '2') goto yy60; goto yy13; yy58: yych = *++YYCURSOR; if (yych <= '/') goto yy13; if (yych <= '0') goto yy61; if (yych <= '2') goto yy62; if (yych <= '3') goto yy63; goto yy13; yy59: yych = *++YYCURSOR; if (yych == 'T') goto yy64; goto yy13; yy60: yych = *++YYCURSOR; if (yych == '-') goto yy65; goto yy13; yy61: yych = *++YYCURSOR; if (yych <= '0') goto yy13; if (yych <= '9') goto yy66; goto yy13; yy62: yych = *++YYCURSOR; if (yych <= '/') goto yy13; if (yych <= '9') goto yy66; goto yy13; yy63: yych = *++YYCURSOR; if (yych <= '/') goto yy13; if (yych <= '1') goto yy66; goto yy13; yy64: yych = *++YYCURSOR; if (yych <= '/') goto yy13; if (yych <= '1') goto yy67; if (yych <= '2') goto yy68; goto yy13; yy65: yych = *++YYCURSOR; if (yych <= '/') goto yy13; if (yych <= '2') goto yy69; if (yych <= '3') goto yy70; goto yy13; yy66: yych = *++YYCURSOR; if (yych == 'T') goto yy71; goto yy13; yy67: yych = *++YYCURSOR; if (yych <= '/') goto yy13; if (yych <= '9') goto yy72; goto yy13; yy68: yych = *++YYCURSOR; if (yych <= '/') goto yy13; if (yych <= '4') goto yy72; goto yy13; yy69: yych = *++YYCURSOR; if (yych <= '/') goto yy13; if (yych <= '9') goto yy73; goto yy13; yy70: yych = *++YYCURSOR; if (yych <= '/') goto yy13; if (yych <= '1') goto yy73; goto yy13; yy71: yych = *++YYCURSOR; if (yych <= '/') goto yy13; if (yych <= '1') goto yy74; if (yych <= '2') goto yy75; goto yy13; yy72: yych = *++YYCURSOR; if (yych <= '/') goto yy13; if (yych <= '5') goto yy76; goto yy13; yy73: yych = *++YYCURSOR; if (yych == 'T') goto yy77; goto yy13; yy74: yych = *++YYCURSOR; if (yych <= '/') goto yy13; if (yych <= '9') goto yy78; goto yy13; yy75: yych = *++YYCURSOR; if (yych <= '/') goto yy13; if (yych <= '4') goto yy78; goto yy13; yy76: yych = *++YYCURSOR; if (yych <= '/') goto yy13; if (yych <= '9') goto yy79; goto yy13; yy77: yych = *++YYCURSOR; if (yych <= '/') goto yy13; if (yych <= '1') goto yy80; if (yych <= '2') goto yy81; goto yy13; yy78: yych = *++YYCURSOR; if (yych == ':') goto yy82; goto yy13; yy79: yych = *++YYCURSOR; if (yych <= '/') goto yy13; if (yych <= '5') goto yy83; goto yy13; yy80: yych = *++YYCURSOR; if (yych <= '/') goto yy13; if (yych <= '9') goto yy84; goto yy13; yy81: yych = *++YYCURSOR; if (yych <= '/') goto yy13; if (yych <= '4') goto yy84; goto yy13; yy82: yych = *++YYCURSOR; if (yych <= '/') goto yy13; if (yych <= '5') goto yy85; goto yy13; yy83: yych = *++YYCURSOR; if (yych <= '/') goto yy13; if (yych <= '9') goto yy86; goto yy13; yy84: yych = *++YYCURSOR; if (yych == ':') goto yy87; goto yy13; yy85: yych = *++YYCURSOR; if (yych <= '/') goto yy13; if (yych <= '9') goto yy88; goto yy13; yy86: yych = *++YYCURSOR; if (yych == 'Z') goto yy89; goto yy13; yy87: yych = *++YYCURSOR; if (yych <= '/') goto yy13; if (yych <= '5') goto yy91; goto yy13; yy88: yych = *++YYCURSOR; if (yych == ':') goto yy79; goto yy13; yy89: ++YYCURSOR; { timelib_time *current; if (s->have_date || s->have_period) { current = s->end; s->have_end_date = 1; } else { current = s->begin; s->have_begin_date = 1; } DEBUG_OUTPUT("datetimebasic | datetimeextended"); TIMELIB_INIT; current->y = timelib_get_nr((char **) &ptr, 4); current->m = timelib_get_nr((char **) &ptr, 2); current->d = timelib_get_nr((char **) &ptr, 2); current->h = timelib_get_nr((char **) &ptr, 2); current->i = timelib_get_nr((char **) &ptr, 2); current->s = timelib_get_nr((char **) &ptr, 2); s->have_date = 1; TIMELIB_DEINIT; return TIMELIB_ISO_DATE; } yy91: yych = *++YYCURSOR; if (yych <= '/') goto yy13; if (yych >= ':') goto yy13; yych = *++YYCURSOR; if (yych != ':') goto yy13; yych = *++YYCURSOR; if (yych <= '/') goto yy13; if (yych >= '6') goto yy13; yych = *++YYCURSOR; if (yych <= '/') goto yy13; if (yych >= ':') goto yy13; ++YYCURSOR; { DEBUG_OUTPUT("combinedrep"); TIMELIB_INIT; s->period->y = timelib_get_unsigned_nr((char **) &ptr, 4); ptr++; s->period->m = timelib_get_unsigned_nr((char **) &ptr, 2); ptr++; s->period->d = timelib_get_unsigned_nr((char **) &ptr, 2); ptr++; s->period->h = timelib_get_unsigned_nr((char **) &ptr, 2); ptr++; s->period->i = timelib_get_unsigned_nr((char **) &ptr, 2); ptr++; s->period->s = timelib_get_unsigned_nr((char **) &ptr, 2); s->have_period = 1; TIMELIB_DEINIT; return TIMELIB_PERIOD; } } } #ifdef PHP_WIN32 #pragma optimize( "", on ) #endif #define YYMAXFILL 20 void timelib_strtointerval(char *s, size_t len, timelib_time **begin, timelib_time **end, timelib_rel_time **period, int *recurrences, struct timelib_error_container **errors) { Scanner in; int t; char *e = s + len - 1; memset(&in, 0, sizeof(in)); in.errors = malloc(sizeof(struct timelib_error_container)); in.errors->warning_count = 0; in.errors->warning_messages = NULL; in.errors->error_count = 0; in.errors->error_messages = NULL; if (len > 0) { while (isspace(*s) && s < e) { s++; } while (isspace(*e) && e > s) { e--; } } if (e - s < 0) { add_error(&in, "Empty string"); if (errors) { *errors = in.errors; } else { timelib_error_container_dtor(in.errors); } return; } e++; /* init cursor */ in.str = malloc((e - s) + YYMAXFILL); memset(in.str, 0, (e - s) + YYMAXFILL); memcpy(in.str, s, (e - s)); in.lim = in.str + (e - s) + YYMAXFILL; in.cur = in.str; /* init value containers */ in.begin = timelib_time_ctor(); in.begin->y = TIMELIB_UNSET; in.begin->d = TIMELIB_UNSET; in.begin->m = TIMELIB_UNSET; in.begin->h = TIMELIB_UNSET; in.begin->i = TIMELIB_UNSET; in.begin->s = TIMELIB_UNSET; in.begin->f = 0; in.begin->z = 0; in.begin->dst = 0; in.begin->is_localtime = 0; in.begin->zone_type = TIMELIB_ZONETYPE_OFFSET; in.end = timelib_time_ctor(); in.end->y = TIMELIB_UNSET; in.end->d = TIMELIB_UNSET; in.end->m = TIMELIB_UNSET; in.end->h = TIMELIB_UNSET; in.end->i = TIMELIB_UNSET; in.end->s = TIMELIB_UNSET; in.end->f = 0; in.end->z = 0; in.end->dst = 0; in.end->is_localtime = 0; in.end->zone_type = TIMELIB_ZONETYPE_OFFSET; in.period = timelib_rel_time_ctor(); in.period->y = 0; in.period->d = 0; in.period->m = 0; in.period->h = 0; in.period->i = 0; in.period->s = 0; in.period->weekday = 0; in.period->weekday_behavior = 0; in.period->first_last_day_of = 0; in.period->days = TIMELIB_UNSET; in.recurrences = 1; do { t = scan(&in); #ifdef DEBUG_PARSER printf("%d\n", t); #endif } while(t != EOI); free(in.str); if (errors) { *errors = in.errors; } else { timelib_error_container_dtor(in.errors); } if (in.have_begin_date) { *begin = in.begin; } else { timelib_time_dtor(in.begin); } if (in.have_end_date) { *end = in.end; } else { timelib_time_dtor(in.end); } if (in.have_period) { *period = in.period; } else { timelib_rel_time_dtor(in.period); } if (in.have_recurrences) { *recurrences = in.recurrences; } }