Lines Matching refs:time

94time->have_time) { add_error(s, TIMELIB_ERR_DOUBLE_TIME, "Double time specification"); timelib_str…
95 #define TIMELIB_UNHAVE_TIME() { s->time->have_time = 0; s->time->h = 0; s->time->i = 0; s->time->s …
96 …>time->have_date) { add_error(s, TIMELIB_ERR_DOUBLE_DATE, "Double date specification"); timelib_st…
97 #define TIMELIB_UNHAVE_DATE() { s->time->have_date = 0; s->time->d = 0; s->time->m = 0; s->time->y …
98 #define TIMELIB_HAVE_RELATIVE() { s->time->have_relative = 1; }
99 #define TIMELIB_HAVE_WEEKDAY_RELATIVE() { s->time->have_relative = 1; s->time->relative.have_weekda…
100 #define TIMELIB_HAVE_SPECIAL_RELATIVE() { s->time->have_relative = 1; s->time->relative.have_specia…
101time->have_zone) { s->time->have_zone > 1 ? add_error(s, TIMELIB_ERR_DOUBLE_TZ, "Double timezone s…
105 #define TIMELIB_ADJUST_RELATIVE_WEEKDAY() if (in->time.have_weekday_relative && (in.rel.d > 0)) { i…
138 timelib_time *time;
648 case TIMELIB_MICROSEC: s->time->relative.us += amount * relunit->multiplier; break;
649 case TIMELIB_SECOND: s->time->relative.s += amount * relunit->multiplier; break;
650 case TIMELIB_MINUTE: s->time->relative.i += amount * relunit->multiplier; break;
651 case TIMELIB_HOUR: s->time->relative.h += amount * relunit->multiplier; break;
652 case TIMELIB_DAY: s->time->relative.d += amount * relunit->multiplier; break;
653 case TIMELIB_MONTH: s->time->relative.m += amount * relunit->multiplier; break;
654 case TIMELIB_YEAR: s->time->relative.y += amount * relunit->multiplier; break;
659 s->time->relative.d += (amount > 0 ? amount - 1 : amount) * 7;
660 s->time->relative.weekday = relunit->multiplier;
661 s->time->relative.weekday_behavior = behavior;
667 s->time->relative.special.type = relunit->multiplier;
668 s->time->relative.special.amount = amount;
1022 s->time->relative.d = -1;
1042 s->time->h = 12;
1065 s->time->relative.d = 1;
1081 s->time->y = 1970;
1082 s->time->m = 1;
1083 s->time->d = 1;
1084 s->time->h = s->time->i = s->time->s = 0;
1085 s->time->us = 0;
1086 s->time->relative.s += i;
1087 s->time->is_localtime = 1;
1088 s->time->zone_type = TIMELIB_ZONETYPE_OFFSET;
1089 s->time->z = 0;
1090 s->time->dst = 0;
1108 s->time->y = 1970;
1109 s->time->m = 1;
1110 s->time->d = 1;
1111 s->time->h = s->time->i = s->time->s = 0;
1112 s->time->us = 0;
1113 s->time->relative.s += i;
1114 s->time->relative.us = us;
1115 s->time->is_localtime = 1;
1116 s->time->zone_type = TIMELIB_ZONETYPE_OFFSET;
1117 s->time->z = 0;
1118 s->time->dst = 0;
1132 s->time->relative.first_last_day_of = TIMELIB_SPECIAL_LAST_DAY_OF_MONTH;
1134 s->time->relative.first_last_day_of = TIMELIB_SPECIAL_FIRST_DAY_OF_MONTH;
1149 s->time->h = timelib_get_nr((char **) &ptr, 2);
1150 s->time->i = 15;
1152 s->time->h = timelib_get_nr((char **) &ptr, 2) - 1;
1153 s->time->i = 45;
1157 s->time->h += timelib_meridian((char **) &ptr, s->time->h);
1176 s->time->relative.special.type = TIMELIB_SPECIAL_DAY_OF_WEEK_IN_MONTH;
1179 s->time->relative.special.type = TIMELIB_SPECIAL_LAST_DAY_OF_WEEK_IN_MONTH;
1191 s->time->h = timelib_get_nr((char **) &ptr, 2);
1193 s->time->i = timelib_get_nr((char **) &ptr, 2);
1195 s->time->s = timelib_get_nr((char **) &ptr, 2);
1198 s->time->h += timelib_meridian((char **) &ptr, s->time->h);
1208 s->time->h = timelib_get_nr((char **) &ptr, 2);
1209 s->time->i = timelib_get_nr((char **) &ptr, 2);
1211 s->time->s = timelib_get_nr((char **) &ptr, 2);
1214 s->time->us = timelib_get_frac_nr((char **) &ptr, 8);
1218 s->time->h += timelib_meridian((char **) &ptr, s->time->h);
1229 s->time->h = timelib_get_nr((char **) &ptr, 2);
1230 s->time->i = timelib_get_nr((char **) &ptr, 2);
1232 s->time->s = timelib_get_nr((char **) &ptr, 2);
1235 s->time->us = timelib_get_frac_nr((char **) &ptr, 8);
1240 …s->time->z = timelib_parse_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz…
1253 switch (s->time->have_time) {
1255 s->time->h = timelib_get_nr((char **) &ptr, 2);
1256 s->time->i = timelib_get_nr((char **) &ptr, 2);
1257 s->time->s = 0;
1260 s->time->y = timelib_get_nr((char **) &ptr, 4);
1264 add_error(s, TIMELIB_ERR_DOUBLE_TIME, "Double time specification");
1267 s->time->have_time++;
1276 switch (s->time->have_time) {
1278 s->time->h = timelib_get_nr((char **) &ptr, 2);
1279 s->time->i = timelib_get_nr((char **) &ptr, 2);
1280 s->time->s = 0;
1281 … s->time->z = timelib_parse_zone((char **) &ptr, &s->time->dst, s->time, s->tzdb, tz_get_wrapper);
1284 s->time->y = timelib_get_nr((char **) &ptr, 4);
1290 s->time->have_time++;
1301 s->time->h = timelib_get_nr((char **) &ptr, 2);
1302 s->time->i = timelib_get_nr((char **) &ptr, 2);
1303 s->time->s = timelib_get_nr((char **) &ptr, 2);
1306 …s->time->z = timelib_parse_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz…
1321 s->time->m = timelib_get_nr((char **) &ptr, 2);
1322 s->time->d = timelib_get_nr((char **) &ptr, 2);
1324 s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
1325 TIMELIB_PROCESS_YEAR(s->time->y, length);
1336 s->time->y = timelib_get_unsigned_nr((char **) &ptr, 4);
1337 s->time->m = timelib_get_nr((char **) &ptr, 2);
1338 s->time->d = timelib_get_nr((char **) &ptr, 2);
1349 s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
1350 s->time->m = timelib_get_nr((char **) &ptr, 2);
1351 s->time->d = timelib_get_nr((char **) &ptr, 2);
1352 TIMELIB_PROCESS_YEAR(s->time->y, length);
1363 s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
1364 s->time->m = timelib_get_nr((char **) &ptr, 2);
1365 s->time->d = 1;
1366 TIMELIB_PROCESS_YEAR(s->time->y, length);
1377 s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
1378 s->time->m = timelib_get_nr((char **) &ptr, 2);
1379 s->time->d = timelib_get_nr((char **) &ptr, 2);
1380 TIMELIB_PROCESS_YEAR(s->time->y, length);
1391 s->time->d = timelib_get_nr((char **) &ptr, 2);
1393 s->time->m = timelib_get_month((char **) &ptr);
1394 s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
1395 TIMELIB_PROCESS_YEAR(s->time->y, length);
1405 s->time->d = timelib_get_nr((char **) &ptr, 2);
1406 s->time->m = timelib_get_nr((char **) &ptr, 2);
1407 s->time->y = timelib_get_nr((char **) &ptr, 4);
1418 s->time->d = timelib_get_nr((char **) &ptr, 2);
1419 s->time->m = timelib_get_nr((char **) &ptr, 2);
1420 s->time->y = timelib_get_nr_ex((char **) &ptr, 2, &length);
1421 TIMELIB_PROCESS_YEAR(s->time->y, length);
1432 s->time->m = timelib_get_month((char **) &ptr);
1433 s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
1434 s->time->d = 1;
1435 TIMELIB_PROCESS_YEAR(s->time->y, length);
1446 s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
1447 s->time->m = timelib_get_month((char **) &ptr);
1448 s->time->d = 1;
1449 TIMELIB_PROCESS_YEAR(s->time->y, length);
1460 s->time->m = timelib_get_month((char **) &ptr);
1461 s->time->d = timelib_get_nr((char **) &ptr, 2);
1462 s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
1463 TIMELIB_PROCESS_YEAR(s->time->y, length);
1473 s->time->d = timelib_get_nr((char **) &ptr, 2);
1475 s->time->m = timelib_get_month((char **) &ptr);
1485 s->time->y = timelib_get_nr((char **) &ptr, 4);
1486 s->time->m = timelib_get_nr((char **) &ptr, 2);
1487 s->time->d = timelib_get_nr((char **) &ptr, 2);
1499 s->time->y = timelib_get_nr((char **) &ptr, 4);
1500 s->time->m = timelib_get_nr((char **) &ptr, 2);
1501 s->time->d = timelib_get_nr((char **) &ptr, 2);
1502 s->time->h = timelib_get_nr((char **) &ptr, 2);
1503 s->time->i = timelib_get_nr((char **) &ptr, 2);
1504 s->time->s = timelib_get_nr((char **) &ptr, 2);
1506 s->time->us = timelib_get_frac_nr((char **) &ptr, 9);
1508 …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_ex((char **) &ptr, 4, &length);
1525 s->time->d = timelib_get_nr((char **) &ptr, 3);
1526 s->time->m = 1;
1527 TIMELIB_PROCESS_YEAR(s->time->y, length);
1540 s->time->y = timelib_get_nr((char **) &ptr, 4);
1543 s->time->m = 1;
1544 s->time->d = 1;
1545 s->time->relative.d = timelib_daynr_from_weeknr(s->time->y, w, d);
1559 s->time->y = timelib_get_nr((char **) &ptr, 4);
1562 s->time->m = 1;
1563 s->time->d = 1;
1564 s->time->relative.d = timelib_daynr_from_weeknr(s->time->y, w, d);
1576 s->time->m = timelib_get_month((char **) &ptr);
1577 s->time->d = timelib_get_nr((char **) &ptr, 2);
1578 s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
1579 TIMELIB_PROCESS_YEAR(s->time->y, length);
1590 s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
1591 s->time->m = timelib_get_month((char **) &ptr);
1592 s->time->d = timelib_get_nr((char **) &ptr, 2);
1593 TIMELIB_PROCESS_YEAR(s->time->y, length);
1605 s->time->d = timelib_get_nr((char **) &ptr, 2);
1606 s->time->m = timelib_get_month((char **) &ptr);
1607 s->time->y = timelib_get_nr((char **) &ptr, 4);
1608 s->time->h = timelib_get_nr((char **) &ptr, 2);
1609 s->time->i = timelib_get_nr((char **) &ptr, 2);
1610 s->time->s = timelib_get_nr((char **) &ptr, 2);
1611 …s->time->z = timelib_parse_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz…
1623 s->time->y = timelib_get_nr((char **) &ptr, 4);
1632 s->time->relative.y = 0 - s->time->relative.y;
1633 s->time->relative.m = 0 - s->time->relative.m;
1634 s->time->relative.d = 0 - s->time->relative.d;
1635 s->time->relative.h = 0 - s->time->relative.h;
1636 s->time->relative.i = 0 - s->time->relative.i;
1637 s->time->relative.s = 0 - s->time->relative.s;
1638 s->time->relative.weekday = 0 - s->time->relative.weekday;
1639 if (s->time->relative.weekday == 0) {
1640 s->time->relative.weekday = -7;
1642 …if (s->time->relative.have_special_relative && s->time->relative.special.type == TIMELIB_SPECIAL_W…
1643 s->time->relative.special.amount = 0 - s->time->relative.special.amount;
1658 s->time->relative.weekday = relunit->multiplier;
1659 if (s->time->relative.weekday_behavior != 2) {
1660 s->time->relative.weekday_behavior = 1;
1679 s->time->relative.weekday_behavior = 2;
1682 if (s->time->relative.have_weekday_relative == 0) {
1684 s->time->relative.weekday = 1;
1713 s->time->m = timelib_lookup_month((char **) &ptr);
1724 …s->time->z = timelib_parse_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz…
1737 s->time->m = timelib_get_month((char **) &ptr);
1738 s->time->d = timelib_get_nr((char **) &ptr, 2);
1741 s->time->h = timelib_get_nr((char **) &ptr, 2);
1742 s->time->i = timelib_get_nr((char **) &ptr, 2);
1744 s->time->s = timelib_get_nr((char **) &ptr, 2);
1747 s->time->us = timelib_get_frac_nr((char **) &ptr, 8);
1751 s->time->h += timelib_meridian((char **) &ptr, s->time->h);
1762 s->time->m = timelib_get_month((char **) &ptr);
1763 s->time->d = timelib_get_nr((char **) &ptr, 2);
1766 s->time->h = timelib_get_nr((char **) &ptr, 2);
1767 s->time->i = timelib_get_nr((char **) &ptr, 2);
1769 s->time->s = timelib_get_nr((char **) &ptr, 2);
1772 s->time->us = timelib_get_frac_nr((char **) &ptr, 8);
1777 …s->time->z = timelib_parse_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz…
1845 in.time = timelib_time_ctor();
1852 …in.time->y = in.time->d = in.time->m = in.time->h = in.time->i = in.time->s = in.time->us = in.tim…
1853 in.time->is_localtime = in.time->zone_type = 0;
1854 return in.time;
1863 in.time = timelib_time_ctor();
1864 in.time->y = TIMELIB_UNSET;
1865 in.time->d = TIMELIB_UNSET;
1866 in.time->m = TIMELIB_UNSET;
1867 in.time->h = TIMELIB_UNSET;
1868 in.time->i = TIMELIB_UNSET;
1869 in.time->s = TIMELIB_UNSET;
1870 in.time->us = TIMELIB_UNSET;
1871 in.time->z = TIMELIB_UNSET;
1872 in.time->dst = TIMELIB_UNSET;
1874 in.time->is_localtime = 0;
1875 in.time->zone_type = 0;
1876 in.time->relative.days = TIMELIB_UNSET;
1885 /* do funky checking whether the parsed time was valid time */
1886 if (in.time->have_time && !timelib_valid_time( in.time->h, in.time->i, in.time->s)) {
1887 add_warning(&in, TIMELIB_WARN_INVALID_TIME, "The parsed time was invalid");
1890 if (in.time->have_date && !timelib_valid_date( in.time->y, in.time->m, in.time->d)) {
1900 return in.time;
1914 static void timelib_time_reset_fields(timelib_time *time)
1916 assert(time != NULL);
1918 time->y = 1970;
1919 time->m = 1;
1920 time->d = 1;
1921 time->h = time->i = time->s = 0;
1922 time->us = 0;
1923 time->tz_info = NULL;
1926 static void timelib_time_reset_unset_fields(timelib_time *time)
1928 assert(time != NULL);
1930 if (time->y == TIMELIB_UNSET ) time->y = 1970;
1931 if (time->m == TIMELIB_UNSET ) time->m = 1;
1932 if (time->d == TIMELIB_UNSET ) time->d = 1;
1933 if (time->h == TIMELIB_UNSET ) time->h = 0;
1934 if (time->i == TIMELIB_UNSET ) time->i = 0;
1935 if (time->s == TIMELIB_UNSET ) time->s = 0;
1936 if (time->us == TIMELIB_UNSET ) time->us = 0;
2031 in.time = timelib_time_ctor();
2032 in.time->y = TIMELIB_UNSET;
2033 in.time->d = TIMELIB_UNSET;
2034 in.time->m = TIMELIB_UNSET;
2035 in.time->h = TIMELIB_UNSET;
2036 in.time->i = TIMELIB_UNSET;
2037 in.time->s = TIMELIB_UNSET;
2038 in.time->us = TIMELIB_UNSET;
2039 in.time->z = TIMELIB_UNSET;
2040 in.time->dst = TIMELIB_UNSET;
2042 in.time->is_localtime = 0;
2043 in.time->zone_type = 0;
2091 in.time->have_relative = 1;
2092 in.time->relative.have_weekday_relative = 1;
2093 in.time->relative.weekday = tmprel->multiplier;
2094 in.time->relative.weekday_behavior = 1;
2101 if ((s->time->d = timelib_get_nr((char **) &ptr, 2)) == TIMELIB_UNSET) {
2113 s->time->m = 1;
2114 s->time->d = tmp + 1;
2115 timelib_do_normalize(s->time);
2122 if ((s->time->m = timelib_get_nr((char **) &ptr, 2)) == TIMELIB_UNSET) {
2132 s->time->m = tmp;
2139 if ((s->time->y = timelib_get_nr_ex((char **) &ptr, 2, &length)) == TIMELIB_UNSET) {
2142 TIMELIB_PROCESS_YEAR(s->time->y, length);
2147 if ((s->time->y = timelib_get_nr((char **) &ptr, 4)) == TIMELIB_UNSET) {
2154 if ((s->time->h = timelib_get_nr((char **) &ptr, 2)) == TIMELIB_UNSET) {
2157 if (s->time->h > 12) {
2164 if ((s->time->h = timelib_get_nr((char **) &ptr, 2)) == TIMELIB_UNSET) {
2169 if (s->time->h == TIMELIB_UNSET) {
2171 } else if ((tmp = timelib_meridian_with_check((char **) &ptr, s->time->h)) == TIMELIB_UNSET) {
2174 s->time->h += tmp;
2187 s->time->i = min;
2201 s->time->s = sec;
2215 s->time->us = (f * pow(10, 6 - (ptr - tptr)));
2229 s->time->us = (f * pow(10, 3 - (ptr - tptr)) * 1000);
2240 s->time->y = 1970;
2241 s->time->m = 1;
2242 s->time->d = 1;
2243 s->time->h = s->time->i = s->time->s = 0;
2244 s->time->relative.s += tmp;
2245 s->time->is_localtime = 1;
2246 s->time->zone_type = TIMELIB_ZONETYPE_OFFSET;
2247 s->time->z = 0;
2248 s->time->dst = 0;
2267 timelib_time_reset_fields(s->time);
2271 timelib_time_reset_unset_fields(s->time);
2324 …s->time->z = timelib_parse_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz…
2331 s->time->z = timelib_parse_tz_minutes((char **) &ptr, s->time);
2332 if (s->time->z == TIMELIB_UNSET) {
2359 timelib_time_reset_fields(s->time);
2363 timelib_time_reset_unset_fields(s->time);
2377 …if (s->time->h != TIMELIB_UNSET || s->time->i != TIMELIB_UNSET || s->time->s != TIMELIB_UNSET || s…
2378 if (s->time->h == TIMELIB_UNSET ) {
2379 s->time->h = 0;
2381 if (s->time->i == TIMELIB_UNSET ) {
2382 s->time->i = 0;
2384 if (s->time->s == TIMELIB_UNSET ) {
2385 s->time->s = 0;
2387 if (s->time->us == TIMELIB_UNSET ) {
2388 s->time->us = 0;
2393 …if (s->time->y != TIMELIB_UNSET && (iso_week_of_year != TIMELIB_UNSET || iso_year != TIMELIB_UNSET…
2396 …if (iso_year != TIMELIB_UNSET && (s->time->y != TIMELIB_UNSET || s->time->m != TIMELIB_UNSET || s-…
2409 …e_from_isodate(iso_year, iso_week_of_year, iso_day_of_week, &s->time->y, &s->time->m, &s->time->d);
2414 /* do funky checking whether the parsed time was valid time */
2415 if (s->time->h != TIMELIB_UNSET && s->time->i != TIMELIB_UNSET &&
2416 s->time->s != TIMELIB_UNSET &&
2417 !timelib_valid_time( s->time->h, s->time->i, s->time->s)) {
2418 add_pbf_warning(s, TIMELIB_WARN_INVALID_TIME, "The parsed time was invalid", string, ptr);
2421 if (s->time->y != TIMELIB_UNSET && s->time->m != TIMELIB_UNSET &&
2422 s->time->d != TIMELIB_UNSET &&
2423 !timelib_valid_date( s->time->y, s->time->m, s->time->d)) {
2432 return in.time;
2497 timelib_time time = timelib_strtotime("May 12");
2500 time.y, time.m, time.d, time.h, time.i, time.s, time.f, time.z, time.dst);
2501 if (time.have_relative) {
2503time.relative.y, time.relative.m, time.relative.d, time.relative.h, time.relative.i, time.relative…
2505 if (time.have_weekday_relative) {
2506 printf (" / %d", time.relative.weekday);
2508 if (time.have_weeknr_day) {
2509 printf(" / %dW%d", time.relative.weeknr_day.weeknr, time.relative.weeknr_day.dayofweek);