33 char **outbuf,
size_t *outbytesleft)
35 unsigned char *outp = (
unsigned char *) *outbuf;
36 if (x ==
'@' || x ==
'*')
38 if (*outbytesleft < 2)
45 *outp++ = (
unsigned char) x;
50 if (*outbytesleft < 1)
55 *outp++ = (
unsigned char) x;
60 if (*outbytesleft < 6)
79 sprintf(*outbuf,
"@%04lX", x);
90 *outbuf = (
char *) outp;
95 char **outbuf,
size_t *outbytesleft)
111 unsigned long x = w->
comp[w->
sz - 1];
114 size_t r =
write1(cd, x, outbuf, outbytesleft);
132 char **outbuf,
size_t *outbytesleft)
Header for errno utilities.
Internal header for iconv.
int yaz_iso_8859_1_lookup_x12(unsigned long x1, unsigned long x2, unsigned long *y)
int yaz_danmarc_is_combining(unsigned long ch)
unsigned long yaz_danmarc_swap_to_danmarc(unsigned long ch)
void yaz_iconv_set_errno(yaz_iconv_t cd, int no)
static size_t write_danmarc(yaz_iconv_t cd, yaz_iconv_encoder_t e, unsigned long x, char **outbuf, size_t *outbytesleft)
static void init_danmarc(yaz_iconv_encoder_t e)
yaz_iconv_encoder_t yaz_danmarc_encoder(const char *tocode, yaz_iconv_encoder_t e)
static size_t flush_danmarc(yaz_iconv_t cd, yaz_iconv_encoder_t e, char **outbuf, size_t *outbytesleft)
static size_t write1(yaz_iconv_t cd, unsigned long x, char **outbuf, size_t *outbytesleft)
static void destroy_danmarc(yaz_iconv_encoder_t e)
int yaz_matchstr(const char *s1, const char *s2)
match strings - independent of case and '-'
unsigned long comp[MAX_COMP]
void(* init_handle)(yaz_iconv_encoder_t e)
size_t(* write_handle)(yaz_iconv_t cd, yaz_iconv_encoder_t e, unsigned long x, char **outbuf, size_t *outbytesleft)
void(* destroy_handle)(yaz_iconv_encoder_t e)
size_t(* flush_handle)(yaz_iconv_t cd, yaz_iconv_encoder_t e, char **outbuf, size_t *outbytesleft)
Header for memory handling functions.
#define xfree(x)
utility macro which calls xfree_f
#define xmalloc(x)
utility macro which calls malloc_f
#define YAZ_ICONV_EILSEQ
error code: Invalid sequence
#define YAZ_ICONV_E2BIG
error code: Not sufficient room for output buffer