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: base64.c 155 2009-01-01 23:57:52Z itix $
21 ***************************************************************************/
24 #include "SDI_stdarg.h"
26 LIBSTUB(CodesetsEncodeB64A
, ULONG
, REG(a0
, struct TagItem
*attrs
))
28 return CodesetsEncodeB64A(attrs
);
31 LIBSTUBVA(CodesetsEncodeB64
, ULONG
, ...)
37 res
= CodesetsEncodeB64A(VA_ARG(args
, struct TagItem
*));
43 LIBSTUB(CodesetsDecodeB64A
, ULONG
, REG(a0
, struct TagItem
*attrs
))
45 return CodesetsDecodeB64A(attrs
);
48 LIBSTUBVA(CodesetsDecodeB64
, ULONG
, ...)
54 res
= CodesetsDecodeB64A(VA_ARG(args
, struct TagItem
*));
60 LIBSTUB(CodesetsSupportedA
, STRPTR
*, REG(a0
, struct TagItem
*attrs
))
62 return CodesetsSupportedA(attrs
);
65 LIBSTUBVA(CodesetsSupported
, STRPTR
*, ...)
71 res
= CodesetsSupportedA(VA_ARG(args
, struct TagItem
*));
77 LIBSTUB(CodesetsFreeA
, void, REG(a0
, APTR obj
), REG(a1
, struct TagItem
*attrs
))
79 return CodesetsFreeA(obj
, attrs
);
82 LIBSTUBVA(CodesetsFree
, void, REG(a0
, APTR obj
), ...)
87 CodesetsFreeA(obj
, VA_ARG(args
, struct TagItem
*));
91 LIBSTUB(CodesetsSetDefaultA
, struct codeset
*, REG(a0
, STRPTR name
), REG(a1
, struct TagItem
*attrs
))
93 return CodesetsSetDefaultA(name
, attrs
);
96 LIBSTUBVA(CodesetsSetDefault
, struct codeset
*, REG(a0
, STRPTR name
), ...)
101 VA_START(args
, name
);
102 cs
= CodesetsSetDefaultA(name
, VA_ARG(args
, struct TagItem
*));
108 LIBSTUB(CodesetsFindA
, struct codeset
*, REG(a0
, STRPTR name
), REG(a1
, struct TagItem
*attrs
))
110 return CodesetsFindA(name
, attrs
);
113 LIBSTUBVA(CodesetsFind
, struct codeset
*, REG(a0
, STRPTR name
), ...)
118 VA_START(args
, name
);
119 cs
= CodesetsFindA(name
, VA_ARG(args
, struct TagItem
*));
125 LIBSTUB(CodesetsFindBestA
, struct codeset
*, REG(a0
, struct TagItem
*attrs
))
127 return CodesetsFindBestA(attrs
);
130 LIBSTUBVA(CodesetsFindBest
, struct codeset
*, ...)
135 VA_START(args
, self
);
136 cs
= CodesetsFindBestA(VA_ARG(args
, struct TagItem
*));
142 LIBSTUB(CodesetsUTF8Len
, ULONG
, REG(a0
, UTF8
* str
))
144 return CodesetsUTF8Len(str
);
147 LIBSTUB(CodesetsStrLenA
, ULONG
, REG(a0
, STRPTR str
),
148 REG(a1
, struct TagItem
*attrs
))
150 return CodesetsStrLenA(str
, attrs
);
153 LIBSTUBVA(CodesetsStrLen
, ULONG
, REG(a0
, STRPTR str
), ...)
159 res
= CodesetsStrLenA(str
, VA_ARG(args
, struct TagItem
*));
165 LIBSTUB(CodesetsUTF8ToStrA
, STRPTR
, REG(a0
, struct TagItem
*attrs
))
167 return CodesetsUTF8ToStrA(attrs
);
170 LIBSTUBVA(CodesetsUTF8ToStr
, STRPTR
, ...)
175 VA_START(args
, self
);
176 res
= CodesetsUTF8ToStrA(VA_ARG(args
, struct TagItem
*));
182 LIBSTUB(CodesetsUTF8CreateA
, UTF8
*, REG(a0
, struct TagItem
*attrs
))
184 return CodesetsUTF8CreateA(attrs
);
187 LIBSTUBVA(CodesetsUTF8Create
, UTF8
*, ...)
192 VA_START(args
, self
);
193 res
= CodesetsUTF8CreateA(VA_ARG(args
, struct TagItem
*));
199 LIBSTUB(CodesetsIsValidUTF8
, BOOL
, REG(a0
, STRPTR s
))
201 return CodesetsIsValidUTF8(s
);
204 LIBSTUB(CodesetsConvertStrA
, STRPTR
, REG(a0
, struct TagItem
*attrs
))
206 return CodesetsConvertStrA(attrs
);
209 LIBSTUBVA(CodesetsConvertStr
, STRPTR
, ...)
214 VA_START(args
, self
);
215 res
= CodesetsConvertStrA(VA_ARG(args
, struct TagItem
*));
221 LIBSTUB(CodesetsFreeVecPooledA
, void, REG(a0
, APTR pool
),
223 REG(a2
, struct TagItem
*attrs
))
225 return CodesetsFreeVecPooledA(pool
, mem
, attrs
);
228 LIBSTUBVA(CodesetsFreeVecPooled
, void, REG(a0
, APTR pool
),
229 REG(a1
, APTR mem
), ...)
234 CodesetsFreeVecPooledA(pool
, mem
, VA_ARG(args
, struct TagItem
*));
238 LIBSTUB(CodesetsListCreateA
, struct codesetList
*, REG(a0
, struct TagItem
*attrs
))
240 return CodesetsListCreateA(attrs
);
243 LIBSTUBVA(CodesetsListCreate
, struct codesetList
*, ...)
245 struct codesetList
*res
;
248 VA_START(args
, self
);
249 res
= CodesetsListCreateA(VA_ARG(args
, struct TagItem
*));
255 LIBSTUB(CodesetsListDeleteA
, BOOL
, REG(a0
, struct TagItem
*attrs
))
257 return CodesetsListDeleteA(attrs
);
260 LIBSTUBVA(CodesetsListDelete
, BOOL
, ...)
265 VA_START(args
, self
);
266 result
= CodesetsListDeleteA(VA_ARG(args
, struct TagItem
*));
272 LIBSTUB(CodesetsListAddA
, BOOL
, REG(a0
, struct codesetList
*csList
), REG(a1
, struct TagItem
*attrs
))
274 return CodesetsListAddA(csList
, attrs
);
277 LIBSTUBVA(CodesetsListAdd
, BOOL
, struct codesetList
*csList
, ...)
282 VA_START(args
, csList
);
283 result
= CodesetsListAddA(csList
, VA_ARG(args
, struct TagItem
*));
289 LIBSTUB(CodesetsListRemoveA
, BOOL
, REG(a0
, struct TagItem
*attrs
))
291 return CodesetsListRemoveA(attrs
);
294 LIBSTUBVA(CodesetsListRemove
, BOOL
, ...)
299 VA_START(args
, self
);
300 result
= CodesetsListRemoveA(VA_ARG(args
, struct TagItem
*));
306 LIBSTUB(CodesetsConvertUTF32toUTF16
, ULONG
, REG(a0
, const UTF32
** sourceStart
),
307 REG(a1
, const UTF32
* sourceEnd
),
308 REG(a2
, UTF16
** targetStart
),
309 REG(a3
, UTF16
* targetEnd
),
310 REG(d0
, ULONG flags
))
312 return CodesetsConvertUTF32toUTF16(sourceStart
, sourceEnd
, targetStart
, targetEnd
, flags
);
316 LIBSTUB(CodesetsConvertUTF16toUTF32
, ULONG
, REG(a0
, const UTF16
** sourceStart
),
317 REG(a1
, const UTF16
* sourceEnd
),
318 REG(a2
, UTF32
** targetStart
),
319 REG(a3
, UTF32
* targetEnd
),
320 REG(d0
, ULONG flags
))
322 return CodesetsConvertUTF16toUTF32(sourceStart
, sourceEnd
, targetStart
, targetEnd
, flags
);
325 LIBSTUB(CodesetsConvertUTF16toUTF8
, ULONG
, REG(a0
, const UTF16
** sourceStart
),
326 REG(a1
, const UTF16
* sourceEnd
),
327 REG(a2
, UTF8
** targetStart
),
328 REG(a3
, UTF8
* targetEnd
),
329 REG(d0
, ULONG flags
))
331 return CodesetsConvertUTF16toUTF8(sourceStart
, sourceEnd
, targetStart
, targetEnd
, flags
);
334 LIBSTUB(CodesetsIsLegalUTF8
, BOOL
, REG(a0
, const UTF8
* source
),
335 REG(d0
, ULONG length
))
337 return CodesetsIsLegalUTF8(source
, length
);
340 LIBSTUB(CodesetsIsLegalUTF8Sequence
, BOOL
, REG(a0
, const UTF8
* source
),
341 REG(a1
, const UTF8
* sourceEnd
))
343 return CodesetsIsLegalUTF8Sequence(source
, sourceEnd
);
346 LIBSTUB(CodesetsConvertUTF8toUTF16
, ULONG
, REG(a0
, const UTF8
** sourceStart
),
347 REG(a1
, const UTF8
* sourceEnd
),
348 REG(a2
, UTF16
** targetStart
),
349 REG(a3
, UTF16
* targetEnd
),
350 REG(d0
, ULONG flags
))
352 return CodesetsConvertUTF8toUTF16(sourceStart
, sourceEnd
, targetStart
, targetEnd
, flags
);
355 LIBSTUB(CodesetsConvertUTF32toUTF8
, ULONG
, REG(a0
, const UTF32
** sourceStart
),
356 REG(a1
, const UTF32
* sourceEnd
),
357 REG(a2
, UTF8
** targetStart
),
358 REG(a3
, UTF8
* targetEnd
),
359 REG(d0
, ULONG flags
))
361 return CodesetsConvertUTF32toUTF8(sourceStart
, sourceEnd
, targetStart
, targetEnd
, flags
);
364 LIBSTUB(CodesetsConvertUTF8toUTF32
, ULONG
, REG(a0
, const UTF8
** sourceStart
),
365 REG(a1
, const UTF8
* sourceEnd
),
366 REG(a2
, UTF32
** targetStart
),
367 REG(a3
, UTF32
* targetEnd
),
368 REG(d0
, ULONG flags
))
370 return CodesetsConvertUTF8toUTF32(sourceStart
, sourceEnd
, targetStart
, targetEnd
, flags
);