The manual
ginnOS
The reference: libc, the libraries and the kernel
Toggle main menu visibility
Loading...
Searching...
No Matches
locale.h
Go to the documentation of this file.
1
#pragma once
2
3
/**
4
* @file locale.h
5
* @brief locales. ginnOS has one: "C" (also called "POSIX"). text is
6
* UTF-8 bytes, numbers use '.', and nothing is translated.
7
*/
8
9
#include <
stddef.h
>
10
11
#define LC_CTYPE 0
12
#define LC_NUMERIC 1
13
#define LC_TIME 2
14
#define LC_COLLATE 3
15
#define LC_MONETARY 4
16
#define LC_MESSAGES 5
17
#define LC_ALL 6
18
19
/**
20
* how numbers and money are written. in the "C" locale the strings are
21
* empty (no grouping, no currency) except decimal_point, and the char
22
* fields are CHAR_MAX (not given).
23
*/
24
struct
lconv
25
{
26
char
*
decimal_point
;
27
char
*
thousands_sep
;
28
char
*
grouping
;
29
char
*
int_curr_symbol
;
30
char
*
currency_symbol
;
31
char
*
mon_decimal_point
;
32
char
*
mon_thousands_sep
;
33
char
*
mon_grouping
;
34
char
*
positive_sign
;
35
char
*
negative_sign
;
36
char
int_frac_digits
;
37
char
frac_digits
;
38
char
p_cs_precedes
;
39
char
p_sep_by_space
;
40
char
n_cs_precedes
;
41
char
n_sep_by_space
;
42
char
p_sign_posn
;
43
char
n_sign_posn
;
44
char
int_p_cs_precedes
;
45
char
int_p_sep_by_space
;
46
char
int_n_cs_precedes
;
47
char
int_n_sep_by_space
;
48
char
int_p_sign_posn
;
49
char
int_n_sign_posn
;
50
};
51
52
/**
53
* choose the locale of a category, or ask for it.
54
* @param locale "C", "POSIX" or "" (the default, also "C"); NULL asks.
55
* @return "C", or NULL if that locale is not there (nothing changes).
56
*/
57
char
*
setlocale
(
int
category,
const
char
*locale);
58
59
/**
60
* @return the number and money formats of the locale ("C").
61
*/
62
struct
lconv
*
localeconv
(
void
);
stddef.h
NULL, size_t, ptrdiff_t, offsetof.
setlocale
char * setlocale(int category, const char *locale)
choose the locale of a category, or ask for it.
localeconv
struct lconv * localeconv(void)
lconv
how numbers and money are written.
Definition
locale.h:25
lconv::mon_grouping
char * mon_grouping
Definition
locale.h:33
lconv::int_p_cs_precedes
char int_p_cs_precedes
Definition
locale.h:44
lconv::mon_decimal_point
char * mon_decimal_point
Definition
locale.h:31
lconv::p_sign_posn
char p_sign_posn
Definition
locale.h:42
lconv::int_p_sign_posn
char int_p_sign_posn
Definition
locale.h:48
lconv::int_n_cs_precedes
char int_n_cs_precedes
Definition
locale.h:46
lconv::p_sep_by_space
char p_sep_by_space
Definition
locale.h:39
lconv::negative_sign
char * negative_sign
Definition
locale.h:35
lconv::decimal_point
char * decimal_point
Definition
locale.h:26
lconv::grouping
char * grouping
Definition
locale.h:28
lconv::mon_thousands_sep
char * mon_thousands_sep
Definition
locale.h:32
lconv::int_n_sign_posn
char int_n_sign_posn
Definition
locale.h:49
lconv::int_frac_digits
char int_frac_digits
Definition
locale.h:36
lconv::positive_sign
char * positive_sign
Definition
locale.h:34
lconv::frac_digits
char frac_digits
Definition
locale.h:37
lconv::n_sep_by_space
char n_sep_by_space
Definition
locale.h:41
lconv::int_curr_symbol
char * int_curr_symbol
Definition
locale.h:29
lconv::n_cs_precedes
char n_cs_precedes
Definition
locale.h:40
lconv::int_n_sep_by_space
char int_n_sep_by_space
Definition
locale.h:47
lconv::n_sign_posn
char n_sign_posn
Definition
locale.h:43
lconv::int_p_sep_by_space
char int_p_sep_by_space
Definition
locale.h:45
lconv::thousands_sep
char * thousands_sep
Definition
locale.h:27
lconv::p_cs_precedes
char p_cs_precedes
Definition
locale.h:38
lconv::currency_symbol
char * currency_symbol
Definition
locale.h:30
src
libc
include
locale.h
Generated by
1.18.0