Lines Matching refs:time

95time->have_time) { add_error(s, TIMELIB_ERR_DOUBLE_TIME, "Double time specification"); timelib_str…
96 #define TIMELIB_UNHAVE_TIME() { s->time->have_time = 0; s->time->h = 0; s->time->i = 0; s->time->s …
97 …>time->have_date) { add_error(s, TIMELIB_ERR_DOUBLE_DATE, "Double date specification"); timelib_st…
98 #define TIMELIB_UNHAVE_DATE() { s->time->have_date = 0; s->time->d = 0; s->time->m = 0; s->time->y …
99 #define TIMELIB_HAVE_RELATIVE() { s->time->have_relative = 1; }
100 #define TIMELIB_HAVE_WEEKDAY_RELATIVE() { s->time->have_relative = 1; s->time->relative.have_weekda…
101 #define TIMELIB_HAVE_SPECIAL_RELATIVE() { s->time->have_relative = 1; s->time->relative.have_specia…
102time->have_zone) { s->time->have_zone > 1 ? add_error(s, TIMELIB_ERR_DOUBLE_TZ, "Double timezone s…
106 #define TIMELIB_ADJUST_RELATIVE_WEEKDAY() if (in->time.have_weekday_relative && (in.rel.d > 0)) { i…
139 timelib_time *time;
649 case TIMELIB_MICROSEC: s->time->relative.us += amount * relunit->multiplier; break;
650 case TIMELIB_SECOND: s->time->relative.s += amount * relunit->multiplier; break;
651 case TIMELIB_MINUTE: s->time->relative.i += amount * relunit->multiplier; break;
652 case TIMELIB_HOUR: s->time->relative.h += amount * relunit->multiplier; break;
653 case TIMELIB_DAY: s->time->relative.d += amount * relunit->multiplier; break;
654 case TIMELIB_MONTH: s->time->relative.m += amount * relunit->multiplier; break;
655 case TIMELIB_YEAR: s->time->relative.y += amount * relunit->multiplier; break;
660 s->time->relative.d += (amount > 0 ? amount - 1 : amount) * 7;
661 s->time->relative.weekday = relunit->multiplier;
662 s->time->relative.weekday_behavior = behavior;
668 s->time->relative.special.type = relunit->multiplier;
669 s->time->relative.special.amount = amount;
992 s->time->relative.d = -1;
1012 s->time->h = 12;
1035 s->time->relative.d = 1;
1051 s->time->y = 1970;
1052 s->time->m = 1;
1053 s->time->d = 1;
1054 s->time->h = s->time->i = s->time->s = 0;
1055 s->time->us = 0;
1056 s->time->relative.s += i;
1057 s->time->is_localtime = 1;
1058 s->time->zone_type = TIMELIB_ZONETYPE_OFFSET;
1059 s->time->z = 0;
1060 s->time->dst = 0;
1078 s->time->y = 1970;
1079 s->time->m = 1;
1080 s->time->d = 1;
1081 s->time->h = s->time->i = s->time->s = 0;
1082 s->time->us = 0;
1083 s->time->relative.s += i;
1084 s->time->relative.us = us;
1085 s->time->is_localtime = 1;
1086 s->time->zone_type = TIMELIB_ZONETYPE_OFFSET;
1087 s->time->z = 0;
1088 s->time->dst = 0;
1102 s->time->relative.first_last_day_of = TIMELIB_SPECIAL_LAST_DAY_OF_MONTH;
1104 s->time->relative.first_last_day_of = TIMELIB_SPECIAL_FIRST_DAY_OF_MONTH;
1119 s->time->h = timelib_get_nr((char **) &ptr, 2);
1120 s->time->i = 15;
1122 s->time->h = timelib_get_nr((char **) &ptr, 2) - 1;
1123 s->time->i = 45;
1127 s->time->h += timelib_meridian((char **) &ptr, s->time->h);
1146 s->time->relative.special.type = TIMELIB_SPECIAL_DAY_OF_WEEK_IN_MONTH;
1149 s->time->relative.special.type = TIMELIB_SPECIAL_LAST_DAY_OF_WEEK_IN_MONTH;
1161 s->time->h = timelib_get_nr((char **) &ptr, 2);
1163 s->time->i = timelib_get_nr((char **) &ptr, 2);
1165 s->time->s = timelib_get_nr((char **) &ptr, 2);
1168 s->time->h += timelib_meridian((char **) &ptr, s->time->h);
1178 s->time->h = timelib_get_nr((char **) &ptr, 2);
1179 s->time->i = timelib_get_nr((char **) &ptr, 2);
1181 s->time->s = timelib_get_nr((char **) &ptr, 2);
1184 s->time->us = timelib_get_frac_nr((char **) &ptr, 8);
1188 s->time->h += timelib_meridian((char **) &ptr, s->time->h);
1199 s->time->h = timelib_get_nr((char **) &ptr, 2);
1200 s->time->i = timelib_get_nr((char **) &ptr, 2);
1202 s->time->s = timelib_get_nr((char **) &ptr, 2);
1205 s->time->us = timelib_get_frac_nr((char **) &ptr, 8);
1210 …s->time->z = timelib_parse_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz…
1223 switch (s->time->have_time) {
1225 s->time->h = timelib_get_nr((char **) &ptr, 2);
1226 s->time->i = timelib_get_nr((char **) &ptr, 2);
1227 s->time->s = 0;
1230 s->time->y = timelib_get_nr((char **) &ptr, 4);
1234 add_error(s, TIMELIB_ERR_DOUBLE_TIME, "Double time specification");
1237 s->time->have_time++;
1246 switch (s->time->have_time) {
1248 s->time->h = timelib_get_nr((char **) &ptr, 2);
1249 s->time->i = timelib_get_nr((char **) &ptr, 2);
1250 s->time->s = 0;
1251 … s->time->z = timelib_parse_zone((char **) &ptr, &s->time->dst, s->time, s->tzdb, tz_get_wrapper);
1254 s->time->y = timelib_get_nr((char **) &ptr, 4);
1260 s->time->have_time++;
1271 s->time->h = timelib_get_nr((char **) &ptr, 2);
1272 s->time->i = timelib_get_nr((char **) &ptr, 2);
1273 s->time->s = timelib_get_nr((char **) &ptr, 2);
1276 …s->time->z = timelib_parse_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz…
1291 s->time->m = timelib_get_nr((char **) &ptr, 2);
1292 s->time->d = timelib_get_nr((char **) &ptr, 2);
1294 s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
1295 TIMELIB_PROCESS_YEAR(s->time->y, length);
1306 s->time->y = timelib_get_unsigned_nr((char **) &ptr, 4);
1307 s->time->m = timelib_get_nr((char **) &ptr, 2);
1308 s->time->d = timelib_get_nr((char **) &ptr, 2);
1319 s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
1320 s->time->m = timelib_get_nr((char **) &ptr, 2);
1321 s->time->d = timelib_get_nr((char **) &ptr, 2);
1322 TIMELIB_PROCESS_YEAR(s->time->y, length);
1333 s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
1334 s->time->m = timelib_get_nr((char **) &ptr, 2);
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_nr((char **) &ptr, 2);
1349 s->time->d = timelib_get_nr((char **) &ptr, 2);
1350 TIMELIB_PROCESS_YEAR(s->time->y, length);
1361 s->time->d = timelib_get_nr((char **) &ptr, 2);
1363 s->time->m = timelib_get_month((char **) &ptr);
1364 s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
1365 TIMELIB_PROCESS_YEAR(s->time->y, length);
1375 s->time->d = timelib_get_nr((char **) &ptr, 2);
1376 s->time->m = timelib_get_nr((char **) &ptr, 2);
1377 s->time->y = timelib_get_nr((char **) &ptr, 4);
1388 s->time->d = timelib_get_nr((char **) &ptr, 2);
1389 s->time->m = timelib_get_nr((char **) &ptr, 2);
1390 s->time->y = timelib_get_nr_ex((char **) &ptr, 2, &length);
1391 TIMELIB_PROCESS_YEAR(s->time->y, length);
1402 s->time->m = timelib_get_month((char **) &ptr);
1403 s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
1404 s->time->d = 1;
1405 TIMELIB_PROCESS_YEAR(s->time->y, length);
1416 s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
1417 s->time->m = timelib_get_month((char **) &ptr);
1418 s->time->d = 1;
1419 TIMELIB_PROCESS_YEAR(s->time->y, length);
1430 s->time->m = timelib_get_month((char **) &ptr);
1431 s->time->d = timelib_get_nr((char **) &ptr, 2);
1432 s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
1433 TIMELIB_PROCESS_YEAR(s->time->y, length);
1443 s->time->d = timelib_get_nr((char **) &ptr, 2);
1445 s->time->m = timelib_get_month((char **) &ptr);
1455 s->time->y = timelib_get_nr((char **) &ptr, 4);
1456 s->time->m = timelib_get_nr((char **) &ptr, 2);
1457 s->time->d = timelib_get_nr((char **) &ptr, 2);
1469 s->time->y = timelib_get_nr((char **) &ptr, 4);
1470 s->time->m = timelib_get_nr((char **) &ptr, 2);
1471 s->time->d = timelib_get_nr((char **) &ptr, 2);
1472 s->time->h = timelib_get_nr((char **) &ptr, 2);
1473 s->time->i = timelib_get_nr((char **) &ptr, 2);
1474 s->time->s = timelib_get_nr((char **) &ptr, 2);
1476 s->time->us = timelib_get_frac_nr((char **) &ptr, 9);
1478 …s->time->z = timelib_parse_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz…
1494 s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
1495 s->time->d = timelib_get_nr((char **) &ptr, 3);
1496 s->time->m = 1;
1497 TIMELIB_PROCESS_YEAR(s->time->y, length);
1510 s->time->y = timelib_get_nr((char **) &ptr, 4);
1513 s->time->m = 1;
1514 s->time->d = 1;
1515 s->time->relative.d = timelib_daynr_from_weeknr(s->time->y, w, d);
1529 s->time->y = timelib_get_nr((char **) &ptr, 4);
1532 s->time->m = 1;
1533 s->time->d = 1;
1534 s->time->relative.d = timelib_daynr_from_weeknr(s->time->y, w, d);
1546 s->time->m = timelib_get_month((char **) &ptr);
1547 s->time->d = timelib_get_nr((char **) &ptr, 2);
1548 s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
1549 TIMELIB_PROCESS_YEAR(s->time->y, length);
1560 s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
1561 s->time->m = timelib_get_month((char **) &ptr);
1562 s->time->d = timelib_get_nr((char **) &ptr, 2);
1563 TIMELIB_PROCESS_YEAR(s->time->y, length);
1575 s->time->d = timelib_get_nr((char **) &ptr, 2);
1576 s->time->m = timelib_get_month((char **) &ptr);
1577 s->time->y = timelib_get_nr((char **) &ptr, 4);
1578 s->time->h = timelib_get_nr((char **) &ptr, 2);
1579 s->time->i = timelib_get_nr((char **) &ptr, 2);
1580 s->time->s = timelib_get_nr((char **) &ptr, 2);
1581 …s->time->z = timelib_parse_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz…
1593 s->time->y = timelib_get_nr((char **) &ptr, 4);
1602 s->time->relative.y = 0 - s->time->relative.y;
1603 s->time->relative.m = 0 - s->time->relative.m;
1604 s->time->relative.d = 0 - s->time->relative.d;
1605 s->time->relative.h = 0 - s->time->relative.h;
1606 s->time->relative.i = 0 - s->time->relative.i;
1607 s->time->relative.s = 0 - s->time->relative.s;
1608 s->time->relative.weekday = 0 - s->time->relative.weekday;
1609 if (s->time->relative.weekday == 0) {
1610 s->time->relative.weekday = -7;
1612 …if (s->time->relative.have_special_relative && s->time->relative.special.type == TIMELIB_SPECIAL_W…
1613 s->time->relative.special.amount = 0 - s->time->relative.special.amount;
1628 s->time->relative.weekday = relunit->multiplier;
1629 if (s->time->relative.weekday_behavior != 2) {
1630 s->time->relative.weekday_behavior = 1;
1649 s->time->relative.weekday_behavior = 2;
1652 if (s->time->relative.have_weekday_relative == 0) {
1654 s->time->relative.weekday = 1;
1683 s->time->m = timelib_lookup_month((char **) &ptr);
1694 …s->time->z = timelib_parse_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz…
1707 s->time->m = timelib_get_month((char **) &ptr);
1708 s->time->d = timelib_get_nr((char **) &ptr, 2);
1711 s->time->h = timelib_get_nr((char **) &ptr, 2);
1712 s->time->i = timelib_get_nr((char **) &ptr, 2);
1714 s->time->s = timelib_get_nr((char **) &ptr, 2);
1717 s->time->us = timelib_get_frac_nr((char **) &ptr, 8);
1721 s->time->h += timelib_meridian((char **) &ptr, s->time->h);
1732 s->time->m = timelib_get_month((char **) &ptr);
1733 s->time->d = timelib_get_nr((char **) &ptr, 2);
1736 s->time->h = timelib_get_nr((char **) &ptr, 2);
1737 s->time->i = timelib_get_nr((char **) &ptr, 2);
1739 s->time->s = timelib_get_nr((char **) &ptr, 2);
1742 s->time->us = timelib_get_frac_nr((char **) &ptr, 8);
1747 …s->time->z = timelib_parse_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz…
1815 in.time = timelib_time_ctor();
1822 …in.time->y = in.time->d = in.time->m = in.time->h = in.time->i = in.time->s = in.time->us = in.tim…
1823 in.time->is_localtime = in.time->zone_type = 0;
1824 return in.time;
1833 in.time = timelib_time_ctor();
1834 in.time->y = TIMELIB_UNSET;
1835 in.time->d = TIMELIB_UNSET;
1836 in.time->m = TIMELIB_UNSET;
1837 in.time->h = TIMELIB_UNSET;
1838 in.time->i = TIMELIB_UNSET;
1839 in.time->s = TIMELIB_UNSET;
1840 in.time->us = TIMELIB_UNSET;
1841 in.time->z = TIMELIB_UNSET;
1842 in.time->dst = TIMELIB_UNSET;
1844 in.time->is_localtime = 0;
1845 in.time->zone_type = 0;
1846 in.time->relative.days = TIMELIB_UNSET;
1855 /* do funky checking whether the parsed time was valid time */
1856 if (in.time->have_time && !timelib_valid_time( in.time->h, in.time->i, in.time->s)) {
1857 add_warning(&in, TIMELIB_WARN_INVALID_TIME, "The parsed time was invalid");
1860 if (in.time->have_date && !timelib_valid_date( in.time->y, in.time->m, in.time->d)) {
1870 return in.time;
1884 static void timelib_time_reset_fields(timelib_time *time)
1886 assert(time != NULL);
1888 time->y = 1970;
1889 time->m = 1;
1890 time->d = 1;
1891 time->h = time->i = time->s = 0;
1892 time->us = 0;
1893 time->tz_info = NULL;
1896 static void timelib_time_reset_unset_fields(timelib_time *time)
1898 assert(time != NULL);
1900 if (time->y == TIMELIB_UNSET ) time->y = 1970;
1901 if (time->m == TIMELIB_UNSET ) time->m = 1;
1902 if (time->d == TIMELIB_UNSET ) time->d = 1;
1903 if (time->h == TIMELIB_UNSET ) time->h = 0;
1904 if (time->i == TIMELIB_UNSET ) time->i = 0;
1905 if (time->s == TIMELIB_UNSET ) time->s = 0;
1906 if (time->us == TIMELIB_UNSET ) time->us = 0;
1926 in.time = timelib_time_ctor();
1927 in.time->y = TIMELIB_UNSET;
1928 in.time->d = TIMELIB_UNSET;
1929 in.time->m = TIMELIB_UNSET;
1930 in.time->h = TIMELIB_UNSET;
1931 in.time->i = TIMELIB_UNSET;
1932 in.time->s = TIMELIB_UNSET;
1933 in.time->us = TIMELIB_UNSET;
1934 in.time->z = TIMELIB_UNSET;
1935 in.time->dst = TIMELIB_UNSET;
1937 in.time->is_localtime = 0;
1938 in.time->zone_type = 0;
1954 in.time->have_relative = 1;
1955 in.time->relative.have_weekday_relative = 1;
1956 in.time->relative.weekday = tmprel->multiplier;
1957 in.time->relative.weekday_behavior = 1;
1964 if ((s->time->d = timelib_get_nr((char **) &ptr, 2)) == TIMELIB_UNSET) {
1976 s->time->m = 1;
1977 s->time->d = tmp + 1;
1978 timelib_do_normalize(s->time);
1985 if ((s->time->m = timelib_get_nr((char **) &ptr, 2)) == TIMELIB_UNSET) {
1995 s->time->m = tmp;
2002 if ((s->time->y = timelib_get_nr_ex((char **) &ptr, 2, &length)) == TIMELIB_UNSET) {
2005 TIMELIB_PROCESS_YEAR(s->time->y, length);
2010 if ((s->time->y = timelib_get_nr((char **) &ptr, 4)) == TIMELIB_UNSET) {
2017 if ((s->time->h = timelib_get_nr((char **) &ptr, 2)) == TIMELIB_UNSET) {
2020 if (s->time->h > 12) {
2027 if ((s->time->h = timelib_get_nr((char **) &ptr, 2)) == TIMELIB_UNSET) {
2033 if (s->time->h == TIMELIB_UNSET) {
2035 } else if ((tmp = timelib_meridian_with_check((char **) &ptr, s->time->h)) == TIMELIB_UNSET) {
2038 s->time->h += tmp;
2051 s->time->i = min;
2065 s->time->s = sec;
2079 s->time->us = (f * pow(10, 6 - (ptr - tptr)));
2090 s->time->y = 1970;
2091 s->time->m = 1;
2092 s->time->d = 1;
2093 s->time->h = s->time->i = s->time->s = 0;
2094 s->time->relative.s += tmp;
2095 s->time->is_localtime = 1;
2096 s->time->zone_type = TIMELIB_ZONETYPE_OFFSET;
2097 s->time->z = 0;
2098 s->time->dst = 0;
2107 …s->time->z = timelib_parse_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz…
2138 timelib_time_reset_fields(s->time);
2142 timelib_time_reset_unset_fields(s->time);
2195 timelib_time_reset_fields(s->time);
2199 timelib_time_reset_unset_fields(s->time);
2210 if (s->time->h != TIMELIB_UNSET || s->time->i != TIMELIB_UNSET || s->time->s != TIMELIB_UNSET) {
2211 if (s->time->h == TIMELIB_UNSET ) {
2212 s->time->h = 0;
2214 if (s->time->i == TIMELIB_UNSET ) {
2215 s->time->i = 0;
2217 if (s->time->s == TIMELIB_UNSET ) {
2218 s->time->s = 0;
2222 /* do funky checking whether the parsed time was valid time */
2223 if (s->time->h != TIMELIB_UNSET && s->time->i != TIMELIB_UNSET &&
2224 s->time->s != TIMELIB_UNSET &&
2225 !timelib_valid_time( s->time->h, s->time->i, s->time->s)) {
2226 add_pbf_warning(s, TIMELIB_WARN_INVALID_TIME, "The parsed time was invalid", string, ptr);
2229 if (s->time->y != TIMELIB_UNSET && s->time->m != TIMELIB_UNSET &&
2230 s->time->d != TIMELIB_UNSET &&
2231 !timelib_valid_date( s->time->y, s->time->m, s->time->d)) {
2240 return in.time;
2305 timelib_time time = timelib_strtotime("May 12");
2308 time.y, time.m, time.d, time.h, time.i, time.s, time.f, time.z, time.dst);
2309 if (time.have_relative) {
2311time.relative.y, time.relative.m, time.relative.d, time.relative.h, time.relative.i, time.relative…
2313 if (time.have_weekday_relative) {
2314 printf (" / %d", time.relative.weekday);
2316 if (time.have_weeknr_day) {
2317 printf(" / %dW%d", time.relative.weeknr_day.weeknr, time.relative.weeknr_day.dayofweek);