xref: /freebsd/lib/libc/locale/mblocal.h (revision 2051a8f2d57177b199cf0cff25a18aaec0142086)
12051a8f2STim J. Robbins /*-
22051a8f2STim J. Robbins  * Copyright (c) 2004 Tim J. Robbins.
32051a8f2STim J. Robbins  * All rights reserved.
42051a8f2STim J. Robbins  *
52051a8f2STim J. Robbins  * Redistribution and use in source and binary forms, with or without
62051a8f2STim J. Robbins  * modification, are permitted provided that the following conditions
72051a8f2STim J. Robbins  * are met:
82051a8f2STim J. Robbins  * 1. Redistributions of source code must retain the above copyright
92051a8f2STim J. Robbins  *    notice, this list of conditions and the following disclaimer.
102051a8f2STim J. Robbins  * 2. Redistributions in binary form must reproduce the above copyright
112051a8f2STim J. Robbins  *    notice, this list of conditions and the following disclaimer in the
122051a8f2STim J. Robbins  *    documentation and/or other materials provided with the distribution.
132051a8f2STim J. Robbins  *
142051a8f2STim J. Robbins  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
152051a8f2STim J. Robbins  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
162051a8f2STim J. Robbins  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
172051a8f2STim J. Robbins  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
182051a8f2STim J. Robbins  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
192051a8f2STim J. Robbins  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
202051a8f2STim J. Robbins  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
212051a8f2STim J. Robbins  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
222051a8f2STim J. Robbins  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
232051a8f2STim J. Robbins  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
242051a8f2STim J. Robbins  * SUCH DAMAGE.
252051a8f2STim J. Robbins  *
262051a8f2STim J. Robbins  * $FreeBSD$
272051a8f2STim J. Robbins  */
282051a8f2STim J. Robbins 
292051a8f2STim J. Robbins #ifndef _MBLOCAL_H_
302051a8f2STim J. Robbins #define	_MBLOCAL_H_
312051a8f2STim J. Robbins 
322051a8f2STim J. Robbins #include <stddef.h>	/* XXX for rune_t */
332051a8f2STim J. Robbins 
342051a8f2STim J. Robbins /*
352051a8f2STim J. Robbins  * Conversion function pointers for current encoding.
362051a8f2STim J. Robbins  */
372051a8f2STim J. Robbins extern size_t (*__mbrtowc)(wchar_t * __restrict, const char * __restrict,
382051a8f2STim J. Robbins     size_t, mbstate_t * __restrict);
392051a8f2STim J. Robbins extern int (*__mbsinit)(const mbstate_t *);
402051a8f2STim J. Robbins extern size_t (*__wcrtomb)(char * __restrict, wchar_t, mbstate_t * __restrict);
412051a8f2STim J. Robbins 
422051a8f2STim J. Robbins /*
432051a8f2STim J. Robbins  * Conversion functions for "NONE"/C/POSIX encoding.
442051a8f2STim J. Robbins  */
452051a8f2STim J. Robbins extern size_t _none_mbrtowc(wchar_t * __restrict, const char * __restrict,
462051a8f2STim J. Robbins     size_t, mbstate_t * __restrict);
472051a8f2STim J. Robbins extern int _none_mbsinit(const mbstate_t *);
482051a8f2STim J. Robbins extern size_t _none_wcrtomb(char * __restrict, wchar_t,
492051a8f2STim J. Robbins     mbstate_t * __restrict);
502051a8f2STim J. Robbins 
512051a8f2STim J. Robbins /*
522051a8f2STim J. Robbins  * Rune emulation functions.
532051a8f2STim J. Robbins  */
542051a8f2STim J. Robbins extern rune_t __emulated_sgetrune(const char *, size_t, const char **);
552051a8f2STim J. Robbins extern int __emulated_sputrune(rune_t, char *, size_t, char **);
562051a8f2STim J. Robbins 
572051a8f2STim J. Robbins #endif	/* _MBLOCAL_H_ */
58