Main Page   Alphabetical List   Data Structures   File List   Data Fields   Globals  

Locale.c File Reference

#include <stdlib.h>
#include <string.h>
#include <xmlparse.h>
#include "debug.h"
#include "macros.h"
#include "Locale.h"
#include "Common.h"
#include "Memory.h"
#include "Net.h"

Include dependency graph for Locale.c:

Include dependency graph

Go to the source code of this file.

Data Structures

struct  Locale_s
struct  LocaleItem_s
struct  LocaleParse_s

Defines

#define ERR_LOC_OK   0
#define ERR_LOC_XML   1
#define ERR_LOC_OUT_OF_MEMORY   2
#define ERR_LOC_ARGUMENT_MISSING   3
#define ERR_LOC_APP_NOTFOUND   4
#define ERR_LOC_CLOSING_NOTFOUND   5
#define ERR_LOC_LOCALE_CANTLOAD   6

Typedefs

typedef LocaleItem_s LocaleItem_t
typedef LocaleParse_s LocaleParse_t

Functions

Locale_tlocale_CleanUpInternal (Locale_t *locale)
int locale_cmp (const void *e1, const void *e2)
void locale_StartElement (void *userData, const char *name, const char **atts)
void locale_EndElement (void *userData, const char *name)
Locale_tlocale_InitInternal (gui_App_t *app, char *lang)
Locale_tlocale_Init (gui_App_t *app, char **lang, char *default_lang)
void locale_CleanUp (Locale_t *locale)
u32 locale_GetString (u32 firsttag,...)
u32 locale_GetStringTL (tag *taglist)
u32 locale_Call (int function, u32 firsttag,...)
u32 locale_CallTL (int function, tag *taglist)

Variables

u32(* call_vector [LOCALE_FUNC_DONE-LOCALE_FUNCBASE+1])(tag *)
char extension_gui [] = "_gui_"
char extension_xml [] = ".xml"
char * errstr []


Define Documentation

#define ERR_LOC_APP_NOTFOUND   4
 

Definition at line 64 of file Locale.c.

Referenced by locale_InitInternal.

#define ERR_LOC_ARGUMENT_MISSING   3
 

Definition at line 63 of file Locale.c.

Referenced by locale_StartElement.

#define ERR_LOC_CLOSING_NOTFOUND   5
 

Definition at line 65 of file Locale.c.

Referenced by locale_InitInternal.

#define ERR_LOC_LOCALE_CANTLOAD   6
 

Definition at line 66 of file Locale.c.

Referenced by locale_Init.

#define ERR_LOC_OK   0
 

Definition at line 60 of file Locale.c.

Referenced by locale_InitInternal.

#define ERR_LOC_OUT_OF_MEMORY   2
 

Definition at line 62 of file Locale.c.

Referenced by locale_StartElement.

#define ERR_LOC_XML   1
 

Definition at line 61 of file Locale.c.

Referenced by locale_InitInternal.


Typedef Documentation

typedef struct LocaleItem_s LocaleItem_t
 

typedef struct LocaleParse_s LocaleParse_t
 


Function Documentation

u32 locale_Call int    function,
u32    firsttag,
...   
 

Definition at line 336 of file Locale.c.

References locale_CallTL, and u32.

Referenced by locale_Init.

u32 locale_CallTL int    function,
tag   taglist
 

Definition at line 340 of file Locale.c.

References call_vector, debug_Begin, debug_End, debug_Message, debug_Warning, LOCALE_FUNC_DONE, LOCALE_FUNCBASE, and u32.

Referenced by locale_Init.

void locale_CleanUp Locale_t   locale
 

Definition at line 278 of file Locale.c.

References debug_Begin, debug_End, Locale_s::filename, Locale_s::itemcount, Locale_s::items, LocaleItem_s::key, mem_free, NULL, and LocaleItem_s::value.

Locale_t* locale_CleanUpInternal Locale_t   locale [static]
 

Definition at line 87 of file Locale.c.

References locale_CleanUp.

Referenced by locale_InitInternal.

int locale_cmp const void *    e1,
const void *    e2
[static]
 

Definition at line 94 of file Locale.c.

References LocaleItem_s::key.

Referenced by locale_GetStringTL, and locale_InitInternal.

void locale_EndElement void *    userData,
const char *    name
[static]
 

Definition at line 155 of file Locale.c.

References debug_Begin, debug_End, and LocaleParse_s::parse_status.

Referenced by locale_InitInternal.

u32 locale_GetString u32    firsttag,
...   
 

Parameters:
TAG_LOCALE_LOCALE  Locale_t *
TAG_LOCALE_MSG  char *

Definition at line 307 of file Locale.c.

References locale_GetStringTL, and u32.

u32 locale_GetStringTL tag   taglist
 

Definition at line 311 of file Locale.c.

References debug_Begin, debug_End, Locale_s::itemcount, Locale_s::items, LocaleItem_s::key, locale_cmp, NULL, tag_GetTagData, TAG_LOCALE_LOCALE, TAG_LOCALE_MSG, u32, and LocaleItem_s::value.

Referenced by locale_Init.

Locale_t* locale_Init gui_App_t   app,
char **    lang,
char *    default_lang
 

Definition at line 257 of file Locale.c.

References call_vector, debug_Begin, debug_End, debug_Error, ERR_LOC_LOCALE_CANTLOAD, errstr, locale_Call, locale_CallTL, LOCALE_FUNCBASE, LOCALE_GETSTRING, locale_GetStringTL, locale_InitInternal, and NULL.

Locale_t* locale_InitInternal gui_App_t   app,
char *    lang
[static]
 

Definition at line 168 of file Locale.c.

References Locale_s::app, gui_App_t::conn, debug_Begin, debug_End, debug_Error, debug_Warning, LocaleParse_s::err, ERR_LOC_APP_NOTFOUND, ERR_LOC_CLOSING_NOTFOUND, ERR_LOC_OK, ERR_LOC_XML, errstr, extension_gui, extension_xml, Locale_s::filename, Locale_s::itemcount, Locale_s::items, LocaleItem_s::key, LocaleParse_s::keypairlist, Locale_s::lang, list_CreateList, list_DeleteList, list_DeleteNode, list_GetNodeCount, list_GetNodeData, list_GetNodeHead, list_GetNodeNext, list_RemoveNode, LocaleParse_s::locale, locale_CleanUpInternal, locale_cmp, locale_EndElement, locale_StartElement, mem_calloc, mem_free, mem_malloc, gui_App_t::name, net_LoadFile, NULL, LocaleParse_s::parse_status, TAG_DONE, TAG_NET_CONN, TAG_NET_NAME, TRUE, and LocaleItem_s::value.

Referenced by locale_Init.

void locale_StartElement void *    userData,
const char *    name,
const char **    atts
[static]
 

Definition at line 101 of file Locale.c.

References Locale_s::app, common_GetAttr, debug_Begin, debug_End, LocaleParse_s::err, ERR_LOC_ARGUMENT_MISSING, ERR_LOC_OUT_OF_MEMORY, LocaleItem_s::key, LocaleParse_s::keypairlist, list_CreateNode, list_InsertNodeHead, list_SetNodeData, LocaleParse_s::locale, mem_malloc, gui_App_t::name, NULL, LocaleParse_s::parse_status, and LocaleItem_s::value.

Referenced by locale_InitInternal.


Variable Documentation

u32(* call_vector[LOCALE_FUNC_DONE-LOCALE_FUNCBASE+1])(tag *) [static]
 

Definition at line 69 of file Locale.c.

Referenced by locale_CallTL, and locale_Init.

char* errstr[] [static]
 

Initial value:

{
  "OK",
  "XML Error",
  "Out of memory",
  "Argument missing",
  "App section not found",
  "Closing tag not found",
  "Locale XML cannot be loaded",
  NULL
}

Definition at line 74 of file Locale.c.

Referenced by locale_Init, and locale_InitInternal.

char extension_gui[] = "_gui_" [static]
 

Definition at line 71 of file Locale.c.

Referenced by locale_InitInternal.

char extension_xml[] = ".xml" [static]
 

Definition at line 72 of file Locale.c.

Referenced by locale_InitInternal.


Generated on Tue Jan 7 12:12:30 2003 for THEGUI by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002