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);
char*       get_month_name                  (char *mname,
                                             int m);
char*       iso_gettext                     (const char *msgid);
char*       maybe_iso_gettext               (const char *msgid);
void        set_gretl_charset               (const char *s);
const char* get_gretl_charset               (void);
const char* get_gnuplot_charset             (void);
int         iso_latin_version               (void);
char*       sprint_l2_to_html               (char *targ,
                                             const char *s,
                                             size_t len);
char*       sprint_l2_to_ascii              (char *targ,
                                             const char *s,
                                             size_t len);
char*       sprint_html_to_l2               (char *targ,
                                             const char *s);
int         print_as_html                   (const char *s,
                                             FILE *fp);
int         print_as_locale                 (const char *s,
                                             FILE *fp);
int         get_utf_width                   (const char *str,
                                             int width);
int         get_translated_width            (const char *str);
void        check_for_console               (PRN *prn);
void        console_off                     (void);
#define     UTF_WIDTH                       (s, w)
#define     TRANSLATED_WIDTH                (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);

Returns : the character representing a decimal point in the current locale.

get_local_decpoint ()

int         get_local_decpoint              (void);

Returns : the character representing a decimal point in the current locale.

iso_to_ascii ()

char*       iso_to_ascii                    (char *s);

s :
Returns :

get_month_name ()

char*       get_month_name                  (char *mname,
                                             int m);

mname :
m :
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 :

get_gretl_charset ()

const char* get_gretl_charset               (void);

Returns :

get_gnuplot_charset ()

const char* get_gnuplot_charset             (void);

Returns :

iso_latin_version ()

int         iso_latin_version               (void);

Returns :

sprint_l2_to_html ()

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

targ :
s :
len :
Returns :

sprint_l2_to_ascii ()

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

targ :
s :
len :
Returns :

sprint_html_to_l2 ()

char*       sprint_html_to_l2               (char *targ,
                                             const char *s);

targ :
s :
Returns :

print_as_html ()

int         print_as_html                   (const char *s,
                                             FILE *fp);

s :
fp :
Returns :

print_as_locale ()

int         print_as_locale                 (const char *s,
                                             FILE *fp);

s :
fp :
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 :

check_for_console ()

void        check_for_console               (PRN *prn);

prn :

console_off ()

void        console_off                     (void);


UTF_WIDTH()

#define     UTF_WIDTH(s, w)

s :
w :

TRANSLATED_WIDTH()

#define     TRANSLATED_WIDTH(s)

s :