1 /* Copyright (C) 1997, 1998 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
4 The GNU C Library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public License as
6 published by the Free Software Foundation; either version 2 of the
7 License, or (at your option) any later version.
9 The GNU C Library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
14 You should have received a copy of the GNU Library General Public
15 License along with the GNU C Library; see the file COPYING.LIB. If not,
16 write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 Boston, MA 02111-1307, USA. */
19 /* This header provides no interface for a user to the internals of
20 the gconv implementation in the libc. Therefore there is no use
21 for these definitions beside for writing additional gconv modules. */
31 /* ISO 10646 value used to signal invalid value. */
32 #define UNKNOWN_10646_CHAR ((wchar_t) 0xfffd)
34 /* Error codes for gconv functions. */
45 GCONV_INCOMPLETE_INPUT
,
47 GCONV_ILLEGAL_DESCRIPTOR
,
52 /* Forward declarations. */
54 struct gconv_step_data
;
55 struct gconv_loaded_object
;
58 /* Type of a conversion function. */
59 typedef int (*gconv_fct
) __PMT ((struct gconv_step
*,
60 struct gconv_step_data
*, __const
char **,
61 __const
char *, size_t *, int));
63 /* Constructor and destructor for local data for conversion step. */
64 typedef int (*gconv_init_fct
) __PMT ((struct gconv_step
*));
65 typedef void (*gconv_end_fct
) __PMT ((struct gconv_step
*));
68 /* Description of a conversion step. */
71 struct gconv_loaded_object
*shlib_handle
;
76 __const
char *from_name
;
77 __const
char *to_name
;
80 gconv_init_fct init_fct
;
81 gconv_end_fct end_fct
;
83 /* Information about the number of bytes needed or produced in this
84 step. This helps optimizing the buffer sizes. */
90 /* Flag whether this is a stateful encoding or not. */
93 void *data
; /* Pointer to step-local data. */
96 /* Additional data for steps in use of conversion descriptor. This is
97 allocated by the `init' function. */
98 struct gconv_step_data
100 char *outbuf
; /* Output buffer for this step. */
101 char *outbufend
; /* Address of first byte after the output buffer. */
103 /* Is this the last module in the chain. */
106 /* Counter for number of invocations of the module function for this
108 int invocation_counter
;
110 /* Flag whether this is an internal use of the module (in the mb*towc*
111 and wc*tomb* functions) or regular with iconv(3). */
115 mbstate_t __state
; /* This element should not be used directly by
116 any module; always use STATEP! */
120 /* Combine conversion step description with data. */
121 typedef struct gconv_info
124 struct gconv_step
*steps
;
125 struct gconv_step_data
*data
;