summaryrefslogtreecommitdiffstats
path: root/include/locale.h
diff options
context:
space:
mode:
authortheraven <theraven@FreeBSD.org>2012-02-14 12:03:23 +0000
committertheraven <theraven@FreeBSD.org>2012-02-14 12:03:23 +0000
commitb529e734cb0e714064ede8ada785785cf36328b3 (patch)
treed83544c2e798a9a440baf38564df616970b2b0f5 /include/locale.h
parentbcfaf51260694a128c1375064baa2ce595f66f24 (diff)
downloadFreeBSD-src-b529e734cb0e714064ede8ada785785cf36328b3.zip
FreeBSD-src-b529e734cb0e714064ede8ada785785cf36328b3.tar.gz
Cleanup of xlocale:
- Address performance regressions encountered by das@ by caching per-thread data in TLS where available. - Add a __NO_TLS flag to cdefs.h to indicate where not available. - Reorganise the xlocale.h definitions into xlocale/*.h so that they can be included from multiple places. - Export the POSIX2008 subset of xlocale when POSIX2008 says it should be exported, independently of whether xlocale.h is included. - Fix the bug where programs using ctype functions always assumed ASCII unless recompiled. - Fix some style(9) violations. Reviewed by: brooks (mentor) Approved by: dim (mentor)
Diffstat (limited to 'include/locale.h')
-rw-r--r--include/locale.h47
1 files changed, 2 insertions, 45 deletions
diff --git a/include/locale.h b/include/locale.h
index 8df0a6a..0edc3ea 100644
--- a/include/locale.h
+++ b/include/locale.h
@@ -77,54 +77,11 @@ struct lconv {
__BEGIN_DECLS
struct lconv *localeconv(void);
char *setlocale(int, const char *);
-__END_DECLS
#if __POSIX_VISIBLE >= 200809
-
-#define LC_COLLATE_MASK (1<<0)
-#define LC_CTYPE_MASK (1<<1)
-#define LC_MESSAGES_MASK (1<<2)
-#define LC_MONETARY_MASK (1<<3)
-#define LC_NUMERIC_MASK (1<<4)
-#define LC_TIME_MASK (1<<5)
-#define LC_ALL_MASK (LC_COLLATE_MASK | LC_CTYPE_MASK | LC_MESSAGES_MASK | \
- LC_MONETARY_MASK | LC_NUMERIC_MASK | LC_TIME_MASK)
-
-#define LC_GLOBAL_LOCALE ((locale_t)-1)
-
-__BEGIN_DECLS
-
-typedef struct _xlocale *locale_t;
-/**
- * Creates a new locale.
- */
-locale_t newlocale(int mask, const char *locale, locale_t base);
-
-/**
- * Returns an identical duplicate of the passed locale. The returned locale
- * must be freed with freelocale(). The returned locale will share components
- * with the original.
- */
-locale_t duplocale(locale_t base);
-/*
- * Free a locale_t. This is quite a poorly named function. It actually
- * disclaims a reference to a locale_t, rather than freeing it.
- */
-int freelocale(locale_t loc);
-
-/*
- * Returns the name of the locale for a particular component of a locale_t.
- */
-const char *querylocale(int mask, locale_t loc);
-
-/*
- * Installs the specified locale_t as this thread's locale.
- */
-locale_t uselocale(locale_t loc);
-
+#include <xlocale/_locale.h>
+#endif
__END_DECLS
-#endif /* __POSIX_VISIBLE >= 200809 */
-
#endif /* _LOCALE_H_ */
OpenPOWER on IntegriCloud