diff options
author | Alexey Zelkin <phantom@FreeBSD.org> | 2001-02-08 17:06:37 +0000 |
---|---|---|
committer | Alexey Zelkin <phantom@FreeBSD.org> | 2001-02-08 17:06:37 +0000 |
commit | 18f3e1e4004b7454ec7fe0fa0f2800de4f4d4423 (patch) | |
tree | 648ff1eb9cd59786bbd404ee5c0ef5f31d5f58ae | |
parent | e690a5563fa7fe40d920ed71eb293b928220217c (diff) | |
download | src-18f3e1e4004b7454ec7fe0fa0f2800de4f4d4423.tar.gz src-18f3e1e4004b7454ec7fe0fa0f2800de4f4d4423.zip |
Export internal data structures in same manner as numeric/monetary/messages
structures exported.
Protect timelocal.h from multiple inclusions.
Notes
Notes:
svn path=/head/; revision=72167
-rw-r--r-- | lib/libc/stdtime/timelocal.c | 12 | ||||
-rw-r--r-- | lib/libc/stdtime/timelocal.h | 10 |
2 files changed, 14 insertions, 8 deletions
diff --git a/lib/libc/stdtime/timelocal.c b/lib/libc/stdtime/timelocal.c index c39b956001ba..6af316710de1 100644 --- a/lib/libc/stdtime/timelocal.c +++ b/lib/libc/stdtime/timelocal.c @@ -44,8 +44,8 @@ static int split_lines(char *, const char *); static void set_from_buf(const char *, int); -struct lc_time_T _time_localebuf; -int _time_using_locale; +static struct lc_time_T _time_localebuf; +static int _time_using_locale; #define LCTIME_SIZE_FULL (sizeof(struct lc_time_T) / sizeof(char *)) #define LCTIME_SIZE_1 \ @@ -53,7 +53,7 @@ int _time_using_locale; #define LCTIME_SIZE_2 \ (offsetof(struct lc_time_T, Ef_fmt) / sizeof(char *)) -const struct lc_time_T _C_time_locale = { +static const struct lc_time_T _C_time_locale = { { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" @@ -111,6 +111,12 @@ const struct lc_time_T _C_time_locale = { "%B %e" }; +struct lc_time_T * +__get_current_time_locale(void) { + return (_time_using_locale + ? &_time_localebuf + : (struct lc_time_T *)&_C_time_locale); +} int __time_load_locale(const char *name) diff --git a/lib/libc/stdtime/timelocal.h b/lib/libc/stdtime/timelocal.h index b5ab91dfb6a8..4e4dc52fb2d0 100644 --- a/lib/libc/stdtime/timelocal.h +++ b/lib/libc/stdtime/timelocal.h @@ -26,6 +26,9 @@ * $FreeBSD$ */ +#ifndef _TIMELOCAL_H +#define _TIMELOCAL_H + /* * Private header file for the strftime and strptime localization * stuff. @@ -46,9 +49,6 @@ struct lc_time_T { const char * EF_fmt; }; -extern struct lc_time_T _time_localebuf; -extern int _time_using_locale; -extern const struct lc_time_T _C_time_locale; - -#define Locale (_time_using_locale ? &_time_localebuf : &_C_time_locale) +struct lc_time_T * __get_current_time_locale(void); +#endif /* _TIMELOCAL_H */ |