Fixed binary search: no more infinite loops when vendor is unknown.
[tangerine.git] / workbench / libs / codesetslib / src / stubs-amigaos4.c
blob5279f008a38b7b985e2c9103fbc6d0710c6e9770
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 ***************************************************************************/
23 #include "lib.h"
24 #include "SDI_stdarg.h"
26 LIBSTUB(CodesetsEncodeB64A, ULONG, REG(a0, struct TagItem *attrs))
28 return CodesetsEncodeB64A(attrs);
31 LIBSTUBVA(CodesetsEncodeB64, ULONG, ...)
33 ULONG res;
34 VA_LIST args;
36 VA_START(args, self);
37 res = CodesetsEncodeB64A(VA_ARG(args, struct TagItem *));
38 VA_END(args);
40 return res;
43 LIBSTUB(CodesetsDecodeB64A, ULONG, REG(a0, struct TagItem *attrs))
45 return CodesetsDecodeB64A(attrs);
48 LIBSTUBVA(CodesetsDecodeB64, ULONG, ...)
50 ULONG res;
51 VA_LIST args;
53 VA_START(args, self);
54 res = CodesetsDecodeB64A(VA_ARG(args, struct TagItem *));
55 VA_END(args);
57 return res;
60 LIBSTUB(CodesetsSupportedA, STRPTR*, REG(a0, struct TagItem *attrs))
62 return CodesetsSupportedA(attrs);
65 LIBSTUBVA(CodesetsSupported, STRPTR*, ...)
67 STRPTR* res;
68 VA_LIST args;
70 VA_START(args, self);
71 res = CodesetsSupportedA(VA_ARG(args, struct TagItem *));
72 VA_END(args);
74 return res;
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), ...)
84 VA_LIST args;
86 VA_START(args, obj);
87 CodesetsFreeA(obj, VA_ARG(args, struct TagItem *));
88 VA_END(args);
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), ...)
98 struct codeset *cs;
99 VA_LIST args;
101 VA_START(args, name);
102 cs = CodesetsSetDefaultA(name, VA_ARG(args, struct TagItem *));
103 VA_END(args);
105 return cs;
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), ...)
115 struct codeset *cs;
116 VA_LIST args;
118 VA_START(args, name);
119 cs = CodesetsFindA(name, VA_ARG(args, struct TagItem *));
120 VA_END(args);
122 return cs;
125 LIBSTUB(CodesetsFindBestA, struct codeset *, REG(a0, struct TagItem *attrs))
127 return CodesetsFindBestA(attrs);
130 LIBSTUBVA(CodesetsFindBest, struct codeset *, ...)
132 struct codeset *cs;
133 VA_LIST args;
135 VA_START(args, self);
136 cs = CodesetsFindBestA(VA_ARG(args, struct TagItem *));
137 VA_END(args);
139 return cs;
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), ...)
155 ULONG res;
156 VA_LIST args;
158 VA_START(args, str);
159 res = CodesetsStrLenA(str, VA_ARG(args, struct TagItem *));
160 VA_END(args);
162 return res;
165 LIBSTUB(CodesetsUTF8ToStrA, STRPTR, REG(a0, struct TagItem *attrs))
167 return CodesetsUTF8ToStrA(attrs);
170 LIBSTUBVA(CodesetsUTF8ToStr, STRPTR, ...)
172 STRPTR res;
173 VA_LIST args;
175 VA_START(args, self);
176 res = CodesetsUTF8ToStrA(VA_ARG(args, struct TagItem *));
177 VA_END(args);
179 return res;
182 LIBSTUB(CodesetsUTF8CreateA, UTF8*, REG(a0, struct TagItem *attrs))
184 return CodesetsUTF8CreateA(attrs);
187 LIBSTUBVA(CodesetsUTF8Create, UTF8*, ...)
189 UTF8 *res;
190 VA_LIST args;
192 VA_START(args, self);
193 res = CodesetsUTF8CreateA(VA_ARG(args, struct TagItem *));
194 VA_END(args);
196 return res;
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, ...)
211 STRPTR res;
212 VA_LIST args;
214 VA_START(args, self);
215 res = CodesetsConvertStrA(VA_ARG(args, struct TagItem *));
216 VA_END(args);
218 return res;
221 LIBSTUB(CodesetsFreeVecPooledA, void, REG(a0, APTR pool),
222 REG(a1, APTR mem),
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), ...)
231 VA_LIST args;
233 VA_START(args, mem);
234 CodesetsFreeVecPooledA(pool, mem, VA_ARG(args, struct TagItem *));
235 VA_END(args);
238 LIBSTUB(CodesetsListCreateA, struct codesetList *, REG(a0, struct TagItem *attrs))
240 return CodesetsListCreateA(attrs);
243 LIBSTUBVA(CodesetsListCreate, struct codesetList *, ...)
245 struct codesetList *res;
246 VA_LIST args;
248 VA_START(args, self);
249 res = CodesetsListCreateA(VA_ARG(args, struct TagItem *));
250 VA_END(args);
252 return res;
255 LIBSTUB(CodesetsListDeleteA, BOOL, REG(a0, struct TagItem *attrs))
257 return CodesetsListDeleteA(attrs);
260 LIBSTUBVA(CodesetsListDelete, BOOL, ...)
262 BOOL result;
263 VA_LIST args;
265 VA_START(args, self);
266 result = CodesetsListDeleteA(VA_ARG(args, struct TagItem *));
267 VA_END(args);
269 return result;
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, ...)
279 BOOL result;
280 VA_LIST args;
282 VA_START(args, csList);
283 result = CodesetsListAddA(csList, VA_ARG(args, struct TagItem *));
284 VA_END(args);
286 return result;
289 LIBSTUB(CodesetsListRemoveA, BOOL, REG(a0, struct TagItem *attrs))
291 return CodesetsListRemoveA(attrs);
294 LIBSTUBVA(CodesetsListRemove, BOOL, ...)
296 BOOL result;
297 VA_LIST args;
299 VA_START(args, self);
300 result = CodesetsListRemoveA(VA_ARG(args, struct TagItem *));
301 VA_END(args);
303 return result;
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);