Skip to content

Commit

Permalink
#if 0 out code for non-ASCII chars until the locale data format is im…
Browse files Browse the repository at this point in the history
…plemented.
  • Loading branch information
Roland McGrath committed Mar 13, 1995
1 parent 7782ca5 commit 4ca6860
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
6 changes: 5 additions & 1 deletion stdlib/mbtowc.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */

#include <ansidecl.h>
#include <localeinfo.h>
#include "../locale/localeinfo.h"
#include <ctype.h>
#include <stddef.h>
#include <stdio.h>
Expand All @@ -33,8 +33,10 @@ long int _mb_shift = 0;
int
DEFUN(mbtowc, (pwc, s, n), wchar_t *pwc AND CONST char *s AND size_t n)
{
#if 0
register CONST mb_char *mb;
register wchar_t i;
#endif

if (s == NULL)
return _mb_shift != 0;
Expand All @@ -51,6 +53,7 @@ DEFUN(mbtowc, (pwc, s, n), wchar_t *pwc AND CONST char *s AND size_t n)
return 1;
}

#if 0
if (_ctype_info->mbchar == NULL ||
_ctype_info->mbchar->mb_chars == NULL)
return -1;
Expand Down Expand Up @@ -79,6 +82,7 @@ DEFUN(mbtowc, (pwc, s, n), wchar_t *pwc AND CONST char *s AND size_t n)
return mb->len;
}
}
#endif

return -1;
}
8 changes: 7 additions & 1 deletion stdlib/wctomb.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */

#include <ansidecl.h>
#include <localeinfo.h>
#include "../locale/localeinfo.h"
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
Expand All @@ -32,12 +32,14 @@ extern long int _mb_shift; /* Defined in mbtowc.c. */
int
DEFUN(wctomb, (s, wchar), register char *s AND wchar_t wchar)
{
#if 0
register CONST mb_char *mb;

if (_ctype_info->mbchar == NULL)
mb = NULL;
else
mb = _ctype_info->mbchar->mb_chars;
#endif

/* If S is NULL, just say if we're shifted or not. */
if (s == NULL)
Expand All @@ -63,10 +65,14 @@ DEFUN(wctomb, (s, wchar), register char *s AND wchar_t wchar)
return -1;
}

#if 1
return -1;
#else
mb += wchar + _mb_shift;
if (mb->string == NULL || mb->len == 0)
return -1;
memcpy((PTR) s, (CONST PTR) mb->string, mb->len + 1);
_mb_shift += mb->shift;
return mb->len;
#endif
}

0 comments on commit 4ca6860

Please sign in to comment.