1 /*
2    Copyright (c) 2002 Perry Rapp
3    "The MIT license"
4    Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
5    The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
7 */
8 /*=============================================================
9  * iconv.h -- Shim to connect to iconv dll if available
10  *   Created: 2002/06 by Perry Rapp
11  *   Edited:  2002/11/20 (Perry Rapp)
12  *==============================================================*/
13 
14 #ifndef ICONV_SHIM_H_INCLUDED
15 #define ICONV_SHIM_H_INCLUDED 1
16 
17 #ifdef __cplusplus
18 extern "C" {
19 #endif
20 
21 /* package may define ICONVDECL to be __declspec(dllexport) to reexport these shim functions */
22 #ifndef ICONVDECL
23 #define ICONVDECL
24 #endif
25 
26 
27 ICONVDECL int get_libiconv_version(void);
28 
29 #define iconv_t libiconv_t
30 typedef void* iconv_t;
31 #include <stddef.h>
32 
33 /* Allocates descriptor for code conversion from encoding `fromcode' to
34    encoding `tocode'. */
35 ICONVDECL iconv_t iconv_open (const char* tocode, const char* fromcode);
36 
37 /* Converts, using conversion descriptor `cd', at most `*inbytesleft' bytes
38    starting at `*inbuf', writing at most `*outbytesleft' bytes starting at
39    `*outbuf'.
40    Decrements `*inbytesleft' and increments `*inbuf' by the same amount.
41    Decrements `*outbytesleft' and increments `*outbuf' by the same amount. */
42 ICONVDECL size_t iconv (iconv_t cd, const char* * inbuf, size_t *inbytesleft, char* * outbuf, size_t *outbytesleft);
43 
44 /* Frees resources allocated for conversion descriptor `cd'. */
45 ICONVDECL int iconv_close (iconv_t cd);
46 
47 
48 /* Nonstandard extensions. */
49 
50 /* Control of attributes. */
51 #define iconvctl libiconvctl
52 ICONVDECL int iconvctl (iconv_t cd, int request, void* argument);
53 
54 /* Requests for iconvctl. */
55 #define ICONV_TRIVIALP            0  /* int *argument */
56 #define ICONV_GET_TRANSLITERATE   1  /* int *argument */
57 #define ICONV_SET_TRANSLITERATE   2  /* const int *argument */
58 
59 /* iconvshim specific API */
60 ICONVDECL int iconvshim_get_property(const char *name, char * value, int valuelen);
61 ICONVDECL int iconvshim_set_property(const char *name, const char *value);
62 
63 /* simple utility functions */
64 int ishim_get_file_version(const char * filepath, char * verout, int veroutlen);
65 
66 #ifdef __cplusplus
67 }
68 #endif
69 
70 #endif /* ICONV_SHIM_H_INCLUDED */
71