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-2007 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/
21 ***************************************************************************/
27 #define __CODESETS_NOLIBBASE__
28 #include <proto/codesets.h>
34 ULONG
freeBase(struct LibraryHeader
* lib
);
35 ULONG
initBase(struct LibraryHeader
* lib
);
38 APTR
allocVecPooled(APTR pool
, ULONG size
);
39 void freeVecPooled(APTR pool
, APTR mem
);
40 APTR
allocArbitratePooled(ULONG s
);
41 void freeArbitratePooled(APTR mem
, ULONG s
);
42 APTR
allocArbitrateVecPooled(ULONG size
);
43 void freeArbitrateVecPooled(APTR mem
);
47 LIBPROTO(CodesetsEncodeB64A
, ULONG
, REG(a0
, struct TagItem
*attrs
));
48 LIBPROTOVA(CodesetsEncodeB64
,ULONG
, ...);
49 LIBPROTO(CodesetsDecodeB64A
, ULONG
, REG(a0
, struct TagItem
*attrs
));
50 LIBPROTOVA(CodesetsDecodeB64
,ULONG
, ...);
55 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
));
56 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
));
57 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
));
58 LIBPROTO(CodesetsIsLegalUTF8
, BOOL
, REG(a0
, const UTF8
*source
), REG(d0
, ULONG length
));
59 LIBPROTO(CodesetsIsLegalUTF8Sequence
, BOOL
, REG(a0
, const UTF8
*source
), REG(a1
, const UTF8
*sourceEnd
));
60 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
));
61 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
));
62 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
));
66 BOOL
codesetsInit(struct codesetList
*csList
);
67 void codesetsCleanup(struct codesetList
*csList
);
68 struct codeset
*codesetsFind(struct codesetList
*csList
, const char *name
);
71 LIBPROTO(CodesetsSupportedA
, STRPTR
*, REG(a0
, struct TagItem
*attrs
));
72 LIBPROTOVA(CodesetsSupported
, STRPTR
*, ...);
73 LIBPROTO(CodesetsFreeA
, void, REG(a0
, APTR obj
), REG(a1
, struct TagItem
*attrs
));
74 LIBPROTOVA(CodesetsFree
, void, REG(a0
, APTR obj
), ...);
75 LIBPROTO(CodesetsSetDefaultA
, struct codeset
*, REG(a0
, STRPTR name
), REG(a1
, struct TagItem
*attrs
));
76 LIBPROTOVA(CodesetsSetDefault
,struct codeset
*, REG(a0
, STRPTR name
), ...);
77 LIBPROTO(CodesetsFindA
, struct codeset
*, REG(a0
, STRPTR name
), REG(a1
, struct TagItem
*attrs
));
78 LIBPROTOVA(CodesetsFind
, struct codeset
*, REG(a0
, STRPTR name
), ...);
79 LIBPROTO(CodesetsFindBestA
, struct codeset
*, REG(a0
, struct TagItem
*attrs
));
80 LIBPROTOVA(CodesetsFindBest
, struct codeset
*, ...);
81 LIBPROTO(CodesetsStrLenA
, ULONG
, REG(a0
, STRPTR str
), REG(a1
, struct TagItem
*attrs
));
82 LIBPROTOVA(CodesetsStrLen
, ULONG
, REG(a0
, STRPTR str
), ...);
83 LIBPROTO(CodesetsConvertStrA
, STRPTR
, REG(a0
, struct TagItem
*attrs
));
84 LIBPROTOVA(CodesetsConvertStr
,STRPTR
, ...);
85 LIBPROTO(CodesetsUTF8ToStrA
, STRPTR
, REG(a0
, struct TagItem
*attrs
));
86 LIBPROTOVA(CodesetsUTF8ToStr
, STRPTR
, ...);
87 LIBPROTO(CodesetsUTF8CreateA
, UTF8
*, REG(a0
, struct TagItem
*attrs
));
88 LIBPROTOVA(CodesetsUTF8Create
,UTF8
*, ...);
89 LIBPROTO(CodesetsFreeVecPooledA
, void, REG(a0
, APTR pool
), REG(a1
, APTR mem
), REG(a2
, struct TagItem
*attrs
));
90 LIBPROTOVA(CodesetsFreeVecPooled
,void, REG(a0
, APTR pool
), REG(a1
, APTR mem
), ...);
91 LIBPROTO(CodesetsIsValidUTF8
,BOOL
, REG(a0
, STRPTR s
));
92 LIBPROTO(CodesetsUTF8Len
, ULONG
, REG(a0
, UTF8
*str
));
93 LIBPROTO(CodesetsListCreateA
, struct codesetList
*, REG(a0
, struct TagItem
*attrs
));
94 LIBPROTOVA(CodesetsListCreate
, struct codesetList
*, ...);
95 LIBPROTO(CodesetsListDeleteA
, BOOL
, REG(a0
, struct TagItem
*attrs
));
96 LIBPROTOVA(CodesetsListDelete
, BOOL
, ...);
97 LIBPROTO(CodesetsListAddA
, BOOL
, REG(a0
, struct codesetList
*csList
), REG(a1
, struct TagItem
*attrs
));
98 LIBPROTOVA(CodesetsListAdd
, BOOL
, REG(a0
, struct codesetList
*csList
), ...);
99 LIBPROTO(CodesetsListRemoveA
, BOOL
, REG(a0
, struct TagItem
*attrs
));
100 LIBPROTOVA(CodesetsListRemove
, BOOL
, ...);
101 #endif /* __AROS__ */
103 #endif /* _LIB_PROTOS_H */