gretl_intl

gretl_intl —

Synopsis

void                gretl_push_c_numeric_locale         (void);
void                gretl_pop_c_numeric_locale          (void);
int                 doing_nls                           (void);
int                 reset_local_decpoint                (void);
int                 get_local_decpoint                  (void);
char *              iso_to_ascii                        (char *s);
enum                GretlLangCode;
const char *        lang_string_from_id                 (int langid);
char *              utf8_to_cp                          (const char *s);
char *              utf8_to_latin                       (const char *s);
int                 iso_latin_version                   (void);
void                check_for_console                   (PRN *prn);
void                console_off                         (void);
int                 lang_id_from_name                   (const char *s);
int                 lang_id_from_code                   (const char *s);
void                set_gui_native_printing             (void);
void                unset_gui_native_printing           (void);
void                set_lcnumeric                       (int langid,
                                                         int lcnumeric);
int                 gretl_is_ascii                      (const char *buf);
int                 force_language                      (int langid);
int                 test_locale                         (const char *langstr);
char *              iso_gettext                         (const char *msgid);
char *              maybe_iso_gettext                   (const char *msgid);
void                set_gretl_charset                   (const char *s);
char *              sprint_l2_to_ascii                  (char *targ,
                                                         const char *s,
                                                         size_t len);
int                 get_utf_width                       (const char *str,
                                                         int width);
int                 get_translated_width                (const char *str);
int                 chinese_locale                      (void);
#define             UTF_WIDTH                           (s, w)
#define             TRANSLATED_WIDTH                    (s)
#define             gettext                             (s)

Description

Details

gretl_push_c_numeric_locale ()

void                gretl_push_c_numeric_locale         (void);

Saves the current LC_NUMERIC locale and sets it to "C" This way you can safely read write floating point numbers all in the same format. You should make sure that code between gretl_push_c_numeric_locale() and gretl_pop_c_numeric_locale() doesn't do any setlocale calls or locale may end up in a strange setting. Also make sure to always pop the C numeric locale after you've pushed it. The calls can be nested.


gretl_pop_c_numeric_locale ()

void                gretl_pop_c_numeric_locale          (void);

Restores the LC_NUMERIC locale to what it was before the matching gretl_push_c_numeric_locale(). If these calls were nested, then this is a no-op until we get to the most outermost layer. Code in between these should not do any setlocale calls to change the LC_NUMERIC locale or things may come out very strange.


doing_nls ()

int                 doing_nls                           (void);

Returns : 1 if NLS translation is in effect, 0 otherwise.

reset_local_decpoint ()

int                 reset_local_decpoint                (void);

Uses localeconv() to determine the representation of the decimal point in the current locale.

Returns : the decimal character for the current locale.

get_local_decpoint ()

int                 get_local_decpoint                  (void);

Returns : the decimal character for the current locale.

iso_to_ascii ()

char *              iso_to_ascii                        (char *s);

s :
Returns :

enum GretlLangCode

typedef enum {
    LANG_AUTO = 0,
    LANG_C,
    LANG_EU,
    LANG_ZH_TW,
    LANG_CS,
    LANG_FR,
    LANG_DE,
    LANG_IT,
    LANG_PL,
    LANG_PT,
    LANG_PT_BR,
    LANG_RU,
    LANG_ES,
    LANG_TR,
    LANG_MAX
} GretlLangCode;


lang_string_from_id ()

const char *        lang_string_from_id                 (int langid);

langid :
Returns :

utf8_to_cp ()

char *              utf8_to_cp                          (const char *s);

s :
Returns :

utf8_to_latin ()

char *              utf8_to_latin                       (const char *s);

s :
Returns :

iso_latin_version ()

int                 iso_latin_version                   (void);

Returns :

check_for_console ()

void                check_for_console                   (PRN *prn);

prn :

console_off ()

void                console_off                         (void);


lang_id_from_name ()

int                 lang_id_from_name                   (const char *s);

s :
Returns :

lang_id_from_code ()

int                 lang_id_from_code                   (const char *s);

s :
Returns :

set_gui_native_printing ()

void                set_gui_native_printing             (void);


unset_gui_native_printing ()

void                unset_gui_native_printing           (void);


set_lcnumeric ()

void                set_lcnumeric                       (int langid,
                                                         int lcnumeric);

langid :
lcnumeric :

gretl_is_ascii ()

int                 gretl_is_ascii                      (const char *buf);

buf :
Returns :

force_language ()

int                 force_language                      (int langid);

langid :
Returns :

test_locale ()

int                 test_locale                         (const char *langstr);

langstr :
Returns :

iso_gettext ()

char *              iso_gettext                         (const char *msgid);

msgid :
Returns :

maybe_iso_gettext ()

char *              maybe_iso_gettext                   (const char *msgid);

msgid :
Returns :

set_gretl_charset ()

void                set_gretl_charset                   (const char *s);

s :

sprint_l2_to_ascii ()

char *              sprint_l2_to_ascii                  (char *targ,
                                                         const char *s,
                                                         size_t len);

targ :
s :
len :
Returns :

get_utf_width ()

int                 get_utf_width                       (const char *str,
                                                         int width);

str :
width :
Returns :

get_translated_width ()

int                 get_translated_width                (const char *str);

str :
Returns :

chinese_locale ()

int                 chinese_locale                      (void);

Returns :

UTF_WIDTH()

#define             UTF_WIDTH(s, w)

s :
w :

TRANSLATED_WIDTH()

#define             TRANSLATED_WIDTH(s)

s :

gettext()

#define gettext(s) s

s :