Skip to content

Commit e196dce

Browse files
committed
Rename timelib_get_zone to timelib_parse_zone and export.
1 parent 62404e7 commit e196dce

File tree

3 files changed

+19
-18
lines changed

3 files changed

+19
-18
lines changed

ext/date/lib/parse_date.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Generated by re2c 0.13.5 on Sat Jan 25 16:16:11 2014 */
1+
/* Generated by re2c 0.13.5 on Thu Feb 6 07:35:53 2014 */
22
#line 1 "ext/date/lib/parse_date.re"
33
/*
44
+----------------------------------------------------------------------+
@@ -751,7 +751,7 @@ static long timelib_lookup_zone(char **ptr, int *dst, char **tz_abbr, int *found
751751
return value;
752752
}
753753

754-
static long timelib_get_zone(char **ptr, int *dst, timelib_time *t, int *tz_not_found, const timelib_tzdb *tzdb, timelib_tz_get_wrapper tz_wrapper)
754+
long timelib_parse_zone(char **ptr, int *dst, timelib_time *t, int *tz_not_found, const timelib_tzdb *tzdb, timelib_tz_get_wrapper tz_wrapper)
755755
{
756756
timelib_tzinfo *res;
757757
long retval = 0;
@@ -1006,7 +1006,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper)
10061006
DEBUG_OUTPUT("tzcorrection | tz");
10071007
TIMELIB_INIT;
10081008
TIMELIB_HAVE_TZ();
1009-
s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz_get_wrapper);
1009+
s->time->z = timelib_parse_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz_get_wrapper);
10101010
if (tz_not_found) {
10111011
add_error(s, "The timezone could not be found in the database");
10121012
}
@@ -4468,7 +4468,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper)
44684468
}
44694469

44704470
if (*ptr != '\0') {
4471-
s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz_get_wrapper);
4471+
s->time->z = timelib_parse_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz_get_wrapper);
44724472
if (tz_not_found) {
44734473
add_error(s, "The timezone could not be found in the database");
44744474
}
@@ -9798,7 +9798,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper)
97989798
}
97999799

98009800
if (*ptr != '\0') {
9801-
s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz_get_wrapper);
9801+
s->time->z = timelib_parse_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz_get_wrapper);
98029802
if (tz_not_found) {
98039803
add_error(s, "The timezone could not be found in the database");
98049804
}
@@ -12073,7 +12073,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper)
1207312073
s->time->h = timelib_get_nr((char **) &ptr, 2);
1207412074
s->time->i = timelib_get_nr((char **) &ptr, 2);
1207512075
s->time->s = timelib_get_nr((char **) &ptr, 2);
12076-
s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz_get_wrapper);
12076+
s->time->z = timelib_parse_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz_get_wrapper);
1207712077
if (tz_not_found) {
1207812078
add_error(s, "The timezone could not be found in the database");
1207912079
}
@@ -13464,7 +13464,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper)
1346413464
if (*ptr == '.') {
1346513465
s->time->f = timelib_get_frac_nr((char **) &ptr, 9);
1346613466
if (*ptr) { /* timezone is optional */
13467-
s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz_get_wrapper);
13467+
s->time->z = timelib_parse_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz_get_wrapper);
1346813468
if (tz_not_found) {
1346913469
add_error(s, "The timezone could not be found in the database");
1347013470
}
@@ -15813,7 +15813,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper)
1581315813
s->time->s = timelib_get_nr((char **) &ptr, 2);
1581415814

1581515815
if (*ptr != '\0') {
15816-
s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz_get_wrapper);
15816+
s->time->z = timelib_parse_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz_get_wrapper);
1581715817
if (tz_not_found) {
1581815818
add_error(s, "The timezone could not be found in the database");
1581915819
}
@@ -25047,7 +25047,7 @@ timelib_time *timelib_parse_from_format(char *format, char *string, int len, tim
2504725047
case 'O': /* timezone */
2504825048
{
2504925049
int tz_not_found;
25050-
s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz_get_wrapper);
25050+
s->time->z = timelib_parse_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz_get_wrapper);
2505125051
if (tz_not_found) {
2505225052
add_pbf_error(s, "The timezone could not be found in the database", string, begin);
2505325053
}

ext/date/lib/parse_date.re

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -749,7 +749,7 @@ static long timelib_lookup_zone(char **ptr, int *dst, char **tz_abbr, int *found
749749
return value;
750750
}
751751

752-
static long timelib_get_zone(char **ptr, int *dst, timelib_time *t, int *tz_not_found, const timelib_tzdb *tzdb, timelib_tz_get_wrapper tz_wrapper)
752+
long timelib_parse_zone(char **ptr, int *dst, timelib_time *t, int *tz_not_found, const timelib_tzdb *tzdb, timelib_tz_get_wrapper tz_wrapper)
753753
{
754754
timelib_tzinfo *res;
755755
long retval = 0;
@@ -1161,7 +1161,7 @@ weekdayof = (reltextnumber|reltexttext) space (dayfull|dayabbr) space 'of
11611161
}
11621162

11631163
if (*ptr != '\0') {
1164-
s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz_get_wrapper);
1164+
s->time->z = timelib_parse_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz_get_wrapper);
11651165
if (tz_not_found) {
11661166
add_error(s, "The timezone could not be found in the database");
11671167
}
@@ -1202,7 +1202,7 @@ weekdayof = (reltextnumber|reltexttext) space (dayfull|dayabbr) space 'of
12021202
s->time->h = timelib_get_nr((char **) &ptr, 2);
12031203
s->time->i = timelib_get_nr((char **) &ptr, 2);
12041204
s->time->s = 0;
1205-
s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, s->tzdb, tz_get_wrapper);
1205+
s->time->z = timelib_parse_zone((char **) &ptr, &s->time->dst, s->time, s->tzdb, tz_get_wrapper);
12061206
break;
12071207
case 1:
12081208
s->time->y = timelib_get_nr((char **) &ptr, 4);
@@ -1227,7 +1227,7 @@ weekdayof = (reltextnumber|reltexttext) space (dayfull|dayabbr) space 'of
12271227
s->time->s = timelib_get_nr((char **) &ptr, 2);
12281228

12291229
if (*ptr != '\0') {
1230-
s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz_get_wrapper);
1230+
s->time->z = timelib_parse_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz_get_wrapper);
12311231
if (tz_not_found) {
12321232
add_error(s, "The timezone could not be found in the database");
12331233
}
@@ -1429,7 +1429,7 @@ weekdayof = (reltextnumber|reltexttext) space (dayfull|dayabbr) space 'of
14291429
if (*ptr == '.') {
14301430
s->time->f = timelib_get_frac_nr((char **) &ptr, 9);
14311431
if (*ptr) { /* timezone is optional */
1432-
s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz_get_wrapper);
1432+
s->time->z = timelib_parse_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz_get_wrapper);
14331433
if (tz_not_found) {
14341434
add_error(s, "The timezone could not be found in the database");
14351435
}
@@ -1532,7 +1532,7 @@ weekdayof = (reltextnumber|reltexttext) space (dayfull|dayabbr) space 'of
15321532
s->time->h = timelib_get_nr((char **) &ptr, 2);
15331533
s->time->i = timelib_get_nr((char **) &ptr, 2);
15341534
s->time->s = timelib_get_nr((char **) &ptr, 2);
1535-
s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz_get_wrapper);
1535+
s->time->z = timelib_parse_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz_get_wrapper);
15361536
if (tz_not_found) {
15371537
add_error(s, "The timezone could not be found in the database");
15381538
}
@@ -1645,7 +1645,7 @@ weekdayof = (reltextnumber|reltexttext) space (dayfull|dayabbr) space 'of
16451645
DEBUG_OUTPUT("tzcorrection | tz");
16461646
TIMELIB_INIT;
16471647
TIMELIB_HAVE_TZ();
1648-
s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz_get_wrapper);
1648+
s->time->z = timelib_parse_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz_get_wrapper);
16491649
if (tz_not_found) {
16501650
add_error(s, "The timezone could not be found in the database");
16511651
}
@@ -1698,7 +1698,7 @@ weekdayof = (reltextnumber|reltexttext) space (dayfull|dayabbr) space 'of
16981698
}
16991699

17001700
if (*ptr != '\0') {
1701-
s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz_get_wrapper);
1701+
s->time->z = timelib_parse_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz_get_wrapper);
17021702
if (tz_not_found) {
17031703
add_error(s, "The timezone could not be found in the database");
17041704
}
@@ -2054,7 +2054,7 @@ timelib_time *timelib_parse_from_format(char *format, char *string, int len, tim
20542054
case 'O': /* timezone */
20552055
{
20562056
int tz_not_found;
2057-
s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz_get_wrapper);
2057+
s->time->z = timelib_parse_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz_get_wrapper);
20582058
if (tz_not_found) {
20592059
add_pbf_error(s, "The timezone could not be found in the database", string, begin);
20602060
}

ext/date/lib/timelib.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ timelib_sll timelib_get_current_offset(timelib_time *t);
105105
void timelib_dump_tzinfo(timelib_tzinfo *tz);
106106
const timelib_tzdb *timelib_builtin_db(void);
107107
const timelib_tzdb_index_entry *timelib_timezone_builtin_identifiers_list(int *count);
108+
long timelib_parse_zone(char **ptr, int *dst, timelib_time *t, int *tz_not_found, const timelib_tzdb *tzdb, timelib_tz_get_wrapper tz_wrapper);
108109

109110
/* From timelib.c */
110111
timelib_tzinfo* timelib_tzinfo_ctor(char *name);

0 commit comments

Comments
 (0)