34 char **outbuf,
size_t *outbytesleft)
36 unsigned char *outp = (
unsigned char *) *outbuf;
37 if (x ==
'@' || x ==
'*')
39 if (*outbytesleft < 2)
46 *outp++ = (
unsigned char) x;
51 if (*outbytesleft < 1)
56 *outp++ = (
unsigned char) x;
61 if (*outbytesleft < 6)
91 *outbuf = (
char *) outp;
96 char **outbuf,
size_t *outbytesleft)
112 unsigned long x = w->
comp[w->
sz - 1];
115 size_t r =
write1(cd, x, outbuf, outbytesleft);
133 char **outbuf,
size_t *outbytesleft)
Header for errno utilities.
Internal header for iconv.
struct yaz_iconv_encoder_s * yaz_iconv_encoder_t
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 init_danmarc(yaz_iconv_t cd, yaz_iconv_decoder_t d, unsigned char *inp, size_t inbytesleft, size_t *no_read)
void destroy_danmarc(yaz_iconv_decoder_t d)
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 '-'
void yaz_snprintf(char *buf, size_t size, const char *fmt,...)
Header for config file reading utilities.
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
struct yaz_iconv_struct * yaz_iconv_t
yaz_iconv handle (similar to iconv_t)