Fixed binary search: no more infinite loops when vendor is unknown.
[tangerine.git] / workbench / libs / codesetslib / src / lib_protos.h
blob104869d336c158a62fa0d16b8be50a2944d1b9b5
1 /***************************************************************************
3 codesets.library - Amiga shared library for handling different codesets
4 Copyright (C) 2001-2005 by Alfonso [alfie] Ranieri <alforan@tin.it>.
5 Copyright (C) 2005-2009 by codesets.library Open Source Team
7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Lesser General Public
9 License as published by the Free Software Foundation; either
10 version 2.1 of the License, or (at your option) any later version.
12 This library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Lesser General Public License for more details.
17 codesets.library project: http://sourceforge.net/projects/codesetslib/
19 $Id$
21 ***************************************************************************/
23 #ifndef _LIB_PROTOS_H
24 #define _LIB_PROTOS_H
26 #include "SDI_lib.h"
28 /* init.c */
29 ULONG freeBase(struct LibraryHeader* lib);
30 ULONG initBase(struct LibraryHeader* lib);
32 /* utils.c */
33 #if defined(__amigaos4__) || defined(__MORPHOS__)
34 #define HAVE_ALLOCVECPOOLED 1
35 #define HAVE_FREEVECPOOLED 1
36 #endif
38 #if defined(HAVE_ALLOCVECPOOLED)
39 #define allocVecPooled(pool,size) AllocVecPooled(pool,size)
40 #else
41 APTR allocVecPooled(APTR pool, ULONG size);
42 #endif
43 #if defined(HAVE_FREEVECPOOLED)
44 #define freeVecPooled(pool,mem) FreeVecPooled(pool,mem)
45 #else
46 void freeVecPooled(APTR pool, APTR mem);
47 #endif
48 APTR reallocVecPooled(APTR pool, APTR mem, ULONG oldSize, ULONG newSize);
49 APTR allocArbitrateVecPooled(ULONG size);
50 void freeArbitrateVecPooled(APTR mem);
51 APTR reallocArbitrateVecPooled(APTR mem, ULONG oldSize, ULONG newSize);
52 ULONG utf16_strlen(UTF16 *ptr);
53 ULONG utf32_strlen(UTF32 *ptr);
55 /* base64.c */
56 LIBPROTO(CodesetsEncodeB64A, ULONG, REG(a0, struct TagItem *attrs));
57 LIBPROTOVA(CodesetsEncodeB64,ULONG, ...);
58 LIBPROTO(CodesetsDecodeB64A, ULONG, REG(a0, struct TagItem *attrs));
59 LIBPROTOVA(CodesetsDecodeB64,ULONG, ...);
61 /* convertUTF.c */
62 LIBPROTO(CodesetsConvertUTF32toUTF16, ULONG, REG(a0, const UTF32 **sourceStart), REG(a1, const UTF32 *sourceEnd), REG(a2, UTF16 **targetStart), REG(a3, UTF16 *targetEnd), REG(d0, ULONG flags));
63 LIBPROTO(CodesetsConvertUTF16toUTF32, ULONG, REG(a0, const UTF16 **sourceStart), REG(a1, const UTF16 *sourceEnd), REG(a2, UTF32 **targetStart), REG(a3, UTF32 *targetEnd), REG(d0, ULONG flags));
64 LIBPROTO(CodesetsConvertUTF16toUTF8, ULONG, REG(a0, const UTF16 **sourceStart), REG(a1, const UTF16 *sourceEnd) , REG(a2, UTF8 **targetStart), REG(a3, UTF8 *targetEnd), REG(d0, ULONG flags));
65 LIBPROTO(CodesetsIsLegalUTF8, BOOL, REG(a0, const UTF8 *source), REG(d0, ULONG length));
66 LIBPROTO(CodesetsIsLegalUTF8Sequence, BOOL, REG(a0, const UTF8 *source), REG(a1, const UTF8 *sourceEnd));
67 LIBPROTO(CodesetsConvertUTF8toUTF16, ULONG, REG(a0, const UTF8 **sourceStart), REG(a1, const UTF8 *sourceEnd), REG(a2, UTF16 **targetStart), REG(a3, UTF16 *targetEnd), REG(d0, ULONG flags));
68 LIBPROTO(CodesetsConvertUTF32toUTF8, ULONG, REG(a0, const UTF32 **sourceStart), REG(a1, const UTF32 *sourceEnd), REG(a2, UTF8 **targetStart), REG(a3, UTF8 *targetEnd), REG(d0, ULONG flags));
69 LIBPROTO(CodesetsConvertUTF8toUTF32, ULONG, REG(a0, const UTF8 **sourceStart), REG(a1, const UTF8 *sourceEnd), REG(a2, UTF32 **targetStart), REG(a3, UTF32 *targetEnd), REG(d0, ULONG flags));
71 /* codesets.c */
72 BOOL codesetsInit(struct codesetList *csList);
73 void codesetsCleanup(struct codesetList *csList);
74 struct codeset *codesetsFind(struct codesetList *csList, const char *name);
76 LIBPROTO(CodesetsSupportedA, STRPTR *, REG(a0, struct TagItem *attrs));
77 LIBPROTOVA(CodesetsSupported, STRPTR *, ...);
78 LIBPROTO(CodesetsFreeA, void, REG(a0, APTR obj), REG(a1, struct TagItem *attrs));
79 LIBPROTOVA(CodesetsFree, void, REG(a0, APTR obj), ...);
80 LIBPROTO(CodesetsSetDefaultA, struct codeset *, REG(a0, STRPTR name), REG(a1, struct TagItem *attrs));
81 LIBPROTOVA(CodesetsSetDefault,struct codeset *, REG(a0, STRPTR name), ...);
82 LIBPROTO(CodesetsFindA, struct codeset *, REG(a0, STRPTR name), REG(a1, struct TagItem *attrs));
83 LIBPROTOVA(CodesetsFind, struct codeset *, REG(a0, STRPTR name), ...);
84 LIBPROTO(CodesetsFindBestA, struct codeset *, REG(a0, struct TagItem *attrs));
85 LIBPROTOVA(CodesetsFindBest, struct codeset *, ...);
86 LIBPROTO(CodesetsStrLenA, ULONG, REG(a0, STRPTR str), REG(a1, struct TagItem *attrs));
87 LIBPROTOVA(CodesetsStrLen, ULONG, REG(a0, STRPTR str), ...);
88 LIBPROTO(CodesetsConvertStrA, STRPTR, REG(a0, struct TagItem *attrs));
89 LIBPROTOVA(CodesetsConvertStr,STRPTR, ...);
90 LIBPROTO(CodesetsUTF8ToStrA, STRPTR, REG(a0, struct TagItem *attrs));
91 LIBPROTOVA(CodesetsUTF8ToStr, STRPTR, ...);
92 LIBPROTO(CodesetsUTF8CreateA, UTF8 *, REG(a0, struct TagItem *attrs));
93 LIBPROTOVA(CodesetsUTF8Create,UTF8 *, ...);
94 LIBPROTO(CodesetsFreeVecPooledA, void, REG(a0, APTR pool), REG(a1, APTR mem), REG(a2, struct TagItem *attrs));
95 LIBPROTOVA(CodesetsFreeVecPooled,void, REG(a0, APTR pool), REG(a1, APTR mem), ...);
96 LIBPROTO(CodesetsIsValidUTF8,BOOL, REG(a0, STRPTR s));
97 LIBPROTO(CodesetsUTF8Len, ULONG, REG(a0, UTF8 *str));
98 LIBPROTO(CodesetsListCreateA, struct codesetList *, REG(a0, struct TagItem *attrs));
99 LIBPROTOVA(CodesetsListCreate, struct codesetList *, ...);
100 LIBPROTO(CodesetsListDeleteA, BOOL, REG(a0, struct TagItem *attrs));
101 LIBPROTOVA(CodesetsListDelete, BOOL, ...);
102 LIBPROTO(CodesetsListAddA, BOOL, REG(a0, struct codesetList *csList), REG(a1, struct TagItem *attrs));
103 LIBPROTOVA(CodesetsListAdd, BOOL, REG(a0, struct codesetList *csList), ...);
104 LIBPROTO(CodesetsListRemoveA, BOOL, REG(a0, struct TagItem *attrs));
105 LIBPROTOVA(CodesetsListRemove, BOOL, ...);
107 #endif /* _LIB_PROTOS_H */