summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortheraven <theraven@FreeBSD.org>2012-03-13 14:14:13 +0000
committertheraven <theraven@FreeBSD.org>2012-03-13 14:14:13 +0000
commit75aeb0cde534161833de0e27f70d1e7d5206cd3d (patch)
tree8b6e86d5cf1d3405e1fcbe790e846aa9d4fc3cb4
parentd0a72d948e70eac20228005908250534eeb9d671 (diff)
downloadFreeBSD-src-75aeb0cde534161833de0e27f70d1e7d5206cd3d.zip
FreeBSD-src-75aeb0cde534161833de0e27f70d1e7d5206cd3d.tar.gz
More xlocale cleanups.
Approved by: dim (mentor)
-rw-r--r--include/xlocale/_ctype.h52
-rw-r--r--lib/libc/locale/Symbol.map4
2 files changed, 30 insertions, 26 deletions
diff --git a/include/xlocale/_ctype.h b/include/xlocale/_ctype.h
index 31359b7..1fdebd6 100644
--- a/include/xlocale/_ctype.h
+++ b/include/xlocale/_ctype.h
@@ -68,19 +68,19 @@ _RuneLocale *__runes_for_locale(locale_t, int*);
#endif /* _XLOCALE_INLINE */
#ifdef _XLOCALE_WCTYPES
-static __inline int
-__maskrune_l(__ct_rune_t _c, unsigned long _f, locale_t locale)
+_XLOCALE_INLINE int
+__maskrune_l(__ct_rune_t __c, unsigned long __f, locale_t __loc)
{
- int mb_sb_limit;
- _RuneLocale *runes = __runes_for_locale(locale, &mb_sb_limit);
- return (_c < 0 || _c >= _CACHED_RUNES) ? ___runetype_l(_c, locale) :
- runes->__runetype[_c] & _f;
+ int __limit;
+ _RuneLocale *runes = __runes_for_locale(__loc, &__limit);
+ return (__c < 0 || __c >= _CACHED_RUNES) ? ___runetype_l(__c, __loc) :
+ runes->__runetype[__c] & __f;
}
-static __inline int
-__istype_l(__ct_rune_t _c, unsigned long _f, locale_t locale)
+_XLOCALE_INLINE __inline int
+__istype_l(__ct_rune_t __c, unsigned long __f, locale_t __loc)
{
- return (!!__maskrune_l(_c, _f, locale));
+ return (!!__maskrune_l(__c, __f, __loc));
}
#define XLOCALE_ISCTYPE(fname, cat) \
@@ -88,25 +88,25 @@ __istype_l(__ct_rune_t _c, unsigned long _f, locale_t locale)
_XLOCALE_INLINE int isw##fname##_l(int __c, locale_t __l)\
{ return __istype_l(__c, cat, __l); }
#else
-static __inline int
-__sbmaskrune_l(__ct_rune_t _c, unsigned long _f, locale_t locale)
+_XLOCALE_INLINE int
+__sbmaskrune_l(__ct_rune_t __c, unsigned long __f, locale_t __loc)
{
- int mb_sb_limit;
- _RuneLocale *runes = __runes_for_locale(locale, &mb_sb_limit);
- return (_c < 0 || _c >= mb_sb_limit) ? 0 :
- runes->__runetype[_c] & _f;
+ int __limit;
+ _RuneLocale *runes = __runes_for_locale(__loc, &__limit);
+ return (__c < 0 || __c >= __limit) ? 0 :
+ runes->__runetype[__c] & __f;
}
-static __inline int
-__sbistype_l(__ct_rune_t _c, unsigned long _f, locale_t locale)
+_XLOCALE_INLINE int
+__sbistype_l(__ct_rune_t __c, unsigned long __f, locale_t __loc)
{
- return (!!__sbmaskrune_l(_c, _f, locale));
+ return (!!__sbmaskrune_l(__c, __f, __loc));
}
-#define XLOCALE_ISCTYPE(fname, cat) \
- _XLOCALE_INLINE int is##fname##_l(int c, locale_t l); \
- _XLOCALE_INLINE int is##fname##_l(int c, locale_t l)\
- { return __sbistype_l(c, cat, l); }
+#define XLOCALE_ISCTYPE(__fname, __cat) \
+ _XLOCALE_INLINE int is##__fname##_l(int, locale_t); \
+ _XLOCALE_INLINE int is##__fname##_l(int __c, locale_t __l)\
+ { return __sbistype_l(__c, __cat, __l); }
#endif
XLOCALE_ISCTYPE(alnum, _CTYPE_A|_CTYPE_D)
@@ -136,15 +136,15 @@ _XLOCALE_INLINE int towupper_l(int, locale_t);
_XLOCALE_INLINE int towlower_l(int __c, locale_t __l)
{
- int mb_sb_limit;
- _RuneLocale *__runes = __runes_for_locale(__l, &mb_sb_limit);
+ int __limit;
+ _RuneLocale *__runes = __runes_for_locale(__l, &__limit);
return (__c < 0 || __c >= _CACHED_RUNES) ? ___tolower_l(__c, __l) :
__runes->__maplower[__c];
}
_XLOCALE_INLINE int towupper_l(int __c, locale_t __l)
{
- int mb_sb_limit;
- _RuneLocale *__runes = __runes_for_locale(__l, &mb_sb_limit);
+ int __limit;
+ _RuneLocale *__runes = __runes_for_locale(__l, &__limit);
return (__c < 0 || __c >= _CACHED_RUNES) ? ___toupper_l(__c, __l) :
__runes->__mapupper[__c];
}
diff --git a/lib/libc/locale/Symbol.map b/lib/libc/locale/Symbol.map
index a65acc2..158ba80 100644
--- a/lib/libc/locale/Symbol.map
+++ b/lib/libc/locale/Symbol.map
@@ -60,9 +60,13 @@ FBSD_1.0 {
nextwctype;
nl_langinfo;
__maskrune;
+ __maskrune_l;
__sbmaskrune;
+ __sbmaskrune_l;
__istype;
+ __istype_l;
__sbistype;
+ __sbistype_l;
__isctype;
__toupper;
__sbtoupper;
OpenPOWER on IntegriCloud