xref: /freebsd/include/xlocale/_stdlib.h (revision a8ed63bb3d75a8057a0ed2e758964b7785106f33)
1*a8ed63bbSDavid Chisnall /*-
2*a8ed63bbSDavid Chisnall  * Copyright (c) 2011, 2012 The FreeBSD Foundation
3*a8ed63bbSDavid Chisnall  * All rights reserved.
4*a8ed63bbSDavid Chisnall  *
5*a8ed63bbSDavid Chisnall  * This software was developed by David Chisnall under sponsorship from
6*a8ed63bbSDavid Chisnall  * the FreeBSD Foundation.
7*a8ed63bbSDavid Chisnall  *
8*a8ed63bbSDavid Chisnall  * Redistribution and use in source and binary forms, with or without
9*a8ed63bbSDavid Chisnall  * modification, are permitted provided that the following conditions
10*a8ed63bbSDavid Chisnall  * are met:
11*a8ed63bbSDavid Chisnall  * 1. Redistributions of source code must retain the above copyright
12*a8ed63bbSDavid Chisnall  *    notice, this list of conditions and the following disclaimer.
13*a8ed63bbSDavid Chisnall  * 2. Redistributions in binary form must reproduce the above copyright
14*a8ed63bbSDavid Chisnall  *    notice, this list of conditions and the following disclaimer in the
15*a8ed63bbSDavid Chisnall  *    documentation and/or other materials provided with the distribution.
16*a8ed63bbSDavid Chisnall  *
17*a8ed63bbSDavid Chisnall  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
18*a8ed63bbSDavid Chisnall  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19*a8ed63bbSDavid Chisnall  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20*a8ed63bbSDavid Chisnall  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
21*a8ed63bbSDavid Chisnall  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22*a8ed63bbSDavid Chisnall  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23*a8ed63bbSDavid Chisnall  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24*a8ed63bbSDavid Chisnall  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25*a8ed63bbSDavid Chisnall  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26*a8ed63bbSDavid Chisnall  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27*a8ed63bbSDavid Chisnall  * SUCH DAMAGE.
28*a8ed63bbSDavid Chisnall  *
29*a8ed63bbSDavid Chisnall  * $FreeBSD$
30*a8ed63bbSDavid Chisnall  */
31*a8ed63bbSDavid Chisnall 
32*a8ed63bbSDavid Chisnall /*
33*a8ed63bbSDavid Chisnall  * Extended locale versions of the locale-aware functions from stdlib.h.
34*a8ed63bbSDavid Chisnall  *
35*a8ed63bbSDavid Chisnall  * Include <stdlib.h> before <xlocale.h> to expose these.
36*a8ed63bbSDavid Chisnall  */
37*a8ed63bbSDavid Chisnall double			 atof_l(const char *, locale_t);
38*a8ed63bbSDavid Chisnall int			 atoi_l(const char *, locale_t);
39*a8ed63bbSDavid Chisnall long			 atol_l(const char *, locale_t);
40*a8ed63bbSDavid Chisnall long long		 atoll_l(const char *, locale_t);
41*a8ed63bbSDavid Chisnall int			 mblen_l(const char *, size_t, locale_t);
42*a8ed63bbSDavid Chisnall size_t			 mbstowcs_l(wchar_t * __restrict,
43*a8ed63bbSDavid Chisnall 			    const char * __restrict, size_t, locale_t);
44*a8ed63bbSDavid Chisnall int			 mbtowc_l(wchar_t * __restrict,
45*a8ed63bbSDavid Chisnall 			    const char * __restrict, size_t, locale_t);
46*a8ed63bbSDavid Chisnall double			 strtod_l(const char *, char **, locale_t);
47*a8ed63bbSDavid Chisnall float			 strtof_l(const char *, char **, locale_t);
48*a8ed63bbSDavid Chisnall long			 strtol_l(const char *, char **, int, locale_t);
49*a8ed63bbSDavid Chisnall long double		 strtold_l(const char *, char **, locale_t);
50*a8ed63bbSDavid Chisnall long long		 strtoll_l(const char *, char **, int, locale_t);
51*a8ed63bbSDavid Chisnall unsigned long		 strtoul_l(const char *, char **, int, locale_t);
52*a8ed63bbSDavid Chisnall unsigned long long	 strtoull_l(const char *, char **, int, locale_t);
53*a8ed63bbSDavid Chisnall size_t			 wcstombs_l(char * __restrict,
54*a8ed63bbSDavid Chisnall 			    const wchar_t * __restrict, size_t, locale_t);
55*a8ed63bbSDavid Chisnall int			 wctomb_l(char *, wchar_t, locale_t);
56*a8ed63bbSDavid Chisnall 
57*a8ed63bbSDavid Chisnall int			 ___mb_cur_max_l(locale_t);
58*a8ed63bbSDavid Chisnall #define MB_CUR_MAX_L(x) (___mb_cur_max_l(x))
59*a8ed63bbSDavid Chisnall 
60