Lines Matching refs:ptr

108 #define   YYMARKER     s->ptr
124 #define TIMELIB_INIT s->cur = cursor; str = timelib_string(s); ptr = str
157 uchar *lim, *str, *ptr, *cur, *tok, *pos;
304 char *ptr = s;
305 while (ptr[0] == ' ' || ptr[0] == '\t') {
306 ptr++;
308 return ptr;
319 s->ptr -= cnt;
328 s->ptr = &buf[s->ptr - s->bot];
381 static timelib_sll timelib_meridian(char **ptr, timelib_sll h)
385 while (!strchr("AaPp", **ptr)) {
386 ++*ptr;
388 if (**ptr == 'a' || **ptr == 'A') {
395 ++*ptr;
396 if (**ptr == '.') {
397 ++*ptr;
399 if (**ptr == 'M' || **ptr == 'm') {
400 ++*ptr;
402 if (**ptr == '.') {
403 ++*ptr;
408 static timelib_sll timelib_meridian_with_check(char **ptr, timelib_sll h)
412 while (**ptr && !strchr("AaPp", **ptr)) {
413 ++*ptr;
415 if(!**ptr) {
418 if (**ptr == 'a' || **ptr == 'A') {
425 ++*ptr;
426 if (**ptr == '.') {
427 ++*ptr;
428 if (**ptr != 'm' && **ptr != 'M') {
431 ++*ptr;
432 if (**ptr != '.' ) {
435 ++*ptr;
436 } else if (**ptr == 'm' || **ptr == 'M') {
437 ++*ptr;
452 static timelib_sll timelib_get_nr_ex(char **ptr, int max_length, int *scanned_length)
458 while ((**ptr < '0') || (**ptr > '9')) {
459 if (**ptr == '\0') {
462 ++*ptr;
464 begin = *ptr;
465 while ((**ptr >= '0') && (**ptr <= '9') && len < max_length) {
466 ++*ptr;
469 end = *ptr;
480 static timelib_sll timelib_get_nr(char **ptr, int max_length)
482 return timelib_get_nr_ex(ptr, max_length, NULL);
485 static void timelib_skip_day_suffix(char **ptr)
487 if (isspace(**ptr)) {
490 …if (!strncasecmp(*ptr, "nd", 2) || !strncasecmp(*ptr, "rd", 2) ||!strncasecmp(*ptr, "st", 2) || !s…
491 *ptr += 2;
495 static double timelib_get_frac_nr(char **ptr, int max_length)
501 while ((**ptr != '.') && (**ptr != ':') && ((**ptr < '0') || (**ptr > '9'))) {
502 if (**ptr == '\0') {
505 ++*ptr;
507 begin = *ptr;
508 …while (((**ptr == '.') || (**ptr == ':') || ((**ptr >= '0') && (**ptr <= '9'))) && len < max_lengt…
509 ++*ptr;
512 end = *ptr;
523 static timelib_ull timelib_get_unsigned_nr(char **ptr, int max_length)
527 while (((**ptr < '0') || (**ptr > '9')) && (**ptr != '+') && (**ptr != '-')) {
528 if (**ptr == '\0') {
531 ++*ptr;
534 while (**ptr == '+' || **ptr == '-')
536 if (**ptr == '-') {
539 ++*ptr;
541 return dir * timelib_get_nr(ptr, max_length);
544 static timelib_sll timelib_lookup_relative_text(char **ptr, int *behavior)
547 char *begin = *ptr, *end;
551 while ((**ptr >= 'A' && **ptr <= 'Z') || (**ptr >= 'a' && **ptr <= 'z')) {
552 ++*ptr;
554 end = *ptr;
569 static timelib_sll timelib_get_relative_text(char **ptr, int *behavior)
571 while (**ptr == ' ' || **ptr == '\t' || **ptr == '-' || **ptr == '/') {
572 ++*ptr;
574 return timelib_lookup_relative_text(ptr, behavior);
577 static timelib_long timelib_lookup_month(char **ptr)
580 char *begin = *ptr, *end;
584 while ((**ptr >= 'A' && **ptr <= 'Z') || (**ptr >= 'a' && **ptr <= 'z')) {
585 ++*ptr;
587 end = *ptr;
601 static timelib_long timelib_get_month(char **ptr)
603 while (**ptr == ' ' || **ptr == '\t' || **ptr == '-' || **ptr == '.' || **ptr == '/') {
604 ++*ptr;
606 return timelib_lookup_month(ptr);
609 static void timelib_eat_spaces(char **ptr)
611 while (**ptr == ' ' || **ptr == '\t') {
612 ++*ptr;
616 static void timelib_eat_until_separator(char **ptr)
618 ++*ptr;
619 while (strchr(" \t.,:;/-0123456789", **ptr) == NULL) {
620 ++*ptr;
624 static const timelib_relunit* timelib_lookup_relunit(char **ptr)
627 char *begin = *ptr, *end;
630 …while (**ptr != '\0' && **ptr != ' ' && **ptr != ',' && **ptr != '\t' && **ptr != ';' && **ptr != …
631 **ptr != '/' && **ptr != '.' && **ptr != '-' && **ptr != '(' && **ptr != ')' ) {
632 ++*ptr;
634 end = *ptr;
649 static void timelib_set_relative(char **ptr, timelib_sll amount, int behavior, Scanner *s)
653 if (!(relunit = timelib_lookup_relunit(ptr))) {
719 static timelib_long timelib_lookup_abbr(char **ptr, int *dst, char **tz_abbr, int *found)
722 char *begin = *ptr, *end;
726 while (**ptr != '\0' && **ptr != ')' && **ptr != ' ') {
727 ++*ptr;
729 end = *ptr;
746 timelib_long timelib_parse_zone(char **ptr, int *dst, timelib_time *t, int *tz_not_found, const tim…
753 while (**ptr == ' ' || **ptr == '\t' || **ptr == '(') {
754 ++*ptr;
756 …if ((*ptr)[0] == 'G' && (*ptr)[1] == 'M' && (*ptr)[2] == 'T' && ((*ptr)[3] == '+' || (*ptr)[3] == …
757 *ptr += 3;
759 if (**ptr == '+') {
760 ++*ptr;
766 retval = -1 * timelib_parse_tz_cor(ptr);
767 } else if (**ptr == '-') {
768 ++*ptr;
774 retval = timelib_parse_tz_cor(ptr);
783 offset = timelib_lookup_abbr(ptr, dst, &tz_abbr, &found);
801 while (**ptr == ')') {
802 ++*ptr;
820 char *str, *ptr = NULL;
1019 i = timelib_get_unsigned_nr((char **) &ptr, 24);
1042 if (*ptr == 'l' || *ptr == 'L') {
1059 if (*ptr == 'b') {
1060 s->time->h = timelib_get_nr((char **) &ptr, 2);
1063 s->time->h = timelib_get_nr((char **) &ptr, 2) - 1;
1066 if (*ptr != '\0' ) {
1067 timelib_eat_spaces((char **) &ptr);
1068 s->time->h += timelib_meridian((char **) &ptr, s->time->h);
1084 i = timelib_get_relative_text((char **) &ptr, &behavior);
1085 timelib_eat_spaces((char **) &ptr);
1088 timelib_set_relative((char **) &ptr, i, 1, s);
1091 timelib_set_relative((char **) &ptr, i, behavior, s);
1102 s->time->h = timelib_get_nr((char **) &ptr, 2);
1103 if (*ptr == ':' || *ptr == '.') {
1104 s->time->i = timelib_get_nr((char **) &ptr, 2);
1105 if (*ptr == ':' || *ptr == '.') {
1106 s->time->s = timelib_get_nr((char **) &ptr, 2);
1109 s->time->h += timelib_meridian((char **) &ptr, s->time->h);
1119 s->time->h = timelib_get_nr((char **) &ptr, 2);
1120 s->time->i = timelib_get_nr((char **) &ptr, 2);
1121 if (*ptr == ':' || *ptr == '.') {
1122 s->time->s = timelib_get_nr((char **) &ptr, 2);
1124 if (*ptr == ':' || *ptr == '.') {
1125 s->time->f = timelib_get_frac_nr((char **) &ptr, 8);
1128 timelib_eat_spaces((char **) &ptr);
1129 s->time->h += timelib_meridian((char **) &ptr, s->time->h);
1140 s->time->h = timelib_get_nr((char **) &ptr, 2);
1141 s->time->i = timelib_get_nr((char **) &ptr, 2);
1142 if (*ptr == ':' || *ptr == '.') {
1143 s->time->s = timelib_get_nr((char **) &ptr, 2);
1145 if (*ptr == '.') {
1146 s->time->f = timelib_get_frac_nr((char **) &ptr, 8);
1150 if (*ptr != '\0') {
1151 …s->time->z = timelib_parse_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz…
1166 s->time->h = timelib_get_nr((char **) &ptr, 2);
1167 s->time->i = timelib_get_nr((char **) &ptr, 2);
1171 s->time->y = timelib_get_nr((char **) &ptr, 4);
1189 s->time->h = timelib_get_nr((char **) &ptr, 2);
1190 s->time->i = timelib_get_nr((char **) &ptr, 2);
1192 … s->time->z = timelib_parse_zone((char **) &ptr, &s->time->dst, s->time, s->tzdb, tz_get_wrapper);
1195 s->time->y = timelib_get_nr((char **) &ptr, 4);
1212 s->time->h = timelib_get_nr((char **) &ptr, 2);
1213 s->time->i = timelib_get_nr((char **) &ptr, 2);
1214 s->time->s = timelib_get_nr((char **) &ptr, 2);
1216 if (*ptr != '\0') {
1217 …s->time->z = timelib_parse_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz…
1232 s->time->m = timelib_get_nr((char **) &ptr, 2);
1233 s->time->d = timelib_get_nr((char **) &ptr, 2);
1234 if (*ptr == '/') {
1235 s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
1247 s->time->y = timelib_get_unsigned_nr((char **) &ptr, 4);
1248 s->time->m = timelib_get_nr((char **) &ptr, 2);
1249 s->time->d = timelib_get_nr((char **) &ptr, 2);
1260 s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
1261 s->time->m = timelib_get_nr((char **) &ptr, 2);
1262 s->time->d = timelib_get_nr((char **) &ptr, 2);
1274 s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
1275 s->time->m = timelib_get_nr((char **) &ptr, 2);
1288 s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
1289 s->time->m = timelib_get_nr((char **) &ptr, 2);
1290 s->time->d = timelib_get_nr((char **) &ptr, 2);
1302 s->time->d = timelib_get_nr((char **) &ptr, 2);
1303 timelib_skip_day_suffix((char **) &ptr);
1304 s->time->m = timelib_get_month((char **) &ptr);
1305 s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
1316 s->time->d = timelib_get_nr((char **) &ptr, 2);
1317 s->time->m = timelib_get_nr((char **) &ptr, 2);
1318 s->time->y = timelib_get_nr((char **) &ptr, 4);
1329 s->time->d = timelib_get_nr((char **) &ptr, 2);
1330 s->time->m = timelib_get_nr((char **) &ptr, 2);
1331 s->time->y = timelib_get_nr_ex((char **) &ptr, 2, &length);
1343 s->time->m = timelib_get_month((char **) &ptr);
1344 s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
1357 s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
1358 s->time->m = timelib_get_month((char **) &ptr);
1371 s->time->m = timelib_get_month((char **) &ptr);
1372 s->time->d = timelib_get_nr((char **) &ptr, 2);
1373 s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
1384 s->time->d = timelib_get_nr((char **) &ptr, 2);
1385 timelib_skip_day_suffix((char **) &ptr);
1386 s->time->m = timelib_get_month((char **) &ptr);
1396 s->time->y = timelib_get_nr((char **) &ptr, 4);
1397 s->time->m = timelib_get_nr((char **) &ptr, 2);
1398 s->time->d = timelib_get_nr((char **) &ptr, 2);
1410 s->time->y = timelib_get_nr((char **) &ptr, 4);
1411 s->time->m = timelib_get_nr((char **) &ptr, 2);
1412 s->time->d = timelib_get_nr((char **) &ptr, 2);
1413 s->time->h = timelib_get_nr((char **) &ptr, 2);
1414 s->time->i = timelib_get_nr((char **) &ptr, 2);
1415 s->time->s = timelib_get_nr((char **) &ptr, 2);
1416 if (*ptr == '.') {
1417 s->time->f = timelib_get_frac_nr((char **) &ptr, 9);
1418 if (*ptr) { /* timezone is optional */
1419 …s->time->z = timelib_parse_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz…
1435 s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
1436 s->time->d = timelib_get_nr((char **) &ptr, 3);
1451 s->time->y = timelib_get_nr((char **) &ptr, 4);
1452 w = timelib_get_nr((char **) &ptr, 2);
1453 d = timelib_get_nr((char **) &ptr, 1);
1470 s->time->y = timelib_get_nr((char **) &ptr, 4);
1471 w = timelib_get_nr((char **) &ptr, 2);
1487 s->time->m = timelib_get_month((char **) &ptr);
1488 s->time->d = timelib_get_nr((char **) &ptr, 2);
1489 s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
1501 s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
1502 s->time->m = timelib_get_month((char **) &ptr);
1503 s->time->d = timelib_get_nr((char **) &ptr, 2);
1516 s->time->d = timelib_get_nr((char **) &ptr, 2);
1517 s->time->m = timelib_get_month((char **) &ptr);
1518 s->time->y = timelib_get_nr((char **) &ptr, 4);
1519 s->time->h = timelib_get_nr((char **) &ptr, 2);
1520 s->time->i = timelib_get_nr((char **) &ptr, 2);
1521 s->time->s = timelib_get_nr((char **) &ptr, 2);
1522 …s->time->z = timelib_parse_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz…
1534 s->time->y = timelib_get_nr((char **) &ptr, 4);
1568 relunit = timelib_lookup_relunit((char**) &ptr);
1586 while(*ptr) {
1587 i = timelib_get_relative_text((char **) &ptr, &behavior);
1588 timelib_eat_spaces((char **) &ptr);
1589 timelib_set_relative((char **) &ptr, i, behavior, s);
1610 while(*ptr) {
1611 i = timelib_get_relative_text((char **) &ptr, &behavior);
1612 timelib_eat_spaces((char **) &ptr);
1613 timelib_set_relative((char **) &ptr, i, behavior, s);
1624 s->time->m = timelib_lookup_month((char **) &ptr);
1635 …s->time->z = timelib_parse_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz…
1648 s->time->m = timelib_get_month((char **) &ptr);
1649 s->time->d = timelib_get_nr((char **) &ptr, 2);
1652 s->time->h = timelib_get_nr((char **) &ptr, 2);
1653 s->time->i = timelib_get_nr((char **) &ptr, 2);
1654 if (*ptr == ':' || *ptr == '.') {
1655 s->time->s = timelib_get_nr((char **) &ptr, 2);
1657 if (*ptr == '.') {
1658 s->time->f = timelib_get_frac_nr((char **) &ptr, 8);
1662 s->time->h += timelib_meridian((char **) &ptr, s->time->h);
1673 s->time->m = timelib_get_month((char **) &ptr);
1674 s->time->d = timelib_get_nr((char **) &ptr, 2);
1677 s->time->h = timelib_get_nr((char **) &ptr, 2);
1678 s->time->i = timelib_get_nr((char **) &ptr, 2);
1679 if (*ptr == ':') {
1680 s->time->s = timelib_get_nr((char **) &ptr, 2);
1682 if (*ptr == '.') {
1683 s->time->f = timelib_get_frac_nr((char **) &ptr, 8);
1687 if (*ptr != '\0') {
1688 …s->time->z = timelib_parse_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz…
1704 while(*ptr) {
1705 i = timelib_get_unsigned_nr((char **) &ptr, 24);
1706 timelib_eat_spaces((char **) &ptr);
1707 timelib_set_relative((char **) &ptr, i, 1, s);
1815 if (strchr("0123456789", *ptr) == NULL) \
1820 if (strchr("-0123456789", *ptr) == NULL) \
1853 char *ptr = string;
1882 while (*fptr && *ptr) {
1883 begin = ptr;
1890 tmprel = timelib_lookup_relunit((char **) &ptr);
1905 if ((s->time->d = timelib_get_nr((char **) &ptr, 2)) == TIMELIB_UNSET) {
1910 timelib_skip_day_suffix((char **) &ptr);
1914 if ((tmp = timelib_get_nr((char **) &ptr, 3)) == TIMELIB_UNSET) {
1926 if ((s->time->m = timelib_get_nr((char **) &ptr, 2)) == TIMELIB_UNSET) {
1932 tmp = timelib_lookup_month((char **) &ptr);
1943 if ((s->time->y = timelib_get_nr_ex((char **) &ptr, 2, &length)) == TIMELIB_UNSET) {
1951 if ((s->time->y = timelib_get_nr((char **) &ptr, 4)) == TIMELIB_UNSET) {
1958 if ((s->time->h = timelib_get_nr((char **) &ptr, 2)) == TIMELIB_UNSET) {
1968 if ((s->time->h = timelib_get_nr((char **) &ptr, 2)) == TIMELIB_UNSET) {
1976 } else if ((tmp = timelib_meridian_with_check((char **) &ptr, s->time->h)) == TIMELIB_UNSET) {
1988 min = timelib_get_nr_ex((char **) &ptr, 2, &length);
2002 sec = timelib_get_nr_ex((char **) &ptr, 2, &length);
2016 tptr = ptr;
2017 if ((f = timelib_get_nr((char **) &ptr, 6)) == TIMELIB_UNSET || (ptr - tptr < 1)) {
2020 s->time->f = (f / pow(10, (ptr - tptr)));
2025 timelib_eat_spaces((char **) &ptr);
2030 tmp = timelib_get_unsigned_nr((char **) &ptr, 24);
2049 …s->time->z = timelib_parse_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz…
2057 …if (*ptr == ';' || *ptr == ':' || *ptr == '/' || *ptr == '.' || *ptr == ',' || *ptr == '-' || *ptr
2058 ++ptr;
2072 if (*ptr == *fptr) {
2073 ++ptr;
2088 ++ptr;
2097 if (*ptr == *fptr) {
2098 ++ptr;
2105 timelib_eat_until_separator((char **) &ptr);
2113 if (*fptr != *ptr) {
2116 ptr++;
2120 if (*ptr) {
2122 add_pbf_warning(s, "Trailing data", string, ptr);
2124 add_pbf_error(s, "Trailing data", string, ptr);
2145 add_pbf_error(s, "Data missing", string, ptr);
2168 add_pbf_warning(s, "The parsed time was invalid", string, ptr);
2174 add_pbf_warning(s, "The parsed date was invalid", string, ptr);