YAZ  5.34.0
iconv-p.h
Go to the documentation of this file.
1 /* This file is part of the YAZ toolkit.
2  * Copyright (C) Index Data.
3  * All rights reserved.
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions are met:
6  *
7  * * Redistributions of source code must retain the above copyright
8  * notice, this list of conditions and the following disclaimer.
9  * * Redistributions in binary form must reproduce the above copyright
10  * notice, this list of conditions and the following disclaimer in the
11  * documentation and/or other materials provided with the distribution.
12  * * Neither the name of Index Data nor the names of its contributors
13  * may be used to endorse or promote products derived from this
14  * software without specific prior written permission.
15  *
16  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY
17  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19  * DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY
20  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26  */
32 #ifndef ICONV_P_H
33 #define ICONV_P_H
34 
35 #include <yaz/yconfig.h>
36 
37 #include <yaz/matchstr.h>
38 #include <yaz/yaz-iconv.h>
39 
40 void yaz_iconv_set_errno(yaz_iconv_t cd, int no);
41 
44  void *data;
46  unsigned long x,
47  char **outbuf, size_t *outbytesleft);
49  char **outbuf, size_t *outbytesleft);
52 };
53 
70 typedef unsigned long yaz_conv_func_t(unsigned char *inp, size_t inbytesleft,
71  size_t *no_read, int *combining,
72  unsigned mask, int boffset);
73 
74 int yaz_iso_8859_1_lookup_y(unsigned long v,
75  unsigned long *x1, unsigned long *x2);
76 
77 int yaz_iso_8859_1_lookup_x12(unsigned long x1, unsigned long x2,
78  unsigned long *y);
79 
82  void *data;
84  unsigned char *inbuf,
85  size_t inbytesleft, size_t *no_read);
87  unsigned char *inbuf,
88  size_t inbytesleft, size_t *no_read);
90 };
91 
92 yaz_iconv_decoder_t yaz_marc8_decoder(const char *fromcode,
94 yaz_iconv_decoder_t yaz_iso5426_decoder(const char *fromcode,
96 yaz_iconv_decoder_t yaz_utf8_decoder(const char *fromcode,
98 yaz_iconv_decoder_t yaz_ucs4_decoder(const char *tocode,
100 yaz_iconv_decoder_t yaz_iso_8859_1_decoder(const char *fromcode,
106 yaz_iconv_decoder_t yaz_wchar_decoder(const char *fromcode,
108 yaz_iconv_decoder_t yaz_danmarc_decoder(const char *fromcode,
110 
111 int yaz_danmarc_is_combining(unsigned long ch);
112 
113 unsigned long yaz_danmarc_swap_to_danmarc(unsigned long ch);
114 
115 #endif
116 /*
117  * Local variables:
118  * c-basic-offset: 4
119  * c-file-style: "Stroustrup"
120  * indent-tabs-mode: nil
121  * End:
122  * vim: shiftwidth=4 tabstop=8 expandtab
123  */
124 
yaz_iconv_encoder_t yaz_wchar_encoder(const char *name, yaz_iconv_encoder_t e)
yaz_iconv_decoder_t yaz_iso5426_decoder(const char *fromcode, yaz_iconv_decoder_t d)
yaz_iconv_decoder_t yaz_ucs4_decoder(const char *tocode, yaz_iconv_decoder_t d)
Definition: ucs4.c:116
yaz_iconv_decoder_t yaz_danmarc_decoder(const char *fromcode, yaz_iconv_decoder_t d)
struct yaz_iconv_decoder_s * yaz_iconv_decoder_t
Definition: iconv-p.h:80
struct yaz_iconv_encoder_s * yaz_iconv_encoder_t
Definition: iconv-p.h:42
yaz_iconv_encoder_t yaz_advancegreek_encoder(const char *name, yaz_iconv_encoder_t e)
Definition: advancegreek.c:376
yaz_iconv_decoder_t yaz_iso_5428_decoder(const char *name, yaz_iconv_decoder_t d)
Definition: iso5428.c:379
yaz_iconv_encoder_t yaz_danmarc_encoder(const char *name, yaz_iconv_encoder_t e)
yaz_iconv_decoder_t yaz_iso_8859_1_decoder(const char *fromcode, yaz_iconv_decoder_t d)
int yaz_iso_8859_1_lookup_x12(unsigned long x1, unsigned long x2, unsigned long *y)
yaz_iconv_decoder_t yaz_advancegreek_decoder(const char *name, yaz_iconv_decoder_t d)
Definition: advancegreek.c:387
yaz_iconv_decoder_t yaz_marc8_decoder(const char *fromcode, yaz_iconv_decoder_t d)
int yaz_danmarc_is_combining(unsigned long ch)
yaz_iconv_encoder_t yaz_marc8_encoder(const char *name, yaz_iconv_encoder_t e)
yaz_iconv_encoder_t yaz_ucs4_encoder(const char *name, yaz_iconv_encoder_t e)
Definition: ucs4.c:103
yaz_iconv_encoder_t yaz_utf8_encoder(const char *name, yaz_iconv_encoder_t e)
Definition: utf8.c:219
unsigned long yaz_danmarc_swap_to_danmarc(unsigned long ch)
unsigned long yaz_conv_func_t(unsigned char *inp, size_t inbytesleft, size_t *no_read, int *combining, unsigned mask, int boffset)
Definition: iconv-p.h:70
yaz_iconv_decoder_t yaz_utf8_decoder(const char *fromcode, yaz_iconv_decoder_t d)
Definition: utf8.c:231
yaz_iconv_decoder_t yaz_wchar_decoder(const char *fromcode, yaz_iconv_decoder_t d)
yaz_iconv_encoder_t yaz_iso_5428_encoder(const char *name, yaz_iconv_encoder_t e)
Definition: iso5428.c:367
void yaz_iconv_set_errno(yaz_iconv_t cd, int no)
Definition: siconv.c:298
int yaz_iso_8859_1_lookup_y(unsigned long v, unsigned long *x1, unsigned long *x2)
yaz_iconv_encoder_t yaz_iso_8859_1_encoder(const char *name, yaz_iconv_encoder_t e)
unsigned long x2
unsigned long x1
unsigned y
char * name
Definition: initopt.c:18
int mask
Definition: log.c:83
Header for YAZ iconv interface.
unsigned long(* read_handle)(yaz_iconv_t cd, yaz_iconv_decoder_t d, unsigned char *inbuf, size_t inbytesleft, size_t *no_read)
Definition: iconv-p.h:86
size_t(* init_handle)(yaz_iconv_t cd, yaz_iconv_decoder_t d, unsigned char *inbuf, size_t inbytesleft, size_t *no_read)
Definition: iconv-p.h:83
void(* destroy_handle)(yaz_iconv_decoder_t d)
Definition: iconv-p.h:89
void(* init_handle)(yaz_iconv_encoder_t e)
Definition: iconv-p.h:50
size_t(* write_handle)(yaz_iconv_t cd, yaz_iconv_encoder_t e, unsigned long x, char **outbuf, size_t *outbytesleft)
Definition: iconv-p.h:45
void(* destroy_handle)(yaz_iconv_encoder_t e)
Definition: iconv-p.h:51
size_t(* flush_handle)(yaz_iconv_t cd, yaz_iconv_encoder_t e, char **outbuf, size_t *outbytesleft)
Definition: iconv-p.h:48
Header for YAZ iconv interface.
Header with fundamental macros.