Lines Matching refs:ptr
88 #define YYMARKER s->ptr
104 #define TIMELIB_INIT s->cur = cursor; str = timelib_string(s); ptr = str
135 uchar *lim, *str, *ptr, *cur, *tok, *pos;
294 char *ptr = s;
295 while (ptr[0] == ' ' || ptr[0] == '\t') {
296 ptr++;
298 return ptr;
309 s->ptr -= cnt;
318 s->ptr = &buf[s->ptr - s->bot];
375 static timelib_sll timelib_meridian(char **ptr, timelib_sll h)
379 while (!strchr("AaPp", **ptr)) {
380 ++*ptr;
382 if (**ptr == 'a' || **ptr == 'A') {
389 ++*ptr;
390 if (**ptr == '.') {
391 ++*ptr;
393 if (**ptr == 'M' || **ptr == 'm') {
394 ++*ptr;
396 if (**ptr == '.') {
397 ++*ptr;
402 static timelib_sll timelib_meridian_with_check(char **ptr, timelib_sll h)
406 while (**ptr && !strchr("AaPp", **ptr)) {
407 ++*ptr;
409 if(!**ptr) {
412 if (**ptr == 'a' || **ptr == 'A') {
419 ++*ptr;
420 if (**ptr == '.') {
421 ++*ptr;
422 if (**ptr != 'm' && **ptr != 'M') {
425 ++*ptr;
426 if (**ptr != '.' ) {
429 ++*ptr;
430 } else if (**ptr == 'm' || **ptr == 'M') {
431 ++*ptr;
446 static timelib_sll timelib_get_nr_ex(char **ptr, int max_length, int *scanned_length)
452 while ((**ptr < '0') || (**ptr > '9')) {
453 if (**ptr == '\0') {
456 ++*ptr;
458 begin = *ptr;
459 while ((**ptr >= '0') && (**ptr <= '9') && len < max_length) {
460 ++*ptr;
463 end = *ptr;
474 static timelib_sll timelib_get_nr(char **ptr, int max_length)
476 return timelib_get_nr_ex(ptr, max_length, NULL);
479 static void timelib_skip_day_suffix(char **ptr)
481 if (isspace(**ptr)) {
484 …lib_strncasecmp(*ptr, "nd", 2) || !timelib_strncasecmp(*ptr, "rd", 2) ||!timelib_strncasecmp(*ptr,…
485 *ptr += 2;
489 static timelib_sll timelib_get_frac_nr(char **ptr, int max_length)
495 while ((**ptr != '.') && (**ptr != ':') && ((**ptr < '0') || (**ptr > '9'))) {
496 if (**ptr == '\0') {
499 ++*ptr;
501 begin = *ptr;
502 …while (((**ptr == '.') || (**ptr == ':') || ((**ptr >= '0') && (**ptr <= '9'))) && len < max_lengt…
503 ++*ptr;
506 end = *ptr;
514 static timelib_ull timelib_get_unsigned_nr(char **ptr, int max_length)
518 while (((**ptr < '0') || (**ptr > '9')) && (**ptr != '+') && (**ptr != '-')) {
519 if (**ptr == '\0') {
522 ++*ptr;
525 while (**ptr == '+' || **ptr == '-')
527 if (**ptr == '-') {
530 ++*ptr;
532 return dir * timelib_get_nr(ptr, max_length);
535 static timelib_sll timelib_lookup_relative_text(char **ptr, int *behavior)
538 char *begin = *ptr, *end;
542 while ((**ptr >= 'A' && **ptr <= 'Z') || (**ptr >= 'a' && **ptr <= 'z')) {
543 ++*ptr;
545 end = *ptr;
560 static timelib_sll timelib_get_relative_text(char **ptr, int *behavior)
562 while (**ptr == ' ' || **ptr == '\t' || **ptr == '-' || **ptr == '/') {
563 ++*ptr;
565 return timelib_lookup_relative_text(ptr, behavior);
568 static timelib_long timelib_lookup_month(char **ptr)
571 char *begin = *ptr, *end;
575 while ((**ptr >= 'A' && **ptr <= 'Z') || (**ptr >= 'a' && **ptr <= 'z')) {
576 ++*ptr;
578 end = *ptr;
592 static timelib_long timelib_get_month(char **ptr)
594 while (**ptr == ' ' || **ptr == '\t' || **ptr == '-' || **ptr == '.' || **ptr == '/') {
595 ++*ptr;
597 return timelib_lookup_month(ptr);
600 static void timelib_eat_spaces(char **ptr)
602 while (**ptr == ' ' || **ptr == '\t') {
603 ++*ptr;
607 static void timelib_eat_until_separator(char **ptr)
609 ++*ptr;
610 while (strchr(" \t.,:;/-0123456789", **ptr) == NULL) {
611 ++*ptr;
615 static const timelib_relunit* timelib_lookup_relunit(char **ptr)
618 char *begin = *ptr, *end;
621 …while (**ptr != '\0' && **ptr != ' ' && **ptr != ',' && **ptr != '\t' && **ptr != ';' && **ptr != …
622 **ptr != '/' && **ptr != '.' && **ptr != '-' && **ptr != '(' && **ptr != ')' ) {
623 ++*ptr;
625 end = *ptr;
640 static void timelib_set_relative(char **ptr, timelib_sll amount, int behavior, Scanner *s)
644 if (!(relunit = timelib_lookup_relunit(ptr))) {
711 static timelib_long timelib_lookup_abbr(char **ptr, int *dst, char **tz_abbr, int *found)
714 char *begin = *ptr, *end;
718 while (**ptr != '\0' && **ptr != ')' && **ptr != ' ') {
719 ++*ptr;
721 end = *ptr;
741 static timelib_long timelib_parse_tz_cor(char **ptr)
743 char *begin = *ptr, *end;
746 while (isdigit(**ptr) || **ptr == ':') {
747 ++*ptr;
749 end = *ptr;
774 timelib_long timelib_parse_zone(char **ptr, int *dst, timelib_time *t, int *tz_not_found, const tim…
781 while (**ptr == ' ' || **ptr == '\t' || **ptr == '(') {
782 ++*ptr;
784 …if ((*ptr)[0] == 'G' && (*ptr)[1] == 'M' && (*ptr)[2] == 'T' && ((*ptr)[3] == '+' || (*ptr)[3] == …
785 *ptr += 3;
787 if (**ptr == '+') {
788 ++*ptr;
794 retval = timelib_parse_tz_cor(ptr);
795 } else if (**ptr == '-') {
796 ++*ptr;
802 retval = -1 * timelib_parse_tz_cor(ptr);
811 offset = timelib_lookup_abbr(ptr, dst, &tz_abbr, &found);
831 while (**ptr == ')') {
832 ++*ptr;
850 char *str, *ptr = NULL;
1050 i = timelib_get_unsigned_nr((char **) &ptr, 24);
1076 i = timelib_get_unsigned_nr((char **) &ptr, 24);
1077 us = timelib_get_unsigned_nr((char **) &ptr, 24);
1101 if (*ptr == 'l' || *ptr == 'L') {
1118 if (*ptr == 'b') {
1119 s->time->h = timelib_get_nr((char **) &ptr, 2);
1122 s->time->h = timelib_get_nr((char **) &ptr, 2) - 1;
1125 if (*ptr != '\0' ) {
1126 timelib_eat_spaces((char **) &ptr);
1127 s->time->h += timelib_meridian((char **) &ptr, s->time->h);
1143 i = timelib_get_relative_text((char **) &ptr, &behavior);
1144 timelib_eat_spaces((char **) &ptr);
1147 timelib_set_relative((char **) &ptr, i, 1, s);
1150 timelib_set_relative((char **) &ptr, i, behavior, s);
1161 s->time->h = timelib_get_nr((char **) &ptr, 2);
1162 if (*ptr == ':' || *ptr == '.') {
1163 s->time->i = timelib_get_nr((char **) &ptr, 2);
1164 if (*ptr == ':' || *ptr == '.') {
1165 s->time->s = timelib_get_nr((char **) &ptr, 2);
1168 s->time->h += timelib_meridian((char **) &ptr, s->time->h);
1178 s->time->h = timelib_get_nr((char **) &ptr, 2);
1179 s->time->i = timelib_get_nr((char **) &ptr, 2);
1180 if (*ptr == ':' || *ptr == '.') {
1181 s->time->s = timelib_get_nr((char **) &ptr, 2);
1183 if (*ptr == ':' || *ptr == '.') {
1184 s->time->us = timelib_get_frac_nr((char **) &ptr, 8);
1187 timelib_eat_spaces((char **) &ptr);
1188 s->time->h += timelib_meridian((char **) &ptr, s->time->h);
1199 s->time->h = timelib_get_nr((char **) &ptr, 2);
1200 s->time->i = timelib_get_nr((char **) &ptr, 2);
1201 if (*ptr == ':' || *ptr == '.') {
1202 s->time->s = timelib_get_nr((char **) &ptr, 2);
1204 if (*ptr == '.') {
1205 s->time->us = timelib_get_frac_nr((char **) &ptr, 8);
1209 if (*ptr != '\0') {
1210 …s->time->z = timelib_parse_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz…
1225 s->time->h = timelib_get_nr((char **) &ptr, 2);
1226 s->time->i = timelib_get_nr((char **) &ptr, 2);
1230 s->time->y = timelib_get_nr((char **) &ptr, 4);
1248 s->time->h = timelib_get_nr((char **) &ptr, 2);
1249 s->time->i = timelib_get_nr((char **) &ptr, 2);
1251 … s->time->z = timelib_parse_zone((char **) &ptr, &s->time->dst, s->time, s->tzdb, tz_get_wrapper);
1254 s->time->y = timelib_get_nr((char **) &ptr, 4);
1271 s->time->h = timelib_get_nr((char **) &ptr, 2);
1272 s->time->i = timelib_get_nr((char **) &ptr, 2);
1273 s->time->s = timelib_get_nr((char **) &ptr, 2);
1275 if (*ptr != '\0') {
1276 …s->time->z = timelib_parse_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz…
1291 s->time->m = timelib_get_nr((char **) &ptr, 2);
1292 s->time->d = timelib_get_nr((char **) &ptr, 2);
1293 if (*ptr == '/') {
1294 s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
1306 s->time->y = timelib_get_unsigned_nr((char **) &ptr, 4);
1307 s->time->m = timelib_get_nr((char **) &ptr, 2);
1308 s->time->d = timelib_get_nr((char **) &ptr, 2);
1319 s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
1320 s->time->m = timelib_get_nr((char **) &ptr, 2);
1321 s->time->d = timelib_get_nr((char **) &ptr, 2);
1333 s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
1334 s->time->m = timelib_get_nr((char **) &ptr, 2);
1347 s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
1348 s->time->m = timelib_get_nr((char **) &ptr, 2);
1349 s->time->d = timelib_get_nr((char **) &ptr, 2);
1361 s->time->d = timelib_get_nr((char **) &ptr, 2);
1362 timelib_skip_day_suffix((char **) &ptr);
1363 s->time->m = timelib_get_month((char **) &ptr);
1364 s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
1375 s->time->d = timelib_get_nr((char **) &ptr, 2);
1376 s->time->m = timelib_get_nr((char **) &ptr, 2);
1377 s->time->y = timelib_get_nr((char **) &ptr, 4);
1388 s->time->d = timelib_get_nr((char **) &ptr, 2);
1389 s->time->m = timelib_get_nr((char **) &ptr, 2);
1390 s->time->y = timelib_get_nr_ex((char **) &ptr, 2, &length);
1402 s->time->m = timelib_get_month((char **) &ptr);
1403 s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
1416 s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
1417 s->time->m = timelib_get_month((char **) &ptr);
1430 s->time->m = timelib_get_month((char **) &ptr);
1431 s->time->d = timelib_get_nr((char **) &ptr, 2);
1432 s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
1443 s->time->d = timelib_get_nr((char **) &ptr, 2);
1444 timelib_skip_day_suffix((char **) &ptr);
1445 s->time->m = timelib_get_month((char **) &ptr);
1455 s->time->y = timelib_get_nr((char **) &ptr, 4);
1456 s->time->m = timelib_get_nr((char **) &ptr, 2);
1457 s->time->d = timelib_get_nr((char **) &ptr, 2);
1469 s->time->y = timelib_get_nr((char **) &ptr, 4);
1470 s->time->m = timelib_get_nr((char **) &ptr, 2);
1471 s->time->d = timelib_get_nr((char **) &ptr, 2);
1472 s->time->h = timelib_get_nr((char **) &ptr, 2);
1473 s->time->i = timelib_get_nr((char **) &ptr, 2);
1474 s->time->s = timelib_get_nr((char **) &ptr, 2);
1475 if (*ptr == '.') {
1476 s->time->us = timelib_get_frac_nr((char **) &ptr, 9);
1477 if (*ptr) { /* timezone is optional */
1478 …s->time->z = timelib_parse_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz…
1494 s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
1495 s->time->d = timelib_get_nr((char **) &ptr, 3);
1510 s->time->y = timelib_get_nr((char **) &ptr, 4);
1511 w = timelib_get_nr((char **) &ptr, 2);
1512 d = timelib_get_nr((char **) &ptr, 1);
1529 s->time->y = timelib_get_nr((char **) &ptr, 4);
1530 w = timelib_get_nr((char **) &ptr, 2);
1546 s->time->m = timelib_get_month((char **) &ptr);
1547 s->time->d = timelib_get_nr((char **) &ptr, 2);
1548 s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
1560 s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
1561 s->time->m = timelib_get_month((char **) &ptr);
1562 s->time->d = timelib_get_nr((char **) &ptr, 2);
1575 s->time->d = timelib_get_nr((char **) &ptr, 2);
1576 s->time->m = timelib_get_month((char **) &ptr);
1577 s->time->y = timelib_get_nr((char **) &ptr, 4);
1578 s->time->h = timelib_get_nr((char **) &ptr, 2);
1579 s->time->i = timelib_get_nr((char **) &ptr, 2);
1580 s->time->s = timelib_get_nr((char **) &ptr, 2);
1581 …s->time->z = timelib_parse_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz…
1593 s->time->y = timelib_get_nr((char **) &ptr, 4);
1627 relunit = timelib_lookup_relunit((char**) &ptr);
1645 while(*ptr) {
1646 i = timelib_get_relative_text((char **) &ptr, &behavior);
1647 timelib_eat_spaces((char **) &ptr);
1648 timelib_set_relative((char **) &ptr, i, behavior, s);
1669 while(*ptr) {
1670 i = timelib_get_relative_text((char **) &ptr, &behavior);
1671 timelib_eat_spaces((char **) &ptr);
1672 timelib_set_relative((char **) &ptr, i, behavior, s);
1683 s->time->m = timelib_lookup_month((char **) &ptr);
1694 …s->time->z = timelib_parse_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz…
1707 s->time->m = timelib_get_month((char **) &ptr);
1708 s->time->d = timelib_get_nr((char **) &ptr, 2);
1711 s->time->h = timelib_get_nr((char **) &ptr, 2);
1712 s->time->i = timelib_get_nr((char **) &ptr, 2);
1713 if (*ptr == ':' || *ptr == '.') {
1714 s->time->s = timelib_get_nr((char **) &ptr, 2);
1716 if (*ptr == '.') {
1717 s->time->us = timelib_get_frac_nr((char **) &ptr, 8);
1721 s->time->h += timelib_meridian((char **) &ptr, s->time->h);
1732 s->time->m = timelib_get_month((char **) &ptr);
1733 s->time->d = timelib_get_nr((char **) &ptr, 2);
1736 s->time->h = timelib_get_nr((char **) &ptr, 2);
1737 s->time->i = timelib_get_nr((char **) &ptr, 2);
1738 if (*ptr == ':') {
1739 s->time->s = timelib_get_nr((char **) &ptr, 2);
1741 if (*ptr == '.') {
1742 s->time->us = timelib_get_frac_nr((char **) &ptr, 8);
1746 if (*ptr != '\0') {
1747 …s->time->z = timelib_parse_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz…
1763 while(*ptr) {
1764 i = timelib_get_unsigned_nr((char **) &ptr, 24);
1765 timelib_eat_spaces((char **) &ptr);
1766 timelib_set_relative((char **) &ptr, i, 1, s);
1874 if (strchr("0123456789", *ptr) == NULL) \
1879 if (strchr("-0123456789", *ptr) == NULL) \
1912 char *ptr = string;
1941 while (*fptr && *ptr) {
1942 begin = ptr;
1949 tmprel = timelib_lookup_relunit((char **) &ptr);
1964 if ((s->time->d = timelib_get_nr((char **) &ptr, 2)) == TIMELIB_UNSET) {
1969 timelib_skip_day_suffix((char **) &ptr);
1973 if ((tmp = timelib_get_nr((char **) &ptr, 3)) == TIMELIB_UNSET) {
1985 if ((s->time->m = timelib_get_nr((char **) &ptr, 2)) == TIMELIB_UNSET) {
1991 tmp = timelib_lookup_month((char **) &ptr);
2002 if ((s->time->y = timelib_get_nr_ex((char **) &ptr, 2, &length)) == TIMELIB_UNSET) {
2010 if ((s->time->y = timelib_get_nr((char **) &ptr, 4)) == TIMELIB_UNSET) {
2017 if ((s->time->h = timelib_get_nr((char **) &ptr, 2)) == TIMELIB_UNSET) {
2027 if ((s->time->h = timelib_get_nr((char **) &ptr, 2)) == TIMELIB_UNSET) {
2035 } else if ((tmp = timelib_meridian_with_check((char **) &ptr, s->time->h)) == TIMELIB_UNSET) {
2047 min = timelib_get_nr_ex((char **) &ptr, 2, &length);
2061 sec = timelib_get_nr_ex((char **) &ptr, 2, &length);
2075 tptr = ptr;
2076 if ((f = timelib_get_nr((char **) &ptr, 6)) == TIMELIB_UNSET || (ptr - tptr < 1)) {
2079 s->time->us = (f * pow(10, 6 - (ptr - tptr)));
2084 timelib_eat_spaces((char **) &ptr);
2089 tmp = timelib_get_unsigned_nr((char **) &ptr, 24);
2107 …s->time->z = timelib_parse_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz…
2115 …if (*ptr == ';' || *ptr == ':' || *ptr == '/' || *ptr == '.' || *ptr == ',' || *ptr == '-' || *ptr…
2116 ++ptr;
2130 if (*ptr == *fptr) {
2131 ++ptr;
2146 ++ptr;
2155 if (*ptr == *fptr) {
2156 ++ptr;
2163 timelib_eat_until_separator((char **) &ptr);
2171 if (*fptr != *ptr) {
2174 ptr++;
2178 if (*ptr) {
2180 add_pbf_warning(s, TIMELIB_WARN_TRAILING_DATA, "Trailing data", string, ptr);
2182 add_pbf_error(s, TIMELIB_ERR_TRAILING_DATA, "Trailing data", string, ptr);
2203 add_pbf_error(s, TIMELIB_ERR_DATA_MISSING, "Data missing", string, ptr);
2226 add_pbf_warning(s, TIMELIB_WARN_INVALID_TIME, "The parsed time was invalid", string, ptr);
2232 add_pbf_warning(s, TIMELIB_WARN_INVALID_DATE, "The parsed date was invalid", string, ptr);