Defines | Functions | Variables

go-locale.c File Reference

#include <goffice/goffice-config.h>
#include "go-locale.h"
#include <glib/gi18n-lib.h>
#include <string.h>

Defines

#define FREE1(var)   if (var) { g_string_free (var, TRUE); var = NULL; }

Functions

char const * go_setlocale (int category, char const *val)
void _go_locale_shutdown (void)
static void convert1 (GString *res, char const *lstr, char const *name, char const *def)
static void update_lc (void)
GString const * go_locale_get_decimal (void)
GString const * go_locale_get_thousand (void)
GString const * go_locale_get_currency (gboolean *precedes, gboolean *space_sep)
 go_locale_get_currency : : a pointer to a boolean which is set to TRUE if the currency should precede : a pointer to a boolean which is set to TRUE if the currency should have a space separating it from the the value
GString const * go_locale_get_date_format (void)
GString const * go_locale_get_time_format (void)
int go_locale_month_before_day (void)
gboolean go_locale_24h (void)
 go_locale_24h :
char go_locale_get_arg_sep (void)
char go_locale_get_col_sep (void)
char go_locale_get_row_sep (void)
char const * go_locale_boolean_name (gboolean b)
void go_locale_untranslated_booleans (void)
 go_locale_untranslated_booleans :

Variables

static gboolean locale_info_cached = FALSE
static GString * lc_decimal = NULL
static GString * lc_thousand = NULL
static gboolean lc_precedes
static gboolean lc_space_sep
static GString * lc_currency = NULL
static gboolean date_format_cached = FALSE
static GString * lc_date_format = NULL
static gboolean time_format_cached = FALSE
static GString * lc_time_format = NULL
static gboolean date_order_cached = FALSE
static gboolean locale_is_24h_cached = FALSE
static gboolean boolean_cached = FALSE
static char const * lc_TRUE = NULL
static char const * lc_FALSE = NULL

Define Documentation

#define FREE1 (   var  )     if (var) { g_string_free (var, TRUE); var = NULL; }

Referenced by _go_locale_shutdown().


Function Documentation

void _go_locale_shutdown ( void   ) 
static void convert1 ( GString *  res,
char const *  lstr,
char const *  name,
char const *  def 
) [static]

Referenced by update_lc().

gboolean go_locale_24h ( void   ) 

go_locale_24h :

Returns: TRUE if the locale uses a 24h clock, FALSE otherwise.

References go_locale_get_time_format(), and locale_is_24h_cached.

char const* go_locale_boolean_name ( gboolean  b  ) 

References _, boolean_cached, lc_FALSE, and lc_TRUE.

Referenced by go_object_set_property().

char go_locale_get_arg_sep ( void   ) 
char go_locale_get_col_sep ( void   ) 
GString const* go_locale_get_currency ( gboolean *  precedes,
gboolean *  space_sep 
)

go_locale_get_currency : : a pointer to a boolean which is set to TRUE if the currency should precede : a pointer to a boolean which is set to TRUE if the currency should have a space separating it from the the value

Play with the default logic so that things come out nicely for the default case.

Returns: A string with the default currency

References lc_currency, lc_precedes, lc_space_sep, locale_info_cached, and update_lc().

GString const* go_locale_get_date_format ( void   ) 
GString const* go_locale_get_decimal ( void   ) 
char go_locale_get_row_sep ( void   ) 
GString const* go_locale_get_thousand ( void   ) 
GString const* go_locale_get_time_format ( void   ) 

References lc_time_format, s, and time_format_cached.

Referenced by go_locale_24h().

int go_locale_month_before_day ( void   ) 

References date_order_cached.

void go_locale_untranslated_booleans ( void   ) 

go_locale_untranslated_booleans :

Short circuit the current locale so that we can import files and still produce error messages in the current LC_MESSAGE

References boolean_cached, lc_FALSE, and lc_TRUE.

char const* go_setlocale ( int  category,
char const *  val 
)
static void update_lc ( void   )  [static]

Variable Documentation

gboolean boolean_cached = FALSE [static]
gboolean date_format_cached = FALSE [static]
gboolean date_order_cached = FALSE [static]
GString* lc_currency = NULL [static]
GString* lc_date_format = NULL [static]
GString* lc_decimal = NULL [static]
char const* lc_FALSE = NULL [static]
gboolean lc_precedes [static]
gboolean lc_space_sep [static]
GString* lc_thousand = NULL [static]
GString* lc_time_format = NULL [static]
char const* lc_TRUE = NULL [static]
gboolean locale_info_cached = FALSE [static]
gboolean locale_is_24h_cached = FALSE [static]

Referenced by go_locale_24h(), and go_setlocale().

gboolean time_format_cached = FALSE [static]