-/* Prototype for the internal function to get information based on TZ. */
-extern void __tzset_internal __P ((int always));
-extern int __tz_compute __P ((time_t timer, struct tm *tp));
-extern int __tzfile_compute __P ((time_t timer,
- long int *leap_correct, int *leap_hit));
-
-extern int __use_tzfile;
-
-/* This lock is defined in tzset.c and locks all the data defined there
- and in tzfile.c; the internal functions do no locking themselves.
- This lock is only taken here and in `tzset'. */
-__libc_lock_define (extern, __tzset_lock)
-
-
-/* Return the `struct tm' representation of *TIMER in the local timezone. */
-static struct tm *
-localtime_internal (const time_t *timer, struct tm *tp)
-{
- long int leap_correction;
- int leap_extra_secs;
-
- if (timer == NULL)
- {
- __set_errno (EINVAL);
- return NULL;
- }
-
- if (__use_tzfile)
- {
- if (! __tzfile_compute (*timer, &leap_correction, &leap_extra_secs))
- tp = NULL;
- }
- else
- {
- tp = __gmtime_r (timer, tp);
- if (tp && ! __tz_compute (*timer, tp))
- tp = NULL;
- leap_correction = 0L;
- leap_extra_secs = 0;
- }
-
- if (tp)
- {
- __offtime (timer, __timezone - leap_correction, tp);
- tp->tm_sec += leap_extra_secs;
- tp->tm_isdst = __daylight;
- tp->tm_gmtoff = __timezone;
- tp->tm_zone = __tzname[__daylight];
- }
-
- return tp;
-}
-
-
-/* POSIX.1 8.3.7.2 says that localtime_r is not required to set
- tzname. This is a good idea since this allows at least a bit more
- parallelism. */