Lines Matching refs:ptr

102 #define   YYMARKER     s->ptr
118 #define TIMELIB_INIT s->cur = cursor; str = timelib_string(s); ptr = str
151 uchar *lim, *str, *ptr, *cur, *tok, *pos;
298 char *ptr = s;
299 while (ptr[0] == ' ' || ptr[0] == '\t') {
300 ptr++;
302 return ptr;
313 s->ptr -= cnt;
322 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 += 3;
393 ++*ptr;
398 static timelib_sll timelib_meridian_with_check(char **ptr, timelib_sll h)
402 while (**ptr && !strchr("AaPp", **ptr)) {
403 ++*ptr;
405 if(!**ptr) {
408 if (**ptr == 'a' || **ptr == 'A') {
415 ++*ptr;
416 if (**ptr == '.') {
417 ++*ptr;
418 if (**ptr != 'm' && **ptr != 'M') {
421 ++*ptr;
422 if (**ptr != '.' ) {
425 ++*ptr;
426 } else if (**ptr == 'm' || **ptr == 'M') {
427 ++*ptr;
442 static timelib_sll timelib_get_nr_ex(char **ptr, int max_length, int *scanned_length)
448 while ((**ptr < '0') || (**ptr > '9')) {
449 if (**ptr == '\0') {
452 ++*ptr;
454 begin = *ptr;
455 while ((**ptr >= '0') && (**ptr <= '9') && len < max_length) {
456 ++*ptr;
459 end = *ptr;
470 static timelib_sll timelib_get_nr(char **ptr, int max_length)
472 return timelib_get_nr_ex(ptr, max_length, NULL);
475 static void timelib_skip_day_suffix(char **ptr)
477 if (isspace(**ptr)) {
480 …if (!strncasecmp(*ptr, "nd", 2) || !strncasecmp(*ptr, "rd", 2) ||!strncasecmp(*ptr, "st", 2) || !s…
481 *ptr += 2;
485 static double timelib_get_frac_nr(char **ptr, int max_length)
491 while ((**ptr != '.') && (**ptr != ':') && ((**ptr < '0') || (**ptr > '9'))) {
492 if (**ptr == '\0') {
495 ++*ptr;
497 begin = *ptr;
498 …while (((**ptr == '.') || (**ptr == ':') || ((**ptr >= '0') && (**ptr <= '9'))) && len < max_lengt…
499 ++*ptr;
502 end = *ptr;
513 static timelib_ull timelib_get_unsigned_nr(char **ptr, int max_length)
517 while (((**ptr < '0') || (**ptr > '9')) && (**ptr != '+') && (**ptr != '-')) {
518 if (**ptr == '\0') {
521 ++*ptr;
524 while (**ptr == '+' || **ptr == '-')
526 if (**ptr == '-') {
529 ++*ptr;
531 return dir * timelib_get_nr(ptr, max_length);
534 static timelib_sll timelib_lookup_relative_text(char **ptr, int *behavior)
537 char *begin = *ptr, *end;
541 while ((**ptr >= 'A' && **ptr <= 'Z') || (**ptr >= 'a' && **ptr <= 'z')) {
542 ++*ptr;
544 end = *ptr;
559 static timelib_sll timelib_get_relative_text(char **ptr, int *behavior)
561 while (**ptr == ' ' || **ptr == '\t' || **ptr == '-' || **ptr == '/') {
562 ++*ptr;
564 return timelib_lookup_relative_text(ptr, behavior);
567 static long timelib_lookup_month(char **ptr)
570 char *begin = *ptr, *end;
574 while ((**ptr >= 'A' && **ptr <= 'Z') || (**ptr >= 'a' && **ptr <= 'z')) {
575 ++*ptr;
577 end = *ptr;
591 static long timelib_get_month(char **ptr)
593 while (**ptr == ' ' || **ptr == '\t' || **ptr == '-' || **ptr == '.' || **ptr == '/') {
594 ++*ptr;
596 return timelib_lookup_month(ptr);
599 static void timelib_eat_spaces(char **ptr)
601 while (**ptr == ' ' || **ptr == '\t') {
602 ++*ptr;
606 static void timelib_eat_until_separator(char **ptr)
608 ++*ptr;
609 while (strchr(" \t.,:;/-0123456789", **ptr) == NULL) {
610 ++*ptr;
614 static const timelib_relunit* timelib_lookup_relunit(char **ptr)
617 char *begin = *ptr, *end;
620 …while (**ptr != '\0' && **ptr != ' ' && **ptr != ',' && **ptr != '\t' && **ptr != ';' && **ptr != …
621 **ptr != '/' && **ptr != '.' && **ptr != '-' && **ptr != '(' && **ptr != ')' ) {
622 ++*ptr;
624 end = *ptr;
639 static void timelib_set_relative(char **ptr, timelib_sll amount, int behavior, Scanner *s)
643 if (!(relunit = timelib_lookup_relunit(ptr))) {
709 static long timelib_lookup_abbr(char **ptr, int *dst, char **tz_abbr, int *found)
712 char *begin = *ptr, *end;
716 while (**ptr != '\0' && **ptr != ')' && **ptr != ' ') {
717 ++*ptr;
719 end = *ptr;
736 long timelib_parse_zone(char **ptr, int *dst, timelib_time *t, int *tz_not_found, const timelib_tzd…
743 while (**ptr == ' ' || **ptr == '\t' || **ptr == '(') {
744 ++*ptr;
746 …if ((*ptr)[0] == 'G' && (*ptr)[1] == 'M' && (*ptr)[2] == 'T' && ((*ptr)[3] == '+' || (*ptr)[3] == …
747 *ptr += 3;
749 if (**ptr == '+') {
750 ++*ptr;
756 retval = -1 * timelib_parse_tz_cor(ptr);
757 } else if (**ptr == '-') {
758 ++*ptr;
764 retval = timelib_parse_tz_cor(ptr);
773 offset = timelib_lookup_abbr(ptr, dst, &tz_abbr, &found);
791 while (**ptr == ')') {
792 ++*ptr;
810 char *str, *ptr = NULL;
1009 i = timelib_get_unsigned_nr((char **) &ptr, 24);
1032 if (*ptr == 'l' || *ptr == 'L') {
1049 if (*ptr == 'b') {
1050 s->time->h = timelib_get_nr((char **) &ptr, 2);
1053 s->time->h = timelib_get_nr((char **) &ptr, 2) - 1;
1056 if (*ptr != '\0' ) {
1057 timelib_eat_spaces((char **) &ptr);
1058 s->time->h += timelib_meridian((char **) &ptr, s->time->h);
1074 i = timelib_get_relative_text((char **) &ptr, &behavior);
1075 timelib_eat_spaces((char **) &ptr);
1078 timelib_set_relative((char **) &ptr, i, 1, s);
1081 timelib_set_relative((char **) &ptr, i, behavior, s);
1092 s->time->h = timelib_get_nr((char **) &ptr, 2);
1093 if (*ptr == ':' || *ptr == '.') {
1094 s->time->i = timelib_get_nr((char **) &ptr, 2);
1095 if (*ptr == ':' || *ptr == '.') {
1096 s->time->s = timelib_get_nr((char **) &ptr, 2);
1099 s->time->h += timelib_meridian((char **) &ptr, s->time->h);
1109 s->time->h = timelib_get_nr((char **) &ptr, 2);
1110 s->time->i = timelib_get_nr((char **) &ptr, 2);
1111 if (*ptr == ':' || *ptr == '.') {
1112 s->time->s = timelib_get_nr((char **) &ptr, 2);
1114 if (*ptr == ':' || *ptr == '.') {
1115 s->time->f = timelib_get_frac_nr((char **) &ptr, 8);
1118 timelib_eat_spaces((char **) &ptr);
1119 s->time->h += timelib_meridian((char **) &ptr, s->time->h);
1130 s->time->h = timelib_get_nr((char **) &ptr, 2);
1131 s->time->i = timelib_get_nr((char **) &ptr, 2);
1132 if (*ptr == ':' || *ptr == '.') {
1133 s->time->s = timelib_get_nr((char **) &ptr, 2);
1135 if (*ptr == '.') {
1136 s->time->f = timelib_get_frac_nr((char **) &ptr, 8);
1140 if (*ptr != '\0') {
1141 …s->time->z = timelib_parse_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz…
1156 s->time->h = timelib_get_nr((char **) &ptr, 2);
1157 s->time->i = timelib_get_nr((char **) &ptr, 2);
1161 s->time->y = timelib_get_nr((char **) &ptr, 4);
1179 s->time->h = timelib_get_nr((char **) &ptr, 2);
1180 s->time->i = timelib_get_nr((char **) &ptr, 2);
1182 … s->time->z = timelib_parse_zone((char **) &ptr, &s->time->dst, s->time, s->tzdb, tz_get_wrapper);
1185 s->time->y = timelib_get_nr((char **) &ptr, 4);
1202 s->time->h = timelib_get_nr((char **) &ptr, 2);
1203 s->time->i = timelib_get_nr((char **) &ptr, 2);
1204 s->time->s = timelib_get_nr((char **) &ptr, 2);
1206 if (*ptr != '\0') {
1207 …s->time->z = timelib_parse_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz…
1222 s->time->m = timelib_get_nr((char **) &ptr, 2);
1223 s->time->d = timelib_get_nr((char **) &ptr, 2);
1224 if (*ptr == '/') {
1225 s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
1237 s->time->y = timelib_get_unsigned_nr((char **) &ptr, 4);
1238 s->time->m = timelib_get_nr((char **) &ptr, 2);
1239 s->time->d = timelib_get_nr((char **) &ptr, 2);
1250 s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
1251 s->time->m = timelib_get_nr((char **) &ptr, 2);
1252 s->time->d = timelib_get_nr((char **) &ptr, 2);
1264 s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
1265 s->time->m = timelib_get_nr((char **) &ptr, 2);
1278 s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
1279 s->time->m = timelib_get_nr((char **) &ptr, 2);
1280 s->time->d = timelib_get_nr((char **) &ptr, 2);
1292 s->time->d = timelib_get_nr((char **) &ptr, 2);
1293 timelib_skip_day_suffix((char **) &ptr);
1294 s->time->m = timelib_get_month((char **) &ptr);
1295 s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
1306 s->time->d = timelib_get_nr((char **) &ptr, 2);
1307 s->time->m = timelib_get_nr((char **) &ptr, 2);
1308 s->time->y = timelib_get_nr((char **) &ptr, 4);
1319 s->time->d = timelib_get_nr((char **) &ptr, 2);
1320 s->time->m = timelib_get_nr((char **) &ptr, 2);
1321 s->time->y = timelib_get_nr_ex((char **) &ptr, 2, &length);
1333 s->time->m = timelib_get_month((char **) &ptr);
1334 s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
1347 s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
1348 s->time->m = timelib_get_month((char **) &ptr);
1361 s->time->m = timelib_get_month((char **) &ptr);
1362 s->time->d = timelib_get_nr((char **) &ptr, 2);
1363 s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
1374 s->time->d = timelib_get_nr((char **) &ptr, 2);
1375 timelib_skip_day_suffix((char **) &ptr);
1376 s->time->m = timelib_get_month((char **) &ptr);
1386 s->time->y = timelib_get_nr((char **) &ptr, 4);
1387 s->time->m = timelib_get_nr((char **) &ptr, 2);
1388 s->time->d = timelib_get_nr((char **) &ptr, 2);
1400 s->time->y = timelib_get_nr((char **) &ptr, 4);
1401 s->time->m = timelib_get_nr((char **) &ptr, 2);
1402 s->time->d = timelib_get_nr((char **) &ptr, 2);
1403 s->time->h = timelib_get_nr((char **) &ptr, 2);
1404 s->time->i = timelib_get_nr((char **) &ptr, 2);
1405 s->time->s = timelib_get_nr((char **) &ptr, 2);
1406 if (*ptr == '.') {
1407 s->time->f = timelib_get_frac_nr((char **) &ptr, 9);
1408 if (*ptr) { /* timezone is optional */
1409 …s->time->z = timelib_parse_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz…
1425 s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
1426 s->time->d = timelib_get_nr((char **) &ptr, 3);
1441 s->time->y = timelib_get_nr((char **) &ptr, 4);
1442 w = timelib_get_nr((char **) &ptr, 2);
1443 d = timelib_get_nr((char **) &ptr, 1);
1460 s->time->y = timelib_get_nr((char **) &ptr, 4);
1461 w = timelib_get_nr((char **) &ptr, 2);
1477 s->time->m = timelib_get_month((char **) &ptr);
1478 s->time->d = timelib_get_nr((char **) &ptr, 2);
1479 s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
1491 s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
1492 s->time->m = timelib_get_month((char **) &ptr);
1493 s->time->d = timelib_get_nr((char **) &ptr, 2);
1506 s->time->d = timelib_get_nr((char **) &ptr, 2);
1507 s->time->m = timelib_get_month((char **) &ptr);
1508 s->time->y = timelib_get_nr((char **) &ptr, 4);
1509 s->time->h = timelib_get_nr((char **) &ptr, 2);
1510 s->time->i = timelib_get_nr((char **) &ptr, 2);
1511 s->time->s = timelib_get_nr((char **) &ptr, 2);
1512 …s->time->z = timelib_parse_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz…
1524 s->time->y = timelib_get_nr((char **) &ptr, 4);
1558 relunit = timelib_lookup_relunit((char**) &ptr);
1576 while(*ptr) {
1577 i = timelib_get_relative_text((char **) &ptr, &behavior);
1578 timelib_eat_spaces((char **) &ptr);
1579 timelib_set_relative((char **) &ptr, i, behavior, s);
1600 while(*ptr) {
1601 i = timelib_get_relative_text((char **) &ptr, &behavior);
1602 timelib_eat_spaces((char **) &ptr);
1603 timelib_set_relative((char **) &ptr, i, behavior, s);
1614 s->time->m = timelib_lookup_month((char **) &ptr);
1625 …s->time->z = timelib_parse_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz…
1638 s->time->m = timelib_get_month((char **) &ptr);
1639 s->time->d = timelib_get_nr((char **) &ptr, 2);
1642 s->time->h = timelib_get_nr((char **) &ptr, 2);
1643 s->time->i = timelib_get_nr((char **) &ptr, 2);
1644 if (*ptr == ':' || *ptr == '.') {
1645 s->time->s = timelib_get_nr((char **) &ptr, 2);
1647 if (*ptr == '.') {
1648 s->time->f = timelib_get_frac_nr((char **) &ptr, 8);
1652 s->time->h += timelib_meridian((char **) &ptr, s->time->h);
1663 s->time->m = timelib_get_month((char **) &ptr);
1664 s->time->d = timelib_get_nr((char **) &ptr, 2);
1667 s->time->h = timelib_get_nr((char **) &ptr, 2);
1668 s->time->i = timelib_get_nr((char **) &ptr, 2);
1669 if (*ptr == ':') {
1670 s->time->s = timelib_get_nr((char **) &ptr, 2);
1672 if (*ptr == '.') {
1673 s->time->f = timelib_get_frac_nr((char **) &ptr, 8);
1677 if (*ptr != '\0') {
1678 …s->time->z = timelib_parse_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz…
1694 while(*ptr) {
1695 i = timelib_get_unsigned_nr((char **) &ptr, 24);
1696 timelib_eat_spaces((char **) &ptr);
1697 timelib_set_relative((char **) &ptr, i, 1, s);
1805 if (strchr("0123456789", *ptr) == NULL) \
1838 char *ptr = string;
1867 while (*fptr && *ptr) {
1868 begin = ptr;
1875 tmprel = timelib_lookup_relunit((char **) &ptr);
1890 if ((s->time->d = timelib_get_nr((char **) &ptr, 2)) == TIMELIB_UNSET) {
1895 timelib_skip_day_suffix((char **) &ptr);
1899 if ((tmp = timelib_get_nr((char **) &ptr, 3)) == TIMELIB_UNSET) {
1911 if ((s->time->m = timelib_get_nr((char **) &ptr, 2)) == TIMELIB_UNSET) {
1917 tmp = timelib_lookup_month((char **) &ptr);
1928 if ((s->time->y = timelib_get_nr_ex((char **) &ptr, 2, &length)) == TIMELIB_UNSET) {
1936 if ((s->time->y = timelib_get_nr((char **) &ptr, 4)) == TIMELIB_UNSET) {
1943 if ((s->time->h = timelib_get_nr((char **) &ptr, 2)) == TIMELIB_UNSET) {
1953 if ((s->time->h = timelib_get_nr((char **) &ptr, 2)) == TIMELIB_UNSET) {
1961 } else if ((tmp = timelib_meridian_with_check((char **) &ptr, s->time->h)) == TIMELIB_UNSET) {
1973 min = timelib_get_nr_ex((char **) &ptr, 2, &length);
1987 sec = timelib_get_nr_ex((char **) &ptr, 2, &length);
2001 tptr = ptr;
2002 if ((f = timelib_get_nr((char **) &ptr, 6)) == TIMELIB_UNSET || (ptr - tptr < 1)) {
2005 s->time->f = (f / pow(10, (ptr - tptr)));
2010 timelib_eat_spaces((char **) &ptr);
2015 tmp = timelib_get_unsigned_nr((char **) &ptr, 24);
2034 …s->time->z = timelib_parse_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz…
2042 …if (*ptr == ';' || *ptr == ':' || *ptr == '/' || *ptr == '.' || *ptr == ',' || *ptr == '-' || *ptr
2043 ++ptr;
2057 if (*ptr == *fptr) {
2058 ++ptr;
2073 ++ptr;
2082 if (*ptr == *fptr) {
2083 ++ptr;
2090 timelib_eat_until_separator((char **) &ptr);
2098 if (*fptr != *ptr) {
2101 ptr++;
2105 if (*ptr) {
2107 add_pbf_warning(s, "Trailing data", string, ptr);
2109 add_pbf_error(s, "Trailing data", string, ptr);
2130 add_pbf_error(s, "Data missing", string, ptr);
2153 add_pbf_warning(s, "The parsed time was invalid", string, ptr);
2159 add_pbf_warning(s, "The parsed date was invalid", string, ptr);