diff options
author | phantom <phantom@FreeBSD.org> | 2005-02-27 15:11:09 +0000 |
---|---|---|
committer | phantom <phantom@FreeBSD.org> | 2005-02-27 15:11:09 +0000 |
commit | 23d961a13f47abb00dde86ee46e2e766a478aca4 (patch) | |
tree | 69f481163c9449c668aa58cf3fa5dbc37df51899 /lib/libc/locale/utf8.c | |
parent | 31651f25d817b24f6d2b1ef090ac6120d90ed86a (diff) | |
download | FreeBSD-src-23d961a13f47abb00dde86ee46e2e766a478aca4.zip FreeBSD-src-23d961a13f47abb00dde86ee46e2e766a478aca4.tar.gz |
. Static'ize functions exported via function reference variables only.
. Replace inclusion of sys/param.h to sys/cdefs.h and sys/types.h where
appropriate.
. move _*_init() prototypes to mblocal.h, and remove these prototypes
from .c files
. use _none_init() in __setrunelocale() instead of duplicating code
. move __mb* variables from table.c to none.c allowing us to not to
export _none_*() externs, and appropriately remove them from mblocal.h
Ok'ed by: tjr
Diffstat (limited to 'lib/libc/locale/utf8.c')
-rw-r--r-- | lib/libc/locale/utf8.c | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/lib/libc/locale/utf8.c b/lib/libc/locale/utf8.c index 2f55ffd..2f537a5 100644 --- a/lib/libc/locale/utf8.c +++ b/lib/libc/locale/utf8.c @@ -35,14 +35,16 @@ __FBSDID("$FreeBSD$"); #include <wchar.h> #include "mblocal.h" -size_t _UTF8_mbrtowc(wchar_t * __restrict, const char * __restrict, size_t, - mbstate_t * __restrict); -int _UTF8_mbsinit(const mbstate_t *); -size_t _UTF8_mbsnrtowcs(wchar_t * __restrict, const char ** __restrict, - size_t, size_t, mbstate_t * __restrict); -size_t _UTF8_wcrtomb(char * __restrict, wchar_t, mbstate_t * __restrict); -size_t _UTF8_wcsnrtombs(char * __restrict, const wchar_t ** __restrict, - size_t, size_t, mbstate_t * __restrict); +static size_t _UTF8_mbrtowc(wchar_t * __restrict, const char * __restrict, + size_t, mbstate_t * __restrict); +static int _UTF8_mbsinit(const mbstate_t *); +static size_t _UTF8_mbsnrtowcs(wchar_t * __restrict, + const char ** __restrict, size_t, size_t, + mbstate_t * __restrict); +static size_t _UTF8_wcrtomb(char * __restrict, wchar_t, + mbstate_t * __restrict); +static size_t _UTF8_wcsnrtombs(char * __restrict, const wchar_t ** __restrict, + size_t, size_t, mbstate_t * __restrict); typedef struct { wchar_t ch; @@ -65,14 +67,14 @@ _UTF8_init(_RuneLocale *rl) return (0); } -int +static int _UTF8_mbsinit(const mbstate_t *ps) { return (ps == NULL || ((const _UTF8State *)ps)->want == 0); } -size_t +static size_t _UTF8_mbrtowc(wchar_t * __restrict pwc, const char * __restrict s, size_t n, mbstate_t * __restrict ps) { @@ -194,7 +196,7 @@ _UTF8_mbrtowc(wchar_t * __restrict pwc, const char * __restrict s, size_t n, return (wch == L'\0' ? 0 : want); } -size_t +static size_t _UTF8_mbsnrtowcs(wchar_t * __restrict dst, const char ** __restrict src, size_t nms, size_t len, mbstate_t * __restrict ps) { @@ -276,7 +278,7 @@ _UTF8_mbsnrtowcs(wchar_t * __restrict dst, const char ** __restrict src, return (nchr); } -size_t +static size_t _UTF8_wcrtomb(char * __restrict s, wchar_t wc, mbstate_t * __restrict ps) { _UTF8State *us; @@ -344,7 +346,7 @@ _UTF8_wcrtomb(char * __restrict s, wchar_t wc, mbstate_t * __restrict ps) return (len); } -size_t +static size_t _UTF8_wcsnrtombs(char * __restrict dst, const wchar_t ** __restrict src, size_t nwc, size_t len, mbstate_t * __restrict ps) { |