Flesh out <locale.h>.
This is a trivial implementation that only supports the C/POSIX locale. Change-Id: Ib11cea4249e1862aca96a8b94d58ea9a418cbe75
This commit is contained in:
@@ -29,6 +29,7 @@
|
||||
#define _LOCALE_H_
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#include <xlocale.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
@@ -43,12 +44,29 @@ enum {
|
||||
LC_PAPER = 7,
|
||||
LC_NAME = 8,
|
||||
LC_ADDRESS = 9,
|
||||
|
||||
LC_TELEPHONE = 10,
|
||||
LC_MEASUREMENT = 11,
|
||||
LC_IDENTIFICATION = 12
|
||||
};
|
||||
|
||||
#define LC_CTYPE_MASK (1 << LC_CTYPE)
|
||||
#define LC_NUMERIC_MASK (1 << LC_NUMERIC)
|
||||
#define LC_TIME_MASK (1 << LC_TIME)
|
||||
#define LC_COLLATE_MASK (1 << LC_COLLATE)
|
||||
#define LC_MONETARY_MASK (1 << LC_MONETARY)
|
||||
#define LC_MESSAGES_MASK (1 << LC_MESSAGES)
|
||||
#define LC_PAPER_MASK (1 << LC_PAPER)
|
||||
#define LC_NAME_MASK (1 << LC_NAME)
|
||||
#define LC_ADDRESS_MASK (1 << LC_ADDRESS)
|
||||
#define LC_TELEPHONE_MASK (1 << LC_TELEPHONE)
|
||||
#define LC_MEASUREMENT_MASK (1 << LC_MEASUREMENT)
|
||||
#define LC_IDENTIFICATION_MASK (1 << LC_IDENTIFICATION)
|
||||
|
||||
#define LC_ALL_MASK (LC_CTYPE_MASK | LC_NUMERIC_MASK | LC_TIME_MASK | LC_COLLATE_MASK | \
|
||||
LC_MONETARY_MASK | LC_MESSAGES_MASK | LC_PAPER_MASK | LC_NAME_MASK | \
|
||||
LC_ADDRESS_MASK | LC_TELEPHONE_MASK | LC_MEASUREMENT_MASK | \
|
||||
LC_IDENTIFICATION_MASK)
|
||||
|
||||
struct lconv {
|
||||
char* decimal_point;
|
||||
char* thousands_sep;
|
||||
@@ -77,7 +95,14 @@ struct lconv {
|
||||
};
|
||||
|
||||
struct lconv* localeconv(void);
|
||||
extern char* setlocale(int, const char*);
|
||||
|
||||
locale_t duplocale(locale_t);
|
||||
void freelocale(locale_t);
|
||||
locale_t newlocale(int, const char*, locale_t);
|
||||
char* setlocale(int, const char*);
|
||||
locale_t uselocale(locale_t);
|
||||
|
||||
#define LC_GLOBAL_LOCALE ((locale_t) -1L)
|
||||
|
||||
__END_DECLS
|
||||
|
||||
|
Reference in New Issue
Block a user