1 /* $MirOS: src/lib/libmbfun/mbfun.h,v 1.4 2014/02/19 16:59:33 tg Exp $ */ 2 3 /*- 4 * Copyright (c) 2010, 2011, 2013, 2014 5 * Thorsten Glaser <tg@mirbsd.org> 6 * 7 * Provided that these terms and disclaimer and all copyright notices 8 * are retained or reproduced in an accompanying document, permission 9 * is granted to deal in this work without restriction, including un- 10 * limited rights to use, publicly perform, distribute, sell, modify, 11 * merge, give away, or sublicence. 12 * 13 * This work is provided "AS IS" and WITHOUT WARRANTY of any kind, to 14 * the utmost extent permitted by applicable law, neither express nor 15 * implied; without malicious intent or gross negligence. In no event 16 * may a licensor, author or contributor be held liable for indirect, 17 * direct, other damage, loss, or other issues arising in any way out 18 * of dealing in the work, even if advised of the possibility of such 19 * damage or existence of a defect, except proven that it results out 20 * of said person's immediate fault when using the work as intended. 21 *- 22 * Function declarations for libmbfun (MirBSD-local functions) 23 */ 24 25 #ifndef _MBFUN_H 26 #define _MBFUN_H 27 28 #include <syskern/libckern.h> 29 30 __BEGIN_DECLS 31 /* allocating multibyte <-> wide character string conversion */ 32 wchar_t *ambsntowcs(const char *, size_t) 33 __attribute__((__nonnull__(1))) 34 __attribute__((__bounded__(__string__, 1, 2))); 35 wchar_t *ambstowcs(const char *) 36 __attribute__((__nonnull__(1))); 37 char *awcsntombs(const wchar_t *, size_t) 38 __attribute__((__nonnull__(1))); 39 char *awcstombs(const wchar_t *) 40 __attribute__((__nonnull__(1))); 41 /* support routine for lseek+read to make 2048-byte aligned I/O */ 42 ssize_t cdblockedread(int, void *, size_t, off_t) 43 __attribute__((__bounded__(__buffer__, 2, 3))); 44 /* legacy UTF-8 or cp1252-or-latin1 to wchar conversion */ 45 #undef mbsnrtowcsvis 46 #define mbsnrtowcsvis mbsnrtowcsvis 47 size_t mbsnrtowcsvis(wchar_t *, const char **, size_t, size_t, mbstate_t *); 48 #undef optu8to16vis 49 #define optu8to16vis optu8to16vis 50 size_t optu8to16vis(wchar_t *, const char *, size_t, mbstate_t *) 51 __attribute__((__bounded__(__string__, 2, 3))); 52 __END_DECLS 53 54 #endif 55