2000-06-10 Ulrich Drepper <drepper@redhat.com>
+ * iconv/skeleton.c: Rename converted written to correcter name
+ irreversible.
+ * iconv/gconv.c: Rename converted variable to correcter name
+ irreversible.
+ * iconv/gconv_int.h: Likewise.
+ * iconv/gconv_simple.c: Likewise.
+ * iconv/iconv.c: Likewise.
+ * iconv/loop.c: Likewise.
+ * iconvdata/8bit-gap.c: Likewise.
+ * iconvdata/8bit-generic.c: Likewise.
+ * iconvdata/ansi_x3.110.c: Likewise.
+ * iconvdata/big5.c: Likewise.
+ * iconvdata/big5hkscs.c: Likewise.
+ * iconvdata/euc-cn.c: Likewise.
+ * iconvdata/euc-jp.c: Likewise.
+ * iconvdata/euc-kr.c: Likewise.
+ * iconvdata/gbgbk.c: Likewise.
+ * iconvdata/gbk.c: Likewise.
+ * iconvdata/iso-2022-cn.c: Likewise.
+ * iconvdata/iso-2022-jp.c: Likewise.
+ * iconvdata/iso-2022-kr.c: Likewise.
+ * iconvdata/iso646.c: Likewise.
+ * iconvdata/iso8859-1.c: Likewise.
+ * iconvdata/iso_6937-2.c: Likewise.
+ * iconvdata/iso_6937.c: Likewise.
+ * iconvdata/johab.c: Likewise.
+ * iconvdata/sjis.c: Likewise.
+ * iconvdata/t.61.c: Likewise.
+ * iconvdata/uhc.c: Likewise.
+ * iconvdata/unicode.c: Likewise.
+ * iconvdata/utf-16.c: Likewise.
+
* sysdeps/unix/sysv/linux/bits/socket.h (struct cmsghdr): Mark
__cmsg_data field with __extension__.
internal_function
__gconv (__gconv_t cd, const unsigned char **inbuf,
const unsigned char *inbufend, unsigned char **outbuf,
- unsigned char *outbufend, size_t *converted)
+ unsigned char *outbufend, size_t *irreversible)
{
size_t last_step = cd->__nsteps - 1;
int result;
if (cd == (__gconv_t) -1L)
return __GCONV_ILLEGAL_DESCRIPTOR;
- assert (converted != NULL);
- *converted = 0;
+ assert (irreversible != NULL);
+ *irreversible = 0;
cd->__data[last_step].__outbuf = outbuf != NULL ? *outbuf : NULL;
cd->__data[last_step].__outbufend = outbufend;
/* We just flush. */
result = DL_CALL_FCT (cd->__steps->__fct,
(cd->__steps, cd->__data, NULL, NULL,
- converted, 1, 0));
+ irreversible, 1, 0));
else
{
const unsigned char *last_start;
last_start = *inbuf;
result = DL_CALL_FCT (cd->__steps->__fct,
(cd->__steps, cd->__data, inbuf, inbufend,
- converted, 0, 0));
+ irreversible, 0, 0));
}
while (result == __GCONV_EMPTY_INPUT && last_start != *inbuf
&& *inbuf + cd->__steps->__min_needed_from <= inbufend);
/* Transform at most *INBYTESLEFT bytes from buffer starting at *INBUF
according to rules described by CD and place up to *OUTBYTESLEFT
bytes in buffer starting at *OUTBUF. Return number of non-identical
- conversions in *CONVERTED if this pointer is not null. */
+ conversions in *IRREVERSIBLE if this pointer is not null. */
extern int __gconv (__gconv_t __cd, const unsigned char **__inbuf,
const unsigned char *inbufend, unsigned char **__outbuf,
- unsigned char *outbufend, size_t *converted)
+ unsigned char *outbufend, size_t *irreversible)
internal_function;
/* Return in *HANDLE a pointer to an array with *NSTEPS elements describing
static inline int
internal_ucs4_loop (const unsigned char **inptrp, const unsigned char *inend,
unsigned char **outptrp, unsigned char *outend,
- mbstate_t *state, int flags, void *data, size_t *converted)
+ mbstate_t *state, int flags, void *data,
+ size_t *irreversible)
{
const unsigned char *inptr = *inptrp;
unsigned char *outptr = *outptrp;
const unsigned char *inend,
unsigned char **outptrp, unsigned char *outend,
mbstate_t *state, int flags, void *data,
- size_t *converted)
+ size_t *irreversible)
{
const unsigned char *inptr = *inptrp;
unsigned char *outptr = *outptrp;
const unsigned char *inend,
unsigned char **outptrp, unsigned char *outend,
mbstate_t *state, int flags, void *data,
- size_t *converted)
+ size_t *irreversible)
{
size_t cnt = state->__count & 7;
static inline int
ucs4_internal_loop (const unsigned char **inptrp, const unsigned char *inend,
unsigned char **outptrp, unsigned char *outend,
- mbstate_t *state, int flags, void *data, size_t *converted)
+ mbstate_t *state, int flags, void *data,
+ size_t *irreversible)
{
const unsigned char *inptr = *inptrp;
unsigned char *outptr = *outptrp;
if (flags & __GCONV_IGNORE_ERRORS)
{
/* Just ignore this character. */
- ++*converted;
+ ++*irreversible;
continue;
}
const unsigned char *inend,
unsigned char **outptrp, unsigned char *outend,
mbstate_t *state, int flags, void *data,
- size_t *converted)
+ size_t *irreversible)
{
const unsigned char *inptr = *inptrp;
unsigned char *outptr = *outptrp;
if (flags & __GCONV_IGNORE_ERRORS)
{
/* Just ignore this character. */
- ++*converted;
+ ++*irreversible;
continue;
}
const unsigned char *inend,
unsigned char **outptrp, unsigned char *outend,
mbstate_t *state, int flags, void *data,
- size_t *converted)
+ size_t *irreversible)
{
size_t cnt = state->__count & 7;
internal_ucs4le_loop (const unsigned char **inptrp, const unsigned char *inend,
unsigned char **outptrp, unsigned char *outend,
mbstate_t *state, int flags, void *data,
- size_t *converted)
+ size_t *irreversible)
{
const unsigned char *inptr = *inptrp;
unsigned char *outptr = *outptrp;
const unsigned char *inend,
unsigned char **outptrp, unsigned char *outend,
mbstate_t *state, int flags, void *data,
- size_t *converted)
+ size_t *irreversible)
{
const unsigned char *inptr = *inptrp;
unsigned char *outptr = *outptrp;
const unsigned char *inend,
unsigned char **outptrp, unsigned char *outend,
mbstate_t *state, int flags, void *data,
- size_t *converted)
+ size_t *irreversible)
{
size_t cnt = state->__count & 7;
ucs4le_internal_loop (const unsigned char **inptrp, const unsigned char *inend,
unsigned char **outptrp, unsigned char *outend,
mbstate_t *state, int flags, void *data,
- size_t *converted)
+ size_t *irreversible)
{
const unsigned char *inptr = *inptrp;
unsigned char *outptr = *outptrp;
if (flags & __GCONV_IGNORE_ERRORS)
{
/* Just ignore this character. */
- ++*converted;
+ ++*irreversible;
continue;
}
const unsigned char *inend,
unsigned char **outptrp, unsigned char *outend,
mbstate_t *state, int flags, void *data,
- size_t *converted)
+ size_t *irreversible)
{
const unsigned char *inptr = *inptrp;
unsigned char *outptr = *outptrp;
if (flags & __GCONV_IGNORE_ERRORS)
{
/* Just ignore this character. */
- ++*converted;
+ ++*irreversible;
continue;
}
const unsigned char *inend,
unsigned char **outptrp, unsigned char *outend,
mbstate_t *state, int flags, void *data,
- size_t *converted)
+ size_t *irreversible)
{
size_t cnt = state->__count & 7;
break; \
} \
\
- ++*converted; \
+ ++*irreversible; \
++inptr; \
} \
else \
break; \
} \
\
- ++*converted; \
+ ++*irreversible; \
inptr += 4; \
} \
else \
{ \
/* Ignore it. */ \
inptr += i; \
- ++*converted; \
+ ++*irreversible; \
continue; \
} \
\
if (ignore_errors_p ()) \
{ \
inptr += i; \
- ++*converted; \
+ ++*irreversible; \
continue; \
} \
\
} \
\
inptr += 4; \
- ++*converted; \
+ ++*irreversible; \
} \
else \
*((uint16_t *) outptr)++ = *((uint32_t *) inptr)++; \
} \
\
inptr += 4; \
- ++*converted; \
+ ++*irreversible; \
} \
*((uint16_t *) outptr)++ = bswap_16 (val); \
inptr += 4; \
{
__gconv_t gcd = (__gconv_t) cd;
char *outstart = outbuf ? *outbuf : NULL;
- size_t converted;
+ size_t irreversible;
int result;
if (__builtin_expect (inbuf == NULL || *inbuf == NULL, 0))
{
if (outbuf == NULL || *outbuf == NULL)
- result = __gconv (gcd, NULL, NULL, NULL, NULL, &converted);
+ result = __gconv (gcd, NULL, NULL, NULL, NULL, &irreversible);
else
result = __gconv (gcd, NULL, NULL, (unsigned char **) outbuf,
(unsigned char *) (outstart + *outbytesleft),
- &converted);
+ &irreversible);
}
else
{
(const unsigned char *) (*inbuf + *inbytesleft),
(unsigned char **) outbuf,
(unsigned char *) (*outbuf + *outbytesleft),
- &converted);
+ &irreversible);
*inbytesleft -= *inbuf - instart;
}
{
case __GCONV_ILLEGAL_DESCRIPTOR:
__set_errno (EBADF);
- converted = (size_t) -1L;
+ irreversible = (size_t) -1L;
break;
case __GCONV_ILLEGAL_INPUT:
__set_errno (EILSEQ);
- converted = (size_t) -1L;
+ irreversible = (size_t) -1L;
break;
case __GCONV_FULL_OUTPUT:
__set_errno (E2BIG);
- converted = (size_t) -1L;
+ irreversible = (size_t) -1L;
break;
case __GCONV_INCOMPLETE_INPUT:
__set_errno (EINVAL);
- converted = (size_t) -1L;
+ irreversible = (size_t) -1L;
break;
case __GCONV_EMPTY_INPUT:
assert (!"Nothing like this should happen");
}
- return converted;
+ return irreversible;
}
static inline int
FCTNAME (LOOPFCT) (const unsigned char **inptrp, const unsigned char *inend,
unsigned char **outptrp, unsigned char *outend,
- mbstate_t *state, int flags, void *data, size_t *converted
- EXTRA_LOOP_DECLS)
+ mbstate_t *state, int flags, void *data,
+ size_t *irreversible EXTRA_LOOP_DECLS)
{
int result = __GCONV_OK;
const unsigned char *inptr = *inptrp;
static inline int
SINGLE(LOOPFCT) (const unsigned char **inptrp, const unsigned char *inend,
unsigned char **outptrp, unsigned char *outend,
- mbstate_t *state, int flags, void *data, size_t *converted
+ mbstate_t *state, int flags, void *data, size_t *irreversible
EXTRA_LOOP_DECLS)
{
int result = __GCONV_OK;
int
FUNCTION_NAME (struct __gconv_step *step, struct __gconv_step_data *data,
const unsigned char **inptrp, const unsigned char *inend,
- size_t *written, int do_flush, int consume_incomplete)
+ size_t *irreversible, int do_flush, int consume_incomplete)
{
struct __gconv_step *next_step = step + 1;
struct __gconv_step_data *next_data = data + 1;
successfully emitted the escape sequence. */
if (status == __GCONV_OK && ! (data->__flags & __GCONV_IS_LAST))
status = DL_CALL_FCT (fct, (next_step, next_data, NULL, NULL,
- written, 1, consume_incomplete));
+ irreversible, 1, consume_incomplete));
}
else
{
unsigned char *outstart;
/* This variable is used to count the number of characters we
actually converted. */
- size_t converted = 0;
+ size_t lirreversible = 0;
#if defined _STRING_ARCH_unaligned \
|| MIN_NEEDED_FROM == 1 || MAX_NEEDED_FROM % MIN_NEEDED_FROM != 0 \
|| MIN_NEEDED_TO == 1 || MAX_NEEDED_TO % MIN_NEEDED_TO != 0
if (MAX_NEEDED_TO == 1 || FROM_DIRECTION)
status = SINGLE(FROM_LOOP) (inptrp, inend, &outbuf, outend,
data->__statep, data->__flags,
- step->__data, &converted
+ step->__data, &lirreversible
EXTRA_LOOP_ARGS);
# endif
# if MAX_NEEDED_FROM > 1 && MAX_NEEDED_TO > 1 && !ONE_DIRECTION
# if MAX_NEEDED_TO > 1 && !ONE_DIRECTION
status = SINGLE(TO_LOOP) (inptrp, inend, &outbuf, outend,
data->__statep, data->__flags,
- step->__data, &converted
+ step->__data, &lirreversible
EXTRA_LOOP_ARGS);
# endif
/* Run the conversion loop. */
status = FROM_LOOP (inptrp, inend, &outbuf, outend,
data->__statep, data->__flags,
- step->__data, &converted EXTRA_LOOP_ARGS);
+ step->__data, &lirreversible
+ EXTRA_LOOP_ARGS);
else
/* Run the conversion loop. */
status = TO_LOOP (inptrp, inend, &outbuf, outend,
data->__statep, data->__flags,
- step->__data, &converted EXTRA_LOOP_ARGS);
+ step->__data, &lirreversible
+ EXTRA_LOOP_ARGS);
}
#if !defined _STRING_ARCH_unaligned \
&& MIN_NEEDED_FROM != 1 && MAX_NEEDED_FROM % MIN_NEEDED_FROM == 0 \
status = GEN_unaligned (FROM_LOOP) (inptrp, inend, &outbuf,
outend, data->__statep,
data->__flags,
- step->__data, &converted
+ step->__data,
+ &lirreversible
EXTRA_LOOP_ARGS);
else
/* Run the conversion loop. */
status = GEN_unaligned (TO_LOOP) (inptrp, inend, &outbuf,
outend, data->__statep,
data->__flags,
- step->__data, &converted
+ step->__data,
+ &lirreversible
EXTRA_LOOP_ARGS);
}
#endif
/* Store information about how many bytes are available. */
data->__outbuf = outbuf;
- /* Remember how many non-identical characters we converted. */
- *written += converted;
+ /* Remember how many non-identical characters we
+ converted in a irreversible way. */
+ *irreversible += lirreversible;
break;
}
int result;
result = DL_CALL_FCT (fct, (next_step, next_data, &outerr,
- outbuf, written, 0,
+ outbuf, irreversible, 0,
consume_incomplete));
if (result != __GCONV_EMPTY_INPUT)
(unsigned char **) &outbuf,
(unsigned char *) outerr,
data->__statep, data->__flags,
- step->__data, &converted
+ step->__data, &lirreversible
EXTRA_LOOP_ARGS);
else
/* Run the conversion loop. */
(unsigned char **) &outbuf,
(unsigned char *) outerr,
data->__statep, data->__flags,
- step->__data, &converted
+ step->__data, &lirreversible
EXTRA_LOOP_ARGS);
/* We must run out of output buffer space in this
break; \
} \
\
- ++*converted; \
+ ++*irreversible; \
} \
else \
{ \
break; \
} \
\
- ++*converted; \
+ ++*irreversible; \
inptr += 4; \
continue; \
} \
break; \
} \
\
- ++*converted; \
+ ++*irreversible; \
inptr += 4; \
continue; \
} \
break; \
} \
\
- ++*converted; \
+ ++*irreversible; \
inptr += 4; \
continue; \
} \
break; \
} \
\
- ++*converted; \
+ ++*irreversible; \
} \
\
put32 (outptr, ch); \
break; \
} \
\
- ++*converted; \
+ ++*irreversible; \
} \
else \
*outptr++ = from_ucs4[ch]; \
break; \
} \
\
- ++*converted; \
+ ++*irreversible; \
incr = 1; \
} \
else \
break; \
} \
\
- ++*converted; \
+ ++*irreversible; \
inptr += 4; \
continue; \
} \
break; \
} \
\
- ++*converted; \
+ ++*irreversible; \
inptr += 4; \
continue; \
} \
break; \
} \
\
- ++*converted; \
+ ++*irreversible; \
inptr += 4; \
continue; \
} \
} \
\
++inptr; \
- ++*converted; \
+ ++*irreversible; \
continue; \
} \
\
} \
\
inptr += 2; \
- ++*converted; \
+ ++*irreversible; \
continue; \
} \
\
break; \
} \
\
- ++*converted; \
+ ++*irreversible; \
} \
else \
{ \
} \
\
++inptr; \
- ++*converted; \
+ ++*irreversible; \
continue; \
} \
\
} \
\
inptr += 2; \
- ++*converted; \
+ ++*irreversible; \
continue; \
} \
\
break; \
} \
\
- ++*converted; \
+ ++*irreversible; \
} \
else \
{ \
} \
\
++inptr; \
- ++*converted; \
+ ++*irreversible; \
continue; \
} \
else \
} \
\
++inptr; \
- ++*converted; \
+ ++*irreversible; \
continue; \
} \
\
} \
\
inptr += 2; \
- ++*converted; \
+ ++*irreversible; \
continue; \
} \
\
} \
\
inptr += 4; \
- ++*converted; \
+ ++*irreversible; \
continue; \
} \
\
} \
\
++inptr; \
- ++*converted; \
+ ++*irreversible; \
continue; \
} \
else \
} \
\
++inptr; \
- ++*converted; \
+ ++*irreversible; \
continue; \
} \
\
} \
\
inptr += 2; \
- ++*converted; \
+ ++*irreversible; \
continue; \
} \
inptr = endp; \
} \
\
inptr += 4; \
- ++*converted; \
+ ++*irreversible; \
continue; \
} \
} \
} \
\
++inptr; \
- ++*converted; \
+ ++*irreversible; \
continue; \
} \
else \
} \
\
inptr += 2; \
- ++*converted; \
+ ++*irreversible; \
continue; \
} \
} \
} \
\
inptr += 4; \
- ++*converted; \
+ ++*irreversible; \
continue; \
} \
\
} \
\
inptr += 2; \
- ++*converted; \
+ ++*irreversible; \
} \
else \
{ \
} \
\
++inptr; \
- ++*converted; \
+ ++*irreversible; \
continue; \
} \
else \
} \
\
++inptr; \
- ++*converted; \
+ ++*irreversible; \
continue; \
} \
\
} \
\
inptr += 2; \
- ++*converted; \
+ ++*irreversible; \
continue; \
} \
\
break; \
} \
\
- ++*converted; \
+ ++*irreversible; \
} \
/* See whether there is enough room for the second byte we write. */ \
else if (NEED_LENGTH_TEST && cp[1] != '\0' \
} \
\
++inptr; \
- ++*converted; \
+ ++*irreversible; \
continue; \
} \
\
break; \
} \
\
- ++*converted; \
+ ++*irreversible; \
continue; \
} \
} \
} \
\
++inptr; \
- ++*converted; \
+ ++*irreversible; \
continue; \
} \
} \
} \
\
inptr += 4; \
- ++*converted; \
+ ++*irreversible; \
continue; \
} \
} \
} \
\
++inptr; \
- ++*converted; \
+ ++*irreversible; \
continue; \
} \
ch = iso88597_to_ucs4[inptr[2] - 0x20]; \
} \
\
inptr += 3; \
- ++*converted; \
+ ++*irreversible; \
continue; \
} \
inptr += 3; \
} \
\
++inptr; \
- ++*converted; \
+ ++*irreversible; \
continue; \
} \
} \
} \
\
++inptr; \
- ++*converted; \
+ ++*irreversible; \
continue; \
} \
++inptr; \
} \
\
++inptr; \
- ++*converted; \
+ ++*irreversible; \
continue; \
} \
++inptr; \
} \
\
++inptr; \
- ++*converted; \
+ ++*irreversible; \
continue; \
} \
} \
break; \
} \
\
- ++*converted; \
+ ++*irreversible; \
} \
else \
{ \
break; \
} \
\
- ++*converted; \
+ ++*irreversible; \
} \
} \
} \
} \
\
++inptr; \
- ++*converted; \
+ ++*irreversible; \
continue; \
} \
\
break; \
} \
\
- ++*converted; \
+ ++*irreversible; \
++inptr; \
continue; \
} \
break; \
} \
\
- ++*converted; \
+ ++*irreversible; \
} \
else \
{ \
break; \
} \
\
- ++*converted; \
+ ++*irreversible; \
} \
else \
{ \
break; \
} \
\
- ++*converted; \
+ ++*irreversible; \
} \
else \
*outptr++ = (unsigned char) ch; \
break; \
} \
\
- ++*converted; \
+ ++*irreversible; \
} \
else \
*outptr++ = (unsigned char) ch; \
} \
\
++inptr; \
- ++*converted; \
+ ++*irreversible; \
continue; \
} \
\
} \
\
inptr += 2; \
- ++*converted; \
+ ++*irreversible; \
continue; \
} \
\
} \
\
++inptr; \
- ++*converted; \
+ ++*irreversible; \
continue; \
} \
++inptr; \
} \
\
inptr += 4; \
- ++*converted; \
+ ++*irreversible; \
continue; \
} \
} \
break; \
} \
\
- ++*converted; \
+ ++*irreversible; \
inptr += 4; \
continue; \
} \
} \
\
++inptr; \
- ++*converted; \
+ ++*irreversible; \
continue; \
} \
\
} \
\
inptr += 2; \
- ++*converted; \
+ ++*irreversible; \
continue; \
} \
\
} \
\
++inptr; \
- ++*converted; \
+ ++*irreversible; \
continue; \
} \
++inptr; \
} \
\
inptr += 4; \
- ++*converted; \
+ ++*irreversible; \
continue; \
} \
} \
break; \
} \
\
- ++*converted; \
+ ++*irreversible; \
inptr += 4; \
continue; \
} \
} \
\
++inptr; \
- ++*converted; \
+ ++*irreversible; \
continue; \
} \
else \
} \
\
++inptr; \
- ++*converted; \
+ ++*irreversible; \
continue; \
} \
else if (i > 0 && m > 0) \
} \
\
++inptr; \
- ++*converted; \
+ ++*irreversible; \
continue; \
} \
} \
} \
\
++inptr; \
- ++*converted; \
+ ++*irreversible; \
continue; \
} \
else \
} \
\
inptr += 2; \
- ++*converted; \
+ ++*irreversible; \
continue; \
} \
\
} \
\
inptr += 4; \
- ++*converted; \
+ ++*irreversible; \
continue; \
} \
\
} \
\
inptr += 4; \
- ++*converted; \
+ ++*irreversible; \
continue; \
} \
\
} \
\
++inptr; \
- ++*converted; \
+ ++*irreversible; \
continue; \
} \
else \
} \
\
++inptr; \
- ++*converted; \
+ ++*irreversible; \
continue; \
} \
else \
} \
\
inptr += 2; \
- ++*converted; \
+ ++*irreversible; \
continue; \
} \
} \
} \
\
inptr += 4; \
- ++*converted; \
+ ++*irreversible; \
continue; \
} \
} \
break; \
} \
\
- ++*converted; \
+ ++*irreversible; \
} \
else \
{ \
} \
\
++inptr; \
- ++*converted; \
+ ++*irreversible; \
continue; \
} \
\
break; \
} \
\
- ++*converted; \
+ ++*irreversible; \
} \
else \
{ \
} \
\
inptr += 4; \
- ++*converted; \
+ ++*irreversible; \
continue; \
} \
else \
} \
\
inptr += 4; \
- ++*converted; \
+ ++*irreversible; \
continue; \
} \
} \
} \
\
++inptr; \
- ++*converted; \
+ ++*irreversible; \
continue; \
} \
else \
} \
\
++inptr; \
- ++*converted; \
+ ++*irreversible; \
continue; \
} \
\
} \
\
inptr += 2; \
- ++*converted; \
+ ++*irreversible; \
continue; \
} \
\
} \
\
inptr += 2; \
- ++*converted; \
+ ++*irreversible; \
continue; \
} \
} \
} \
\
inptr += 4; \
- ++*converted; \
+ ++*irreversible; \
continue; \
} \
\
} \
\
inptr += 4; \
- ++*converted; \
+ ++*irreversible; \
continue; \
} \
\
break; \
} \
\
- ++*converted; \
+ ++*irreversible; \
} \
else \
{ \
break; \
} \
\
- ++*converted; \
+ ++*irreversible; \
inptr += 4; \
continue; \
} \
break; \
} \
\
- ++*converted; \
+ ++*irreversible; \
inptr += 4; \
continue; \
} \
break; \
} \
\
- ++*converted; \
+ ++*irreversible; \
continue; \
} \
\
break; \
} \
\
- ++*converted; \
+ ++*irreversible; \
continue; \
} \
\