Lines Matching refs:time

115time->have_time) { add_error(s, "Double time specification"); timelib_string_free(str); return TIM…
116 #define TIMELIB_UNHAVE_TIME() { s->time->have_time = 0; s->time->h = 0; s->time->i = 0; s->time->s …
117 …E() { if (s->time->have_date) { add_error(s, "Double date specification"); timelib_string_free(str…
118 #define TIMELIB_UNHAVE_DATE() { s->time->have_date = 0; s->time->d = 0; s->time->m = 0; s->time->y …
119 #define TIMELIB_HAVE_RELATIVE() { s->time->have_relative = 1; }
120 #define TIMELIB_HAVE_WEEKDAY_RELATIVE() { s->time->have_relative = 1; s->time->relative.have_weekda…
121 #define TIMELIB_HAVE_SPECIAL_RELATIVE() { s->time->have_relative = 1; s->time->relative.have_specia…
122time->have_zone) { s->time->have_zone > 1 ? add_error(s, "Double timezone specification") : add_wa…
126 #define TIMELIB_ADJUST_RELATIVE_WEEKDAY() if (in->time.have_weekday_relative && (in.rel.d > 0)) { i…
161 struct timelib_time *time;
658 case TIMELIB_SECOND: s->time->relative.s += amount * relunit->multiplier; break;
659 case TIMELIB_MINUTE: s->time->relative.i += amount * relunit->multiplier; break;
660 case TIMELIB_HOUR: s->time->relative.h += amount * relunit->multiplier; break;
661 case TIMELIB_DAY: s->time->relative.d += amount * relunit->multiplier; break;
662 case TIMELIB_MONTH: s->time->relative.m += amount * relunit->multiplier; break;
663 case TIMELIB_YEAR: s->time->relative.y += amount * relunit->multiplier; break;
668 s->time->relative.d += (amount > 0 ? amount - 1 : amount) * 7;
669 s->time->relative.weekday = relunit->multiplier;
670 s->time->relative.weekday_behavior = behavior;
676 s->time->relative.special.type = relunit->multiplier;
677 s->time->relative.special.amount = amount;
961 s->time->relative.d = -1;
981 s->time->h = 12;
1004 s->time->relative.d = 1;
1020 s->time->y = 1970;
1021 s->time->m = 1;
1022 s->time->d = 1;
1023 s->time->h = s->time->i = s->time->s = 0;
1024 s->time->f = 0.0;
1025 s->time->relative.s += i;
1026 s->time->is_localtime = 1;
1027 s->time->zone_type = TIMELIB_ZONETYPE_OFFSET;
1028 s->time->z = 0;
1029 s->time->dst = 0;
1043 s->time->relative.first_last_day_of = TIMELIB_SPECIAL_LAST_DAY_OF_MONTH;
1045 s->time->relative.first_last_day_of = TIMELIB_SPECIAL_FIRST_DAY_OF_MONTH;
1060 s->time->h = timelib_get_nr((char **) &ptr, 2);
1061 s->time->i = 15;
1063 s->time->h = timelib_get_nr((char **) &ptr, 2) - 1;
1064 s->time->i = 45;
1068 s->time->h += timelib_meridian((char **) &ptr, s->time->h);
1087 s->time->relative.special.type = TIMELIB_SPECIAL_DAY_OF_WEEK_IN_MONTH;
1090 s->time->relative.special.type = TIMELIB_SPECIAL_LAST_DAY_OF_WEEK_IN_MONTH;
1102 s->time->h = timelib_get_nr((char **) &ptr, 2);
1104 s->time->i = timelib_get_nr((char **) &ptr, 2);
1106 s->time->s = timelib_get_nr((char **) &ptr, 2);
1109 s->time->h += timelib_meridian((char **) &ptr, s->time->h);
1119 s->time->h = timelib_get_nr((char **) &ptr, 2);
1120 s->time->i = timelib_get_nr((char **) &ptr, 2);
1122 s->time->s = timelib_get_nr((char **) &ptr, 2);
1125 s->time->f = timelib_get_frac_nr((char **) &ptr, 8);
1129 s->time->h += timelib_meridian((char **) &ptr, s->time->h);
1140 s->time->h = timelib_get_nr((char **) &ptr, 2);
1141 s->time->i = timelib_get_nr((char **) &ptr, 2);
1143 s->time->s = timelib_get_nr((char **) &ptr, 2);
1146 s->time->f = timelib_get_frac_nr((char **) &ptr, 8);
1151 …s->time->z = timelib_parse_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz…
1164 switch (s->time->have_time) {
1166 s->time->h = timelib_get_nr((char **) &ptr, 2);
1167 s->time->i = timelib_get_nr((char **) &ptr, 2);
1168 s->time->s = 0;
1171 s->time->y = timelib_get_nr((char **) &ptr, 4);
1175 add_error(s, "Double time specification");
1178 s->time->have_time++;
1187 switch (s->time->have_time) {
1189 s->time->h = timelib_get_nr((char **) &ptr, 2);
1190 s->time->i = timelib_get_nr((char **) &ptr, 2);
1191 s->time->s = 0;
1192 … s->time->z = timelib_parse_zone((char **) &ptr, &s->time->dst, s->time, s->tzdb, tz_get_wrapper);
1195 s->time->y = timelib_get_nr((char **) &ptr, 4);
1201 s->time->have_time++;
1212 s->time->h = timelib_get_nr((char **) &ptr, 2);
1213 s->time->i = timelib_get_nr((char **) &ptr, 2);
1214 s->time->s = timelib_get_nr((char **) &ptr, 2);
1217 …s->time->z = timelib_parse_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz…
1232 s->time->m = timelib_get_nr((char **) &ptr, 2);
1233 s->time->d = timelib_get_nr((char **) &ptr, 2);
1235 s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
1236 TIMELIB_PROCESS_YEAR(s->time->y, length);
1247 s->time->y = timelib_get_unsigned_nr((char **) &ptr, 4);
1248 s->time->m = timelib_get_nr((char **) &ptr, 2);
1249 s->time->d = timelib_get_nr((char **) &ptr, 2);
1260 s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
1261 s->time->m = timelib_get_nr((char **) &ptr, 2);
1262 s->time->d = timelib_get_nr((char **) &ptr, 2);
1263 TIMELIB_PROCESS_YEAR(s->time->y, length);
1274 s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
1275 s->time->m = timelib_get_nr((char **) &ptr, 2);
1276 s->time->d = 1;
1277 TIMELIB_PROCESS_YEAR(s->time->y, length);
1288 s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
1289 s->time->m = timelib_get_nr((char **) &ptr, 2);
1290 s->time->d = timelib_get_nr((char **) &ptr, 2);
1291 TIMELIB_PROCESS_YEAR(s->time->y, length);
1302 s->time->d = timelib_get_nr((char **) &ptr, 2);
1304 s->time->m = timelib_get_month((char **) &ptr);
1305 s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
1306 TIMELIB_PROCESS_YEAR(s->time->y, length);
1316 s->time->d = timelib_get_nr((char **) &ptr, 2);
1317 s->time->m = timelib_get_nr((char **) &ptr, 2);
1318 s->time->y = timelib_get_nr((char **) &ptr, 4);
1329 s->time->d = timelib_get_nr((char **) &ptr, 2);
1330 s->time->m = timelib_get_nr((char **) &ptr, 2);
1331 s->time->y = timelib_get_nr_ex((char **) &ptr, 2, &length);
1332 TIMELIB_PROCESS_YEAR(s->time->y, length);
1343 s->time->m = timelib_get_month((char **) &ptr);
1344 s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
1345 s->time->d = 1;
1346 TIMELIB_PROCESS_YEAR(s->time->y, length);
1357 s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
1358 s->time->m = timelib_get_month((char **) &ptr);
1359 s->time->d = 1;
1360 TIMELIB_PROCESS_YEAR(s->time->y, length);
1371 s->time->m = timelib_get_month((char **) &ptr);
1372 s->time->d = timelib_get_nr((char **) &ptr, 2);
1373 s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
1374 TIMELIB_PROCESS_YEAR(s->time->y, length);
1384 s->time->d = timelib_get_nr((char **) &ptr, 2);
1386 s->time->m = timelib_get_month((char **) &ptr);
1396 s->time->y = timelib_get_nr((char **) &ptr, 4);
1397 s->time->m = timelib_get_nr((char **) &ptr, 2);
1398 s->time->d = timelib_get_nr((char **) &ptr, 2);
1410 s->time->y = timelib_get_nr((char **) &ptr, 4);
1411 s->time->m = timelib_get_nr((char **) &ptr, 2);
1412 s->time->d = timelib_get_nr((char **) &ptr, 2);
1413 s->time->h = timelib_get_nr((char **) &ptr, 2);
1414 s->time->i = timelib_get_nr((char **) &ptr, 2);
1415 s->time->s = timelib_get_nr((char **) &ptr, 2);
1417 s->time->f = timelib_get_frac_nr((char **) &ptr, 9);
1419 …s->time->z = timelib_parse_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz…
1435 s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
1436 s->time->d = timelib_get_nr((char **) &ptr, 3);
1437 s->time->m = 1;
1438 TIMELIB_PROCESS_YEAR(s->time->y, length);
1451 s->time->y = timelib_get_nr((char **) &ptr, 4);
1454 s->time->m = 1;
1455 s->time->d = 1;
1456 s->time->relative.d = timelib_daynr_from_weeknr(s->time->y, w, d);
1470 s->time->y = timelib_get_nr((char **) &ptr, 4);
1473 s->time->m = 1;
1474 s->time->d = 1;
1475 s->time->relative.d = timelib_daynr_from_weeknr(s->time->y, w, d);
1487 s->time->m = timelib_get_month((char **) &ptr);
1488 s->time->d = timelib_get_nr((char **) &ptr, 2);
1489 s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
1490 TIMELIB_PROCESS_YEAR(s->time->y, length);
1501 s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
1502 s->time->m = timelib_get_month((char **) &ptr);
1503 s->time->d = timelib_get_nr((char **) &ptr, 2);
1504 TIMELIB_PROCESS_YEAR(s->time->y, length);
1516 s->time->d = timelib_get_nr((char **) &ptr, 2);
1517 s->time->m = timelib_get_month((char **) &ptr);
1518 s->time->y = timelib_get_nr((char **) &ptr, 4);
1519 s->time->h = timelib_get_nr((char **) &ptr, 2);
1520 s->time->i = timelib_get_nr((char **) &ptr, 2);
1521 s->time->s = timelib_get_nr((char **) &ptr, 2);
1522 …s->time->z = timelib_parse_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz…
1534 s->time->y = timelib_get_nr((char **) &ptr, 4);
1543 s->time->relative.y = 0 - s->time->relative.y;
1544 s->time->relative.m = 0 - s->time->relative.m;
1545 s->time->relative.d = 0 - s->time->relative.d;
1546 s->time->relative.h = 0 - s->time->relative.h;
1547 s->time->relative.i = 0 - s->time->relative.i;
1548 s->time->relative.s = 0 - s->time->relative.s;
1549 s->time->relative.weekday = 0 - s->time->relative.weekday;
1550 if (s->time->relative.weekday == 0) {
1551 s->time->relative.weekday = -7;
1553 …if (s->time->relative.have_special_relative && s->time->relative.special.type == TIMELIB_SPECIAL_W…
1554 s->time->relative.special.amount = 0 - s->time->relative.special.amount;
1569 s->time->relative.weekday = relunit->multiplier;
1570 if (s->time->relative.weekday_behavior != 2) {
1571 s->time->relative.weekday_behavior = 1;
1590 s->time->relative.weekday_behavior = 2;
1593 if (s->time->relative.have_weekday_relative == 0) {
1595 s->time->relative.weekday = 1;
1624 s->time->m = timelib_lookup_month((char **) &ptr);
1635 …s->time->z = timelib_parse_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz…
1648 s->time->m = timelib_get_month((char **) &ptr);
1649 s->time->d = timelib_get_nr((char **) &ptr, 2);
1652 s->time->h = timelib_get_nr((char **) &ptr, 2);
1653 s->time->i = timelib_get_nr((char **) &ptr, 2);
1655 s->time->s = timelib_get_nr((char **) &ptr, 2);
1658 s->time->f = timelib_get_frac_nr((char **) &ptr, 8);
1662 s->time->h += timelib_meridian((char **) &ptr, s->time->h);
1673 s->time->m = timelib_get_month((char **) &ptr);
1674 s->time->d = timelib_get_nr((char **) &ptr, 2);
1677 s->time->h = timelib_get_nr((char **) &ptr, 2);
1678 s->time->i = timelib_get_nr((char **) &ptr, 2);
1680 s->time->s = timelib_get_nr((char **) &ptr, 2);
1683 s->time->f = timelib_get_frac_nr((char **) &ptr, 8);
1688 …s->time->z = timelib_parse_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz…
1756 in.time = timelib_time_ctor();
1763 …in.time->y = in.time->d = in.time->m = in.time->h = in.time->i = in.time->s = in.time->f = in.time
1764 in.time->is_localtime = in.time->zone_type = 0;
1765 return in.time;
1774 in.time = timelib_time_ctor();
1775 in.time->y = TIMELIB_UNSET;
1776 in.time->d = TIMELIB_UNSET;
1777 in.time->m = TIMELIB_UNSET;
1778 in.time->h = TIMELIB_UNSET;
1779 in.time->i = TIMELIB_UNSET;
1780 in.time->s = TIMELIB_UNSET;
1781 in.time->f = TIMELIB_UNSET;
1782 in.time->z = TIMELIB_UNSET;
1783 in.time->dst = TIMELIB_UNSET;
1785 in.time->is_localtime = 0;
1786 in.time->zone_type = 0;
1787 in.time->relative.days = TIMELIB_UNSET;
1796 /* do funky checking whether the parsed time was valid time */
1797 if (in.time->have_time && !timelib_valid_time( in.time->h, in.time->i, in.time->s)) {
1798 add_warning(&in, "The parsed time was invalid");
1801 if (in.time->have_date && !timelib_valid_date( in.time->y, in.time->m, in.time->d)) {
1811 return in.time;
1825 static void timelib_time_reset_fields(timelib_time *time)
1827 assert(time != NULL);
1829 time->y = 1970;
1830 time->m = 1;
1831 time->d = 1;
1832 time->h = time->i = time->s = 0;
1833 time->f = 0.0;
1834 time->tz_info = NULL;
1837 static void timelib_time_reset_unset_fields(timelib_time *time)
1839 assert(time != NULL);
1841 if (time->y == TIMELIB_UNSET ) time->y = 1970;
1842 if (time->m == TIMELIB_UNSET ) time->m = 1;
1843 if (time->d == TIMELIB_UNSET ) time->d = 1;
1844 if (time->h == TIMELIB_UNSET ) time->h = 0;
1845 if (time->i == TIMELIB_UNSET ) time->i = 0;
1846 if (time->s == TIMELIB_UNSET ) time->s = 0;
1847 if (time->f == TIMELIB_UNSET ) time->f = 0.0;
1867 in.time = timelib_time_ctor();
1868 in.time->y = TIMELIB_UNSET;
1869 in.time->d = TIMELIB_UNSET;
1870 in.time->m = TIMELIB_UNSET;
1871 in.time->h = TIMELIB_UNSET;
1872 in.time->i = TIMELIB_UNSET;
1873 in.time->s = TIMELIB_UNSET;
1874 in.time->f = TIMELIB_UNSET;
1875 in.time->z = TIMELIB_UNSET;
1876 in.time->dst = TIMELIB_UNSET;
1878 in.time->is_localtime = 0;
1879 in.time->zone_type = 0;
1895 in.time->have_relative = 1;
1896 in.time->relative.have_weekday_relative = 1;
1897 in.time->relative.weekday = tmprel->multiplier;
1898 in.time->relative.weekday_behavior = 1;
1905 if ((s->time->d = timelib_get_nr((char **) &ptr, 2)) == TIMELIB_UNSET) {
1917 s->time->m = 1;
1918 s->time->d = tmp + 1;
1919 timelib_do_normalize(s->time);
1926 if ((s->time->m = timelib_get_nr((char **) &ptr, 2)) == TIMELIB_UNSET) {
1936 s->time->m = tmp;
1943 if ((s->time->y = timelib_get_nr_ex((char **) &ptr, 2, &length)) == TIMELIB_UNSET) {
1946 TIMELIB_PROCESS_YEAR(s->time->y, length);
1951 if ((s->time->y = timelib_get_nr((char **) &ptr, 4)) == TIMELIB_UNSET) {
1958 if ((s->time->h = timelib_get_nr((char **) &ptr, 2)) == TIMELIB_UNSET) {
1961 if (s->time->h > 12) {
1968 if ((s->time->h = timelib_get_nr((char **) &ptr, 2)) == TIMELIB_UNSET) {
1974 if (s->time->h == TIMELIB_UNSET) {
1976 } else if ((tmp = timelib_meridian_with_check((char **) &ptr, s->time->h)) == TIMELIB_UNSET) {
1979 s->time->h += tmp;
1992 s->time->i = min;
2006 s->time->s = sec;
2020 s->time->f = (f / pow(10, (ptr - tptr)));
2031 s->time->y = 1970;
2032 s->time->m = 1;
2033 s->time->d = 1;
2034 s->time->h = s->time->i = s->time->s = 0;
2035 s->time->f = 0.0;
2036 s->time->relative.s += tmp;
2037 s->time->is_localtime = 1;
2038 s->time->zone_type = TIMELIB_ZONETYPE_OFFSET;
2039 s->time->z = 0;
2040 s->time->dst = 0;
2049 …s->time->z = timelib_parse_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz…
2080 timelib_time_reset_fields(s->time);
2084 timelib_time_reset_unset_fields(s->time);
2137 timelib_time_reset_fields(s->time);
2141 timelib_time_reset_unset_fields(s->time);
2152 if (s->time->h != TIMELIB_UNSET || s->time->i != TIMELIB_UNSET || s->time->s != TIMELIB_UNSET) {
2153 if (s->time->h == TIMELIB_UNSET ) {
2154 s->time->h = 0;
2156 if (s->time->i == TIMELIB_UNSET ) {
2157 s->time->i = 0;
2159 if (s->time->s == TIMELIB_UNSET ) {
2160 s->time->s = 0;
2164 /* do funky checking whether the parsed time was valid time */
2165 if (s->time->h != TIMELIB_UNSET && s->time->i != TIMELIB_UNSET &&
2166 s->time->s != TIMELIB_UNSET &&
2167 !timelib_valid_time( s->time->h, s->time->i, s->time->s)) {
2168 add_pbf_warning(s, "The parsed time was invalid", string, ptr);
2171 if (s->time->y != TIMELIB_UNSET && s->time->m != TIMELIB_UNSET &&
2172 s->time->d != TIMELIB_UNSET &&
2173 !timelib_valid_date( s->time->y, s->time->m, s->time->d)) {
2182 return in.time;
2240 timelib_time time = timelib_strtotime("May 12");
2243 time.y, time.m, time.d, time.h, time.i, time.s, time.f, time.z, time.dst);
2244 if (time.have_relative) {
2246time.relative.y, time.relative.m, time.relative.d, time.relative.h, time.relative.i, time.relative…
2248 if (time.have_weekday_relative) {
2249 printf (" / %d", time.relative.weekday);
2251 if (time.have_weeknr_day) {
2252 printf(" / %dW%d", time.relative.weeknr_day.weeknr, time.relative.weeknr_day.dayofweek);