Lines Matching refs:time

109time->have_time) { add_error(s, "Double time specification"); timelib_string_free(str); return TIM…
110 #define TIMELIB_UNHAVE_TIME() { s->time->have_time = 0; s->time->h = 0; s->time->i = 0; s->time->s …
111 …E() { if (s->time->have_date) { add_error(s, "Double date specification"); timelib_string_free(str…
112 #define TIMELIB_UNHAVE_DATE() { s->time->have_date = 0; s->time->d = 0; s->time->m = 0; s->time->y …
113 #define TIMELIB_HAVE_RELATIVE() { s->time->have_relative = 1; }
114 #define TIMELIB_HAVE_WEEKDAY_RELATIVE() { s->time->have_relative = 1; s->time->relative.have_weekda…
115 #define TIMELIB_HAVE_SPECIAL_RELATIVE() { s->time->have_relative = 1; s->time->relative.have_specia…
116time->have_zone) { s->time->have_zone > 1 ? add_error(s, "Double timezone specification") : add_wa…
120 #define TIMELIB_ADJUST_RELATIVE_WEEKDAY() if (in->time.have_weekday_relative && (in.rel.d > 0)) { i…
155 struct timelib_time *time;
648 case TIMELIB_SECOND: s->time->relative.s += amount * relunit->multiplier; break;
649 case TIMELIB_MINUTE: s->time->relative.i += amount * relunit->multiplier; break;
650 case TIMELIB_HOUR: s->time->relative.h += amount * relunit->multiplier; break;
651 case TIMELIB_DAY: s->time->relative.d += amount * relunit->multiplier; break;
652 case TIMELIB_MONTH: s->time->relative.m += amount * relunit->multiplier; break;
653 case TIMELIB_YEAR: s->time->relative.y += amount * relunit->multiplier; break;
658 s->time->relative.d += (amount > 0 ? amount - 1 : amount) * 7;
659 s->time->relative.weekday = relunit->multiplier;
660 s->time->relative.weekday_behavior = behavior;
666 s->time->relative.special.type = relunit->multiplier;
667 s->time->relative.special.amount = amount;
951 s->time->relative.d = -1;
971 s->time->h = 12;
994 s->time->relative.d = 1;
1010 s->time->y = 1970;
1011 s->time->m = 1;
1012 s->time->d = 1;
1013 s->time->h = s->time->i = s->time->s = 0;
1014 s->time->f = 0.0;
1015 s->time->relative.s += i;
1016 s->time->is_localtime = 1;
1017 s->time->zone_type = TIMELIB_ZONETYPE_OFFSET;
1018 s->time->z = 0;
1019 s->time->dst = 0;
1033 s->time->relative.first_last_day_of = TIMELIB_SPECIAL_LAST_DAY_OF_MONTH;
1035 s->time->relative.first_last_day_of = TIMELIB_SPECIAL_FIRST_DAY_OF_MONTH;
1050 s->time->h = timelib_get_nr((char **) &ptr, 2);
1051 s->time->i = 15;
1053 s->time->h = timelib_get_nr((char **) &ptr, 2) - 1;
1054 s->time->i = 45;
1058 s->time->h += timelib_meridian((char **) &ptr, s->time->h);
1077 s->time->relative.special.type = TIMELIB_SPECIAL_DAY_OF_WEEK_IN_MONTH;
1080 s->time->relative.special.type = TIMELIB_SPECIAL_LAST_DAY_OF_WEEK_IN_MONTH;
1092 s->time->h = timelib_get_nr((char **) &ptr, 2);
1094 s->time->i = timelib_get_nr((char **) &ptr, 2);
1096 s->time->s = timelib_get_nr((char **) &ptr, 2);
1099 s->time->h += timelib_meridian((char **) &ptr, s->time->h);
1109 s->time->h = timelib_get_nr((char **) &ptr, 2);
1110 s->time->i = timelib_get_nr((char **) &ptr, 2);
1112 s->time->s = timelib_get_nr((char **) &ptr, 2);
1115 s->time->f = timelib_get_frac_nr((char **) &ptr, 8);
1119 s->time->h += timelib_meridian((char **) &ptr, s->time->h);
1130 s->time->h = timelib_get_nr((char **) &ptr, 2);
1131 s->time->i = timelib_get_nr((char **) &ptr, 2);
1133 s->time->s = timelib_get_nr((char **) &ptr, 2);
1136 s->time->f = timelib_get_frac_nr((char **) &ptr, 8);
1141 …s->time->z = timelib_parse_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz…
1154 switch (s->time->have_time) {
1156 s->time->h = timelib_get_nr((char **) &ptr, 2);
1157 s->time->i = timelib_get_nr((char **) &ptr, 2);
1158 s->time->s = 0;
1161 s->time->y = timelib_get_nr((char **) &ptr, 4);
1165 add_error(s, "Double time specification");
1168 s->time->have_time++;
1177 switch (s->time->have_time) {
1179 s->time->h = timelib_get_nr((char **) &ptr, 2);
1180 s->time->i = timelib_get_nr((char **) &ptr, 2);
1181 s->time->s = 0;
1182 … s->time->z = timelib_parse_zone((char **) &ptr, &s->time->dst, s->time, s->tzdb, tz_get_wrapper);
1185 s->time->y = timelib_get_nr((char **) &ptr, 4);
1191 s->time->have_time++;
1202 s->time->h = timelib_get_nr((char **) &ptr, 2);
1203 s->time->i = timelib_get_nr((char **) &ptr, 2);
1204 s->time->s = timelib_get_nr((char **) &ptr, 2);
1207 …s->time->z = timelib_parse_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz…
1222 s->time->m = timelib_get_nr((char **) &ptr, 2);
1223 s->time->d = timelib_get_nr((char **) &ptr, 2);
1225 s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
1226 TIMELIB_PROCESS_YEAR(s->time->y, length);
1237 s->time->y = timelib_get_unsigned_nr((char **) &ptr, 4);
1238 s->time->m = timelib_get_nr((char **) &ptr, 2);
1239 s->time->d = timelib_get_nr((char **) &ptr, 2);
1250 s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
1251 s->time->m = timelib_get_nr((char **) &ptr, 2);
1252 s->time->d = timelib_get_nr((char **) &ptr, 2);
1253 TIMELIB_PROCESS_YEAR(s->time->y, length);
1264 s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
1265 s->time->m = timelib_get_nr((char **) &ptr, 2);
1266 s->time->d = 1;
1267 TIMELIB_PROCESS_YEAR(s->time->y, length);
1278 s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
1279 s->time->m = timelib_get_nr((char **) &ptr, 2);
1280 s->time->d = timelib_get_nr((char **) &ptr, 2);
1281 TIMELIB_PROCESS_YEAR(s->time->y, length);
1292 s->time->d = timelib_get_nr((char **) &ptr, 2);
1294 s->time->m = timelib_get_month((char **) &ptr);
1295 s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
1296 TIMELIB_PROCESS_YEAR(s->time->y, length);
1306 s->time->d = timelib_get_nr((char **) &ptr, 2);
1307 s->time->m = timelib_get_nr((char **) &ptr, 2);
1308 s->time->y = timelib_get_nr((char **) &ptr, 4);
1319 s->time->d = timelib_get_nr((char **) &ptr, 2);
1320 s->time->m = timelib_get_nr((char **) &ptr, 2);
1321 s->time->y = timelib_get_nr_ex((char **) &ptr, 2, &length);
1322 TIMELIB_PROCESS_YEAR(s->time->y, length);
1333 s->time->m = timelib_get_month((char **) &ptr);
1334 s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
1335 s->time->d = 1;
1336 TIMELIB_PROCESS_YEAR(s->time->y, length);
1347 s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
1348 s->time->m = timelib_get_month((char **) &ptr);
1349 s->time->d = 1;
1350 TIMELIB_PROCESS_YEAR(s->time->y, length);
1361 s->time->m = timelib_get_month((char **) &ptr);
1362 s->time->d = timelib_get_nr((char **) &ptr, 2);
1363 s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
1364 TIMELIB_PROCESS_YEAR(s->time->y, length);
1374 s->time->d = timelib_get_nr((char **) &ptr, 2);
1376 s->time->m = timelib_get_month((char **) &ptr);
1386 s->time->y = timelib_get_nr((char **) &ptr, 4);
1387 s->time->m = timelib_get_nr((char **) &ptr, 2);
1388 s->time->d = timelib_get_nr((char **) &ptr, 2);
1400 s->time->y = timelib_get_nr((char **) &ptr, 4);
1401 s->time->m = timelib_get_nr((char **) &ptr, 2);
1402 s->time->d = timelib_get_nr((char **) &ptr, 2);
1403 s->time->h = timelib_get_nr((char **) &ptr, 2);
1404 s->time->i = timelib_get_nr((char **) &ptr, 2);
1405 s->time->s = timelib_get_nr((char **) &ptr, 2);
1407 s->time->f = timelib_get_frac_nr((char **) &ptr, 9);
1409 …s->time->z = timelib_parse_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz…
1425 s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
1426 s->time->d = timelib_get_nr((char **) &ptr, 3);
1427 s->time->m = 1;
1428 TIMELIB_PROCESS_YEAR(s->time->y, length);
1441 s->time->y = timelib_get_nr((char **) &ptr, 4);
1444 s->time->m = 1;
1445 s->time->d = 1;
1446 s->time->relative.d = timelib_daynr_from_weeknr(s->time->y, w, d);
1460 s->time->y = timelib_get_nr((char **) &ptr, 4);
1463 s->time->m = 1;
1464 s->time->d = 1;
1465 s->time->relative.d = timelib_daynr_from_weeknr(s->time->y, w, d);
1477 s->time->m = timelib_get_month((char **) &ptr);
1478 s->time->d = timelib_get_nr((char **) &ptr, 2);
1479 s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
1480 TIMELIB_PROCESS_YEAR(s->time->y, length);
1491 s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
1492 s->time->m = timelib_get_month((char **) &ptr);
1493 s->time->d = timelib_get_nr((char **) &ptr, 2);
1494 TIMELIB_PROCESS_YEAR(s->time->y, length);
1506 s->time->d = timelib_get_nr((char **) &ptr, 2);
1507 s->time->m = timelib_get_month((char **) &ptr);
1508 s->time->y = timelib_get_nr((char **) &ptr, 4);
1509 s->time->h = timelib_get_nr((char **) &ptr, 2);
1510 s->time->i = timelib_get_nr((char **) &ptr, 2);
1511 s->time->s = timelib_get_nr((char **) &ptr, 2);
1512 …s->time->z = timelib_parse_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz…
1524 s->time->y = timelib_get_nr((char **) &ptr, 4);
1533 s->time->relative.y = 0 - s->time->relative.y;
1534 s->time->relative.m = 0 - s->time->relative.m;
1535 s->time->relative.d = 0 - s->time->relative.d;
1536 s->time->relative.h = 0 - s->time->relative.h;
1537 s->time->relative.i = 0 - s->time->relative.i;
1538 s->time->relative.s = 0 - s->time->relative.s;
1539 s->time->relative.weekday = 0 - s->time->relative.weekday;
1540 if (s->time->relative.weekday == 0) {
1541 s->time->relative.weekday = -7;
1543 …if (s->time->relative.have_special_relative && s->time->relative.special.type == TIMELIB_SPECIAL_W…
1544 s->time->relative.special.amount = 0 - s->time->relative.special.amount;
1559 s->time->relative.weekday = relunit->multiplier;
1560 if (s->time->relative.weekday_behavior != 2) {
1561 s->time->relative.weekday_behavior = 1;
1580 s->time->relative.weekday_behavior = 2;
1583 if (s->time->relative.have_weekday_relative == 0) {
1585 s->time->relative.weekday = 1;
1614 s->time->m = timelib_lookup_month((char **) &ptr);
1625 …s->time->z = timelib_parse_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz…
1638 s->time->m = timelib_get_month((char **) &ptr);
1639 s->time->d = timelib_get_nr((char **) &ptr, 2);
1642 s->time->h = timelib_get_nr((char **) &ptr, 2);
1643 s->time->i = timelib_get_nr((char **) &ptr, 2);
1645 s->time->s = timelib_get_nr((char **) &ptr, 2);
1648 s->time->f = timelib_get_frac_nr((char **) &ptr, 8);
1652 s->time->h += timelib_meridian((char **) &ptr, s->time->h);
1663 s->time->m = timelib_get_month((char **) &ptr);
1664 s->time->d = timelib_get_nr((char **) &ptr, 2);
1667 s->time->h = timelib_get_nr((char **) &ptr, 2);
1668 s->time->i = timelib_get_nr((char **) &ptr, 2);
1670 s->time->s = timelib_get_nr((char **) &ptr, 2);
1673 s->time->f = timelib_get_frac_nr((char **) &ptr, 8);
1678 …s->time->z = timelib_parse_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz…
1746 in.time = timelib_time_ctor();
1753 …in.time->y = in.time->d = in.time->m = in.time->h = in.time->i = in.time->s = in.time->f = in.time
1754 in.time->is_localtime = in.time->zone_type = 0;
1755 return in.time;
1764 in.time = timelib_time_ctor();
1765 in.time->y = TIMELIB_UNSET;
1766 in.time->d = TIMELIB_UNSET;
1767 in.time->m = TIMELIB_UNSET;
1768 in.time->h = TIMELIB_UNSET;
1769 in.time->i = TIMELIB_UNSET;
1770 in.time->s = TIMELIB_UNSET;
1771 in.time->f = TIMELIB_UNSET;
1772 in.time->z = TIMELIB_UNSET;
1773 in.time->dst = TIMELIB_UNSET;
1775 in.time->is_localtime = 0;
1776 in.time->zone_type = 0;
1777 in.time->relative.days = TIMELIB_UNSET;
1786 /* do funky checking whether the parsed time was valid time */
1787 if (in.time->have_time && !timelib_valid_time( in.time->h, in.time->i, in.time->s)) {
1788 add_warning(&in, "The parsed time was invalid");
1791 if (in.time->have_date && !timelib_valid_date( in.time->y, in.time->m, in.time->d)) {
1801 return in.time;
1810 static void timelib_time_reset_fields(timelib_time *time)
1812 assert(time != NULL);
1814 time->y = 1970;
1815 time->m = 1;
1816 time->d = 1;
1817 time->h = time->i = time->s = 0;
1818 time->f = 0.0;
1819 time->tz_info = NULL;
1822 static void timelib_time_reset_unset_fields(timelib_time *time)
1824 assert(time != NULL);
1826 if (time->y == TIMELIB_UNSET ) time->y = 1970;
1827 if (time->m == TIMELIB_UNSET ) time->m = 1;
1828 if (time->d == TIMELIB_UNSET ) time->d = 1;
1829 if (time->h == TIMELIB_UNSET ) time->h = 0;
1830 if (time->i == TIMELIB_UNSET ) time->i = 0;
1831 if (time->s == TIMELIB_UNSET ) time->s = 0;
1832 if (time->f == TIMELIB_UNSET ) time->f = 0.0;
1852 in.time = timelib_time_ctor();
1853 in.time->y = TIMELIB_UNSET;
1854 in.time->d = TIMELIB_UNSET;
1855 in.time->m = TIMELIB_UNSET;
1856 in.time->h = TIMELIB_UNSET;
1857 in.time->i = TIMELIB_UNSET;
1858 in.time->s = TIMELIB_UNSET;
1859 in.time->f = TIMELIB_UNSET;
1860 in.time->z = TIMELIB_UNSET;
1861 in.time->dst = TIMELIB_UNSET;
1863 in.time->is_localtime = 0;
1864 in.time->zone_type = 0;
1880 in.time->have_relative = 1;
1881 in.time->relative.have_weekday_relative = 1;
1882 in.time->relative.weekday = tmprel->multiplier;
1883 in.time->relative.weekday_behavior = 1;
1890 if ((s->time->d = timelib_get_nr((char **) &ptr, 2)) == TIMELIB_UNSET) {
1902 s->time->m = 1;
1903 s->time->d = tmp + 1;
1904 timelib_do_normalize(s->time);
1911 if ((s->time->m = timelib_get_nr((char **) &ptr, 2)) == TIMELIB_UNSET) {
1921 s->time->m = tmp;
1928 if ((s->time->y = timelib_get_nr_ex((char **) &ptr, 2, &length)) == TIMELIB_UNSET) {
1931 TIMELIB_PROCESS_YEAR(s->time->y, length);
1936 if ((s->time->y = timelib_get_nr((char **) &ptr, 4)) == TIMELIB_UNSET) {
1943 if ((s->time->h = timelib_get_nr((char **) &ptr, 2)) == TIMELIB_UNSET) {
1946 if (s->time->h > 12) {
1953 if ((s->time->h = timelib_get_nr((char **) &ptr, 2)) == TIMELIB_UNSET) {
1959 if (s->time->h == TIMELIB_UNSET) {
1961 } else if ((tmp = timelib_meridian_with_check((char **) &ptr, s->time->h)) == TIMELIB_UNSET) {
1964 s->time->h += tmp;
1977 s->time->i = min;
1991 s->time->s = sec;
2005 s->time->f = (f / pow(10, (ptr - tptr)));
2016 s->time->y = 1970;
2017 s->time->m = 1;
2018 s->time->d = 1;
2019 s->time->h = s->time->i = s->time->s = 0;
2020 s->time->f = 0.0;
2021 s->time->relative.s += tmp;
2022 s->time->is_localtime = 1;
2023 s->time->zone_type = TIMELIB_ZONETYPE_OFFSET;
2024 s->time->z = 0;
2025 s->time->dst = 0;
2034 …s->time->z = timelib_parse_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz…
2065 timelib_time_reset_fields(s->time);
2069 timelib_time_reset_unset_fields(s->time);
2122 timelib_time_reset_fields(s->time);
2126 timelib_time_reset_unset_fields(s->time);
2137 if (s->time->h != TIMELIB_UNSET || s->time->i != TIMELIB_UNSET || s->time->s != TIMELIB_UNSET) {
2138 if (s->time->h == TIMELIB_UNSET ) {
2139 s->time->h = 0;
2141 if (s->time->i == TIMELIB_UNSET ) {
2142 s->time->i = 0;
2144 if (s->time->s == TIMELIB_UNSET ) {
2145 s->time->s = 0;
2149 /* do funky checking whether the parsed time was valid time */
2150 if (s->time->h != TIMELIB_UNSET && s->time->i != TIMELIB_UNSET &&
2151 s->time->s != TIMELIB_UNSET &&
2152 !timelib_valid_time( s->time->h, s->time->i, s->time->s)) {
2153 add_pbf_warning(s, "The parsed time was invalid", string, ptr);
2156 if (s->time->y != TIMELIB_UNSET && s->time->m != TIMELIB_UNSET &&
2157 s->time->d != TIMELIB_UNSET &&
2158 !timelib_valid_date( s->time->y, s->time->m, s->time->d)) {
2167 return in.time;
2225 timelib_time time = timelib_strtotime("May 12");
2228 time.y, time.m, time.d, time.h, time.i, time.s, time.f, time.z, time.dst);
2229 if (time.have_relative) {
2231time.relative.y, time.relative.m, time.relative.d, time.relative.h, time.relative.i, time.relative…
2233 if (time.have_weekday_relative) {
2234 printf (" / %d", time.relative.weekday);
2236 if (time.have_weeknr_day) {
2237 printf(" / %dW%d", time.relative.weeknr_day.weeknr, time.relative.weeknr_day.dayofweek);