blob: 4494cb043da5be142d86c0387fdbc4fa900aa6e7 [file] [log] [blame]
The Android Open Source Project1dc9e472009-03-03 19:28:35 -08001/*
2 * Copyright (C) 2008 The Android Open Source Project
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in
12 * the documentation and/or other materials provided with the
13 * distribution.
14 *
15 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
16 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
17 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
18 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
19 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
20 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
21 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
22 * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
23 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
25 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 * SUCH DAMAGE.
27 */
28#ifndef _WCHAR_H_
29#define _WCHAR_H_
30
31#include <sys/cdefs.h>
32#include <stdio.h>
33
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080034#include <stdarg.h>
Elliott Hughes0cc0d252012-10-01 15:12:40 -070035#include <stddef.h>
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080036#include <time.h>
Elliott Hughesb20c2442014-11-06 15:04:08 -080037#include <xlocale.h>
Elliott Hughes83c07b52014-04-21 18:09:46 -070038
Elliott Hughes0fe88852016-07-27 10:45:05 -070039#include <bits/mbstate_t.h>
Elliott Hughes5704c422016-01-25 18:06:24 -080040#include <bits/wchar_limits.h>
Elliott Hughes7ba106c2016-04-28 18:22:06 -070041#include <bits/wctype.h>
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080042
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080043__BEGIN_DECLS
44
Colin Cross9af91202017-08-17 18:29:54 +000045wint_t btowc(int);
46int fwprintf(FILE *, const wchar_t *, ...);
47int fwscanf(FILE *, const wchar_t *, ...);
48wint_t fgetwc(FILE *);
49wchar_t *fgetws(wchar_t *, int, FILE *);
50wint_t fputwc(wchar_t, FILE *);
51int fputws(const wchar_t *, FILE *);
52int fwide(FILE *, int);
53wint_t getwc(FILE *);
54wint_t getwchar(void);
55int mbsinit(const mbstate_t *);
56size_t mbrlen(const char *, size_t, mbstate_t *);
57size_t mbrtowc(wchar_t *, const char *, size_t, mbstate_t *);
58size_t mbsrtowcs(wchar_t*, const char**, size_t, mbstate_t*);
59size_t mbsnrtowcs(wchar_t*, const char**, size_t, size_t, mbstate_t*) __INTRODUCED_IN(21);
60wint_t putwc(wchar_t, FILE *);
61wint_t putwchar(wchar_t);
62int swprintf(wchar_t *, size_t, const wchar_t *, ...);
63int swscanf(const wchar_t *, const wchar_t *, ...);
64wint_t ungetwc(wint_t, FILE *);
65int vfwprintf(FILE*, const wchar_t*, va_list);
66int vfwscanf(FILE*, const wchar_t*, va_list) __INTRODUCED_IN(21);
67int vswprintf(wchar_t*, size_t, const wchar_t*, va_list);
68int vswscanf(const wchar_t*, const wchar_t*, va_list) __INTRODUCED_IN(21);
69int vwprintf(const wchar_t*, va_list);
70int vwscanf(const wchar_t*, va_list) __INTRODUCED_IN(21);
71wchar_t* wcpcpy (wchar_t*, const wchar_t *);
72wchar_t* wcpncpy (wchar_t*, const wchar_t *, size_t);
73size_t wcrtomb(char *, wchar_t, mbstate_t *);
74int wcscasecmp(const wchar_t *, const wchar_t *);
75int wcscasecmp_l(const wchar_t*, const wchar_t*, locale_t) __INTRODUCED_IN(23);
76wchar_t *wcscat(wchar_t *, const wchar_t *);
77wchar_t *wcschr(const wchar_t *, wchar_t);
78int wcscmp(const wchar_t *, const wchar_t *);
79int wcscoll(const wchar_t *, const wchar_t *);
80wchar_t *wcscpy(wchar_t *, const wchar_t *);
81size_t wcscspn(const wchar_t *, const wchar_t *);
82size_t wcsftime(wchar_t *, size_t, const wchar_t *, const struct tm *);
83size_t wcslen(const wchar_t *);
84int wcsncasecmp(const wchar_t *, const wchar_t *, size_t);
85int wcsncasecmp_l(const wchar_t*, const wchar_t*, size_t, locale_t) __INTRODUCED_IN(23);
86wchar_t *wcsncat(wchar_t *, const wchar_t *, size_t);
87int wcsncmp(const wchar_t *, const wchar_t *, size_t);
88wchar_t *wcsncpy(wchar_t *, const wchar_t *, size_t);
89size_t wcsnrtombs(char*, const wchar_t**, size_t, size_t, mbstate_t*) __INTRODUCED_IN(21);
90wchar_t *wcspbrk(const wchar_t *, const wchar_t *);
91wchar_t *wcsrchr(const wchar_t *, wchar_t);
92size_t wcsrtombs(char*, const wchar_t**, size_t, mbstate_t*);
93size_t wcsspn(const wchar_t *, const wchar_t *);
94wchar_t *wcsstr(const wchar_t *, const wchar_t *);
95double wcstod(const wchar_t*, wchar_t**);
96float wcstof(const wchar_t*, wchar_t**) __INTRODUCED_IN(21);
97wchar_t* wcstok(wchar_t*, const wchar_t*, wchar_t**);
98long wcstol(const wchar_t*, wchar_t**, int);
99long long wcstoll(const wchar_t*, wchar_t**, int) __INTRODUCED_IN(21);
100long double wcstold(const wchar_t*, wchar_t**) __INTRODUCED_IN(21);
101unsigned long wcstoul(const wchar_t*, wchar_t**, int);
102unsigned long long wcstoull(const wchar_t*, wchar_t**, int) __INTRODUCED_IN(21);
103int wcswidth(const wchar_t *, size_t);
104size_t wcsxfrm(wchar_t *, const wchar_t *, size_t);
105int wctob(wint_t);
106int wcwidth(wchar_t);
107wchar_t *wmemchr(const wchar_t *, wchar_t, size_t);
108int wmemcmp(const wchar_t *, const wchar_t *, size_t);
109wchar_t *wmemcpy(wchar_t *, const wchar_t *, size_t);
Elliott Hughes3cfb52a2015-02-18 21:29:13 -0800110#if defined(__USE_GNU)
Colin Cross9af91202017-08-17 18:29:54 +0000111wchar_t* wmempcpy(wchar_t*, const wchar_t*, size_t) __INTRODUCED_IN(23);
Elliott Hughes3cfb52a2015-02-18 21:29:13 -0800112#endif
Colin Cross9af91202017-08-17 18:29:54 +0000113wchar_t *wmemmove(wchar_t *, const wchar_t *, size_t);
114wchar_t *wmemset(wchar_t *, wchar_t, size_t);
115int wprintf(const wchar_t *, ...);
116int wscanf(const wchar_t *, ...);
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800117
Elliott Hughes5bc78c82016-11-16 11:35:43 -0800118#if __ANDROID_API__ >= __ANDROID_API_L__
Colin Cross9af91202017-08-17 18:29:54 +0000119long long wcstoll_l(const wchar_t*, wchar_t**, int, locale_t) __INTRODUCED_IN(21);
120unsigned long long wcstoull_l(const wchar_t*, wchar_t**, int, locale_t) __INTRODUCED_IN(21);
121long double wcstold_l(const wchar_t*, wchar_t**, locale_t) __INTRODUCED_IN(21);
Dan Albertdfb5ce42014-07-09 22:51:34 +0000122
Colin Cross9af91202017-08-17 18:29:54 +0000123int wcscoll_l(const wchar_t*, const wchar_t*, locale_t) __attribute_pure__
Dan Albertf45d76a2016-09-21 01:57:51 -0700124 __INTRODUCED_IN(21);
Colin Cross9af91202017-08-17 18:29:54 +0000125size_t wcsxfrm_l(wchar_t*, const wchar_t*, size_t, locale_t) __INTRODUCED_IN(21);
Josh Gao6cd9fb02016-09-23 14:06:05 -0700126#else
127// Implemented as static inlines before 21.
128#endif
Dan Albertdfb5ce42014-07-09 22:51:34 +0000129
Colin Cross9af91202017-08-17 18:29:54 +0000130size_t wcslcat(wchar_t*, const wchar_t*, size_t);
131size_t wcslcpy(wchar_t*, const wchar_t*, size_t);
Elliott Hughes53e43292014-02-24 18:00:43 -0800132
Colin Cross9af91202017-08-17 18:29:54 +0000133FILE* open_wmemstream(wchar_t**, size_t*) __INTRODUCED_IN(23);
134wchar_t* wcsdup(const wchar_t*);
135size_t wcsnlen(const wchar_t*, size_t);
Elliott Hugheseb93ebf2013-03-01 18:35:56 -0800136
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800137__END_DECLS
138
Colin Cross9af91202017-08-17 18:29:54 +0000139#endif /* _WCHAR_H_ */