Lines Matching refs:time
109 …time->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…
116 …time->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;
683 case TIMELIB_SECOND: s->time->relative.s += amount * relunit->multiplier; break;
684 case TIMELIB_MINUTE: s->time->relative.i += amount * relunit->multiplier; break;
685 case TIMELIB_HOUR: s->time->relative.h += amount * relunit->multiplier; break;
686 case TIMELIB_DAY: s->time->relative.d += amount * relunit->multiplier; break;
687 case TIMELIB_MONTH: s->time->relative.m += amount * relunit->multiplier; break;
688 case TIMELIB_YEAR: s->time->relative.y += amount * relunit->multiplier; break;
693 s->time->relative.d += (amount > 0 ? amount - 1 : amount) * 7;
694 s->time->relative.weekday = relunit->multiplier;
695 s->time->relative.weekday_behavior = behavior;
701 s->time->relative.special.type = relunit->multiplier;
702 s->time->relative.special.amount = amount;
1012 s->time->relative.d = -1;
1032 s->time->h = 12;
1055 s->time->relative.d = 1;
1071 s->time->y = 1970;
1072 s->time->m = 1;
1073 s->time->d = 1;
1074 s->time->h = s->time->i = s->time->s = 0;
1075 s->time->f = 0.0;
1076 s->time->relative.s += i;
1077 s->time->is_localtime = 1;
1078 s->time->zone_type = TIMELIB_ZONETYPE_OFFSET;
1079 s->time->z = 0;
1080 s->time->dst = 0;
1094 s->time->relative.first_last_day_of = 2;
1096 s->time->relative.first_last_day_of = 1;
1111 s->time->h = timelib_get_nr((char **) &ptr, 2);
1112 s->time->i = 15;
1114 s->time->h = timelib_get_nr((char **) &ptr, 2) - 1;
1115 s->time->i = 45;
1119 s->time->h += timelib_meridian((char **) &ptr, s->time->h);
1138 s->time->relative.special.type = TIMELIB_SPECIAL_DAY_OF_WEEK_IN_MONTH;
1141 s->time->relative.special.type = TIMELIB_SPECIAL_LAST_DAY_OF_WEEK_IN_MONTH;
1153 s->time->h = timelib_get_nr((char **) &ptr, 2);
1155 s->time->i = timelib_get_nr((char **) &ptr, 2);
1157 s->time->s = timelib_get_nr((char **) &ptr, 2);
1160 s->time->h += timelib_meridian((char **) &ptr, s->time->h);
1170 s->time->h = timelib_get_nr((char **) &ptr, 2);
1171 s->time->i = timelib_get_nr((char **) &ptr, 2);
1173 s->time->s = timelib_get_nr((char **) &ptr, 2);
1176 s->time->f = timelib_get_frac_nr((char **) &ptr, 8);
1180 s->time->h += timelib_meridian((char **) &ptr, s->time->h);
1191 s->time->h = timelib_get_nr((char **) &ptr, 2);
1192 s->time->i = timelib_get_nr((char **) &ptr, 2);
1194 s->time->s = timelib_get_nr((char **) &ptr, 2);
1197 s->time->f = timelib_get_frac_nr((char **) &ptr, 8);
1202 …s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz_g…
1215 switch (s->time->have_time) {
1217 s->time->h = timelib_get_nr((char **) &ptr, 2);
1218 s->time->i = timelib_get_nr((char **) &ptr, 2);
1219 s->time->s = 0;
1222 s->time->y = timelib_get_nr((char **) &ptr, 4);
1226 add_error(s, "Double time specification");
1229 s->time->have_time++;
1238 switch (s->time->have_time) {
1240 s->time->h = timelib_get_nr((char **) &ptr, 2);
1241 s->time->i = timelib_get_nr((char **) &ptr, 2);
1242 s->time->s = 0;
1243 s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, s->tzdb, tz_get_wrapper);
1246 s->time->y = timelib_get_nr((char **) &ptr, 4);
1252 s->time->have_time++;
1263 s->time->h = timelib_get_nr((char **) &ptr, 2);
1264 s->time->i = timelib_get_nr((char **) &ptr, 2);
1265 s->time->s = timelib_get_nr((char **) &ptr, 2);
1268 …s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz_g…
1283 s->time->m = timelib_get_nr((char **) &ptr, 2);
1284 s->time->d = timelib_get_nr((char **) &ptr, 2);
1286 s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
1287 TIMELIB_PROCESS_YEAR(s->time->y, length);
1298 s->time->y = timelib_get_unsigned_nr((char **) &ptr, 4);
1299 s->time->m = timelib_get_nr((char **) &ptr, 2);
1300 s->time->d = timelib_get_nr((char **) &ptr, 2);
1311 s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
1312 s->time->m = timelib_get_nr((char **) &ptr, 2);
1313 s->time->d = timelib_get_nr((char **) &ptr, 2);
1314 TIMELIB_PROCESS_YEAR(s->time->y, length);
1325 s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
1326 s->time->m = timelib_get_nr((char **) &ptr, 2);
1327 s->time->d = 1;
1328 TIMELIB_PROCESS_YEAR(s->time->y, length);
1339 s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
1340 s->time->m = timelib_get_nr((char **) &ptr, 2);
1341 s->time->d = timelib_get_nr((char **) &ptr, 2);
1342 TIMELIB_PROCESS_YEAR(s->time->y, length);
1353 s->time->d = timelib_get_nr((char **) &ptr, 2);
1355 s->time->m = timelib_get_month((char **) &ptr);
1356 s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
1357 TIMELIB_PROCESS_YEAR(s->time->y, length);
1367 s->time->d = timelib_get_nr((char **) &ptr, 2);
1368 s->time->m = timelib_get_nr((char **) &ptr, 2);
1369 s->time->y = timelib_get_nr((char **) &ptr, 4);
1380 s->time->d = timelib_get_nr((char **) &ptr, 2);
1381 s->time->m = timelib_get_nr((char **) &ptr, 2);
1382 s->time->y = timelib_get_nr_ex((char **) &ptr, 2, &length);
1383 TIMELIB_PROCESS_YEAR(s->time->y, length);
1394 s->time->m = timelib_get_month((char **) &ptr);
1395 s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
1396 s->time->d = 1;
1397 TIMELIB_PROCESS_YEAR(s->time->y, length);
1408 s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
1409 s->time->m = timelib_get_month((char **) &ptr);
1410 s->time->d = 1;
1411 TIMELIB_PROCESS_YEAR(s->time->y, length);
1422 s->time->m = timelib_get_month((char **) &ptr);
1423 s->time->d = timelib_get_nr((char **) &ptr, 2);
1424 s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
1425 TIMELIB_PROCESS_YEAR(s->time->y, length);
1435 s->time->d = timelib_get_nr((char **) &ptr, 2);
1437 s->time->m = timelib_get_month((char **) &ptr);
1447 s->time->y = timelib_get_nr((char **) &ptr, 4);
1448 s->time->m = timelib_get_nr((char **) &ptr, 2);
1449 s->time->d = timelib_get_nr((char **) &ptr, 2);
1461 s->time->y = timelib_get_nr((char **) &ptr, 4);
1462 s->time->m = timelib_get_nr((char **) &ptr, 2);
1463 s->time->d = timelib_get_nr((char **) &ptr, 2);
1464 s->time->h = timelib_get_nr((char **) &ptr, 2);
1465 s->time->i = timelib_get_nr((char **) &ptr, 2);
1466 s->time->s = timelib_get_nr((char **) &ptr, 2);
1468 s->time->f = timelib_get_frac_nr((char **) &ptr, 9);
1470 …s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz_g…
1486 s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
1487 s->time->d = timelib_get_nr((char **) &ptr, 3);
1488 s->time->m = 1;
1489 TIMELIB_PROCESS_YEAR(s->time->y, length);
1502 s->time->y = timelib_get_nr((char **) &ptr, 4);
1505 s->time->m = 1;
1506 s->time->d = 1;
1507 s->time->relative.d = timelib_daynr_from_weeknr(s->time->y, w, d);
1521 s->time->y = timelib_get_nr((char **) &ptr, 4);
1524 s->time->m = 1;
1525 s->time->d = 1;
1526 s->time->relative.d = timelib_daynr_from_weeknr(s->time->y, w, d);
1538 s->time->m = timelib_get_month((char **) &ptr);
1539 s->time->d = timelib_get_nr((char **) &ptr, 2);
1540 s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
1541 TIMELIB_PROCESS_YEAR(s->time->y, length);
1552 s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
1553 s->time->m = timelib_get_month((char **) &ptr);
1554 s->time->d = timelib_get_nr((char **) &ptr, 2);
1555 TIMELIB_PROCESS_YEAR(s->time->y, length);
1567 s->time->d = timelib_get_nr((char **) &ptr, 2);
1568 s->time->m = timelib_get_month((char **) &ptr);
1569 s->time->y = timelib_get_nr((char **) &ptr, 4);
1570 s->time->h = timelib_get_nr((char **) &ptr, 2);
1571 s->time->i = timelib_get_nr((char **) &ptr, 2);
1572 s->time->s = timelib_get_nr((char **) &ptr, 2);
1573 …s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz_g…
1585 s->time->y = timelib_get_nr((char **) &ptr, 4);
1594 s->time->relative.y = 0 - s->time->relative.y;
1595 s->time->relative.m = 0 - s->time->relative.m;
1596 s->time->relative.d = 0 - s->time->relative.d;
1597 s->time->relative.h = 0 - s->time->relative.h;
1598 s->time->relative.i = 0 - s->time->relative.i;
1599 s->time->relative.s = 0 - s->time->relative.s;
1600 s->time->relative.weekday = 0 - s->time->relative.weekday;
1601 if (s->time->relative.weekday == 0) {
1602 s->time->relative.weekday = -7;
1604 …if (s->time->relative.have_special_relative && s->time->relative.special.type == TIMELIB_SPECIAL_W…
1605 s->time->relative.special.amount = 0 - s->time->relative.special.amount;
1620 s->time->relative.weekday = relunit->multiplier;
1621 if (s->time->relative.weekday_behavior != 2) {
1622 s->time->relative.weekday_behavior = 1;
1641 s->time->relative.weekday_behavior = 2;
1644 if (s->time->relative.have_weekday_relative == 0) {
1646 s->time->relative.weekday = 1;
1675 s->time->m = timelib_lookup_month((char **) &ptr);
1686 …s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz_g…
1699 s->time->m = timelib_get_month((char **) &ptr);
1700 s->time->d = timelib_get_nr((char **) &ptr, 2);
1703 s->time->h = timelib_get_nr((char **) &ptr, 2);
1704 s->time->i = timelib_get_nr((char **) &ptr, 2);
1706 s->time->s = timelib_get_nr((char **) &ptr, 2);
1709 s->time->f = timelib_get_frac_nr((char **) &ptr, 8);
1713 s->time->h += timelib_meridian((char **) &ptr, s->time->h);
1724 s->time->m = timelib_get_month((char **) &ptr);
1725 s->time->d = timelib_get_nr((char **) &ptr, 2);
1728 s->time->h = timelib_get_nr((char **) &ptr, 2);
1729 s->time->i = timelib_get_nr((char **) &ptr, 2);
1731 s->time->s = timelib_get_nr((char **) &ptr, 2);
1734 s->time->f = timelib_get_frac_nr((char **) &ptr, 8);
1739 …s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz_g…
1807 in.time = timelib_time_ctor();
1814 …in.time->y = in.time->d = in.time->m = in.time->h = in.time->i = in.time->s = in.time->f = in.time…
1815 in.time->is_localtime = in.time->zone_type = 0;
1816 return in.time;
1825 in.time = timelib_time_ctor();
1826 in.time->y = TIMELIB_UNSET;
1827 in.time->d = TIMELIB_UNSET;
1828 in.time->m = TIMELIB_UNSET;
1829 in.time->h = TIMELIB_UNSET;
1830 in.time->i = TIMELIB_UNSET;
1831 in.time->s = TIMELIB_UNSET;
1832 in.time->f = TIMELIB_UNSET;
1833 in.time->z = TIMELIB_UNSET;
1834 in.time->dst = TIMELIB_UNSET;
1836 in.time->is_localtime = 0;
1837 in.time->zone_type = 0;
1846 /* do funky checking whether the parsed time was valid time */
1847 if (in.time->have_time && !timelib_valid_time( in.time->h, in.time->i, in.time->s)) {
1848 add_warning(&in, "The parsed time was invalid");
1851 if (in.time->have_date && !timelib_valid_date( in.time->y, in.time->m, in.time->d)) {
1861 return in.time;
1870 static void timelib_time_reset_fields(timelib_time *time)
1872 assert(time != NULL);
1874 time->y = 1970;
1875 time->m = 1;
1876 time->d = 1;
1877 time->h = time->i = time->s = 0;
1878 time->f = 0.0;
1879 time->tz_info = NULL;
1882 static void timelib_time_reset_unset_fields(timelib_time *time)
1884 assert(time != NULL);
1886 if (time->y == TIMELIB_UNSET ) time->y = 1970;
1887 if (time->m == TIMELIB_UNSET ) time->m = 1;
1888 if (time->d == TIMELIB_UNSET ) time->d = 1;
1889 if (time->h == TIMELIB_UNSET ) time->h = 0;
1890 if (time->i == TIMELIB_UNSET ) time->i = 0;
1891 if (time->s == TIMELIB_UNSET ) time->s = 0;
1892 if (time->f == TIMELIB_UNSET ) time->f = 0.0;
1912 in.time = timelib_time_ctor();
1913 in.time->y = TIMELIB_UNSET;
1914 in.time->d = TIMELIB_UNSET;
1915 in.time->m = TIMELIB_UNSET;
1916 in.time->h = TIMELIB_UNSET;
1917 in.time->i = TIMELIB_UNSET;
1918 in.time->s = TIMELIB_UNSET;
1919 in.time->f = TIMELIB_UNSET;
1920 in.time->z = TIMELIB_UNSET;
1921 in.time->dst = TIMELIB_UNSET;
1923 in.time->is_localtime = 0;
1924 in.time->zone_type = 0;
1940 in.time->have_relative = 1;
1941 in.time->relative.have_weekday_relative = 1;
1942 in.time->relative.weekday = tmprel->multiplier;
1943 in.time->relative.weekday_behavior = 1;
1950 if ((s->time->d = timelib_get_nr((char **) &ptr, 2)) == TIMELIB_UNSET) {
1962 s->time->m = 1;
1963 s->time->d = tmp + 1;
1964 timelib_do_normalize(s->time);
1971 if ((s->time->m = timelib_get_nr((char **) &ptr, 2)) == TIMELIB_UNSET) {
1981 s->time->m = tmp;
1988 if ((s->time->y = timelib_get_nr_ex((char **) &ptr, 2, &length)) == TIMELIB_UNSET) {
1991 TIMELIB_PROCESS_YEAR(s->time->y, length);
1996 if ((s->time->y = timelib_get_nr((char **) &ptr, 4)) == TIMELIB_UNSET) {
2003 if ((s->time->h = timelib_get_nr((char **) &ptr, 2)) == TIMELIB_UNSET) {
2006 if (s->time->h > 12) {
2013 if ((s->time->h = timelib_get_nr((char **) &ptr, 2)) == TIMELIB_UNSET) {
2019 if (s->time->h == TIMELIB_UNSET) {
2021 } else if ((tmp = timelib_meridian_with_check((char **) &ptr, s->time->h)) == TIMELIB_UNSET) {
2024 s->time->h += tmp;
2037 s->time->i = min;
2051 s->time->s = sec;
2065 s->time->f = (f / pow(10, (ptr - tptr)));
2076 s->time->y = 1970;
2077 s->time->m = 1;
2078 s->time->d = 1;
2079 s->time->h = s->time->i = s->time->s = 0;
2080 s->time->f = 0.0;
2081 s->time->relative.s += tmp;
2082 s->time->is_localtime = 1;
2083 s->time->zone_type = TIMELIB_ZONETYPE_OFFSET;
2084 s->time->z = 0;
2085 s->time->dst = 0;
2094 …s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz_g…
2125 timelib_time_reset_fields(s->time);
2129 timelib_time_reset_unset_fields(s->time);
2182 timelib_time_reset_fields(s->time);
2186 timelib_time_reset_unset_fields(s->time);
2197 if (s->time->h != TIMELIB_UNSET || s->time->i != TIMELIB_UNSET || s->time->s != TIMELIB_UNSET) {
2198 if (s->time->h == TIMELIB_UNSET ) {
2199 s->time->h = 0;
2201 if (s->time->i == TIMELIB_UNSET ) {
2202 s->time->i = 0;
2204 if (s->time->s == TIMELIB_UNSET ) {
2205 s->time->s = 0;
2209 /* do funky checking whether the parsed time was valid time */
2210 if (s->time->h != TIMELIB_UNSET && s->time->i != TIMELIB_UNSET &&
2211 s->time->s != TIMELIB_UNSET &&
2212 !timelib_valid_time( s->time->h, s->time->i, s->time->s)) {
2213 add_pbf_warning(s, "The parsed time was invalid", string, ptr);
2216 if (s->time->y != TIMELIB_UNSET && s->time->m != TIMELIB_UNSET &&
2217 s->time->d != TIMELIB_UNSET &&
2218 !timelib_valid_date( s->time->y, s->time->m, s->time->d)) {
2227 return in.time;
2285 timelib_time time = timelib_strtotime("May 12");
2288 time.y, time.m, time.d, time.h, time.i, time.s, time.f, time.z, time.dst);
2289 if (time.have_relative) {
2291 …time.relative.y, time.relative.m, time.relative.d, time.relative.h, time.relative.i, time.relative…
2293 if (time.have_weekday_relative) {
2294 printf (" / %d", time.relative.weekday);
2296 if (time.have_weeknr_day) {
2297 printf(" / %dW%d", time.relative.weeknr_day.weeknr, time.relative.weeknr_day.dayofweek);