summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorphantom <phantom@FreeBSD.org>2001-02-08 17:06:37 +0000
committerphantom <phantom@FreeBSD.org>2001-02-08 17:06:37 +0000
commitfe9086e23b0885193f08660bcd7ea91f2a9905fe (patch)
tree303e32de90fed93221f5984e07e7cbaed4d5233e /lib
parentd35a50f01040f12045947fe62e49b233561ac434 (diff)
downloadFreeBSD-src-fe9086e23b0885193f08660bcd7ea91f2a9905fe.zip
FreeBSD-src-fe9086e23b0885193f08660bcd7ea91f2a9905fe.tar.gz
Export internal data structures in same manner as numeric/monetary/messages
structures exported. Protect timelocal.h from multiple inclusions.
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/stdtime/timelocal.c12
-rw-r--r--lib/libc/stdtime/timelocal.h10
2 files changed, 14 insertions, 8 deletions
diff --git a/lib/libc/stdtime/timelocal.c b/lib/libc/stdtime/timelocal.c
index c39b956..6af3167 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 b5ab91d..4e4dc52 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 */
OpenPOWER on IntegriCloud