2012-09-28 18:36:46 -04:00
|
|
|
/*******************************************************************************
|
2011-08-05 08:25:00 -04:00
|
|
|
|
2013-03-23 19:25:50 -04:00
|
|
|
Copyright(C) Jonas 'Sortie' Termansen 2011, 2012, 2013.
|
2011-08-05 08:25:00 -04:00
|
|
|
|
2013-07-10 09:26:01 -04:00
|
|
|
This file is part of the Sortix C Library.
|
2011-08-05 08:25:00 -04:00
|
|
|
|
2013-07-10 09:26:01 -04:00
|
|
|
The Sortix C Library is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU Lesser General Public License as published by
|
|
|
|
the Free Software Foundation, either version 3 of the License, or (at your
|
|
|
|
option) any later version.
|
2011-08-05 08:25:00 -04:00
|
|
|
|
2013-07-10 09:26:01 -04:00
|
|
|
The Sortix C Library is distributed in the hope that it will be useful, but
|
|
|
|
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
|
|
|
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
|
|
|
|
License for more details.
|
2011-08-05 08:25:00 -04:00
|
|
|
|
2013-07-10 09:26:01 -04:00
|
|
|
You should have received a copy of the GNU Lesser General Public License
|
|
|
|
along with the Sortix C Library. If not, see <http://www.gnu.org/licenses/>.
|
2011-08-05 08:25:00 -04:00
|
|
|
|
2013-07-10 09:26:01 -04:00
|
|
|
wchar.h
|
|
|
|
Wide character support.
|
2011-08-05 08:25:00 -04:00
|
|
|
|
2012-09-28 18:36:46 -04:00
|
|
|
*******************************************************************************/
|
2011-08-05 08:25:00 -04:00
|
|
|
|
2013-07-19 16:36:11 -04:00
|
|
|
#ifndef INCLUDE_WCHAR_H
|
|
|
|
#define INCLUDE_WCHAR_H
|
2011-08-05 08:25:00 -04:00
|
|
|
|
2013-10-13 07:04:27 -04:00
|
|
|
#include <sys/cdefs.h>
|
2011-08-05 08:25:00 -04:00
|
|
|
|
2013-09-23 10:37:33 -04:00
|
|
|
#include <sys/__/types.h>
|
|
|
|
|
2013-12-26 19:51:19 -05:00
|
|
|
#include <stdarg.h>
|
|
|
|
|
2014-01-18 10:21:46 -05:00
|
|
|
#if defined(__is_sortix_libc)
|
2013-10-01 09:33:53 -04:00
|
|
|
#include <FILE.h>
|
|
|
|
#endif
|
|
|
|
|
2011-08-05 08:25:00 -04:00
|
|
|
__BEGIN_DECLS
|
|
|
|
|
2013-12-26 19:44:03 -05:00
|
|
|
#ifndef __size_t_defined
|
|
|
|
#define __size_t_defined
|
|
|
|
#define __need_size_t
|
|
|
|
#include <stddef.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef __off_t_defined
|
|
|
|
#define __off_t_defined
|
|
|
|
typedef __off_t off_t;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef __FILE_defined
|
|
|
|
#define __FILE_defined
|
|
|
|
typedef struct FILE FILE;
|
|
|
|
#define FILE FILE
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef __locale_t_defined
|
|
|
|
#define __locale_t_defined
|
|
|
|
/* TODO: figure out what this does and typedef it properly. This is just a
|
|
|
|
temporary assignment. */
|
|
|
|
typedef int __locale_t;
|
|
|
|
typedef __locale_t locale_t;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef __wchar_t_defined
|
|
|
|
#define __wchar_t_defined
|
|
|
|
#define __need_wchar_t
|
|
|
|
#include <stddef.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef __wint_t_defined
|
|
|
|
#define __wint_t_defined
|
|
|
|
typedef int __wint_t;
|
|
|
|
typedef __wint_t wint_t;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef WCHAR_MAX
|
|
|
|
#define WCHAR_MAX __WCHAR_MAX
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef WCHAR_MIN
|
|
|
|
#define WCHAR_MIN __WCHAR_MIN
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef WEOF
|
|
|
|
#define WEOF (-1)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef NULL
|
|
|
|
#define __need_NULL
|
|
|
|
#include <stddef.h>
|
|
|
|
#endif
|
2011-08-05 08:25:00 -04:00
|
|
|
|
|
|
|
#ifndef __mbstate_t_defined
|
|
|
|
/* Conversion state information. */
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
int __count;
|
|
|
|
union
|
|
|
|
{
|
|
|
|
wint_t __wch;
|
2012-09-07 14:46:06 -04:00
|
|
|
char __wchb[4];
|
2011-08-05 08:25:00 -04:00
|
|
|
} __value; /* Value so far. */
|
|
|
|
} mbstate_t;
|
|
|
|
#define __mbstate_t_defined 1
|
|
|
|
#endif
|
|
|
|
|
|
|
|
struct tm;
|
|
|
|
|
2013-04-07 11:27:11 -04:00
|
|
|
size_t mbsrtowcs(wchar_t* __restrict, const char** __restrict, size_t, mbstate_t* __restrict);
|
|
|
|
size_t wcrtomb(char* __restrict, wchar_t, mbstate_t* __restrict);
|
2013-04-22 04:06:44 -04:00
|
|
|
size_t mbrlen(const char* __restrict, size_t, mbstate_t* __restrict);
|
2013-04-07 11:27:11 -04:00
|
|
|
size_t mbrtowc(wchar_t* __restrict, const char* __restrict, size_t, mbstate_t* __restrict);
|
|
|
|
wchar_t* wcscat(wchar_t* __restrict, const wchar_t* __restrict);
|
2013-03-23 19:37:22 -04:00
|
|
|
wchar_t* wcschr(const wchar_t*, wchar_t);
|
|
|
|
wchar_t* wcschrnul(const wchar_t*, wchar_t);
|
2013-03-23 19:41:35 -04:00
|
|
|
int wcscmp(const wchar_t*, const wchar_t*);
|
2013-07-19 16:49:25 -04:00
|
|
|
int wcscoll(const wchar_t*, const wchar_t*);
|
2013-04-07 11:27:11 -04:00
|
|
|
wchar_t* wcscpy(wchar_t* __restrict, const wchar_t* __restrict);
|
2013-03-23 19:54:34 -04:00
|
|
|
size_t wcscspn(const wchar_t*, const wchar_t*);
|
2013-03-23 19:29:31 -04:00
|
|
|
size_t wcslen(const wchar_t*);
|
2013-04-07 11:27:11 -04:00
|
|
|
wchar_t* wcsncat(wchar_t* __restrict, const wchar_t* __restrict, size_t);
|
2013-09-15 18:06:27 -04:00
|
|
|
int wcsncmp(const wchar_t*, const wchar_t*, size_t);
|
2013-04-07 11:27:11 -04:00
|
|
|
wchar_t* wcsncpy(wchar_t* __restrict, const wchar_t* __restrict, size_t);
|
2013-09-15 18:20:30 -04:00
|
|
|
wchar_t* wcspbrk(const wchar_t*, const wchar_t*);
|
2013-03-23 19:46:44 -04:00
|
|
|
wchar_t* wcsrchr(const wchar_t*, wchar_t);
|
2013-04-07 11:27:11 -04:00
|
|
|
size_t wcsrtombs(char* __restrict, const wchar_t** __restrict, size_t, mbstate_t* __restrict);
|
2013-03-23 19:52:40 -04:00
|
|
|
size_t wcsspn(const wchar_t*, const wchar_t*);
|
2013-09-16 08:41:16 -04:00
|
|
|
wchar_t* wcsstr(const wchar_t* __restrict, const wchar_t* __restrict);
|
2013-04-07 11:27:11 -04:00
|
|
|
wchar_t* wcstok(wchar_t* __restrict, const wchar_t* __restrict, wchar_t** __restrict);
|
2013-07-19 16:36:11 -04:00
|
|
|
long long wcstoll(const wchar_t* __restrict, wchar_t** __restrict, int);
|
|
|
|
long wcstol(const wchar_t* __restrict, wchar_t** __restrict, int);
|
|
|
|
unsigned long long wcstoull(const wchar_t* __restrict, wchar_t** __restrict, int);
|
|
|
|
unsigned long wcstoul(const wchar_t* __restrict, wchar_t** __restrict, int);
|
2013-09-15 18:14:06 -04:00
|
|
|
size_t wcsxfrm(wchar_t* __restrict, const wchar_t* __restrict, size_t);
|
2013-09-16 09:05:52 -04:00
|
|
|
wchar_t* wmemchr(const wchar_t*, wchar_t, size_t);
|
2013-09-15 18:01:19 -04:00
|
|
|
int wmemcmp(const wchar_t*, const wchar_t*, size_t);
|
2013-09-16 09:12:30 -04:00
|
|
|
wchar_t* wmemcpy(wchar_t* __restrict, const wchar_t* __restrict, size_t);
|
2013-09-16 09:37:27 -04:00
|
|
|
wchar_t* wmemmove(wchar_t*, const wchar_t*, size_t);
|
2013-09-16 09:46:08 -04:00
|
|
|
wchar_t* wmemset(wchar_t*, wchar_t, size_t);
|
2012-12-20 08:42:28 -05:00
|
|
|
|
2012-09-28 18:53:50 -04:00
|
|
|
/* TODO: These are not implemented in sortix libc yet. */
|
2013-09-23 10:57:22 -04:00
|
|
|
#if 0
|
2013-04-07 11:27:11 -04:00
|
|
|
double wcstod(const wchar_t* __restrict, wchar_t** __restrict);
|
2011-08-05 08:25:00 -04:00
|
|
|
FILE* open_wmemstream(wchar_t** bufp, size_t* sizep);
|
2013-04-07 11:27:11 -04:00
|
|
|
float wcstof(const wchar_t* __restrict, wchar_t** __restrict);
|
|
|
|
int fputws(const wchar_t* __restrict, FILE* __restrict);
|
2011-08-05 08:25:00 -04:00
|
|
|
int fwide(FILE*, int);
|
2013-04-07 11:27:11 -04:00
|
|
|
int fwprintf(FILE* __restrict, const wchar_t* __restrict, ...);
|
|
|
|
int fwscanf(FILE* __restrict, const wchar_t* __restrict, ...);
|
2011-08-05 08:25:00 -04:00
|
|
|
int mbsinit(const mbstate_t*);
|
2013-04-07 11:27:11 -04:00
|
|
|
int swprintf(wchar_t* __restrict, size_t, const wchar_t* __restrict, ...);
|
|
|
|
int swscanf(const wchar_t* __restrict, const wchar_t* __restrict, ...);
|
|
|
|
int vfwprintf(FILE* __restrict, const wchar_t* __restrict, va_list);
|
|
|
|
int vfwscanf(FILE* __restrict, const wchar_t* __restrict, va_list);
|
|
|
|
int vswprintf(wchar_t* __restrict, size_t, const wchar_t* __restrict, va_list);
|
|
|
|
int vswscanf(const wchar_t* __restrict, const wchar_t* __restrict, va_list);
|
|
|
|
int vwprintf(const wchar_t* __restrict, va_list);
|
|
|
|
int vwscanf(const wchar_t* __restrict, va_list);
|
2011-08-05 08:25:00 -04:00
|
|
|
int wcswidth(const wchar_t*, size_t);
|
|
|
|
int wctob(wint_t);
|
|
|
|
int wcwidth(wchar_t);
|
2013-04-07 11:27:11 -04:00
|
|
|
int wprintf(const wchar_t* __restrict, ...);
|
|
|
|
int wscanf(const wchar_t* __restrict, ...);
|
|
|
|
long double wcstold(const wchar_t* __restrict, wchar_t** __restrict);
|
|
|
|
size_t wcsftime(wchar_t* __restrict, size_t, const wchar_t* __restrict, const struct tm* __restrict);
|
|
|
|
wchar_t* fgetws(wchar_t* __restrict, int, FILE* __restrict);
|
2011-08-05 08:25:00 -04:00
|
|
|
wint_t btowc(int);
|
|
|
|
wint_t fgetwc(FILE*);
|
|
|
|
wint_t fputwc(wchar_t, FILE*);
|
|
|
|
wint_t getwc(FILE*);
|
|
|
|
wint_t getwchar(void);
|
|
|
|
wint_t putwchar(wchar_t);
|
|
|
|
wint_t putwc(wchar_t, FILE*);
|
|
|
|
wint_t ungetwc(wint_t, FILE*);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
__END_DECLS
|
|
|
|
|
|
|
|
#endif
|