Simple iconv library
[yaz-moved-to-github.git] / include / yaz / yaz-util.h
1 /*
2  * Copyright (c) 1995-2000, Index Data.
3  * See the file LICENSE for details.
4  * Sebastian Hammer, Adam Dickmeiss
5  *
6  * $Log: yaz-util.h,v $
7  * Revision 1.4  2002-08-27 14:02:43  adam
8  * Simple iconv library
9  *
10  * Revision 1.3  2001/04/06 12:26:46  adam
11  * Optional CCL module. Moved atoi_n to marcdisp.h from yaz-util.h.
12  *
13  * Revision 1.2  2000/02/28 11:20:06  adam
14  * Using autoconf. New definitions: YAZ_BEGIN_CDECL/YAZ_END_CDECL.
15  *
16  * Revision 1.1  1999/11/30 13:47:11  adam
17  * Improved installation. Moved header files to include/yaz.
18  *
19  * Revision 1.6  1997/10/27 13:52:46  adam
20  * Header yaz-util includes all YAZ utility header files.
21  *
22  * Revision 1.5  1997/09/04 07:58:36  adam
23  * Added prototype for atoi_n.
24  *
25  * Revision 1.4  1997/09/01 08:49:54  adam
26  * New windows NT/95 port using MSV5.0. To export DLL functions the
27  * YAZ_EXPORT modifier was added. Defined in yconfig.h.
28  *
29  * Revision 1.3  1997/05/14 06:53:54  adam
30  * C++ support.
31  *
32  * Revision 1.2  1996/02/20 17:58:09  adam
33  * Added const to yaz_matchstr.
34  *
35  * Revision 1.1  1996/02/20  16:32:49  quinn
36  * Created util file.
37  */
38
39 #ifndef YAZ_UTIL_H
40 #define YAZ_UTIL_H
41
42 #include <yaz/yconfig.h>
43 #include <yaz/xmalloc.h>
44 #include <yaz/log.h>
45 #include <yaz/tpath.h>
46 #include <yaz/options.h>
47 #include <yaz/wrbuf.h>
48 #include <yaz/nmem.h>
49 #include <yaz/readconf.h>
50 #include <yaz/marcdisp.h>
51
52 YAZ_BEGIN_CDECL
53
54 typedef struct yaz_iconv_struct *yaz_iconv_t;
55 #define YAZ_ICONV_UNKNOWN 1
56 #define YAZ_ICONV_E2BIG 2
57 #define YAZ_ICONV_EILSEQ 3
58 #define YAZ_ICONV_EINVAL 4
59
60 YAZ_EXPORT yaz_iconv_t yaz_iconv_open (const char *tocode,
61                                        const char *fromcode);
62 YAZ_EXPORT size_t yaz_iconv (yaz_iconv_t cd, char **inbuf, size_t *inbytesleft,
63                              char **outbuf, size_t *outbytesleft);
64 YAZ_EXPORT int yaz_iconv_error (yaz_iconv_t cd);
65
66 YAZ_EXPORT int yaz_iconv_close (yaz_iconv_t cd);
67
68 YAZ_EXPORT int yaz_matchstr(const char *s1, const char *s2);
69
70
71 YAZ_END_CDECL
72
73 #endif