Add sys/_locale.h header and fix up headers

Signed-off by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
Corinna Vinschen 2016-07-25 11:47:36 +02:00
parent 91ebe04042
commit 7156bf842e
9 changed files with 47 additions and 22 deletions

View File

@ -4,9 +4,8 @@
#include "_ansi.h"
#include <sys/cdefs.h>
#if __MISC_VISIBLE || __POSIX_VISIBLE >= 200809 || defined (_COMPILING_NEWLIB)
struct __locale_t;
typedef struct __locale_t *locale_t;
#if __POSIX_VISIBLE >= 200809 || __MISC_VISIBLE || defined (_COMPILING_NEWLIB)
#include <sys/_locale.h>
#endif
_BEGIN_STD_C

View File

@ -21,7 +21,9 @@
#define LC_TIME 5
#define LC_MESSAGES 6
#if __POSIX_VISIBLE >= 200809
#if __POSIX_VISIBLE >= 200809 || defined (_COMPILING_NEWLIB)
#include <sys/_locale.h>
#define LC_ALL_MASK (1 << LC_ALL)
#define LC_COLLATE_MASK (1 << LC_COLLATE)
@ -33,9 +35,6 @@
#define LC_GLOBAL_LOCALE ((struct __locale_t *) -1)
struct __locale_t;
typedef struct __locale_t *locale_t;
#endif /* __POSIX_VISIBLE >= 200809 */
_BEGIN_STD_C

View File

@ -16,9 +16,8 @@
#define __need_NULL
#include <stddef.h>
#if __POSIX_VISIBLE >= 200809 || defined (_COMPILING_NEWLIB)
struct __locale_t;
typedef struct __locale_t *locale_t;
#if __POSIX_VISIBLE >= 200809
#include <sys/_locale.h>
#endif
_BEGIN_STD_C

View File

@ -0,0 +1,12 @@
/* Definition of opaque POSIX-1.2008 type locale_t for userspace. */
#ifndef _SYS__LOCALE_H
#define _SYS__LOCALE_H
#include <newlib.h>
#include <sys/config.h>
struct __locale_t;
typedef struct __locale_t *locale_t;
#endif /* _SYS__LOCALE_H */

View File

@ -37,9 +37,6 @@ typedef __uint32_t __ULong;
struct _reent;
/* TODO: This structure type isn't defined yet. It's supposed to be used
by locale-specific functions in case a per-thread locale per SUSv4 has
been specified. */
struct __locale_t;
/*

View File

@ -28,6 +28,10 @@
#include <sys/types.h>
#include <sys/timespec.h>
#if __POSIX_VISIBLE >= 200809
#include <sys/_locale.h>
#endif
_BEGIN_STD_C
struct tm
@ -63,6 +67,12 @@ size_t _EXFUN(strftime, (char *__restrict _s,
size_t _maxsize, const char *__restrict _fmt,
const struct tm *__restrict _t));
#if __POSIX_VISIBLE >= 200809
extern size_t strftime_l (char *__restrict _s, size_t _maxsize,
const char *__restrict _fmt,
const struct tm *__restrict _t, locale_t _l);
#endif
char *_EXFUN(asctime_r, (const struct tm *__restrict,
char *__restrict));
char *_EXFUN(ctime_r, (const time_t *, char *));

View File

@ -63,9 +63,8 @@ typedef __gnuc_va_list va_list;
#endif
#endif
#if __POSIX_VISIBLE >= 200809 || defined (_COMPILING_NEWLIB)
struct __locale_t;
typedef struct __locale_t *locale_t;
#if __POSIX_VISIBLE >= 200809
#include <sys/_locale.h>
#endif
_BEGIN_STD_C

View File

@ -7,6 +7,10 @@
#define __need_wint_t
#include <stddef.h>
#if __POSIX_VISIBLE >= 200809
#include <sys/_locale.h>
#endif
#ifndef WEOF
# define WEOF ((wint_t)-1)
#endif
@ -44,11 +48,6 @@ wint_t _EXFUN(towlower, (wint_t));
wctrans_t _EXFUN(wctrans, (const char *));
wctype_t _EXFUN(wctype, (const char *));
#if __POSIX_VISIBLE >= 200809 || defined (_COMPILING_NEWLIB)
struct __locale_t;
typedef struct __locale_t *locale_t;
#endif
#if __POSIX_VISIBLE >= 200809
extern int iswalpha_l (wint_t, locale_t);
extern int iswalnum_l (wint_t, locale_t);

View File

@ -31,9 +31,20 @@
#include <sys/cdefs.h>
#include <sys/types.h>
#if __POSIX_VISIBLE >= 200809
#include <sys/_locale.h>
#endif
__BEGIN_DECLS
ssize_t strfmon(char * __restrict, size_t, const char * __restrict, ...);
extern ssize_t strfmon (char * __restrict, size_t, const char * __restrict,
...);
#if __POSIX_VISIBLE >= 200809
extern ssize_t strfmon_l (char * __restrict, size_t, locale_t,
const char * __restrict, ...);
#endif
__END_DECLS
#endif /* !_MONETARY_H_ */