Lines Matching refs:ptr
89 #define YYMARKER s->ptr
105 #define TIMELIB_INIT s->cur = cursor; str = timelib_string(s); ptr = str
136 uchar *lim, *str, *ptr, *cur, *tok, *pos;
310 char *ptr = s;
311 while (ptr[0] == ' ' || ptr[0] == '\t') {
312 ptr++;
314 return ptr;
325 s->ptr -= cnt;
334 s->ptr = &buf[s->ptr - s->bot];
404 static timelib_sll timelib_meridian(const char **ptr, timelib_sll h)
408 while (!strchr("AaPp", **ptr)) {
409 ++*ptr;
411 if (**ptr == 'a' || **ptr == 'A') {
418 ++*ptr;
419 if (**ptr == '.') {
420 ++*ptr;
422 if (**ptr == 'M' || **ptr == 'm') {
423 ++*ptr;
425 if (**ptr == '.') {
426 ++*ptr;
431 static timelib_sll timelib_meridian_with_check(const char **ptr, timelib_sll h)
435 while (**ptr && !strchr("AaPp", **ptr)) {
436 ++*ptr;
438 if(!**ptr) {
441 if (**ptr == 'a' || **ptr == 'A') {
448 ++*ptr;
449 if (**ptr == '.') {
450 ++*ptr;
451 if (**ptr != 'm' && **ptr != 'M') {
454 ++*ptr;
455 if (**ptr != '.' ) {
458 ++*ptr;
459 } else if (**ptr == 'm' || **ptr == 'M') {
460 ++*ptr;
475 static timelib_sll timelib_get_nr_ex(const char **ptr, int max_length, int *scanned_length)
482 while ((**ptr < '0') || (**ptr > '9')) {
483 if (**ptr == '\0') {
486 ++*ptr;
489 begin = *ptr;
490 while ((**ptr >= '0') && (**ptr <= '9') && len < max_length) {
491 ++*ptr;
494 end = *ptr;
505 static timelib_sll timelib_get_nr(const char **ptr, int max_length)
507 return timelib_get_nr_ex(ptr, max_length, NULL);
510 static void timelib_skip_day_suffix(const char **ptr)
512 if (isspace(**ptr)) {
515 …lib_strncasecmp(*ptr, "nd", 2) || !timelib_strncasecmp(*ptr, "rd", 2) ||!timelib_strncasecmp(*ptr,…
516 *ptr += 2;
520 static timelib_sll timelib_get_frac_nr(const char **ptr)
526 while ((**ptr != '.') && (**ptr != ':') && ((**ptr < '0') || (**ptr > '9'))) {
527 if (**ptr == '\0') {
530 ++*ptr;
532 begin = *ptr;
533 while ((**ptr == '.') || (**ptr == ':') || ((**ptr >= '0') && (**ptr <= '9'))) {
534 ++*ptr;
536 end = *ptr;
544 static timelib_ull timelib_get_signed_nr(Scanner *s, const char **ptr, int max_length)
552 while (((**ptr < '0') || (**ptr > '9')) && (**ptr != '+') && (**ptr != '-')) {
553 if (**ptr == '\0') {
557 ++*ptr;
565 while ((**ptr == '+') || (**ptr == '-')) {
566 if (**ptr == '-') {
569 ++*ptr;
572 while (((**ptr < '0') || (**ptr > '9'))) {
573 if (**ptr == '\0') {
578 ++*ptr;
581 while ((**ptr >= '0') && (**ptr <= '9') && len < max_length) {
582 *str_ptr = **ptr;
583 ++*ptr;
601 static timelib_sll timelib_lookup_relative_text(const char **ptr, int *behavior)
604 const char *begin = *ptr, *end;
608 while ((**ptr >= 'A' && **ptr <= 'Z') || (**ptr >= 'a' && **ptr <= 'z')) {
609 ++*ptr;
611 end = *ptr;
626 static timelib_sll timelib_get_relative_text(const char **ptr, int *behavior)
628 while (**ptr == ' ' || **ptr == '\t' || **ptr == '-' || **ptr == '/') {
629 ++*ptr;
631 return timelib_lookup_relative_text(ptr, behavior);
634 static timelib_long timelib_lookup_month(const char **ptr)
637 const char *begin = *ptr, *end;
641 while ((**ptr >= 'A' && **ptr <= 'Z') || (**ptr >= 'a' && **ptr <= 'z')) {
642 ++*ptr;
644 end = *ptr;
658 static timelib_long timelib_get_month(const char **ptr)
660 while (**ptr == ' ' || **ptr == '\t' || **ptr == '-' || **ptr == '.' || **ptr == '/') {
661 ++*ptr;
663 return timelib_lookup_month(ptr);
666 static void timelib_eat_spaces(const char **ptr)
669 if (**ptr == ' ' || **ptr == '\t') {
670 ++*ptr;
673 if ((*ptr)[0] == '\xe2' && (*ptr)[1] == '\x80' && (*ptr)[2] == '\xaf') { // NNBSP
674 *ptr += 3;
677 if ((*ptr)[0] == '\xc2' && (*ptr)[1] == '\xa0') { // NBSP
678 *ptr += 2;
685 static void timelib_eat_until_separator(const char **ptr)
687 ++*ptr;
688 while (strchr(" \t.,:;/-0123456789", **ptr) == NULL) {
689 ++*ptr;
693 static const timelib_relunit* timelib_lookup_relunit(const char **ptr)
696 const char *begin = *ptr, *end;
699 …while (**ptr != '\0' && **ptr != ' ' && **ptr != ',' && **ptr != '\t' && **ptr != ';' && **ptr != …
700 **ptr != '/' && **ptr != '.' && **ptr != '-' && **ptr != '(' && **ptr != ')' ) {
701 ++*ptr;
703 end = *ptr;
735 static void timelib_set_relative(const char **ptr, timelib_sll amount, int behavior, Scanner *s, in…
739 if (!(relunit = timelib_lookup_relunit(ptr))) {
810 static timelib_long timelib_lookup_abbr(const char **ptr, int *dst, char **tz_abbr, int *found)
813 const char *begin = *ptr, *end;
819 (**ptr >= 'A' && **ptr <= 'Z') ||
820 (**ptr >= 'a' && **ptr <= 'z') ||
821 (**ptr >= '0' && **ptr <= '9') ||
822 **ptr == '/' || **ptr == '_' || **ptr == '-' || **ptr == '+'
824 ++*ptr;
826 end = *ptr;
846 static timelib_long timelib_parse_tz_cor(const char **ptr, int *tz_not_found)
848 const char *begin = *ptr, *end;
853 while (isdigit(**ptr) || **ptr == ':') {
854 ++*ptr;
856 end = *ptr;
907 static timelib_long timelib_parse_tz_minutes(const char **ptr, timelib_time *t)
910 const char *begin = *ptr;
913 if (**ptr != '+' && **ptr != '-') {
917 ++*ptr;
918 while (isdigit(**ptr)) {
919 ++*ptr;
938 timelib_long timelib_parse_zone(const char **ptr, int *dst, timelib_time *t, int *tz_not_found, con…
945 while (**ptr == ' ' || **ptr == '\t' || **ptr == '(') {
946 ++*ptr;
948 …if ((*ptr)[0] == 'G' && (*ptr)[1] == 'M' && (*ptr)[2] == 'T' && ((*ptr)[3] == '+' || (*ptr)[3] == …
949 *ptr += 3;
951 if (**ptr == '+') {
952 ++*ptr;
957 retval = timelib_parse_tz_cor(ptr, tz_not_found);
958 } else if (**ptr == '-') {
959 ++*ptr;
964 retval = -1 * timelib_parse_tz_cor(ptr, tz_not_found);
973 offset = timelib_lookup_abbr(ptr, dst, &tz_abbr, &found);
994 while (**ptr == ')') {
995 ++*ptr;
1014 const char *ptr = NULL;
1220 i = timelib_get_signed_nr(s, &ptr, 24);
1249 is_negative = *(ptr + 1) == '-';
1251 i = timelib_get_signed_nr(s, &ptr, 24);
1253 ptr_before = ptr;
1254 us = timelib_get_signed_nr(s, &ptr, 6);
1255 us = us * pow(10, 7 - (ptr - ptr_before));
1283 if (*ptr == 'l' || *ptr == 'L') {
1300 if (*ptr == 'b') {
1301 s->time->h = timelib_get_nr(&ptr, 2);
1304 s->time->h = timelib_get_nr(&ptr, 2) - 1;
1307 if (*ptr != '\0' ) {
1308 timelib_eat_spaces(&ptr);
1309 s->time->h += timelib_meridian(&ptr, s->time->h);
1325 i = timelib_get_relative_text(&ptr, &behavior);
1326 timelib_eat_spaces(&ptr);
1329 timelib_set_relative(&ptr, i, 1, s, TIMELIB_TIME_PART_DONT_KEEP);
1332 timelib_set_relative(&ptr, i, behavior, s, TIMELIB_TIME_PART_DONT_KEEP);
1343 s->time->h = timelib_get_nr(&ptr, 2);
1344 if (*ptr == ':' || *ptr == '.') {
1345 s->time->i = timelib_get_nr(&ptr, 2);
1346 if (*ptr == ':' || *ptr == '.') {
1347 s->time->s = timelib_get_nr(&ptr, 2);
1350 timelib_eat_spaces(&ptr);
1351 s->time->h += timelib_meridian(&ptr, s->time->h);
1361 s->time->h = timelib_get_nr(&ptr, 2);
1362 s->time->i = timelib_get_nr(&ptr, 2);
1363 if (*ptr == ':' || *ptr == '.') {
1364 s->time->s = timelib_get_nr(&ptr, 2);
1366 if (*ptr == ':' || *ptr == '.') {
1367 s->time->us = timelib_get_frac_nr(&ptr);
1370 timelib_eat_spaces(&ptr);
1371 s->time->h += timelib_meridian(&ptr, s->time->h);
1382 s->time->h = timelib_get_nr(&ptr, 2);
1383 if (*ptr == ':' || *ptr == '.') {
1384 s->time->i = timelib_get_nr(&ptr, 2);
1385 if (*ptr == ':' || *ptr == '.') {
1386 s->time->s = timelib_get_nr(&ptr, 2);
1388 if (*ptr == '.') {
1389 s->time->us = timelib_get_frac_nr(&ptr);
1394 if (*ptr != '\0') {
1395 …s->time->z = timelib_parse_zone(&ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz_get_wrapp…
1410 s->time->h = timelib_get_nr(&ptr, 2);
1411 s->time->i = timelib_get_nr(&ptr, 2);
1415 s->time->y = timelib_get_nr(&ptr, 4);
1433 s->time->h = timelib_get_nr(&ptr, 2);
1434 s->time->i = timelib_get_nr(&ptr, 2);
1436 s->time->z = timelib_parse_zone(&ptr, &s->time->dst, s->time, s->tzdb, tz_get_wrapper);
1439 s->time->y = timelib_get_nr(&ptr, 4);
1456 s->time->h = timelib_get_nr(&ptr, 2);
1457 s->time->i = timelib_get_nr(&ptr, 2);
1458 s->time->s = timelib_get_nr(&ptr, 2);
1460 if (*ptr != '\0') {
1461 …s->time->z = timelib_parse_zone(&ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz_get_wrapp…
1476 s->time->m = timelib_get_nr(&ptr, 2);
1477 s->time->d = timelib_get_nr(&ptr, 2);
1478 if (*ptr == '/') {
1479 s->time->y = timelib_get_nr_ex(&ptr, 4, &length);
1491 s->time->y = timelib_get_signed_nr(s, &ptr, 4);
1492 s->time->m = timelib_get_nr(&ptr, 2);
1493 s->time->d = timelib_get_nr(&ptr, 2);
1504 s->time->y = timelib_get_nr_ex(&ptr, 4, &length);
1505 s->time->m = timelib_get_nr(&ptr, 2);
1506 s->time->d = timelib_get_nr(&ptr, 2);
1517 s->time->y = timelib_get_signed_nr(s, &ptr, 19);
1518 s->time->m = timelib_get_nr(&ptr, 2);
1519 s->time->d = timelib_get_nr(&ptr, 2);
1530 s->time->y = timelib_get_nr_ex(&ptr, 4, &length);
1531 s->time->m = timelib_get_nr(&ptr, 2);
1544 s->time->y = timelib_get_nr_ex(&ptr, 4, &length);
1545 s->time->m = timelib_get_nr(&ptr, 2);
1546 s->time->d = timelib_get_nr(&ptr, 2);
1558 s->time->d = timelib_get_nr(&ptr, 2);
1559 timelib_skip_day_suffix(&ptr);
1560 s->time->m = timelib_get_month(&ptr);
1561 s->time->y = timelib_get_nr_ex(&ptr, 4, &length);
1572 s->time->d = timelib_get_nr(&ptr, 2);
1573 s->time->m = timelib_get_nr(&ptr, 2);
1574 s->time->y = timelib_get_nr(&ptr, 4);
1585 s->time->d = timelib_get_nr(&ptr, 2);
1586 s->time->m = timelib_get_nr(&ptr, 2);
1587 s->time->y = timelib_get_nr_ex(&ptr, 2, &length);
1599 s->time->m = timelib_get_month(&ptr);
1600 s->time->y = timelib_get_nr_ex(&ptr, 4, &length);
1613 s->time->y = timelib_get_nr_ex(&ptr, 4, &length);
1614 s->time->m = timelib_get_month(&ptr);
1627 s->time->m = timelib_get_month(&ptr);
1628 s->time->d = timelib_get_nr(&ptr, 2);
1629 s->time->y = timelib_get_nr_ex(&ptr, 4, &length);
1640 s->time->d = timelib_get_nr(&ptr, 2);
1641 timelib_skip_day_suffix(&ptr);
1642 s->time->m = timelib_get_month(&ptr);
1652 s->time->y = timelib_get_nr(&ptr, 4);
1653 s->time->m = timelib_get_nr(&ptr, 2);
1654 s->time->d = timelib_get_nr(&ptr, 2);
1666 s->time->y = timelib_get_nr(&ptr, 4);
1667 s->time->m = timelib_get_nr(&ptr, 2);
1668 s->time->d = timelib_get_nr(&ptr, 2);
1669 s->time->h = timelib_get_nr(&ptr, 2);
1670 s->time->i = timelib_get_nr(&ptr, 2);
1671 s->time->s = timelib_get_nr(&ptr, 2);
1672 if (*ptr == '.') {
1673 s->time->us = timelib_get_frac_nr(&ptr);
1674 if (*ptr) { /* timezone is optional */
1675 …s->time->z = timelib_parse_zone(&ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz_get_wrapp…
1691 s->time->y = timelib_get_nr_ex(&ptr, 4, &length);
1692 s->time->d = timelib_get_nr(&ptr, 3);
1707 s->time->y = timelib_get_nr(&ptr, 4);
1708 w = timelib_get_nr(&ptr, 2);
1709 d = timelib_get_nr(&ptr, 1);
1726 s->time->y = timelib_get_nr(&ptr, 4);
1727 w = timelib_get_nr(&ptr, 2);
1743 s->time->m = timelib_get_month(&ptr);
1744 s->time->d = timelib_get_nr(&ptr, 2);
1745 s->time->y = timelib_get_nr_ex(&ptr, 4, &length);
1757 s->time->y = timelib_get_nr_ex(&ptr, 4, &length);
1758 s->time->m = timelib_get_month(&ptr);
1759 s->time->d = timelib_get_nr(&ptr, 2);
1772 s->time->d = timelib_get_nr(&ptr, 2);
1773 s->time->m = timelib_get_month(&ptr);
1774 s->time->y = timelib_get_nr(&ptr, 4);
1775 s->time->h = timelib_get_nr(&ptr, 2);
1776 s->time->i = timelib_get_nr(&ptr, 2);
1777 s->time->s = timelib_get_nr(&ptr, 2);
1779 timelib_eat_spaces(&ptr);
1781 …s->time->z = timelib_parse_zone(&ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz_get_wrapp…
1793 s->time->y = timelib_get_nr(&ptr, 4);
1827 relunit = timelib_lookup_relunit(&ptr);
1845 while(*ptr) {
1846 i = timelib_get_relative_text(&ptr, &behavior);
1847 timelib_eat_spaces(&ptr);
1848 timelib_set_relative(&ptr, i, behavior, s, TIMELIB_TIME_PART_DONT_KEEP);
1869 while(*ptr) {
1870 i = timelib_get_relative_text(&ptr, &behavior);
1871 timelib_eat_spaces(&ptr);
1872 timelib_set_relative(&ptr, i, behavior, s, TIMELIB_TIME_PART_DONT_KEEP);
1883 s->time->m = timelib_lookup_month(&ptr);
1894 timelib_eat_spaces(&ptr);
1895 …s->time->z = timelib_parse_zone(&ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz_get_wrapp…
1908 s->time->m = timelib_get_month(&ptr);
1909 s->time->d = timelib_get_nr(&ptr, 2);
1912 s->time->h = timelib_get_nr(&ptr, 2);
1913 s->time->i = timelib_get_nr(&ptr, 2);
1914 if (*ptr == ':' || *ptr == '.') {
1915 s->time->s = timelib_get_nr(&ptr, 2);
1917 if (*ptr == '.') {
1918 s->time->us = timelib_get_frac_nr(&ptr);
1922 s->time->h += timelib_meridian(&ptr, s->time->h);
1933 s->time->m = timelib_get_month(&ptr);
1934 s->time->d = timelib_get_nr(&ptr, 2);
1937 s->time->h = timelib_get_nr(&ptr, 2);
1938 s->time->i = timelib_get_nr(&ptr, 2);
1939 if (*ptr == ':') {
1940 s->time->s = timelib_get_nr(&ptr, 2);
1942 if (*ptr == '.') {
1943 s->time->us = timelib_get_frac_nr(&ptr);
1947 if (*ptr != '\0') {
1948 …s->time->z = timelib_parse_zone(&ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz_get_wrapp…
1964 while(*ptr) {
1965 i = timelib_get_signed_nr(s, &ptr, 24);
1966 timelib_eat_spaces(&ptr);
1967 timelib_set_relative(&ptr, i, 1, s, TIMELIB_TIME_PART_KEEP);
2080 if (strchr("0123456789", *ptr) == NULL) \
2085 if (strchr("+-0123456789", *ptr) == NULL) \
2190 const char *ptr = string;
2225 while (*fptr && *ptr) {
2226 begin = ptr;
2239 if (*fptr != *ptr) {
2242 ptr++;
2265 tmprel = timelib_lookup_relunit(&ptr);
2280 if ((s->time->d = timelib_get_nr(&ptr, 2)) == TIMELIB_UNSET) {
2288 timelib_skip_day_suffix(&ptr);
2295 if ((tmp = timelib_get_nr(&ptr, 3)) == TIMELIB_UNSET) {
2311 if ((s->time->m = timelib_get_nr(&ptr, 2)) == TIMELIB_UNSET) {
2319 tmp = timelib_lookup_month(&ptr);
2332 if ((s->time->y = timelib_get_nr_ex(&ptr, 2, &length)) == TIMELIB_UNSET) {
2343 if ((s->time->y = timelib_get_nr(&ptr, 4)) == TIMELIB_UNSET) {
2352 if ((s->time->y = timelib_get_signed_nr(s, &ptr, 19)) == TIMELIB_UNSET) {
2362 if ((s->time->h = timelib_get_nr(&ptr, 2)) == TIMELIB_UNSET) {
2376 if ((s->time->h = timelib_get_nr(&ptr, 2)) == TIMELIB_UNSET) {
2387 if ((tmp = timelib_meridian_with_check(&ptr, s->time->h)) == TIMELIB_UNSET) {
2403 min = timelib_get_nr_ex(&ptr, 2, &length);
2419 sec = timelib_get_nr_ex(&ptr, 2, &length);
2435 tptr = ptr;
2436 if ((f = timelib_get_nr(&ptr, 6)) == TIMELIB_UNSET || (ptr - tptr < 1)) {
2441 s->time->us = (f * pow(10, 6 - (ptr - tptr)));
2450 tptr = ptr;
2451 if ((f = timelib_get_nr(&ptr, 3)) == TIMELIB_UNSET || (ptr - tptr < 1)) {
2456 s->time->us = (f * pow(10, 3 - (ptr - tptr)) * 1000);
2460 timelib_eat_spaces(&ptr);
2464 tmp = timelib_get_signed_nr(s, &ptr, 24);
2475 if (timelib_lookup_format(*ptr, format_map) != TIMELIB_FORMAT_SEPARATOR) {
2480 ++ptr;
2484 if (*ptr != *fptr) {
2489 ++ptr;
2501 ++ptr;
2510 if (*ptr != *fptr) {
2515 ++ptr;
2519 timelib_eat_until_separator(&ptr);
2526 if ((iso_year = timelib_get_nr(&ptr, 4)) == TIMELIB_UNSET) {
2534 if ((iso_week_of_year = timelib_get_nr(&ptr, 2)) == TIMELIB_UNSET) {
2547 if ((iso_day_of_week = timelib_get_nr(&ptr, 1)) == TIMELIB_UNSET) {
2562 …s->time->z = timelib_parse_zone(&ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz_get_wrapp…
2572 s->time->z = timelib_parse_tz_minutes(&ptr, s->time);
2582 if (*fptr != *ptr) {
2585 ptr++;
2589 if (*ptr) {
2591 add_pbf_warning(s, TIMELIB_WARN_TRAILING_DATA, "Trailing data", string, ptr);
2593 add_pbf_error(s, TIMELIB_ERR_TRAILING_DATA, "Trailing data", string, ptr);
2613 …pbf_error(s, TIMELIB_ERR_DATA_MISSING, "Not enough data available to satisfy format", string, ptr);
2638 …IB_ERR_MIX_ISO_WITH_NATURAL, "Mixing of ISO dates with natural dates is not allowed", string, ptr);
2641 …IB_ERR_MIX_ISO_WITH_NATURAL, "Mixing of ISO dates with natural dates is not allowed", string, ptr);
2655 add_pbf_warning(s, TIMELIB_WARN_INVALID_DATE, "The parsed date was invalid", string, ptr);
2662 add_pbf_warning(s, TIMELIB_WARN_INVALID_TIME, "The parsed time was invalid", string, ptr);
2668 add_pbf_warning(s, TIMELIB_WARN_INVALID_DATE, "The parsed date was invalid", string, ptr);