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);


enum GretlLangCode

typedef enum {
    LANG_AUTO = 0,
    LANG_C,
    LANG_SQ,
    LANG_EU,
    LANG_ZH_TW,
    LANG_CS,
    LANG_FR,
    LANG_DE,
    LANG_EL,
    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);


utf8_to_cp ()

char *              utf8_to_cp                          (const char *s);


utf8_to_latin ()

char *              utf8_to_latin                       (const char *s);


iso_latin_version ()

int                 iso_latin_version                   (void);


check_for_console ()

void                check_for_console                   (PRN *prn);


console_off ()

void                console_off                         (void);


lang_id_from_name ()

int                 lang_id_from_name                   (const char *s);


lang_id_from_code ()

int                 lang_id_from_code                   (const char *s);


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);


gretl_is_ascii ()

int                 gretl_is_ascii                      (const char *buf);


force_language ()

int                 force_language                      (int langid);


test_locale ()

int                 test_locale                         (const char *langstr);


iso_gettext ()

char *              iso_gettext                         (const char *msgid);


maybe_iso_gettext ()

char *              maybe_iso_gettext                   (const char *msgid);


set_gretl_charset ()

void                set_gretl_charset                   (const char *s);


sprint_l2_to_ascii ()

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


get_utf_width ()

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


get_translated_width ()

int                 get_translated_width                (const char *str);


chinese_locale ()

int                 chinese_locale                      (void);


UTF_WIDTH()

# define UTF_WIDTH(s, w) get_utf_width(s, w) 


TRANSLATED_WIDTH()

# define TRANSLATED_WIDTH(s) get_translated_width(s)


gettext()

#define gettext(s) s