| Libgretl Reference Manual | ||||
|---|---|---|---|---|
| Top | Description | ||||
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)
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.
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.
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. |
int get_local_decpoint (void);
| Returns : | the decimal character for the current locale. |
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;
char * sprint_l2_to_ascii (char *targ,
const char *s,
size_t len);
targ : |
|
s : |
|
len : |
|
| Returns : |