Lines Matching refs:time

109time->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…
116time->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;
682 case TIMELIB_SECOND: s->time->relative.s += amount * relunit->multiplier; break;
683 case TIMELIB_MINUTE: s->time->relative.i += amount * relunit->multiplier; break;
684 case TIMELIB_HOUR: s->time->relative.h += amount * relunit->multiplier; break;
685 case TIMELIB_DAY: s->time->relative.d += amount * relunit->multiplier; break;
686 case TIMELIB_MONTH: s->time->relative.m += amount * relunit->multiplier; break;
687 case TIMELIB_YEAR: s->time->relative.y += amount * relunit->multiplier; break;
692 s->time->relative.d += (amount > 0 ? amount - 1 : amount) * 7;
693 s->time->relative.weekday = relunit->multiplier;
694 s->time->relative.weekday_behavior = behavior;
700 s->time->relative.special.type = relunit->multiplier;
701 s->time->relative.special.amount = amount;
1011 s->time->relative.d = -1;
1031 s->time->h = 12;
1054 s->time->relative.d = 1;
1070 s->time->y = 1970;
1071 s->time->m = 1;
1072 s->time->d = 1;
1073 s->time->h = s->time->i = s->time->s = 0;
1074 s->time->f = 0.0;
1075 s->time->relative.s += i;
1076 s->time->is_localtime = 1;
1077 s->time->zone_type = TIMELIB_ZONETYPE_OFFSET;
1078 s->time->z = 0;
1092 s->time->relative.first_last_day_of = 2;
1094 s->time->relative.first_last_day_of = 1;
1109 s->time->h = timelib_get_nr((char **) &ptr, 2);
1110 s->time->i = 15;
1112 s->time->h = timelib_get_nr((char **) &ptr, 2) - 1;
1113 s->time->i = 45;
1117 s->time->h += timelib_meridian((char **) &ptr, s->time->h);
1136 s->time->relative.special.type = TIMELIB_SPECIAL_DAY_OF_WEEK_IN_MONTH;
1139 s->time->relative.special.type = TIMELIB_SPECIAL_LAST_DAY_OF_WEEK_IN_MONTH;
1151 s->time->h = timelib_get_nr((char **) &ptr, 2);
1153 s->time->i = timelib_get_nr((char **) &ptr, 2);
1155 s->time->s = timelib_get_nr((char **) &ptr, 2);
1158 s->time->h += timelib_meridian((char **) &ptr, s->time->h);
1168 s->time->h = timelib_get_nr((char **) &ptr, 2);
1169 s->time->i = timelib_get_nr((char **) &ptr, 2);
1171 s->time->s = timelib_get_nr((char **) &ptr, 2);
1174 s->time->f = timelib_get_frac_nr((char **) &ptr, 8);
1178 s->time->h += timelib_meridian((char **) &ptr, s->time->h);
1189 s->time->h = timelib_get_nr((char **) &ptr, 2);
1190 s->time->i = timelib_get_nr((char **) &ptr, 2);
1192 s->time->s = timelib_get_nr((char **) &ptr, 2);
1195 s->time->f = timelib_get_frac_nr((char **) &ptr, 8);
1200 …s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz_g…
1213 switch (s->time->have_time) {
1215 s->time->h = timelib_get_nr((char **) &ptr, 2);
1216 s->time->i = timelib_get_nr((char **) &ptr, 2);
1217 s->time->s = 0;
1220 s->time->y = timelib_get_nr((char **) &ptr, 4);
1224 add_error(s, "Double time specification");
1227 s->time->have_time++;
1236 switch (s->time->have_time) {
1238 s->time->h = timelib_get_nr((char **) &ptr, 2);
1239 s->time->i = timelib_get_nr((char **) &ptr, 2);
1240 s->time->s = 0;
1241 s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, s->tzdb, tz_get_wrapper);
1244 s->time->y = timelib_get_nr((char **) &ptr, 4);
1250 s->time->have_time++;
1261 s->time->h = timelib_get_nr((char **) &ptr, 2);
1262 s->time->i = timelib_get_nr((char **) &ptr, 2);
1263 s->time->s = timelib_get_nr((char **) &ptr, 2);
1266 …s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz_g…
1281 s->time->m = timelib_get_nr((char **) &ptr, 2);
1282 s->time->d = timelib_get_nr((char **) &ptr, 2);
1284 s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
1285 TIMELIB_PROCESS_YEAR(s->time->y, length);
1296 s->time->y = timelib_get_unsigned_nr((char **) &ptr, 4);
1297 s->time->m = timelib_get_nr((char **) &ptr, 2);
1298 s->time->d = timelib_get_nr((char **) &ptr, 2);
1309 s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
1310 s->time->m = timelib_get_nr((char **) &ptr, 2);
1311 s->time->d = timelib_get_nr((char **) &ptr, 2);
1312 TIMELIB_PROCESS_YEAR(s->time->y, length);
1323 s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
1324 s->time->m = timelib_get_nr((char **) &ptr, 2);
1325 s->time->d = 1;
1326 TIMELIB_PROCESS_YEAR(s->time->y, length);
1337 s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
1338 s->time->m = timelib_get_nr((char **) &ptr, 2);
1339 s->time->d = timelib_get_nr((char **) &ptr, 2);
1340 TIMELIB_PROCESS_YEAR(s->time->y, length);
1351 s->time->d = timelib_get_nr((char **) &ptr, 2);
1353 s->time->m = timelib_get_month((char **) &ptr);
1354 s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
1355 TIMELIB_PROCESS_YEAR(s->time->y, length);
1365 s->time->d = timelib_get_nr((char **) &ptr, 2);
1366 s->time->m = timelib_get_nr((char **) &ptr, 2);
1367 s->time->y = timelib_get_nr((char **) &ptr, 4);
1378 s->time->d = timelib_get_nr((char **) &ptr, 2);
1379 s->time->m = timelib_get_nr((char **) &ptr, 2);
1380 s->time->y = timelib_get_nr_ex((char **) &ptr, 2, &length);
1381 TIMELIB_PROCESS_YEAR(s->time->y, length);
1392 s->time->m = timelib_get_month((char **) &ptr);
1393 s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
1394 s->time->d = 1;
1395 TIMELIB_PROCESS_YEAR(s->time->y, length);
1406 s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
1407 s->time->m = timelib_get_month((char **) &ptr);
1408 s->time->d = 1;
1409 TIMELIB_PROCESS_YEAR(s->time->y, length);
1420 s->time->m = timelib_get_month((char **) &ptr);
1421 s->time->d = timelib_get_nr((char **) &ptr, 2);
1422 s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
1423 TIMELIB_PROCESS_YEAR(s->time->y, length);
1433 s->time->d = timelib_get_nr((char **) &ptr, 2);
1435 s->time->m = timelib_get_month((char **) &ptr);
1445 s->time->y = timelib_get_nr((char **) &ptr, 4);
1446 s->time->m = timelib_get_nr((char **) &ptr, 2);
1447 s->time->d = timelib_get_nr((char **) &ptr, 2);
1459 s->time->y = timelib_get_nr((char **) &ptr, 4);
1460 s->time->m = timelib_get_nr((char **) &ptr, 2);
1461 s->time->d = timelib_get_nr((char **) &ptr, 2);
1462 s->time->h = timelib_get_nr((char **) &ptr, 2);
1463 s->time->i = timelib_get_nr((char **) &ptr, 2);
1464 s->time->s = timelib_get_nr((char **) &ptr, 2);
1466 s->time->f = timelib_get_frac_nr((char **) &ptr, 9);
1468 …s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz_g…
1484 s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
1485 s->time->d = timelib_get_nr((char **) &ptr, 3);
1486 s->time->m = 1;
1487 TIMELIB_PROCESS_YEAR(s->time->y, length);
1500 s->time->y = timelib_get_nr((char **) &ptr, 4);
1503 s->time->m = 1;
1504 s->time->d = 1;
1505 s->time->relative.d = timelib_daynr_from_weeknr(s->time->y, w, d);
1519 s->time->y = timelib_get_nr((char **) &ptr, 4);
1522 s->time->m = 1;
1523 s->time->d = 1;
1524 s->time->relative.d = timelib_daynr_from_weeknr(s->time->y, w, d);
1536 s->time->m = timelib_get_month((char **) &ptr);
1537 s->time->d = timelib_get_nr((char **) &ptr, 2);
1538 s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
1539 TIMELIB_PROCESS_YEAR(s->time->y, length);
1550 s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
1551 s->time->m = timelib_get_month((char **) &ptr);
1552 s->time->d = timelib_get_nr((char **) &ptr, 2);
1553 TIMELIB_PROCESS_YEAR(s->time->y, length);
1565 s->time->d = timelib_get_nr((char **) &ptr, 2);
1566 s->time->m = timelib_get_month((char **) &ptr);
1567 s->time->y = timelib_get_nr((char **) &ptr, 4);
1568 s->time->h = timelib_get_nr((char **) &ptr, 2);
1569 s->time->i = timelib_get_nr((char **) &ptr, 2);
1570 s->time->s = timelib_get_nr((char **) &ptr, 2);
1571 …s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz_g…
1583 s->time->y = timelib_get_nr((char **) &ptr, 4);
1592 s->time->relative.y = 0 - s->time->relative.y;
1593 s->time->relative.m = 0 - s->time->relative.m;
1594 s->time->relative.d = 0 - s->time->relative.d;
1595 s->time->relative.h = 0 - s->time->relative.h;
1596 s->time->relative.i = 0 - s->time->relative.i;
1597 s->time->relative.s = 0 - s->time->relative.s;
1598 s->time->relative.weekday = 0 - s->time->relative.weekday;
1599 if (s->time->relative.weekday == 0) {
1600 s->time->relative.weekday = -7;
1602 …if (s->time->relative.have_special_relative && s->time->relative.special.type == TIMELIB_SPECIAL_W…
1603 s->time->relative.special.amount = 0 - s->time->relative.special.amount;
1618 s->time->relative.weekday = relunit->multiplier;
1619 if (s->time->relative.weekday_behavior != 2) {
1620 s->time->relative.weekday_behavior = 1;
1639 s->time->relative.weekday_behavior = 2;
1642 if (s->time->relative.have_weekday_relative == 0) {
1644 s->time->relative.weekday = 1;
1673 s->time->m = timelib_lookup_month((char **) &ptr);
1684 …s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz_g…
1697 s->time->m = timelib_get_month((char **) &ptr);
1698 s->time->d = timelib_get_nr((char **) &ptr, 2);
1701 s->time->h = timelib_get_nr((char **) &ptr, 2);
1702 s->time->i = timelib_get_nr((char **) &ptr, 2);
1704 s->time->s = timelib_get_nr((char **) &ptr, 2);
1707 s->time->f = timelib_get_frac_nr((char **) &ptr, 8);
1711 s->time->h += timelib_meridian((char **) &ptr, s->time->h);
1722 s->time->m = timelib_get_month((char **) &ptr);
1723 s->time->d = timelib_get_nr((char **) &ptr, 2);
1726 s->time->h = timelib_get_nr((char **) &ptr, 2);
1727 s->time->i = timelib_get_nr((char **) &ptr, 2);
1729 s->time->s = timelib_get_nr((char **) &ptr, 2);
1732 s->time->f = timelib_get_frac_nr((char **) &ptr, 8);
1737 …s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz_g…
1805 in.time = timelib_time_ctor();
1812 …in.time->y = in.time->d = in.time->m = in.time->h = in.time->i = in.time->s = in.time->f = in.time
1813 in.time->is_localtime = in.time->zone_type = 0;
1814 return in.time;
1823 in.time = timelib_time_ctor();
1824 in.time->y = TIMELIB_UNSET;
1825 in.time->d = TIMELIB_UNSET;
1826 in.time->m = TIMELIB_UNSET;
1827 in.time->h = TIMELIB_UNSET;
1828 in.time->i = TIMELIB_UNSET;
1829 in.time->s = TIMELIB_UNSET;
1830 in.time->f = TIMELIB_UNSET;
1831 in.time->z = TIMELIB_UNSET;
1832 in.time->dst = TIMELIB_UNSET;
1834 in.time->is_localtime = 0;
1835 in.time->zone_type = 0;
1844 /* do funky checking whether the parsed time was valid time */
1845 if (in.time->have_time && !timelib_valid_time( in.time->h, in.time->i, in.time->s)) {
1846 add_warning(&in, "The parsed time was invalid");
1849 if (in.time->have_date && !timelib_valid_date( in.time->y, in.time->m, in.time->d)) {
1859 return in.time;
1868 static void timelib_time_reset_fields(timelib_time *time)
1870 assert(time != NULL);
1872 time->y = 1970;
1873 time->m = 1;
1874 time->d = 1;
1875 time->h = time->i = time->s = 0;
1876 time->f = 0.0;
1877 time->tz_info = NULL;
1880 static void timelib_time_reset_unset_fields(timelib_time *time)
1882 assert(time != NULL);
1884 if (time->y == TIMELIB_UNSET ) time->y = 1970;
1885 if (time->m == TIMELIB_UNSET ) time->m = 1;
1886 if (time->d == TIMELIB_UNSET ) time->d = 1;
1887 if (time->h == TIMELIB_UNSET ) time->h = 0;
1888 if (time->i == TIMELIB_UNSET ) time->i = 0;
1889 if (time->s == TIMELIB_UNSET ) time->s = 0;
1890 if (time->f == TIMELIB_UNSET ) time->f = 0.0;
1910 in.time = timelib_time_ctor();
1911 in.time->y = TIMELIB_UNSET;
1912 in.time->d = TIMELIB_UNSET;
1913 in.time->m = TIMELIB_UNSET;
1914 in.time->h = TIMELIB_UNSET;
1915 in.time->i = TIMELIB_UNSET;
1916 in.time->s = TIMELIB_UNSET;
1917 in.time->f = TIMELIB_UNSET;
1918 in.time->z = TIMELIB_UNSET;
1919 in.time->dst = TIMELIB_UNSET;
1921 in.time->is_localtime = 0;
1922 in.time->zone_type = 0;
1938 in.time->have_relative = 1;
1939 in.time->relative.have_weekday_relative = 1;
1940 in.time->relative.weekday = tmprel->multiplier;
1941 in.time->relative.weekday_behavior = 1;
1948 if ((s->time->d = timelib_get_nr((char **) &ptr, 2)) == TIMELIB_UNSET) {
1960 s->time->m = 1;
1961 s->time->d = tmp + 1;
1962 timelib_do_normalize(s->time);
1969 if ((s->time->m = timelib_get_nr((char **) &ptr, 2)) == TIMELIB_UNSET) {
1979 s->time->m = tmp;
1986 if ((s->time->y = timelib_get_nr_ex((char **) &ptr, 2, &length)) == TIMELIB_UNSET) {
1989 TIMELIB_PROCESS_YEAR(s->time->y, length);
1994 if ((s->time->y = timelib_get_nr((char **) &ptr, 4)) == TIMELIB_UNSET) {
2001 if ((s->time->h = timelib_get_nr((char **) &ptr, 2)) == TIMELIB_UNSET) {
2004 if (s->time->h > 12) {
2011 if ((s->time->h = timelib_get_nr((char **) &ptr, 2)) == TIMELIB_UNSET) {
2017 if (s->time->h == TIMELIB_UNSET) {
2019 } else if ((tmp = timelib_meridian_with_check((char **) &ptr, s->time->h)) == TIMELIB_UNSET) {
2022 s->time->h += tmp;
2035 s->time->i = min;
2049 s->time->s = sec;
2063 s->time->f = (f / pow(10, (ptr - tptr)));
2074 s->time->y = 1970;
2075 s->time->m = 1;
2076 s->time->d = 1;
2077 s->time->h = s->time->i = s->time->s = 0;
2078 s->time->f = 0.0;
2079 s->time->relative.s += tmp;
2080 s->time->is_localtime = 1;
2081 s->time->zone_type = TIMELIB_ZONETYPE_OFFSET;
2082 s->time->z = 0;
2091 …s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz_g…
2122 timelib_time_reset_fields(s->time);
2126 timelib_time_reset_unset_fields(s->time);
2179 timelib_time_reset_fields(s->time);
2183 timelib_time_reset_unset_fields(s->time);
2194 if (s->time->h != TIMELIB_UNSET || s->time->i != TIMELIB_UNSET || s->time->s != TIMELIB_UNSET) {
2195 if (s->time->h == TIMELIB_UNSET ) {
2196 s->time->h = 0;
2198 if (s->time->i == TIMELIB_UNSET ) {
2199 s->time->i = 0;
2201 if (s->time->s == TIMELIB_UNSET ) {
2202 s->time->s = 0;
2206 /* do funky checking whether the parsed time was valid time */
2207 if (s->time->h != TIMELIB_UNSET && s->time->i != TIMELIB_UNSET &&
2208 s->time->s != TIMELIB_UNSET &&
2209 !timelib_valid_time( s->time->h, s->time->i, s->time->s)) {
2210 add_pbf_warning(s, "The parsed time was invalid", string, ptr);
2213 if (s->time->y != TIMELIB_UNSET && s->time->m != TIMELIB_UNSET &&
2214 s->time->d != TIMELIB_UNSET &&
2215 !timelib_valid_date( s->time->y, s->time->m, s->time->d)) {
2224 return in.time;
2282 timelib_time time = timelib_strtotime("May 12");
2285 time.y, time.m, time.d, time.h, time.i, time.s, time.f, time.z, time.dst);
2286 if (time.have_relative) {
2288time.relative.y, time.relative.m, time.relative.d, time.relative.h, time.relative.i, time.relative…
2290 if (time.have_weekday_relative) {
2291 printf (" / %d", time.relative.weekday);
2293 if (time.have_weeknr_day) {
2294 printf(" / %dW%d", time.relative.weeknr_day.weeknr, time.relative.weeknr_day.dayofweek);