but they are not yet finished.
If all input from the input buffer is successfully converted and stored
-in the output buffer the function returns the number of conversions
-performed. In all other cases the return value is @code{(size_t) -1}
-and @code{errno} is set appropriately. In this case the value pointed
-to by @var{inbytesleft} is nonzero.
+in the output buffer the function returns the number of non-reversible
+conversions performed. In all other cases the return value is
+@code{(size_t) -1} and @code{errno} is set appropriately. In this case
+the value pointed to by @var{inbytesleft} is nonzero.
@table @code
@item EILSEQ
text is available in the output buffer. Beside this the variable
pointed to by the fifth parameter, which is of type @code{size_t}, must
be incremented by the number of characters (@emph{not bytes}) which were
-written in the output buffer. Then the function can return.
+converted in a non-reversible way. Then the function can return.
In case the step is not the last one the later conversion functions have
to get a chance to do their work. Therefore the appropriate conversion
char *outend = data->outbufend;
char *outptr;
- /* @r{This variable is used to count the number of characters}
- @r{we actually converted.} */
- size_t converted = 0;
-
do
@{
/* @r{Remember the start value for this round.} */
@r{available.} */
data->outbuf = outbuf;
- /* @r{Remember how many characters we converted.} */
- *written += converted;
+ /* @r{If any non-reversible conversions were performed,}
+ @r{add the number to @code{*written}.} */
break;
@}