diff options
Diffstat (limited to 'src/time/__tz.c')
| -rw-r--r-- | src/time/__tz.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/time/__tz.c b/src/time/__tz.c index 54ed4cf6..cfce268e 100644 --- a/src/time/__tz.c +++ b/src/time/__tz.c @@ -436,3 +436,22 @@ const char *__tm_to_tzname(const struct tm *tm) UNLOCK(lock); return p; } + +int __tzname_to_isdst(const char *restrict *s) +{ + size_t len; + int isdst = -1; + LOCK(lock); + if (tzname[0] && !strncmp(*s, tzname[0], len = strlen(tzname[0]))) { + isdst = 0; + *s += len; + } else if (tzname[1] && !strncmp(*s, tzname[1], len=strlen(tzname[1]))) { + isdst = 1; + *s += len; + } else { + /* FIXME: is this supposed to be an error? */ + while (isalpha(**s)) ++*s; + } + UNLOCK(lock); + return isdst; +} |
