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;
1025 s->time->relative.d = -1;
1045 s->time->h = 12;
1068 s->time->relative.d = 1;
1084 s->time->y = 1970;
1085 s->time->m = 1;
1086 s->time->d = 1;
1087 s->time->h = s->time->i = s->time->s = 0;
1088 s->time->us = 0;
1089 s->time->relative.s += i;
1090 s->time->is_localtime = 1;
1091 s->time->zone_type = TIMELIB_ZONETYPE_OFFSET;
1092 s->time->z = 0;
1093 s->time->dst = 0;
1111 s->time->y = 1970;
1112 s->time->m = 1;
1113 s->time->d = 1;
1114 s->time->h = s->time->i = s->time->s = 0;
1115 s->time->us = 0;
1116 s->time->relative.s += i;
1117 s->time->relative.us = us;
1118 s->time->is_localtime = 1;
1119 s->time->zone_type = TIMELIB_ZONETYPE_OFFSET;
1120 s->time->z = 0;
1121 s->time->dst = 0;
1135 s->time->relative.first_last_day_of = TIMELIB_SPECIAL_LAST_DAY_OF_MONTH;
1137 s->time->relative.first_last_day_of = TIMELIB_SPECIAL_FIRST_DAY_OF_MONTH;
1152 s->time->h = timelib_get_nr((char **) &ptr, 2);
1153 s->time->i = 15;
1155 s->time->h = timelib_get_nr((char **) &ptr, 2) - 1;
1156 s->time->i = 45;
1160 s->time->h += timelib_meridian((char **) &ptr, s->time->h);
1179 s->time->relative.special.type = TIMELIB_SPECIAL_DAY_OF_WEEK_IN_MONTH;
1182 s->time->relative.special.type = TIMELIB_SPECIAL_LAST_DAY_OF_WEEK_IN_MONTH;
1194 s->time->h = timelib_get_nr((char **) &ptr, 2);
1196 s->time->i = timelib_get_nr((char **) &ptr, 2);
1198 s->time->s = timelib_get_nr((char **) &ptr, 2);
1201 s->time->h += timelib_meridian((char **) &ptr, s->time->h);
1211 s->time->h = timelib_get_nr((char **) &ptr, 2);
1212 s->time->i = timelib_get_nr((char **) &ptr, 2);
1214 s->time->s = timelib_get_nr((char **) &ptr, 2);
1217 s->time->us = timelib_get_frac_nr((char **) &ptr, 8);
1221 s->time->h += timelib_meridian((char **) &ptr, s->time->h);
1232 s->time->h = timelib_get_nr((char **) &ptr, 2);
1233 s->time->i = timelib_get_nr((char **) &ptr, 2);
1235 s->time->s = timelib_get_nr((char **) &ptr, 2);
1238 s->time->us = timelib_get_frac_nr((char **) &ptr, 8);
1243 …s->time->z = timelib_parse_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz…
1256 switch (s->time->have_time) {
1258 s->time->h = timelib_get_nr((char **) &ptr, 2);
1259 s->time->i = timelib_get_nr((char **) &ptr, 2);
1260 s->time->s = 0;
1263 s->time->y = timelib_get_nr((char **) &ptr, 4);
1267 add_error(s, TIMELIB_ERR_DOUBLE_TIME, "Double time specification");
1270 s->time->have_time++;
1279 switch (s->time->have_time) {
1281 s->time->h = timelib_get_nr((char **) &ptr, 2);
1282 s->time->i = timelib_get_nr((char **) &ptr, 2);
1283 s->time->s = 0;
1284 … s->time->z = timelib_parse_zone((char **) &ptr, &s->time->dst, s->time, s->tzdb, tz_get_wrapper);
1287 s->time->y = timelib_get_nr((char **) &ptr, 4);
1293 s->time->have_time++;
1304 s->time->h = timelib_get_nr((char **) &ptr, 2);
1305 s->time->i = timelib_get_nr((char **) &ptr, 2);
1306 s->time->s = timelib_get_nr((char **) &ptr, 2);
1309 …s->time->z = timelib_parse_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz…
1324 s->time->m = timelib_get_nr((char **) &ptr, 2);
1325 s->time->d = timelib_get_nr((char **) &ptr, 2);
1327 s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
1328 TIMELIB_PROCESS_YEAR(s->time->y, length);
1339 s->time->y = timelib_get_unsigned_nr((char **) &ptr, 4);
1340 s->time->m = timelib_get_nr((char **) &ptr, 2);
1341 s->time->d = timelib_get_nr((char **) &ptr, 2);
1352 s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
1353 s->time->m = timelib_get_nr((char **) &ptr, 2);
1354 s->time->d = timelib_get_nr((char **) &ptr, 2);
1355 TIMELIB_PROCESS_YEAR(s->time->y, length);
1366 s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
1367 s->time->m = timelib_get_nr((char **) &ptr, 2);
1368 s->time->d = 1;
1369 TIMELIB_PROCESS_YEAR(s->time->y, length);
1380 s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
1381 s->time->m = timelib_get_nr((char **) &ptr, 2);
1382 s->time->d = timelib_get_nr((char **) &ptr, 2);
1383 TIMELIB_PROCESS_YEAR(s->time->y, length);
1394 s->time->d = timelib_get_nr((char **) &ptr, 2);
1396 s->time->m = timelib_get_month((char **) &ptr);
1397 s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
1398 TIMELIB_PROCESS_YEAR(s->time->y, length);
1408 s->time->d = timelib_get_nr((char **) &ptr, 2);
1409 s->time->m = timelib_get_nr((char **) &ptr, 2);
1410 s->time->y = timelib_get_nr((char **) &ptr, 4);
1421 s->time->d = timelib_get_nr((char **) &ptr, 2);
1422 s->time->m = timelib_get_nr((char **) &ptr, 2);
1423 s->time->y = timelib_get_nr_ex((char **) &ptr, 2, &length);
1424 TIMELIB_PROCESS_YEAR(s->time->y, length);
1435 s->time->m = timelib_get_month((char **) &ptr);
1436 s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
1437 s->time->d = 1;
1438 TIMELIB_PROCESS_YEAR(s->time->y, length);
1449 s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
1450 s->time->m = timelib_get_month((char **) &ptr);
1451 s->time->d = 1;
1452 TIMELIB_PROCESS_YEAR(s->time->y, length);
1463 s->time->m = timelib_get_month((char **) &ptr);
1464 s->time->d = timelib_get_nr((char **) &ptr, 2);
1465 s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
1466 TIMELIB_PROCESS_YEAR(s->time->y, length);
1476 s->time->d = timelib_get_nr((char **) &ptr, 2);
1478 s->time->m = timelib_get_month((char **) &ptr);
1488 s->time->y = timelib_get_nr((char **) &ptr, 4);
1489 s->time->m = timelib_get_nr((char **) &ptr, 2);
1490 s->time->d = timelib_get_nr((char **) &ptr, 2);
1502 s->time->y = timelib_get_nr((char **) &ptr, 4);
1503 s->time->m = timelib_get_nr((char **) &ptr, 2);
1504 s->time->d = timelib_get_nr((char **) &ptr, 2);
1505 s->time->h = timelib_get_nr((char **) &ptr, 2);
1506 s->time->i = timelib_get_nr((char **) &ptr, 2);
1507 s->time->s = timelib_get_nr((char **) &ptr, 2);
1509 s->time->us = timelib_get_frac_nr((char **) &ptr, 9);
1511 …s->time->z = timelib_parse_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz…
1527 s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
1528 s->time->d = timelib_get_nr((char **) &ptr, 3);
1529 s->time->m = 1;
1530 TIMELIB_PROCESS_YEAR(s->time->y, length);
1543 s->time->y = timelib_get_nr((char **) &ptr, 4);
1546 s->time->m = 1;
1547 s->time->d = 1;
1548 s->time->relative.d = timelib_daynr_from_weeknr(s->time->y, w, d);
1562 s->time->y = timelib_get_nr((char **) &ptr, 4);
1565 s->time->m = 1;
1566 s->time->d = 1;
1567 s->time->relative.d = timelib_daynr_from_weeknr(s->time->y, w, d);
1579 s->time->m = timelib_get_month((char **) &ptr);
1580 s->time->d = timelib_get_nr((char **) &ptr, 2);
1581 s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
1582 TIMELIB_PROCESS_YEAR(s->time->y, length);
1593 s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
1594 s->time->m = timelib_get_month((char **) &ptr);
1595 s->time->d = timelib_get_nr((char **) &ptr, 2);
1596 TIMELIB_PROCESS_YEAR(s->time->y, length);
1608 s->time->d = timelib_get_nr((char **) &ptr, 2);
1609 s->time->m = timelib_get_month((char **) &ptr);
1610 s->time->y = timelib_get_nr((char **) &ptr, 4);
1611 s->time->h = timelib_get_nr((char **) &ptr, 2);
1612 s->time->i = timelib_get_nr((char **) &ptr, 2);
1613 s->time->s = timelib_get_nr((char **) &ptr, 2);
1614 …s->time->z = timelib_parse_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz…
1626 s->time->y = timelib_get_nr((char **) &ptr, 4);
1635 s->time->relative.y = 0 - s->time->relative.y;
1636 s->time->relative.m = 0 - s->time->relative.m;
1637 s->time->relative.d = 0 - s->time->relative.d;
1638 s->time->relative.h = 0 - s->time->relative.h;
1639 s->time->relative.i = 0 - s->time->relative.i;
1640 s->time->relative.s = 0 - s->time->relative.s;
1641 s->time->relative.weekday = 0 - s->time->relative.weekday;
1642 if (s->time->relative.weekday == 0) {
1643 s->time->relative.weekday = -7;
1645 …if (s->time->relative.have_special_relative && s->time->relative.special.type == TIMELIB_SPECIAL_W…
1646 s->time->relative.special.amount = 0 - s->time->relative.special.amount;
1661 s->time->relative.weekday = relunit->multiplier;
1662 if (s->time->relative.weekday_behavior != 2) {
1663 s->time->relative.weekday_behavior = 1;
1682 s->time->relative.weekday_behavior = 2;
1685 if (s->time->relative.have_weekday_relative == 0) {
1687 s->time->relative.weekday = 1;
1716 s->time->m = timelib_lookup_month((char **) &ptr);
1727 …s->time->z = timelib_parse_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz…
1740 s->time->m = timelib_get_month((char **) &ptr);
1741 s->time->d = timelib_get_nr((char **) &ptr, 2);
1744 s->time->h = timelib_get_nr((char **) &ptr, 2);
1745 s->time->i = timelib_get_nr((char **) &ptr, 2);
1747 s->time->s = timelib_get_nr((char **) &ptr, 2);
1750 s->time->us = timelib_get_frac_nr((char **) &ptr, 8);
1754 s->time->h += timelib_meridian((char **) &ptr, s->time->h);
1765 s->time->m = timelib_get_month((char **) &ptr);
1766 s->time->d = timelib_get_nr((char **) &ptr, 2);
1769 s->time->h = timelib_get_nr((char **) &ptr, 2);
1770 s->time->i = timelib_get_nr((char **) &ptr, 2);
1772 s->time->s = timelib_get_nr((char **) &ptr, 2);
1775 s->time->us = timelib_get_frac_nr((char **) &ptr, 8);
1780 …s->time->z = timelib_parse_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz…
1848 in.time = timelib_time_ctor();
1855 …in.time->y = in.time->d = in.time->m = in.time->h = in.time->i = in.time->s = in.time->us = in.tim…
1856 in.time->is_localtime = in.time->zone_type = 0;
1857 return in.time;
1866 in.time = timelib_time_ctor();
1867 in.time->y = TIMELIB_UNSET;
1868 in.time->d = TIMELIB_UNSET;
1869 in.time->m = TIMELIB_UNSET;
1870 in.time->h = TIMELIB_UNSET;
1871 in.time->i = TIMELIB_UNSET;
1872 in.time->s = TIMELIB_UNSET;
1873 in.time->us = TIMELIB_UNSET;
1874 in.time->z = TIMELIB_UNSET;
1875 in.time->dst = TIMELIB_UNSET;
1877 in.time->is_localtime = 0;
1878 in.time->zone_type = 0;
1879 in.time->relative.days = TIMELIB_UNSET;
1888 /* do funky checking whether the parsed time was valid time */
1889 if (in.time->have_time && !timelib_valid_time( in.time->h, in.time->i, in.time->s)) {
1890 add_warning(&in, TIMELIB_WARN_INVALID_TIME, "The parsed time was invalid");
1893 if (in.time->have_date && !timelib_valid_date( in.time->y, in.time->m, in.time->d)) {
1903 return in.time;
1917 static void timelib_time_reset_fields(timelib_time *time)
1919 assert(time != NULL);
1921 time->y = 1970;
1922 time->m = 1;
1923 time->d = 1;
1924 time->h = time->i = time->s = 0;
1925 time->us = 0;
1926 time->tz_info = NULL;
1929 static void timelib_time_reset_unset_fields(timelib_time *time)
1931 assert(time != NULL);
1933 if (time->y == TIMELIB_UNSET ) time->y = 1970;
1934 if (time->m == TIMELIB_UNSET ) time->m = 1;
1935 if (time->d == TIMELIB_UNSET ) time->d = 1;
1936 if (time->h == TIMELIB_UNSET ) time->h = 0;
1937 if (time->i == TIMELIB_UNSET ) time->i = 0;
1938 if (time->s == TIMELIB_UNSET ) time->s = 0;
1939 if (time->us == TIMELIB_UNSET ) time->us = 0;
2034 in.time = timelib_time_ctor();
2035 in.time->y = TIMELIB_UNSET;
2036 in.time->d = TIMELIB_UNSET;
2037 in.time->m = TIMELIB_UNSET;
2038 in.time->h = TIMELIB_UNSET;
2039 in.time->i = TIMELIB_UNSET;
2040 in.time->s = TIMELIB_UNSET;
2041 in.time->us = TIMELIB_UNSET;
2042 in.time->z = TIMELIB_UNSET;
2043 in.time->dst = TIMELIB_UNSET;
2045 in.time->is_localtime = 0;
2046 in.time->zone_type = 0;
2094 in.time->have_relative = 1;
2095 in.time->relative.have_weekday_relative = 1;
2096 in.time->relative.weekday = tmprel->multiplier;
2097 in.time->relative.weekday_behavior = 1;
2104 if ((s->time->d = timelib_get_nr((char **) &ptr, 2)) == TIMELIB_UNSET) {
2116 s->time->m = 1;
2117 s->time->d = tmp + 1;
2118 timelib_do_normalize(s->time);
2125 if ((s->time->m = timelib_get_nr((char **) &ptr, 2)) == TIMELIB_UNSET) {
2135 s->time->m = tmp;
2142 if ((s->time->y = timelib_get_nr_ex((char **) &ptr, 2, &length)) == TIMELIB_UNSET) {
2145 TIMELIB_PROCESS_YEAR(s->time->y, length);
2150 if ((s->time->y = timelib_get_nr((char **) &ptr, 4)) == TIMELIB_UNSET) {
2157 if ((s->time->h = timelib_get_nr((char **) &ptr, 2)) == TIMELIB_UNSET) {
2160 if (s->time->h > 12) {
2167 if ((s->time->h = timelib_get_nr((char **) &ptr, 2)) == TIMELIB_UNSET) {
2172 if (s->time->h == TIMELIB_UNSET) {
2174 } else if ((tmp = timelib_meridian_with_check((char **) &ptr, s->time->h)) == TIMELIB_UNSET) {
2177 s->time->h += tmp;
2190 s->time->i = min;
2204 s->time->s = sec;
2218 s->time->us = (f * pow(10, 6 - (ptr - tptr)));
2232 s->time->us = (f * pow(10, 3 - (ptr - tptr)) * 1000);
2243 s->time->y = 1970;
2244 s->time->m = 1;
2245 s->time->d = 1;
2246 s->time->h = s->time->i = s->time->s = 0;
2247 s->time->relative.s += tmp;
2248 s->time->is_localtime = 1;
2249 s->time->zone_type = TIMELIB_ZONETYPE_OFFSET;
2250 s->time->z = 0;
2251 s->time->dst = 0;
2270 timelib_time_reset_fields(s->time);
2274 timelib_time_reset_unset_fields(s->time);
2327 …s->time->z = timelib_parse_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz…
2334 s->time->z = timelib_parse_tz_minutes((char **) &ptr, s->time);
2335 if (s->time->z == TIMELIB_UNSET) {
2362 timelib_time_reset_fields(s->time);
2366 timelib_time_reset_unset_fields(s->time);
2380 …if (s->time->h != TIMELIB_UNSET || s->time->i != TIMELIB_UNSET || s->time->s != TIMELIB_UNSET || s…
2381 if (s->time->h == TIMELIB_UNSET ) {
2382 s->time->h = 0;
2384 if (s->time->i == TIMELIB_UNSET ) {
2385 s->time->i = 0;
2387 if (s->time->s == TIMELIB_UNSET ) {
2388 s->time->s = 0;
2390 if (s->time->us == TIMELIB_UNSET ) {
2391 s->time->us = 0;
2396 …if (s->time->y != TIMELIB_UNSET && (iso_week_of_year != TIMELIB_UNSET || iso_year != TIMELIB_UNSET…
2399 …if (iso_year != TIMELIB_UNSET && (s->time->y != TIMELIB_UNSET || s->time->m != TIMELIB_UNSET || s-…
2412 …e_from_isodate(iso_year, iso_week_of_year, iso_day_of_week, &s->time->y, &s->time->m, &s->time->d);
2417 /* do funky checking whether the parsed time was valid time */
2418 if (s->time->h != TIMELIB_UNSET && s->time->i != TIMELIB_UNSET &&
2419 s->time->s != TIMELIB_UNSET &&
2420 !timelib_valid_time( s->time->h, s->time->i, s->time->s)) {
2421 add_pbf_warning(s, TIMELIB_WARN_INVALID_TIME, "The parsed time was invalid", string, ptr);
2424 if (s->time->y != TIMELIB_UNSET && s->time->m != TIMELIB_UNSET &&
2425 s->time->d != TIMELIB_UNSET &&
2426 !timelib_valid_date( s->time->y, s->time->m, s->time->d)) {
2435 return in.time;
2500 timelib_time time = timelib_strtotime("May 12");
2503 time.y, time.m, time.d, time.h, time.i, time.s, time.f, time.z, time.dst);
2504 if (time.have_relative) {
2506time.relative.y, time.relative.m, time.relative.d, time.relative.h, time.relative.i, time.relative…
2508 if (time.have_weekday_relative) {
2509 printf (" / %d", time.relative.weekday);
2511 if (time.have_weeknr_day) {
2512 printf(" / %dW%d", time.relative.weeknr_day.weeknr, time.relative.weeknr_day.dayofweek);