2002-10-23 18:47:12 +00:00
|
|
|
/*
|
2011-05-30 18:44:22 +00:00
|
|
|
* Copyright 2008-2011 Haiku Inc. All Rights Reserved.
|
2008-08-19 19:28:41 +00:00
|
|
|
* Distributed under the terms of the MIT License.
|
2002-10-23 18:47:12 +00:00
|
|
|
*/
|
2003-12-30 07:37:08 +00:00
|
|
|
#ifndef _WCHAR_H
|
|
|
|
#define _WCHAR_H
|
2002-10-23 18:47:12 +00:00
|
|
|
|
2009-11-09 08:43:32 +00:00
|
|
|
|
2008-03-16 17:21:37 +00:00
|
|
|
#include <stddef.h>
|
2006-03-16 14:42:04 +00:00
|
|
|
#include <stdio.h>
|
2003-12-30 07:37:08 +00:00
|
|
|
|
2009-11-09 08:43:32 +00:00
|
|
|
|
2008-05-10 21:30:34 +00:00
|
|
|
/* stddef.h is not supposed to define wint_t, but gcc 2.95.3's one does.
|
|
|
|
* In all other cases we will do that. */
|
2008-03-16 17:21:37 +00:00
|
|
|
#ifndef _WINT_T
|
2005-02-22 18:06:35 +00:00
|
|
|
#define _WINT_T
|
2008-03-16 17:21:37 +00:00
|
|
|
|
|
|
|
#ifndef __WINT_TYPE__
|
|
|
|
#define __WINT_TYPE__ unsigned int
|
|
|
|
#endif
|
|
|
|
|
|
|
|
typedef __WINT_TYPE__ wint_t;
|
|
|
|
|
2008-05-10 21:30:34 +00:00
|
|
|
#endif /* _WINT_T */
|
2008-03-16 17:21:37 +00:00
|
|
|
|
2006-03-16 11:09:43 +00:00
|
|
|
typedef int wctype_t;
|
2005-02-22 18:06:35 +00:00
|
|
|
|
|
|
|
typedef struct {
|
2006-03-16 14:42:04 +00:00
|
|
|
int __count;
|
|
|
|
wint_t __value;
|
2005-02-22 18:06:35 +00:00
|
|
|
} mbstate_t;
|
|
|
|
|
2003-12-30 07:37:08 +00:00
|
|
|
|
2009-06-22 19:48:36 +00:00
|
|
|
#define WEOF ((wint_t)(-1))
|
|
|
|
|
|
|
|
#define WCHAR_MIN 0x00000000UL
|
|
|
|
#define WCHAR_MAX 0x7FFFFFFFUL
|
|
|
|
|
2010-07-23 23:13:00 +00:00
|
|
|
/*
|
|
|
|
* Haiku is always using UTF32 in wchars, other encodings can be handled
|
|
|
|
* by converting to/from wchar by means of mbsrtowcs() or wcsrtombs().
|
|
|
|
* TODO: define __STDC_ISO_10646__ accordingly in our compilers.
|
|
|
|
*/
|
|
|
|
|
2009-06-22 19:48:36 +00:00
|
|
|
|
2007-03-04 02:31:43 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2009-06-22 19:48:36 +00:00
|
|
|
extern wint_t btowc(int);
|
|
|
|
|
2006-03-16 11:09:43 +00:00
|
|
|
extern wint_t fgetwc(FILE *);
|
|
|
|
extern wchar_t *fgetws(wchar_t *, int, FILE *);
|
|
|
|
extern wint_t fputwc(wchar_t, FILE *);
|
2006-03-16 14:42:04 +00:00
|
|
|
extern int fputws(const wchar_t *, FILE *);
|
2009-06-22 19:48:36 +00:00
|
|
|
extern int fwide(FILE *, int);
|
|
|
|
extern int fwprintf(FILE *, const wchar_t *, ...);
|
2010-07-23 17:34:33 +00:00
|
|
|
extern int fwscanf(FILE *, const wchar_t *, ...);
|
2006-03-16 11:09:43 +00:00
|
|
|
extern wint_t getwc(FILE *);
|
|
|
|
extern wint_t getwchar(void);
|
|
|
|
|
|
|
|
extern size_t mbrlen(const char *s, size_t n, mbstate_t *ps);
|
|
|
|
extern size_t mbrtowc(wchar_t *pwc, const char *s, size_t n, mbstate_t *ps);
|
|
|
|
extern int mbsinit(const mbstate_t *);
|
2009-06-22 19:48:36 +00:00
|
|
|
extern size_t mbsrtowcs(wchar_t *dst, const char **src, size_t len,
|
|
|
|
mbstate_t *ps);
|
|
|
|
|
|
|
|
extern wint_t putwc(wchar_t, FILE *);
|
|
|
|
extern wint_t putwchar(wchar_t);
|
|
|
|
|
|
|
|
extern int swprintf(wchar_t *, size_t, const wchar_t *, ...);
|
2009-07-29 17:41:10 +00:00
|
|
|
extern int swscanf(const wchar_t *, const wchar_t *, ...);
|
2006-03-16 11:09:43 +00:00
|
|
|
|
|
|
|
extern wint_t ungetwc(wint_t, FILE *);
|
|
|
|
|
2009-06-22 19:48:36 +00:00
|
|
|
extern int vfwprintf(FILE *, const wchar_t *, va_list);
|
2009-07-29 17:41:10 +00:00
|
|
|
extern int vfwscanf(FILE *, const wchar_t *, va_list);
|
2009-06-22 19:48:36 +00:00
|
|
|
extern int vswprintf(wchar_t *, size_t, const wchar_t *, va_list);
|
2009-07-29 17:41:10 +00:00
|
|
|
extern int vswscanf(const wchar_t *, const wchar_t *, va_list);
|
2009-06-22 19:48:36 +00:00
|
|
|
extern int vwprintf(const wchar_t *, va_list);
|
2009-07-29 17:41:10 +00:00
|
|
|
extern int vwscanf(const wchar_t *, va_list);
|
2009-06-22 19:48:36 +00:00
|
|
|
|
2006-03-16 11:09:43 +00:00
|
|
|
extern size_t wcrtomb(char *, wchar_t, mbstate_t *);
|
|
|
|
extern wchar_t *wcscat(wchar_t *, const wchar_t *);
|
|
|
|
extern wchar_t *wcschr(const wchar_t *, wchar_t);
|
|
|
|
extern int wcscmp(const wchar_t *ws1, const wchar_t *ws2);
|
|
|
|
extern int wcscoll(const wchar_t *ws1, const wchar_t *ws2);
|
|
|
|
extern wchar_t *wcscpy(wchar_t *, const wchar_t *);
|
|
|
|
extern size_t wcscspn(const wchar_t *, const wchar_t *);
|
2009-11-21 15:26:19 +00:00
|
|
|
extern wchar_t *wcsdup(const wchar_t *);
|
2010-07-23 17:34:33 +00:00
|
|
|
extern size_t wcsftime(wchar_t *, size_t, const wchar_t *, const struct tm *);
|
2006-03-16 11:09:43 +00:00
|
|
|
extern size_t wcslen(const wchar_t *);
|
|
|
|
extern wchar_t *wcsncat(wchar_t *, const wchar_t *, size_t);
|
|
|
|
extern int wcsncmp(const wchar_t *, const wchar_t *, size_t);
|
|
|
|
extern wchar_t *wcsncpy(wchar_t *, const wchar_t *, size_t);
|
|
|
|
extern wchar_t *wcspbrk(const wchar_t *, const wchar_t *);
|
|
|
|
extern wchar_t *wcsrchr(const wchar_t *, wchar_t);
|
|
|
|
extern size_t wcsrtombs(char *dst, const wchar_t **src, size_t len,
|
|
|
|
mbstate_t *ps);
|
|
|
|
extern size_t wcsspn(const wchar_t *, const wchar_t *);
|
2009-07-31 22:16:58 +00:00
|
|
|
extern wchar_t *wcsstr(const wchar_t *, const wchar_t *);
|
2006-03-16 11:09:43 +00:00
|
|
|
extern double wcstod(const wchar_t *, wchar_t **);
|
2009-06-22 19:48:36 +00:00
|
|
|
extern float wcstof(const wchar_t *, wchar_t **);
|
2006-03-16 11:09:43 +00:00
|
|
|
extern wchar_t *wcstok(wchar_t *, const wchar_t *, wchar_t **);
|
2009-11-09 08:43:32 +00:00
|
|
|
extern long wcstol(const wchar_t *, wchar_t **, int);
|
2009-06-22 19:48:36 +00:00
|
|
|
extern long double wcstold(const wchar_t *, wchar_t **);
|
|
|
|
extern long long wcstoll(const wchar_t *, wchar_t **, int);
|
|
|
|
extern unsigned long wcstoul(const wchar_t *, wchar_t **, int);
|
|
|
|
extern unsigned long long wcstoull(const wchar_t *, wchar_t **, int);
|
2006-03-16 11:09:43 +00:00
|
|
|
extern wchar_t *wcswcs(const wchar_t *, const wchar_t *);
|
|
|
|
extern int wcswidth(const wchar_t *, size_t);
|
|
|
|
extern size_t wcsxfrm(wchar_t *, const wchar_t *, size_t);
|
2009-06-22 19:48:36 +00:00
|
|
|
extern int wctob(wint_t);
|
2006-03-16 11:09:43 +00:00
|
|
|
extern int wcwidth(wchar_t);
|
2009-06-22 19:48:36 +00:00
|
|
|
extern wchar_t *wmemchr(const wchar_t *, wchar_t, size_t);
|
|
|
|
extern int wmemcmp(const wchar_t *, const wchar_t *, size_t);
|
|
|
|
extern wchar_t *wmemcpy(wchar_t *, const wchar_t *, size_t);
|
|
|
|
extern wchar_t *wmemmove(wchar_t *, const wchar_t *, size_t);
|
|
|
|
extern wchar_t *wmemset(wchar_t *, wchar_t, size_t);
|
|
|
|
extern int wprintf(const wchar_t *, ...);
|
2009-07-29 17:41:10 +00:00
|
|
|
extern int wscanf(const wchar_t *, ...);
|
2006-03-14 23:18:32 +00:00
|
|
|
|
2007-03-04 02:31:43 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2003-12-30 07:37:08 +00:00
|
|
|
#endif /* _WCHAR_H */
|