2004-04-23 Artem B. Bityuckiy <abitytsky@softminecorp.com>
* configure.in: Define _MB_CAPABLE if mb supported. * configure: Regenerated. * configure.host: Remove manual setting of MB_CAPABLE compiler flag. * newlib.hin: Add _MB_CAPABLE flag. * libc/ctype/iswalpha.c, libc/ctype/iswblank.c: Include <newlib.h> and check for _MB_CAPABLE flag instead of MB_CAPABLE. * libc/ctype/iswcntrl.c, libc/ctype/iswprint.c: Ditto. * libc/ctype/iswpunct.c, libc/ctype/iswspace.c: Ditto. * libc/ctype/jp2uc.c: Ditto. * libc/ctype/towlower.c, libc/ctype/towupper.c: Ditto. * libc/locale/locale.c: Ditto * libc/machine/powerpc/vfscanf.c: Ditto * libc/stdio/vfprintf.c, libc/stdio/vfscanf.c: Ditto * libc/stdlib/mblen.c: Ditto * libc/stdlib/mblen_r.c, libc/stdlib/mbrlen.c: Ditto * libc/stdlib/mbrtowc.c, libc/stdlib/mbsrtowcs.c: Ditto * libc/stdlib/mbstowcs.c, libc/stdlib/mbtowc.c: Ditto * libc/stdlib/mbtowc_r.c, libc/stdlib/wcrtomb.c: Ditto * libc/stdlib/wcsrtombs.c, libc/stdlib/wcstombs.c: Ditto * libc/stdlib/wctomb.c, libc/sys/linux/intl/dcigettext.c: Ditto * libc/sys/linux/intl/explodename.c: Ditto * libc/sys/linux/intl/finddomain.c: Ditto * libc/sys/linux/intl/l10nflist.c: Ditto * libc/sys/linux/intl/loadmsgcat.c: Ditto * libc/sys/linux/intl/localealias.c: Ditto
This commit is contained in:
parent
27c7566ca4
commit
f777e3a5ac
@ -1,3 +1,32 @@
|
|||||||
|
2004-04-23 Artem B. Bityuckiy <abitytsky@softminecorp.com>
|
||||||
|
|
||||||
|
* configure.in: Define _MB_CAPABLE if mb supported.
|
||||||
|
* configure: Regenerated.
|
||||||
|
* configure.host: Remove manual setting of MB_CAPABLE compiler
|
||||||
|
flag.
|
||||||
|
* newlib.hin: Add _MB_CAPABLE flag.
|
||||||
|
* libc/ctype/iswalpha.c, libc/ctype/iswblank.c: Include <newlib.h>
|
||||||
|
and check for _MB_CAPABLE flag instead of MB_CAPABLE.
|
||||||
|
* libc/ctype/iswcntrl.c, libc/ctype/iswprint.c: Ditto.
|
||||||
|
* libc/ctype/iswpunct.c, libc/ctype/iswspace.c: Ditto.
|
||||||
|
* libc/ctype/jp2uc.c: Ditto.
|
||||||
|
* libc/ctype/towlower.c, libc/ctype/towupper.c: Ditto.
|
||||||
|
* libc/locale/locale.c: Ditto
|
||||||
|
* libc/machine/powerpc/vfscanf.c: Ditto
|
||||||
|
* libc/stdio/vfprintf.c, libc/stdio/vfscanf.c: Ditto
|
||||||
|
* libc/stdlib/mblen.c: Ditto
|
||||||
|
* libc/stdlib/mblen_r.c, libc/stdlib/mbrlen.c: Ditto
|
||||||
|
* libc/stdlib/mbrtowc.c, libc/stdlib/mbsrtowcs.c: Ditto
|
||||||
|
* libc/stdlib/mbstowcs.c, libc/stdlib/mbtowc.c: Ditto
|
||||||
|
* libc/stdlib/mbtowc_r.c, libc/stdlib/wcrtomb.c: Ditto
|
||||||
|
* libc/stdlib/wcsrtombs.c, libc/stdlib/wcstombs.c: Ditto
|
||||||
|
* libc/stdlib/wctomb.c, libc/sys/linux/intl/dcigettext.c: Ditto
|
||||||
|
* libc/sys/linux/intl/explodename.c: Ditto
|
||||||
|
* libc/sys/linux/intl/finddomain.c: Ditto
|
||||||
|
* libc/sys/linux/intl/l10nflist.c: Ditto
|
||||||
|
* libc/sys/linux/intl/loadmsgcat.c: Ditto
|
||||||
|
* libc/sys/linux/intl/localealias.c: Ditto
|
||||||
|
|
||||||
2004-04-23 Jeff Johnston <jjohnstn@redhat.com>
|
2004-04-23 Jeff Johnston <jjohnstn@redhat.com>
|
||||||
|
|
||||||
* libc/machine/powerpc/vfscanf.c (NNZDIGITS): New define.
|
* libc/machine/powerpc/vfscanf.c (NNZDIGITS): New define.
|
||||||
|
4
newlib/configure
vendored
4
newlib/configure
vendored
@ -3206,6 +3206,10 @@ EOF
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if test "${newlib_mb}" = "yes"; then
|
if test "${newlib_mb}" = "yes"; then
|
||||||
|
cat >> confdefs.h <<EOF
|
||||||
|
#define _MB_CAPABLE 1
|
||||||
|
EOF
|
||||||
|
|
||||||
cat >> confdefs.h <<EOF
|
cat >> confdefs.h <<EOF
|
||||||
#define _MB_LEN_MAX 8
|
#define _MB_LEN_MAX 8
|
||||||
EOF
|
EOF
|
||||||
|
@ -250,10 +250,6 @@ if [ "x${newlib_mb}" = "x" ]; then
|
|||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "x${newlib_mb}" = "xyes" ] ; then
|
|
||||||
newlib_cflags="${newlib_cflags} -DMB_CAPABLE"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Disable printf/scanf floating-point support if requested.
|
# Disable printf/scanf floating-point support if requested.
|
||||||
|
|
||||||
if [ "${newlib_io_float}" = "no" ] ; then
|
if [ "${newlib_io_float}" = "no" ] ; then
|
||||||
|
@ -145,6 +145,7 @@ AC_DEFINE_UNQUOTED(_ELIX_LEVEL,${newlib_elix_level})
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if test "${newlib_mb}" = "yes"; then
|
if test "${newlib_mb}" = "yes"; then
|
||||||
|
AC_DEFINE_UNQUOTED(_MB_CAPABLE)
|
||||||
AC_DEFINE_UNQUOTED(_MB_LEN_MAX,8)
|
AC_DEFINE_UNQUOTED(_MB_LEN_MAX,8)
|
||||||
else
|
else
|
||||||
AC_DEFINE_UNQUOTED(_MB_LEN_MAX,1)
|
AC_DEFINE_UNQUOTED(_MB_LEN_MAX,1)
|
||||||
|
@ -56,14 +56,15 @@ PORTABILITY
|
|||||||
No supporting OS subroutines are required.
|
No supporting OS subroutines are required.
|
||||||
*/
|
*/
|
||||||
#include <_ansi.h>
|
#include <_ansi.h>
|
||||||
|
#include <newlib.h>
|
||||||
#include <wctype.h>
|
#include <wctype.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include "local.h"
|
#include "local.h"
|
||||||
|
|
||||||
#ifdef MB_CAPABLE
|
#ifdef _MB_CAPABLE
|
||||||
#include "utf8alpha.h"
|
#include "utf8alpha.h"
|
||||||
#endif /* MB_CAPABLE */
|
#endif /* _MB_CAPABLE */
|
||||||
|
|
||||||
int
|
int
|
||||||
_DEFUN(iswalpha,(c), wint_t c)
|
_DEFUN(iswalpha,(c), wint_t c)
|
||||||
@ -74,7 +75,7 @@ _DEFUN(iswalpha,(c), wint_t c)
|
|||||||
unicode = 0;
|
unicode = 0;
|
||||||
/* fall-through */
|
/* fall-through */
|
||||||
}
|
}
|
||||||
#ifdef MB_CAPABLE
|
#ifdef _MB_CAPABLE
|
||||||
else if (!strcmp (__lc_ctype, "C-JIS"))
|
else if (!strcmp (__lc_ctype, "C-JIS"))
|
||||||
{
|
{
|
||||||
c = __jp2uc (c, JP_JIS);
|
c = __jp2uc (c, JP_JIS);
|
||||||
@ -335,7 +336,7 @@ _DEFUN(iswalpha,(c), wint_t c)
|
|||||||
/* not in table */
|
/* not in table */
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#endif /* MB_CAPABLE */
|
#endif /* _MB_CAPABLE */
|
||||||
|
|
||||||
return (c < (wint_t)0x100 ? isalpha (c) : 0);
|
return (c < (wint_t)0x100 ? isalpha (c) : 0);
|
||||||
}
|
}
|
||||||
|
@ -56,6 +56,7 @@ PORTABILITY
|
|||||||
No supporting OS subroutines are required.
|
No supporting OS subroutines are required.
|
||||||
*/
|
*/
|
||||||
#include <_ansi.h>
|
#include <_ansi.h>
|
||||||
|
#include <newlib.h>
|
||||||
#include <wctype.h>
|
#include <wctype.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@ -70,7 +71,7 @@ _DEFUN(iswblank,(c), wint_t c)
|
|||||||
unicode = 0;
|
unicode = 0;
|
||||||
/* fall-through */
|
/* fall-through */
|
||||||
}
|
}
|
||||||
#ifdef MB_CAPABLE
|
#ifdef _MB_CAPABLE
|
||||||
else if (!strcmp (__lc_ctype, "C-JIS"))
|
else if (!strcmp (__lc_ctype, "C-JIS"))
|
||||||
{
|
{
|
||||||
c = __jp2uc (c, JP_JIS);
|
c = __jp2uc (c, JP_JIS);
|
||||||
@ -98,7 +99,7 @@ _DEFUN(iswblank,(c), wint_t c)
|
|||||||
(c >= 0x2008 && c <= 0x200b) ||
|
(c >= 0x2008 && c <= 0x200b) ||
|
||||||
c == 0x205f || c == 0x3000);
|
c == 0x205f || c == 0x3000);
|
||||||
}
|
}
|
||||||
#endif /* MB_CAPABLE */
|
#endif /* _MB_CAPABLE */
|
||||||
|
|
||||||
return (c < 0x100 ? isblank (c) : 0);
|
return (c < 0x100 ? isblank (c) : 0);
|
||||||
}
|
}
|
||||||
|
@ -56,6 +56,7 @@ PORTABILITY
|
|||||||
No supporting OS subroutines are required.
|
No supporting OS subroutines are required.
|
||||||
*/
|
*/
|
||||||
#include <_ansi.h>
|
#include <_ansi.h>
|
||||||
|
#include <newlib.h>
|
||||||
#include <wctype.h>
|
#include <wctype.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@ -70,7 +71,7 @@ _DEFUN(iswcntrl,(c), wint_t c)
|
|||||||
unicode = 0;
|
unicode = 0;
|
||||||
/* fall-through */
|
/* fall-through */
|
||||||
}
|
}
|
||||||
#ifdef MB_CAPABLE
|
#ifdef _MB_CAPABLE
|
||||||
else if (!strcmp (__lc_ctype, "C-JIS"))
|
else if (!strcmp (__lc_ctype, "C-JIS"))
|
||||||
{
|
{
|
||||||
c = __jp2uc (c, JP_JIS);
|
c = __jp2uc (c, JP_JIS);
|
||||||
@ -97,7 +98,7 @@ _DEFUN(iswcntrl,(c), wint_t c)
|
|||||||
(c >= 0x007f && c <= 0x009f) ||
|
(c >= 0x007f && c <= 0x009f) ||
|
||||||
c == 0x2028 || c == 0x2029);
|
c == 0x2028 || c == 0x2029);
|
||||||
}
|
}
|
||||||
#endif /* MB_CAPABLE */
|
#endif /* _MB_CAPABLE */
|
||||||
|
|
||||||
return (c < 0x100 ? iscntrl (c) : 0);
|
return (c < 0x100 ? iscntrl (c) : 0);
|
||||||
}
|
}
|
||||||
|
@ -56,14 +56,15 @@ PORTABILITY
|
|||||||
No supporting OS subroutines are required.
|
No supporting OS subroutines are required.
|
||||||
*/
|
*/
|
||||||
#include <_ansi.h>
|
#include <_ansi.h>
|
||||||
|
#include <newlib.h>
|
||||||
#include <wctype.h>
|
#include <wctype.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include "local.h"
|
#include "local.h"
|
||||||
|
|
||||||
#ifdef MB_CAPABLE
|
#ifdef _MB_CAPABLE
|
||||||
#include "utf8print.h"
|
#include "utf8print.h"
|
||||||
#endif /* MB_CAPABLE */
|
#endif /* _MB_CAPABLE */
|
||||||
|
|
||||||
int
|
int
|
||||||
_DEFUN(iswprint,(c), wint_t c)
|
_DEFUN(iswprint,(c), wint_t c)
|
||||||
@ -74,7 +75,7 @@ _DEFUN(iswprint,(c), wint_t c)
|
|||||||
unicode = 0;
|
unicode = 0;
|
||||||
/* fall-through */
|
/* fall-through */
|
||||||
}
|
}
|
||||||
#ifdef MB_CAPABLE
|
#ifdef _MB_CAPABLE
|
||||||
else if (!strcmp (__lc_ctype, "C-JIS"))
|
else if (!strcmp (__lc_ctype, "C-JIS"))
|
||||||
{
|
{
|
||||||
c = __jp2uc (c, JP_JIS);
|
c = __jp2uc (c, JP_JIS);
|
||||||
@ -390,7 +391,7 @@ _DEFUN(iswprint,(c), wint_t c)
|
|||||||
/* not in table */
|
/* not in table */
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#endif /* MB_CAPABLE */
|
#endif /* _MB_CAPABLE */
|
||||||
|
|
||||||
return (c < (wint_t)0x100 ? isprint (c) : 0);
|
return (c < (wint_t)0x100 ? isprint (c) : 0);
|
||||||
}
|
}
|
||||||
|
@ -56,14 +56,15 @@ PORTABILITY
|
|||||||
No supporting OS subroutines are required.
|
No supporting OS subroutines are required.
|
||||||
*/
|
*/
|
||||||
#include <_ansi.h>
|
#include <_ansi.h>
|
||||||
|
#include <newlib.h>
|
||||||
#include <wctype.h>
|
#include <wctype.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include "local.h"
|
#include "local.h"
|
||||||
|
|
||||||
#ifdef MB_CAPABLE
|
#ifdef _MB_CAPABLE
|
||||||
#include "utf8punct.h"
|
#include "utf8punct.h"
|
||||||
#endif /* MB_CAPABLE */
|
#endif /* _MB_CAPABLE */
|
||||||
|
|
||||||
int
|
int
|
||||||
_DEFUN(iswpunct,(c), wint_t c)
|
_DEFUN(iswpunct,(c), wint_t c)
|
||||||
@ -74,7 +75,7 @@ _DEFUN(iswpunct,(c), wint_t c)
|
|||||||
unicode = 0;
|
unicode = 0;
|
||||||
/* fall-through */
|
/* fall-through */
|
||||||
}
|
}
|
||||||
#ifdef MB_CAPABLE
|
#ifdef _MB_CAPABLE
|
||||||
else if (!strcmp (__lc_ctype, "C-JIS"))
|
else if (!strcmp (__lc_ctype, "C-JIS"))
|
||||||
{
|
{
|
||||||
c = __jp2uc (c, JP_JIS);
|
c = __jp2uc (c, JP_JIS);
|
||||||
@ -325,7 +326,7 @@ _DEFUN(iswpunct,(c), wint_t c)
|
|||||||
/* not in table */
|
/* not in table */
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#endif /* MB_CAPABLE */
|
#endif /* _MB_CAPABLE */
|
||||||
|
|
||||||
return (c < (wint_t)0x100 ? ispunct (c) : 0);
|
return (c < (wint_t)0x100 ? ispunct (c) : 0);
|
||||||
}
|
}
|
||||||
|
@ -56,6 +56,7 @@ PORTABILITY
|
|||||||
No supporting OS subroutines are required.
|
No supporting OS subroutines are required.
|
||||||
*/
|
*/
|
||||||
#include <_ansi.h>
|
#include <_ansi.h>
|
||||||
|
#include <newlib.h>
|
||||||
#include <wctype.h>
|
#include <wctype.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@ -70,7 +71,7 @@ _DEFUN(iswspace,(c), wint_t c)
|
|||||||
unicode = 0;
|
unicode = 0;
|
||||||
/* fall-through */
|
/* fall-through */
|
||||||
}
|
}
|
||||||
#ifdef MB_CAPABLE
|
#ifdef _MB_CAPABLE
|
||||||
else if (!strcmp (__lc_ctype, "C-JIS"))
|
else if (!strcmp (__lc_ctype, "C-JIS"))
|
||||||
{
|
{
|
||||||
c = __jp2uc (c, JP_JIS);
|
c = __jp2uc (c, JP_JIS);
|
||||||
@ -99,7 +100,7 @@ _DEFUN(iswspace,(c), wint_t c)
|
|||||||
c == 0x2028 || c == 0x2029 ||
|
c == 0x2028 || c == 0x2029 ||
|
||||||
c == 0x205f || c == 0x3000);
|
c == 0x205f || c == 0x3000);
|
||||||
}
|
}
|
||||||
#endif /* MB_CAPABLE */
|
#endif /* _MB_CAPABLE */
|
||||||
|
|
||||||
return (c < 0x100 ? isspace (c) : 0);
|
return (c < 0x100 ? isspace (c) : 0);
|
||||||
}
|
}
|
||||||
|
@ -29,7 +29,9 @@
|
|||||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef MB_CAPABLE
|
#include <newlib.h>
|
||||||
|
|
||||||
|
#ifdef _MB_CAPABLE
|
||||||
|
|
||||||
#include <_ansi.h>
|
#include <_ansi.h>
|
||||||
#include <wctype.h>
|
#include <wctype.h>
|
||||||
@ -140,4 +142,4 @@ _DEFUN (__jp2uc, (c, type), wint_t c _AND int type)
|
|||||||
return WEOF;
|
return WEOF;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* MB_CAPABLE */
|
#endif /* _MB_CAPABLE */
|
||||||
|
@ -59,6 +59,7 @@ No supporting OS subroutines are required.
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <_ansi.h>
|
#include <_ansi.h>
|
||||||
|
#include <newlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <reent.h>
|
#include <reent.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
@ -75,7 +76,7 @@ _DEFUN(towlower,(c), wint_t c)
|
|||||||
unicode = 0;
|
unicode = 0;
|
||||||
/* fall-through */
|
/* fall-through */
|
||||||
}
|
}
|
||||||
#ifdef MB_CAPABLE
|
#ifdef _MB_CAPABLE
|
||||||
else if (!strcmp (__lc_ctype, "C-JIS"))
|
else if (!strcmp (__lc_ctype, "C-JIS"))
|
||||||
{
|
{
|
||||||
c = __jp2uc (c, JP_JIS);
|
c = __jp2uc (c, JP_JIS);
|
||||||
@ -471,7 +472,7 @@ _DEFUN(towlower,(c), wint_t c)
|
|||||||
return 0x00e5;
|
return 0x00e5;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif /* MB_CAPABLE */
|
#endif /* _MB_CAPABLE */
|
||||||
|
|
||||||
return (c < 0x00ff ? (wint_t)(tolower ((int)c)) : c);
|
return (c < 0x00ff ? (wint_t)(tolower ((int)c)) : c);
|
||||||
}
|
}
|
||||||
|
@ -59,6 +59,7 @@ No supporting OS subroutines are required.
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <_ansi.h>
|
#include <_ansi.h>
|
||||||
|
#include <newlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <reent.h>
|
#include <reent.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
@ -75,7 +76,7 @@ _DEFUN(towupper,(c), wint_t c)
|
|||||||
unicode = 0;
|
unicode = 0;
|
||||||
/* fall-through */
|
/* fall-through */
|
||||||
}
|
}
|
||||||
#ifdef MB_CAPABLE
|
#ifdef _MB_CAPABLE
|
||||||
else if (!strcmp (__lc_ctype, "C-JIS"))
|
else if (!strcmp (__lc_ctype, "C-JIS"))
|
||||||
{
|
{
|
||||||
c = __jp2uc (c, JP_JIS);
|
c = __jp2uc (c, JP_JIS);
|
||||||
@ -498,7 +499,7 @@ _DEFUN(towupper,(c), wint_t c)
|
|||||||
return (c - 0x28);
|
return (c - 0x28);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif /* MB_CAPABLE */
|
#endif /* _MB_CAPABLE */
|
||||||
|
|
||||||
return (c < 0x00ff ? (wint_t)(toupper ((int)c)) : c);
|
return (c < 0x00ff ? (wint_t)(toupper ((int)c)) : c);
|
||||||
}
|
}
|
||||||
|
@ -44,7 +44,7 @@ locale.
|
|||||||
|
|
||||||
This is a minimal implementation, supporting only the required <<"C">>
|
This is a minimal implementation, supporting only the required <<"C">>
|
||||||
value for <[locale]>; strings representing other locales are not
|
value for <[locale]>; strings representing other locales are not
|
||||||
honored unless MB_CAPABLE is defined in which case three new
|
honored unless _MB_CAPABLE is defined in which case three new
|
||||||
extensions are allowed for LC_CTYPE or LC_MESSAGES only: <<"C-JIS">>,
|
extensions are allowed for LC_CTYPE or LC_MESSAGES only: <<"C-JIS">>,
|
||||||
<<"C-EUCJP">>, <<"C-SJIS">>, or <<"C-ISO-8859-1">>. (<<"">> is
|
<<"C-EUCJP">>, <<"C-SJIS">>, or <<"C-ISO-8859-1">>. (<<"">> is
|
||||||
also accepted; it represents the default locale
|
also accepted; it represents the default locale
|
||||||
@ -86,6 +86,7 @@ No supporting OS subroutines are required.
|
|||||||
* (Only "C" or null supported).
|
* (Only "C" or null supported).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <newlib.h>
|
||||||
#include <locale.h>
|
#include <locale.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
@ -120,7 +121,7 @@ _DEFUN(_setlocale_r, (p, category, locale),
|
|||||||
int category _AND
|
int category _AND
|
||||||
_CONST char *locale)
|
_CONST char *locale)
|
||||||
{
|
{
|
||||||
#ifndef MB_CAPABLE
|
#ifndef _MB_CAPABLE
|
||||||
if (locale)
|
if (locale)
|
||||||
{
|
{
|
||||||
if (strcmp (locale, "C") && strcmp (locale, ""))
|
if (strcmp (locale, "C") && strcmp (locale, ""))
|
||||||
|
@ -103,6 +103,7 @@ Supporting OS subroutines required:
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <_ansi.h>
|
#include <_ansi.h>
|
||||||
|
#include <newlib.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@ -279,7 +280,7 @@ __svfscanf_r (rptr, fp, fmt0, ap)
|
|||||||
char buf[BUF]; /* buffer for numeric conversions */
|
char buf[BUF]; /* buffer for numeric conversions */
|
||||||
vec_union vec_buf;
|
vec_union vec_buf;
|
||||||
char *lptr; /* literal pointer */
|
char *lptr; /* literal pointer */
|
||||||
#ifdef MB_CAPABLE
|
#ifdef _MB_CAPABLE
|
||||||
mbstate_t state; /* value to keep track of multibyte state */
|
mbstate_t state; /* value to keep track of multibyte state */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -304,7 +305,7 @@ __svfscanf_r (rptr, fp, fmt0, ap)
|
|||||||
nread = 0;
|
nread = 0;
|
||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
#ifndef MB_CAPABLE
|
#ifndef _MB_CAPABLE
|
||||||
wc = *fmt;
|
wc = *fmt;
|
||||||
#else
|
#else
|
||||||
memset (&state, '\0', sizeof (state));
|
memset (&state, '\0', sizeof (state));
|
||||||
|
@ -180,6 +180,7 @@ static char *rcsid = "$Id$";
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <_ansi.h>
|
#include <_ansi.h>
|
||||||
|
#include <newlib.h>
|
||||||
#include <reent.h>
|
#include <reent.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@ -440,7 +441,7 @@ _DEFUN(_VFPRINTF_R, (data, fp, fmt0, ap),
|
|||||||
struct __siov iov[NIOV];/* ... and individual io vectors */
|
struct __siov iov[NIOV];/* ... and individual io vectors */
|
||||||
char buf[BUF]; /* space for %c, %[diouxX], %[eEfgG] */
|
char buf[BUF]; /* space for %c, %[diouxX], %[eEfgG] */
|
||||||
char ox[2]; /* space for 0x hex-prefix */
|
char ox[2]; /* space for 0x hex-prefix */
|
||||||
#ifdef MB_CAPABLE
|
#ifdef _MB_CAPABLE
|
||||||
wchar_t wc;
|
wchar_t wc;
|
||||||
mbstate_t state; /* mbtowc calls from library must not change state */
|
mbstate_t state; /* mbtowc calls from library must not change state */
|
||||||
#endif
|
#endif
|
||||||
@ -457,7 +458,7 @@ _DEFUN(_VFPRINTF_R, (data, fp, fmt0, ap),
|
|||||||
static _CONST char zeroes[PADSIZE] =
|
static _CONST char zeroes[PADSIZE] =
|
||||||
{'0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0'};
|
{'0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0'};
|
||||||
|
|
||||||
#ifdef MB_CAPABLE
|
#ifdef _MB_CAPABLE
|
||||||
memset (&state, '\0', sizeof (state));
|
memset (&state, '\0', sizeof (state));
|
||||||
#endif
|
#endif
|
||||||
/*
|
/*
|
||||||
@ -560,7 +561,7 @@ _DEFUN(_VFPRINTF_R, (data, fp, fmt0, ap),
|
|||||||
*/
|
*/
|
||||||
for (;;) {
|
for (;;) {
|
||||||
cp = fmt;
|
cp = fmt;
|
||||||
#ifdef MB_CAPABLE
|
#ifdef _MB_CAPABLE
|
||||||
while ((n = _mbtowc_r (data, &wc, fmt, MB_CUR_MAX, &state)) > 0) {
|
while ((n = _mbtowc_r (data, &wc, fmt, MB_CUR_MAX, &state)) > 0) {
|
||||||
if (wc == '%')
|
if (wc == '%')
|
||||||
break;
|
break;
|
||||||
@ -574,7 +575,7 @@ _DEFUN(_VFPRINTF_R, (data, fp, fmt0, ap),
|
|||||||
PRINT (cp, m);
|
PRINT (cp, m);
|
||||||
ret += m;
|
ret += m;
|
||||||
}
|
}
|
||||||
#ifdef MB_CAPABLE
|
#ifdef _MB_CAPABLE
|
||||||
if (n <= 0)
|
if (n <= 0)
|
||||||
goto done;
|
goto done;
|
||||||
#else
|
#else
|
||||||
@ -1491,7 +1492,7 @@ _DEFUN(get_arg, (data, n, fmt, ap, numargs_p, args, arg_type, last_fmt),
|
|||||||
int pos, last_arg;
|
int pos, last_arg;
|
||||||
int max_pos_arg = n;
|
int max_pos_arg = n;
|
||||||
enum types { INT, LONG_INT, SHORT_INT, QUAD_INT, CHAR, CHAR_PTR, DOUBLE, LONG_DOUBLE, WIDE_CHAR };
|
enum types { INT, LONG_INT, SHORT_INT, QUAD_INT, CHAR, CHAR_PTR, DOUBLE, LONG_DOUBLE, WIDE_CHAR };
|
||||||
#ifdef MB_CAPABLE
|
#ifdef _MB_CAPABLE
|
||||||
wchar_t wc;
|
wchar_t wc;
|
||||||
mbstate_t wc_state;
|
mbstate_t wc_state;
|
||||||
int nbytes;
|
int nbytes;
|
||||||
@ -1501,7 +1502,7 @@ _DEFUN(get_arg, (data, n, fmt, ap, numargs_p, args, arg_type, last_fmt),
|
|||||||
if (*last_fmt != NULL)
|
if (*last_fmt != NULL)
|
||||||
fmt = *last_fmt;
|
fmt = *last_fmt;
|
||||||
|
|
||||||
#ifdef MB_CAPABLE
|
#ifdef _MB_CAPABLE
|
||||||
memset (&wc_state, '\0', sizeof (wc_state));
|
memset (&wc_state, '\0', sizeof (wc_state));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -1509,7 +1510,7 @@ _DEFUN(get_arg, (data, n, fmt, ap, numargs_p, args, arg_type, last_fmt),
|
|||||||
read the desired parameter from the vararg list. */
|
read the desired parameter from the vararg list. */
|
||||||
while (*fmt && n >= numargs)
|
while (*fmt && n >= numargs)
|
||||||
{
|
{
|
||||||
#ifdef MB_CAPABLE
|
#ifdef _MB_CAPABLE
|
||||||
while ((nbytes = _mbtowc_r (data, &wc, fmt, MB_CUR_MAX, &wc_state)) > 0)
|
while ((nbytes = _mbtowc_r (data, &wc, fmt, MB_CUR_MAX, &wc_state)) > 0)
|
||||||
{
|
{
|
||||||
fmt += nbytes;
|
fmt += nbytes;
|
||||||
|
@ -103,6 +103,7 @@ Supporting OS subroutines required:
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <_ansi.h>
|
#include <_ansi.h>
|
||||||
|
#include <newlib.h>
|
||||||
#include <reent.h>
|
#include <reent.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <wctype.h>
|
#include <wctype.h>
|
||||||
@ -293,7 +294,7 @@ _DEFUN(__svfscanf_r, (rptr, fp, fmt0, ap),
|
|||||||
nread = 0;
|
nread = 0;
|
||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
#ifndef MB_CAPABLE
|
#ifndef _MB_CAPABLE
|
||||||
wc = *fmt;
|
wc = *fmt;
|
||||||
#else
|
#else
|
||||||
memset (&state, '\0', sizeof (state));
|
memset (&state, '\0', sizeof (state));
|
||||||
|
@ -16,20 +16,20 @@ TRAD_SYNOPSIS
|
|||||||
size_t <[n]>;
|
size_t <[n]>;
|
||||||
|
|
||||||
DESCRIPTION
|
DESCRIPTION
|
||||||
When MB_CAPABLE is not defined, this is a minimal ANSI-conforming
|
When _MB_CAPABLE is not defined, this is a minimal ANSI-conforming
|
||||||
implementation of <<mblen>>. In this case, the
|
implementation of <<mblen>>. In this case, the
|
||||||
only ``multi-byte character sequences'' recognized are single bytes,
|
only ``multi-byte character sequences'' recognized are single bytes,
|
||||||
and thus <<1>> is returned unless <[s]> is the null pointer or
|
and thus <<1>> is returned unless <[s]> is the null pointer or
|
||||||
has a length of 0 or is the empty string.
|
has a length of 0 or is the empty string.
|
||||||
|
|
||||||
When MB_CAPABLE is defined, this routine calls <<_mbtowc_r>> to perform
|
When _MB_CAPABLE is defined, this routine calls <<_mbtowc_r>> to perform
|
||||||
the conversion, passing a state variable to allow state dependent
|
the conversion, passing a state variable to allow state dependent
|
||||||
decoding. The result is based on the locale setting which may
|
decoding. The result is based on the locale setting which may
|
||||||
be restricted to a defined set of locales.
|
be restricted to a defined set of locales.
|
||||||
|
|
||||||
RETURNS
|
RETURNS
|
||||||
This implementation of <<mblen>> returns <<0>> if
|
This implementation of <<mblen>> returns <<0>> if
|
||||||
<[s]> is <<NULL>> or the empty string; it returns <<1>> if not MB_CAPABLE or
|
<[s]> is <<NULL>> or the empty string; it returns <<1>> if not _MB_CAPABLE or
|
||||||
the character is a single-byte character; it returns <<-1>>
|
the character is a single-byte character; it returns <<-1>>
|
||||||
if the multi-byte character is invalid; otherwise it returns
|
if the multi-byte character is invalid; otherwise it returns
|
||||||
the number of bytes in the multibyte character.
|
the number of bytes in the multibyte character.
|
||||||
@ -43,6 +43,7 @@ effects vary with the locale.
|
|||||||
|
|
||||||
#ifndef _REENT_ONLY
|
#ifndef _REENT_ONLY
|
||||||
|
|
||||||
|
#include <newlib.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <wchar.h>
|
#include <wchar.h>
|
||||||
|
|
||||||
@ -51,7 +52,7 @@ _DEFUN (mblen, (s, n),
|
|||||||
const char *s _AND
|
const char *s _AND
|
||||||
size_t n)
|
size_t n)
|
||||||
{
|
{
|
||||||
#ifdef MB_CAPABLE
|
#ifdef _MB_CAPABLE
|
||||||
int retval = 0;
|
int retval = 0;
|
||||||
mbstate_t *state;
|
mbstate_t *state;
|
||||||
|
|
||||||
@ -66,13 +67,13 @@ _DEFUN (mblen, (s, n),
|
|||||||
else
|
else
|
||||||
return retval;
|
return retval;
|
||||||
|
|
||||||
#else /* not MB_CAPABLE */
|
#else /* not _MB_CAPABLE */
|
||||||
if (s == NULL || *s == '\0')
|
if (s == NULL || *s == '\0')
|
||||||
return 0;
|
return 0;
|
||||||
if (n == 0)
|
if (n == 0)
|
||||||
return -1;
|
return -1;
|
||||||
return 1;
|
return 1;
|
||||||
#endif /* not MB_CAPABLE */
|
#endif /* not _MB_CAPABLE */
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* !_REENT_ONLY */
|
#endif /* !_REENT_ONLY */
|
||||||
|
@ -18,20 +18,20 @@ TRAD_SYNOPSIS
|
|||||||
int *<[state]>;
|
int *<[state]>;
|
||||||
|
|
||||||
DESCRIPTION
|
DESCRIPTION
|
||||||
When MB_CAPABLE is not defined, this is a minimal ANSI-conforming
|
When _MB_CAPABLE is not defined, this is a minimal ANSI-conforming
|
||||||
implementation of <<_mblen_r>>. In this case, the
|
implementation of <<_mblen_r>>. In this case, the
|
||||||
only ``multi-byte character sequences'' recognized are single bytes,
|
only ``multi-byte character sequences'' recognized are single bytes,
|
||||||
and thus <<1>> is returned unless <[s]> is the null pointer or
|
and thus <<1>> is returned unless <[s]> is the null pointer or
|
||||||
has a length of 0 or is the empty string.
|
has a length of 0 or is the empty string.
|
||||||
|
|
||||||
When MB_CAPABLE is defined, this routine calls <<_mbtowc_r>> to perform
|
When _MB_CAPABLE is defined, this routine calls <<_mbtowc_r>> to perform
|
||||||
the conversion, passing a state variable to allow state dependent
|
the conversion, passing a state variable to allow state dependent
|
||||||
decoding. The result is based on the locale setting which may
|
decoding. The result is based on the locale setting which may
|
||||||
be restricted to a defined set of locales.
|
be restricted to a defined set of locales.
|
||||||
|
|
||||||
RETURNS
|
RETURNS
|
||||||
This implementation of <<_mblen_r>> returns <<0>> if
|
This implementation of <<_mblen_r>> returns <<0>> if
|
||||||
<[s]> is <<NULL>> or the empty string; it returns <<1>> if not MB_CAPABLE or
|
<[s]> is <<NULL>> or the empty string; it returns <<1>> if not _MB_CAPABLE or
|
||||||
the character is a single-byte character; it returns <<-1>>
|
the character is a single-byte character; it returns <<-1>>
|
||||||
if the multi-byte character is invalid; otherwise it returns
|
if the multi-byte character is invalid; otherwise it returns
|
||||||
the number of bytes in the multibyte character.
|
the number of bytes in the multibyte character.
|
||||||
@ -43,6 +43,7 @@ effects vary with the locale.
|
|||||||
<<_mblen_r>> requires no supporting OS subroutines.
|
<<_mblen_r>> requires no supporting OS subroutines.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <newlib.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <wchar.h>
|
#include <wchar.h>
|
||||||
|
|
||||||
@ -53,7 +54,7 @@ _DEFUN (_mblen_r, (r, s, n, state),
|
|||||||
size_t n _AND
|
size_t n _AND
|
||||||
mbstate_t *state)
|
mbstate_t *state)
|
||||||
{
|
{
|
||||||
#ifdef MB_CAPABLE
|
#ifdef _MB_CAPABLE
|
||||||
int retval;
|
int retval;
|
||||||
retval = _mbtowc_r (r, NULL, s, n, state);
|
retval = _mbtowc_r (r, NULL, s, n, state);
|
||||||
|
|
||||||
@ -64,12 +65,12 @@ _DEFUN (_mblen_r, (r, s, n, state),
|
|||||||
}
|
}
|
||||||
|
|
||||||
return retval;
|
return retval;
|
||||||
#else /* not MB_CAPABLE */
|
#else /* not _MB_CAPABLE */
|
||||||
if (s == NULL || *s == '\0')
|
if (s == NULL || *s == '\0')
|
||||||
return 0;
|
return 0;
|
||||||
if (n == 0)
|
if (n == 0)
|
||||||
return -1;
|
return -1;
|
||||||
return 1;
|
return 1;
|
||||||
#endif /* not MB_CAPABLE */
|
#endif /* not _MB_CAPABLE */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
#include <reent.h>
|
#include <reent.h>
|
||||||
|
#include <newlib.h>
|
||||||
#include <wchar.h>
|
#include <wchar.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@ -7,7 +8,7 @@
|
|||||||
size_t
|
size_t
|
||||||
mbrlen(const char *s, size_t n, mbstate_t *ps)
|
mbrlen(const char *s, size_t n, mbstate_t *ps)
|
||||||
{
|
{
|
||||||
#ifdef MB_CAPABLE
|
#ifdef _MB_CAPABLE
|
||||||
if (ps == NULL)
|
if (ps == NULL)
|
||||||
{
|
{
|
||||||
_REENT_CHECK_MISC(_REENT);
|
_REENT_CHECK_MISC(_REENT);
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
#include <reent.h>
|
#include <reent.h>
|
||||||
|
#include <newlib.h>
|
||||||
#include <wchar.h>
|
#include <wchar.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@ -15,7 +16,7 @@ _DEFUN (_mbrtowc_r, (ptr, pwc, s, n, ps),
|
|||||||
{
|
{
|
||||||
int retval = 0;
|
int retval = 0;
|
||||||
|
|
||||||
#ifdef MB_CAPABLE
|
#ifdef _MB_CAPABLE
|
||||||
if (ps == NULL)
|
if (ps == NULL)
|
||||||
{
|
{
|
||||||
_REENT_CHECK_MISC(ptr);
|
_REENT_CHECK_MISC(ptr);
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
#include <reent.h>
|
#include <reent.h>
|
||||||
|
#include <newlib.h>
|
||||||
#include <wchar.h>
|
#include <wchar.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@ -18,7 +19,7 @@ _DEFUN (_mbsrtowcs_r, (r, dst, src, n, ps),
|
|||||||
size_t count = 0;
|
size_t count = 0;
|
||||||
int bytes;
|
int bytes;
|
||||||
|
|
||||||
#ifdef MB_CAPABLE
|
#ifdef _MB_CAPABLE
|
||||||
if (ps == NULL)
|
if (ps == NULL)
|
||||||
{
|
{
|
||||||
_REENT_CHECK_MISC(r);
|
_REENT_CHECK_MISC(r);
|
||||||
|
@ -17,13 +17,13 @@ TRAD_SYNOPSIS
|
|||||||
size_t <[n]>;
|
size_t <[n]>;
|
||||||
|
|
||||||
DESCRIPTION
|
DESCRIPTION
|
||||||
When MB_CAPABLE is not defined, this is a minimal ANSI-conforming
|
When _MB_CAPABLE is not defined, this is a minimal ANSI-conforming
|
||||||
implementation of <<mbstowcs>>. In this case, the
|
implementation of <<mbstowcs>>. In this case, the
|
||||||
only ``multi-byte character sequences'' recognized are single bytes,
|
only ``multi-byte character sequences'' recognized are single bytes,
|
||||||
and they are ``converted'' to wide-char versions simply by byte
|
and they are ``converted'' to wide-char versions simply by byte
|
||||||
extension.
|
extension.
|
||||||
|
|
||||||
When MB_CAPABLE is defined, this routine calls <<_mbstowcs_r>> to perform
|
When _MB_CAPABLE is defined, this routine calls <<_mbstowcs_r>> to perform
|
||||||
the conversion, passing a state variable to allow state dependent
|
the conversion, passing a state variable to allow state dependent
|
||||||
decoding. The result is based on the locale setting which may
|
decoding. The result is based on the locale setting which may
|
||||||
be restricted to a defined set of locales.
|
be restricted to a defined set of locales.
|
||||||
@ -31,7 +31,7 @@ be restricted to a defined set of locales.
|
|||||||
RETURNS
|
RETURNS
|
||||||
This implementation of <<mbstowcs>> returns <<0>> if
|
This implementation of <<mbstowcs>> returns <<0>> if
|
||||||
<[s]> is <<NULL>> or is the empty string;
|
<[s]> is <<NULL>> or is the empty string;
|
||||||
it returns <<-1>> if MB_CAPABLE and one of the
|
it returns <<-1>> if _MB_CAPABLE and one of the
|
||||||
multi-byte characters is invalid or incomplete;
|
multi-byte characters is invalid or incomplete;
|
||||||
otherwise it returns the minimum of: <<n>> or the
|
otherwise it returns the minimum of: <<n>> or the
|
||||||
number of multi-byte characters in <<s>> plus 1 (to
|
number of multi-byte characters in <<s>> plus 1 (to
|
||||||
@ -49,6 +49,7 @@ effects vary with the locale.
|
|||||||
|
|
||||||
#ifndef _REENT_ONLY
|
#ifndef _REENT_ONLY
|
||||||
|
|
||||||
|
#include <newlib.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <wchar.h>
|
#include <wchar.h>
|
||||||
|
|
||||||
@ -58,12 +59,12 @@ _DEFUN (mbstowcs, (pwcs, s, n),
|
|||||||
const char *s _AND
|
const char *s _AND
|
||||||
size_t n)
|
size_t n)
|
||||||
{
|
{
|
||||||
#ifdef MB_CAPABLE
|
#ifdef _MB_CAPABLE
|
||||||
mbstate_t state;
|
mbstate_t state;
|
||||||
state.__count = 0;
|
state.__count = 0;
|
||||||
|
|
||||||
return _mbstowcs_r (_REENT, pwcs, s, n, &state);
|
return _mbstowcs_r (_REENT, pwcs, s, n, &state);
|
||||||
#else /* not MB_CAPABLE */
|
#else /* not _MB_CAPABLE */
|
||||||
|
|
||||||
int count = 0;
|
int count = 0;
|
||||||
|
|
||||||
@ -76,7 +77,7 @@ _DEFUN (mbstowcs, (pwcs, s, n),
|
|||||||
}
|
}
|
||||||
|
|
||||||
return count;
|
return count;
|
||||||
#endif /* not MB_CAPABLE */
|
#endif /* not _MB_CAPABLE */
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* !_REENT_ONLY */
|
#endif /* !_REENT_ONLY */
|
||||||
|
@ -17,7 +17,7 @@ TRAD_SYNOPSIS
|
|||||||
size_t <[n]>;
|
size_t <[n]>;
|
||||||
|
|
||||||
DESCRIPTION
|
DESCRIPTION
|
||||||
When MB_CAPABLE is not defined, this is a minimal ANSI-conforming
|
When _MB_CAPABLE is not defined, this is a minimal ANSI-conforming
|
||||||
implementation of <<mbtowc>>. In this case,
|
implementation of <<mbtowc>>. In this case,
|
||||||
only ``multi-byte character sequences'' recognized are single bytes,
|
only ``multi-byte character sequences'' recognized are single bytes,
|
||||||
and they are ``converted'' to themselves.
|
and they are ``converted'' to themselves.
|
||||||
@ -25,7 +25,7 @@ Each call to <<mbtowc>> copies one character from <<*<[s]>>> to
|
|||||||
<<*<[pwc]>>>, unless <[s]> is a null pointer. The argument n
|
<<*<[pwc]>>>, unless <[s]> is a null pointer. The argument n
|
||||||
is ignored.
|
is ignored.
|
||||||
|
|
||||||
When MB_CAPABLE is defined, this routine calls <<_mbtowc_r>> to perform
|
When _MB_CAPABLE is defined, this routine calls <<_mbtowc_r>> to perform
|
||||||
the conversion, passing a state variable to allow state dependent
|
the conversion, passing a state variable to allow state dependent
|
||||||
decoding. The result is based on the locale setting which may
|
decoding. The result is based on the locale setting which may
|
||||||
be restricted to a defined set of locales.
|
be restricted to a defined set of locales.
|
||||||
@ -33,7 +33,7 @@ be restricted to a defined set of locales.
|
|||||||
RETURNS
|
RETURNS
|
||||||
This implementation of <<mbtowc>> returns <<0>> if
|
This implementation of <<mbtowc>> returns <<0>> if
|
||||||
<[s]> is <<NULL>> or is the empty string;
|
<[s]> is <<NULL>> or is the empty string;
|
||||||
it returns <<1>> if not MB_CAPABLE or
|
it returns <<1>> if not _MB_CAPABLE or
|
||||||
the character is a single-byte character; it returns <<-1>>
|
the character is a single-byte character; it returns <<-1>>
|
||||||
if n is <<0>> or the multi-byte character is invalid;
|
if n is <<0>> or the multi-byte character is invalid;
|
||||||
otherwise it returns the number of bytes in the multibyte character.
|
otherwise it returns the number of bytes in the multibyte character.
|
||||||
@ -51,6 +51,7 @@ effects vary with the locale.
|
|||||||
|
|
||||||
#ifndef _REENT_ONLY
|
#ifndef _REENT_ONLY
|
||||||
|
|
||||||
|
#include <newlib.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <wchar.h>
|
#include <wchar.h>
|
||||||
|
|
||||||
@ -60,7 +61,7 @@ _DEFUN (mbtowc, (pwc, s, n),
|
|||||||
const char *s _AND
|
const char *s _AND
|
||||||
size_t n)
|
size_t n)
|
||||||
{
|
{
|
||||||
#ifdef MB_CAPABLE
|
#ifdef _MB_CAPABLE
|
||||||
int retval = 0;
|
int retval = 0;
|
||||||
mbstate_t *ps;
|
mbstate_t *ps;
|
||||||
|
|
||||||
@ -75,7 +76,7 @@ _DEFUN (mbtowc, (pwc, s, n),
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
return retval;
|
return retval;
|
||||||
#else /* not MB_CAPABLE */
|
#else /* not _MB_CAPABLE */
|
||||||
if (s == NULL)
|
if (s == NULL)
|
||||||
return 0;
|
return 0;
|
||||||
if (n == 0)
|
if (n == 0)
|
||||||
@ -83,7 +84,7 @@ _DEFUN (mbtowc, (pwc, s, n),
|
|||||||
if (pwc)
|
if (pwc)
|
||||||
*pwc = (wchar_t) *s;
|
*pwc = (wchar_t) *s;
|
||||||
return (*s != '\0');
|
return (*s != '\0');
|
||||||
#endif /* not MB_CAPABLE */
|
#endif /* not _MB_CAPABLE */
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* !_REENT_ONLY */
|
#endif /* !_REENT_ONLY */
|
||||||
|
@ -1,10 +1,11 @@
|
|||||||
|
#include <newlib.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <locale.h>
|
#include <locale.h>
|
||||||
#include "mbctype.h"
|
#include "mbctype.h"
|
||||||
#include <wchar.h>
|
#include <wchar.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#ifdef MB_CAPABLE
|
#ifdef _MB_CAPABLE
|
||||||
typedef enum { ESCAPE, DOLLAR, BRACKET, AT, B, J,
|
typedef enum { ESCAPE, DOLLAR, BRACKET, AT, B, J,
|
||||||
NUL, JIS_CHAR, OTHER, JIS_C_NUM } JIS_CHAR_TYPE;
|
NUL, JIS_CHAR, OTHER, JIS_C_NUM } JIS_CHAR_TYPE;
|
||||||
typedef enum { ASCII, JIS, A_ESC, A_ESC_DL, JIS_1, J_ESC, J_ESC_BR,
|
typedef enum { ASCII, JIS, A_ESC, A_ESC_DL, JIS_1, J_ESC, J_ESC_BR,
|
||||||
@ -39,7 +40,7 @@ static JIS_ACTION JIS_action_table[JIS_S_NUM][JIS_C_NUM] = {
|
|||||||
/* J_ESC */ { ERROR, ERROR, NOOP, ERROR, ERROR, ERROR, ERROR, ERROR, ERROR },
|
/* J_ESC */ { ERROR, ERROR, NOOP, ERROR, ERROR, ERROR, ERROR, ERROR, ERROR },
|
||||||
/* J_ESC_BR */{ ERROR, ERROR, ERROR, ERROR, MAKE_A, MAKE_A, ERROR, ERROR, ERROR },
|
/* J_ESC_BR */{ ERROR, ERROR, ERROR, ERROR, MAKE_A, MAKE_A, ERROR, ERROR, ERROR },
|
||||||
};
|
};
|
||||||
#endif /* MB_CAPABLE */
|
#endif /* _MB_CAPABLE */
|
||||||
|
|
||||||
/* we override the mbstate_t __count field for more complex encodings and use it store a state value */
|
/* we override the mbstate_t __count field for more complex encodings and use it store a state value */
|
||||||
#define __state __count
|
#define __state __count
|
||||||
@ -63,7 +64,7 @@ _DEFUN (_mbtowc_r, (r, pwc, s, n, state),
|
|||||||
if (s != NULL && n == 0)
|
if (s != NULL && n == 0)
|
||||||
return -2;
|
return -2;
|
||||||
|
|
||||||
#ifdef MB_CAPABLE
|
#ifdef _MB_CAPABLE
|
||||||
if (__lc_ctype == NULL ||
|
if (__lc_ctype == NULL ||
|
||||||
(strlen (__lc_ctype) <= 1))
|
(strlen (__lc_ctype) <= 1))
|
||||||
{ /* fall-through */ }
|
{ /* fall-through */ }
|
||||||
@ -455,7 +456,7 @@ _DEFUN (_mbtowc_r, (r, pwc, s, n, state),
|
|||||||
state->__state = curr_state;
|
state->__state = curr_state;
|
||||||
return -2; /* n < bytes needed */
|
return -2; /* n < bytes needed */
|
||||||
}
|
}
|
||||||
#endif /* MB_CAPABLE */
|
#endif /* _MB_CAPABLE */
|
||||||
|
|
||||||
/* otherwise this must be the "C" locale or unknown locale */
|
/* otherwise this must be the "C" locale or unknown locale */
|
||||||
if (s == NULL)
|
if (s == NULL)
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
#include <reent.h>
|
#include <reent.h>
|
||||||
|
#include <newlib.h>
|
||||||
#include <wchar.h>
|
#include <wchar.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@ -14,7 +15,7 @@ _DEFUN (_wcrtomb_r, (ptr, s, wc, ps),
|
|||||||
int retval = 0;
|
int retval = 0;
|
||||||
char buf[10];
|
char buf[10];
|
||||||
|
|
||||||
#ifdef MB_CAPABLE
|
#ifdef _MB_CAPABLE
|
||||||
if (ps == NULL)
|
if (ps == NULL)
|
||||||
{
|
{
|
||||||
_REENT_CHECK_MISC(ptr);
|
_REENT_CHECK_MISC(ptr);
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
#include <reent.h>
|
#include <reent.h>
|
||||||
|
#include <newlib.h>
|
||||||
#include <wchar.h>
|
#include <wchar.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@ -18,7 +19,7 @@ _DEFUN (_wcsrtombs_r, (r, dst, src, len, ps),
|
|||||||
size_t n;
|
size_t n;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
#ifdef MB_CAPABLE
|
#ifdef _MB_CAPABLE
|
||||||
if (ps == NULL)
|
if (ps == NULL)
|
||||||
{
|
{
|
||||||
_REENT_CHECK_MISC(r);
|
_REENT_CHECK_MISC(r);
|
||||||
|
@ -17,12 +17,12 @@ TRAD_SYNOPSIS
|
|||||||
size_t <[n]>;
|
size_t <[n]>;
|
||||||
|
|
||||||
DESCRIPTION
|
DESCRIPTION
|
||||||
When MB_CAPABLE is not defined, this is a minimal ANSI-conforming
|
When _MB_CAPABLE is not defined, this is a minimal ANSI-conforming
|
||||||
implementation of <<wcstombs>>. In this case,
|
implementation of <<wcstombs>>. In this case,
|
||||||
all wide-characters are expected to represent single bytes and so
|
all wide-characters are expected to represent single bytes and so
|
||||||
are converted simply by casting to char.
|
are converted simply by casting to char.
|
||||||
|
|
||||||
When MB_CAPABLE is defined, this routine calls <<_wcstombs_r>> to perform
|
When _MB_CAPABLE is defined, this routine calls <<_wcstombs_r>> to perform
|
||||||
the conversion, passing a state variable to allow state dependent
|
the conversion, passing a state variable to allow state dependent
|
||||||
decoding. The result is based on the locale setting which may
|
decoding. The result is based on the locale setting which may
|
||||||
be restricted to a defined set of locales.
|
be restricted to a defined set of locales.
|
||||||
@ -30,7 +30,7 @@ be restricted to a defined set of locales.
|
|||||||
RETURNS
|
RETURNS
|
||||||
This implementation of <<wcstombs>> returns <<0>> if
|
This implementation of <<wcstombs>> returns <<0>> if
|
||||||
<[s]> is <<NULL>> or is the empty string;
|
<[s]> is <<NULL>> or is the empty string;
|
||||||
it returns <<-1>> if MB_CAPABLE and one of the
|
it returns <<-1>> if _MB_CAPABLE and one of the
|
||||||
wide-char characters does not represent a valid multi-byte character;
|
wide-char characters does not represent a valid multi-byte character;
|
||||||
otherwise it returns the minimum of: <<n>> or the
|
otherwise it returns the minimum of: <<n>> or the
|
||||||
number of bytes that are transferred to <<s>>, not including the
|
number of bytes that are transferred to <<s>>, not including the
|
||||||
@ -50,6 +50,7 @@ effects vary with the locale.
|
|||||||
|
|
||||||
#ifndef _REENT_ONLY
|
#ifndef _REENT_ONLY
|
||||||
|
|
||||||
|
#include <newlib.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <wchar.h>
|
#include <wchar.h>
|
||||||
|
|
||||||
@ -59,12 +60,12 @@ _DEFUN (wcstombs, (s, pwcs, n),
|
|||||||
const wchar_t *pwcs _AND
|
const wchar_t *pwcs _AND
|
||||||
size_t n)
|
size_t n)
|
||||||
{
|
{
|
||||||
#ifdef MB_CAPABLE
|
#ifdef _MB_CAPABLE
|
||||||
mbstate_t state;
|
mbstate_t state;
|
||||||
state.__count = 0;
|
state.__count = 0;
|
||||||
|
|
||||||
return _wcstombs_r (_REENT, s, pwcs, n, &state);
|
return _wcstombs_r (_REENT, s, pwcs, n, &state);
|
||||||
#else /* not MB_CAPABLE */
|
#else /* not _MB_CAPABLE */
|
||||||
int count = 0;
|
int count = 0;
|
||||||
|
|
||||||
if (n != 0) {
|
if (n != 0) {
|
||||||
@ -76,7 +77,7 @@ _DEFUN (wcstombs, (s, pwcs, n),
|
|||||||
}
|
}
|
||||||
|
|
||||||
return count;
|
return count;
|
||||||
#endif /* not MB_CAPABLE */
|
#endif /* not _MB_CAPABLE */
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* !_REENT_ONLY */
|
#endif /* !_REENT_ONLY */
|
||||||
|
@ -16,24 +16,24 @@ TRAD_SYNOPSIS
|
|||||||
wchar_t <[wchar]>;
|
wchar_t <[wchar]>;
|
||||||
|
|
||||||
DESCRIPTION
|
DESCRIPTION
|
||||||
When MB_CAPABLE is not defined, this is a minimal ANSI-conforming
|
When _MB_CAPABLE is not defined, this is a minimal ANSI-conforming
|
||||||
implementation of <<wctomb>>. The
|
implementation of <<wctomb>>. The
|
||||||
only ``wide characters'' recognized are single bytes,
|
only ``wide characters'' recognized are single bytes,
|
||||||
and they are ``converted'' to themselves.
|
and they are ``converted'' to themselves.
|
||||||
|
|
||||||
When MB_CAPABLE is defined, this routine calls <<_wctomb_r>> to perform
|
When _MB_CAPABLE is defined, this routine calls <<_wctomb_r>> to perform
|
||||||
the conversion, passing a state variable to allow state dependent
|
the conversion, passing a state variable to allow state dependent
|
||||||
decoding. The result is based on the locale setting which may
|
decoding. The result is based on the locale setting which may
|
||||||
be restricted to a defined set of locales.
|
be restricted to a defined set of locales.
|
||||||
|
|
||||||
Each call to <<wctomb>> modifies <<*<[s]>>> unless <[s]> is a null
|
Each call to <<wctomb>> modifies <<*<[s]>>> unless <[s]> is a null
|
||||||
pointer or MB_CAPABLE is defined and <[wchar]> is invalid.
|
pointer or _MB_CAPABLE is defined and <[wchar]> is invalid.
|
||||||
|
|
||||||
RETURNS
|
RETURNS
|
||||||
This implementation of <<wctomb>> returns <<0>> if
|
This implementation of <<wctomb>> returns <<0>> if
|
||||||
<[s]> is <<NULL>>; it returns <<-1>> if MB_CAPABLE is enabled
|
<[s]> is <<NULL>>; it returns <<-1>> if _MB_CAPABLE is enabled
|
||||||
and the wchar is not a valid multi-byte character, it returns <<1>>
|
and the wchar is not a valid multi-byte character, it returns <<1>>
|
||||||
if MB_CAPABLE is not defined or the wchar is in reality a single
|
if _MB_CAPABLE is not defined or the wchar is in reality a single
|
||||||
byte character, otherwise it returns the number of bytes in the
|
byte character, otherwise it returns the number of bytes in the
|
||||||
multi-byte character.
|
multi-byte character.
|
||||||
|
|
||||||
@ -46,6 +46,7 @@ effects vary with the locale.
|
|||||||
|
|
||||||
#ifndef _REENT_ONLY
|
#ifndef _REENT_ONLY
|
||||||
|
|
||||||
|
#include <newlib.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
int
|
int
|
||||||
@ -53,17 +54,17 @@ _DEFUN (wctomb, (s, wchar),
|
|||||||
char *s _AND
|
char *s _AND
|
||||||
wchar_t wchar)
|
wchar_t wchar)
|
||||||
{
|
{
|
||||||
#ifdef MB_CAPABLE
|
#ifdef _MB_CAPABLE
|
||||||
_REENT_CHECK_MISC(_REENT);
|
_REENT_CHECK_MISC(_REENT);
|
||||||
|
|
||||||
return _wctomb_r (_REENT, s, wchar, &(_REENT_WCTOMB_STATE(_REENT)));
|
return _wctomb_r (_REENT, s, wchar, &(_REENT_WCTOMB_STATE(_REENT)));
|
||||||
#else /* not MB_CAPABLE */
|
#else /* not _MB_CAPABLE */
|
||||||
if (s == NULL)
|
if (s == NULL)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
*s = (char) wchar;
|
*s = (char) wchar;
|
||||||
return 1;
|
return 1;
|
||||||
#endif /* not MB_CAPABLE */
|
#endif /* not _MB_CAPABLE */
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* !_REENT_ONLY */
|
#endif /* !_REENT_ONLY */
|
||||||
|
@ -17,7 +17,9 @@
|
|||||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||||
02111-1307 USA. */
|
02111-1307 USA. */
|
||||||
|
|
||||||
#ifdef MB_CAPABLE
|
#include <newlib.h>
|
||||||
|
|
||||||
|
#ifdef _MB_CAPABLE
|
||||||
|
|
||||||
/* Tell glibc's <string.h> to provide a prototype for mempcpy().
|
/* Tell glibc's <string.h> to provide a prototype for mempcpy().
|
||||||
This must come before <config.h> because <config.h> may include
|
This must come before <config.h> because <config.h> may include
|
||||||
@ -1237,7 +1239,7 @@ free_mem (void)
|
|||||||
|
|
||||||
text_set_element (__libc_subfreeres, free_mem);
|
text_set_element (__libc_subfreeres, free_mem);
|
||||||
#endif
|
#endif
|
||||||
#else /* !MB_CAPABLE */
|
#else /* !_MB_CAPABLE */
|
||||||
|
|
||||||
#include <machine/weakalias.h>
|
#include <machine/weakalias.h>
|
||||||
#include <sys/lock.h>
|
#include <sys/lock.h>
|
||||||
@ -1281,4 +1283,4 @@ __dcigettext (domainname, msgid1, msgid2, plural, n, category)
|
|||||||
}
|
}
|
||||||
weak_alias(__dcigettext, dcigettext)
|
weak_alias(__dcigettext, dcigettext)
|
||||||
|
|
||||||
#endif /* !MB_CAPABLE */
|
#endif /* !_MB_CAPABLE */
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
#ifdef MB_CAPABLE
|
#include <newlib.h>
|
||||||
|
|
||||||
|
#ifdef _MB_CAPABLE
|
||||||
|
|
||||||
/* Copyright (C) 1995-1998, 2000, 2001 Free Software Foundation, Inc.
|
/* Copyright (C) 1995-1998, 2000, 2001 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
@ -201,4 +203,4 @@ _nl_explode_name (name, language, modifier, territory, codeset,
|
|||||||
return mask;
|
return mask;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* MB_CAPABLE */
|
#endif /* _MB_CAPABLE */
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
#ifdef MB_CAPABLE
|
#include <newlib.h>
|
||||||
|
|
||||||
|
#ifdef _MB_CAPABLE
|
||||||
|
|
||||||
/* Handle list of needed message catalogs
|
/* Handle list of needed message catalogs
|
||||||
Copyright (C) 1995-1999, 2000, 2001 Free Software Foundation, Inc.
|
Copyright (C) 1995-1999, 2000, 2001 Free Software Foundation, Inc.
|
||||||
@ -217,4 +219,4 @@ free_mem (void)
|
|||||||
text_set_element (__libc_subfreeres, free_mem);
|
text_set_element (__libc_subfreeres, free_mem);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* MB_CAPABLE */
|
#endif /* _MB_CAPABLE */
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
#ifdef MB_CAPABLE
|
#include <newlib.h>
|
||||||
|
|
||||||
|
#ifdef _MB_CAPABLE
|
||||||
|
|
||||||
/* Copyright (C) 1995-1999, 2000, 2001 Free Software Foundation, Inc.
|
/* Copyright (C) 1995-1999, 2000, 2001 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
@ -418,4 +420,4 @@ stpcpy (dest, src)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* MB_CAPABLE */
|
#endif /* _MB_CAPABLE */
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
#ifdef MB_CAPABLE
|
#include <newlib.h>
|
||||||
|
|
||||||
|
#ifdef _MB_CAPABLE
|
||||||
|
|
||||||
/* Load needed message catalogs.
|
/* Load needed message catalogs.
|
||||||
Copyright (C) 1995-1999, 2000, 2001 Free Software Foundation, Inc.
|
Copyright (C) 1995-1999, 2000, 2001 Free Software Foundation, Inc.
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
#ifdef MB_CAPABLE
|
#include <newlib.h>
|
||||||
|
|
||||||
|
#ifdef _MB_CAPABLE
|
||||||
|
|
||||||
/* Handle aliases for locale names.
|
/* Handle aliases for locale names.
|
||||||
Copyright (C) 1995-1999, 2000, 2001 Free Software Foundation, Inc.
|
Copyright (C) 1995-1999, 2000, 2001 Free Software Foundation, Inc.
|
||||||
@ -440,4 +442,4 @@ alias_compare (map1, map2)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* MB_CAPABLE */
|
#endif /* _MB_CAPABLE */
|
||||||
|
@ -8,6 +8,9 @@
|
|||||||
/* Newlib version */
|
/* Newlib version */
|
||||||
#undef _NEWLIB_VERSION
|
#undef _NEWLIB_VERSION
|
||||||
|
|
||||||
|
/* Multibyte supported */
|
||||||
|
#undef _MB_CAPABLE
|
||||||
|
|
||||||
/* MB_LEN_MAX */
|
/* MB_LEN_MAX */
|
||||||
#undef _MB_LEN_MAX
|
#undef _MB_LEN_MAX
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user