/* Multibyte Character Functions.
Copyright (C) 1998 Free Software Foundation, Inc.
-This file is part of GNU CC.
+This file is part of GCC.
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 2, or (at your option) any later
+version.
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
+along with GCC; see the file COPYING. If not, write to the Free
+Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+02111-1307, USA. */
/* Note regarding cross compilation:
leaves the source character values unchanged (except for removing the
state shifting markers). */
-#ifdef MULTIBYTE_CHARS
#include "config.h"
+#ifdef MULTIBYTE_CHARS
#include "system.h"
#include "mbchar.h"
#include <locale.h>
};
-char *literal_codeset = NULL;
+const char *literal_codeset = NULL;
/* Store into *PWC (if PWC is not null) the wide character
corresponding to the multibyte character at the start of the
int
local_mbtowc (pwc, s, n)
wchar_t *pwc;
- char *s;
+ const char *s;
size_t n;
{
static JIS_STATE save_state = ASCII;
JIS_STATE curr_state = save_state;
- unsigned char *t = (unsigned char *) s;
+ const unsigned char *t = (const unsigned char *) s;
if (s != NULL && n == 0)
return -1;
{
JIS_ACTION action;
JIS_CHAR_TYPE ch;
- unsigned char *ptr;
- int i, curr_ch;
+ const unsigned char *ptr;
+ size_t i, curr_ch;
if (s == NULL)
{
save_state = ASCII;
- /* State-dependent. */
+ /* State-dependent. */
return 1;
}
case MAKE_A:
case MAKE_J:
- ptr = (char *) (t + i + 1);
+ ptr = (const unsigned char *) (t + i + 1);
break;
case ERROR:
return 1;
#else
- /* This must be the "C" locale or unknown locale. */
+ /* This must be the "C" locale or unknown locale. */
return mbtowc (pwc, s, n);
#endif
}
int
local_mblen (s, n)
- char *s;
+ const char *s;
size_t n;
{
return local_mbtowc (NULL, s, n);
return 1; /* default */
#endif
}
+#else /* MULTIBYTE_CHARS */
+extern int dummy; /* silence 'ANSI C forbids an empty source file' warning */
#endif /* MULTIBYTE_CHARS */