From c09b6f8ab6edefba52183f8c5ecf6520a8b7ad8f Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Mon, 6 Feb 2012 21:33:40 -0500 Subject: [PATCH] fix some omissions and mistakes in locale_t interface definitions --- include/wctype.h | 24 ++++++++++++++++++++++++ src/locale/iswalnum_l.c | 2 +- src/locale/iswalpha_l.c | 2 +- src/locale/iswblank_l.c | 2 +- src/locale/iswcntrl_l.c | 2 +- src/locale/iswctype_l.c | 2 +- src/locale/iswdigit_l.c | 2 +- src/locale/iswgraph_l.c | 2 +- src/locale/iswlower_l.c | 2 +- src/locale/iswprint_l.c | 2 +- src/locale/iswpunct_l.c | 2 +- src/locale/iswspace_l.c | 2 +- src/locale/iswupper_l.c | 2 +- src/locale/iswxdigit_l.c | 2 +- 14 files changed, 37 insertions(+), 13 deletions(-) diff --git a/include/wctype.h b/include/wctype.h index ee5be7c6..f7be2cb0 100644 --- a/include/wctype.h +++ b/include/wctype.h @@ -43,6 +43,30 @@ wctype_t wctype(const char *); #undef iswdigit #define iswdigit(a) (((unsigned)(a)-L'0') < 10) +#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \ + || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) + +int iswalnum_l(wint_t, locale_t); +int iswalpha_l(wint_t, locale_t); +int iswblank_l(wint_t, locale_t); +int iswcntrl_l(wint_t, locale_t); +int iswdigit_l(wint_t, locale_t); +int iswgraph_l(wint_t, locale_t); +int iswlower_l(wint_t, locale_t); +int iswprint_l(wint_t, locale_t); +int iswpunct_l(wint_t, locale_t); +int iswspace_l(wint_t, locale_t); +int iswupper_l(wint_t, locale_t); +int iswxdigit_l(wint_t, locale_t); +int iswctype_l(wint_t, wctype_t, locale_t); +wint_t towlower_l(wint_t, locale_t); +wint_t towupper_l(wint_t, locale_t); +wint_t towctrans_l(wint_t, wctrans_t, locale_t); +wctrans_t wctrans_l(const char *, locale_t); +wctype_t wctype_l(const char *, locale_t); + +#endif + #ifdef __cplusplus } #endif diff --git a/src/locale/iswalnum_l.c b/src/locale/iswalnum_l.c index 8aaf1be6..c888060c 100644 --- a/src/locale/iswalnum_l.c +++ b/src/locale/iswalnum_l.c @@ -1,6 +1,6 @@ #include -wint_t iswalnum_l(wint_t c, locale_t l) +int iswalnum_l(wint_t c, locale_t l) { return iswalnum(c); } diff --git a/src/locale/iswalpha_l.c b/src/locale/iswalpha_l.c index ebe5a05e..cd2be91e 100644 --- a/src/locale/iswalpha_l.c +++ b/src/locale/iswalpha_l.c @@ -1,6 +1,6 @@ #include -wint_t iswalpha_l(wint_t c, locale_t l) +int iswalpha_l(wint_t c, locale_t l) { return iswalpha(c); } diff --git a/src/locale/iswblank_l.c b/src/locale/iswblank_l.c index 180a8f43..f3a2691f 100644 --- a/src/locale/iswblank_l.c +++ b/src/locale/iswblank_l.c @@ -1,6 +1,6 @@ #include -wint_t iswblank_l(wint_t c, locale_t l) +int iswblank_l(wint_t c, locale_t l) { return iswblank(c); } diff --git a/src/locale/iswcntrl_l.c b/src/locale/iswcntrl_l.c index 50e97c5a..7681fe09 100644 --- a/src/locale/iswcntrl_l.c +++ b/src/locale/iswcntrl_l.c @@ -1,6 +1,6 @@ #include -wint_t iswcntrl_l(wint_t c, locale_t l) +int iswcntrl_l(wint_t c, locale_t l) { return iswcntrl(c); } diff --git a/src/locale/iswctype_l.c b/src/locale/iswctype_l.c index be222d36..1dccef63 100644 --- a/src/locale/iswctype_l.c +++ b/src/locale/iswctype_l.c @@ -1,6 +1,6 @@ #include -wint_t iswctype_l(wint_t c, wctype_t t, locale_t l) +int iswctype_l(wint_t c, wctype_t t, locale_t l) { return iswctype(c, t); } diff --git a/src/locale/iswdigit_l.c b/src/locale/iswdigit_l.c index 3f567fc1..3de678c2 100644 --- a/src/locale/iswdigit_l.c +++ b/src/locale/iswdigit_l.c @@ -1,6 +1,6 @@ #include -wint_t iswdigit_l(wint_t c, locale_t l) +int iswdigit_l(wint_t c, locale_t l) { return iswdigit(c); } diff --git a/src/locale/iswgraph_l.c b/src/locale/iswgraph_l.c index 4a8f787c..34df64fc 100644 --- a/src/locale/iswgraph_l.c +++ b/src/locale/iswgraph_l.c @@ -1,6 +1,6 @@ #include -wint_t iswgraph_l(wint_t c, locale_t l) +int iswgraph_l(wint_t c, locale_t l) { return iswgraph(c); } diff --git a/src/locale/iswlower_l.c b/src/locale/iswlower_l.c index 51e07f35..c52421a0 100644 --- a/src/locale/iswlower_l.c +++ b/src/locale/iswlower_l.c @@ -1,6 +1,6 @@ #include -wint_t iswlower_l(wint_t c, locale_t l) +int iswlower_l(wint_t c, locale_t l) { return iswlower(c); } diff --git a/src/locale/iswprint_l.c b/src/locale/iswprint_l.c index eeacb94e..73d83ab3 100644 --- a/src/locale/iswprint_l.c +++ b/src/locale/iswprint_l.c @@ -1,6 +1,6 @@ #include -wint_t iswprint_l(wint_t c, locale_t l) +int iswprint_l(wint_t c, locale_t l) { return iswprint(c); } diff --git a/src/locale/iswpunct_l.c b/src/locale/iswpunct_l.c index 60e2ccf6..831e0e54 100644 --- a/src/locale/iswpunct_l.c +++ b/src/locale/iswpunct_l.c @@ -1,6 +1,6 @@ #include -wint_t iswpunct_l(wint_t c, locale_t l) +int iswpunct_l(wint_t c, locale_t l) { return iswpunct(c); } diff --git a/src/locale/iswspace_l.c b/src/locale/iswspace_l.c index befccc8f..b507e9e3 100644 --- a/src/locale/iswspace_l.c +++ b/src/locale/iswspace_l.c @@ -1,6 +1,6 @@ #include -wint_t iswspace_l(wint_t c, locale_t l) +int iswspace_l(wint_t c, locale_t l) { return iswspace(c); } diff --git a/src/locale/iswupper_l.c b/src/locale/iswupper_l.c index 867edc63..fc988ef1 100644 --- a/src/locale/iswupper_l.c +++ b/src/locale/iswupper_l.c @@ -1,6 +1,6 @@ #include -wint_t iswupper_l(wint_t c, locale_t l) +int iswupper_l(wint_t c, locale_t l) { return iswupper(c); } diff --git a/src/locale/iswxdigit_l.c b/src/locale/iswxdigit_l.c index 8df3f738..9527cf3e 100644 --- a/src/locale/iswxdigit_l.c +++ b/src/locale/iswxdigit_l.c @@ -1,6 +1,6 @@ #include -wint_t iswxdigit_l(wint_t c, locale_t l) +int iswxdigit_l(wint_t c, locale_t l) { return iswxdigit(c); } -- 2.25.1