mbgtools-lx  4.2.8
ctry.h File Reference
#include <words.h>
#include <use_pack.h>

Go to the source code of this file.

Data Structures

struct  CTRY
 

Macros

#define _ext   extern
 
#define LNG_DEFINED
 
#define CTRY_US   1
 
#define CTRY_UK   44
 
#define CTRY_GERMANY   49
 
#define CTRY_DEFINED
 
#define DT_SEP_DOT   '.'
 
#define DT_SEP_MINUS   '-'
 
#define DT_SEP_SLASH   '/'
 
#define DT_SEP_LIST   { DT_SEP_DOT, DT_SEP_MINUS, DT_SEP_SLASH, 0 }
 
#define TM_SEP_COLON   ':'
 
#define TM_SEP_DOT   '.'
 
#define TM_SEP_LIST   { TM_SEP_COLON, TM_SEP_DOT, 0 }
 
#define _ctry_init()   ctry_setup( ctry_get_code() )
 
#define _next_language()
 
#define _lstr(_s)   lstr_lng( (_s), language )
 
#define _clstr(_s)   clstr_lng( language, _s )
 

Typedefs

typedef uint8_t LANGUAGE
 
typedef uint16_t CTRY_CODE
 
typedef char * LSTR[N_LNG]
 
typedef char ** PLSTR
 
typedef const char *const CLSTR[N_LNG]
 
typedef const char *const * PCLSTR
 

Enumerations

enum  { LNG_ENGLISH, LNG_GERMAN, N_LNG }
 
enum  { DT_FMT_DDMMYYYY, DT_FMT_MMDDYYYY, DT_FMT_YYYYMMDD, N_DT_FMT }
 
enum  { TM_FMT_24H, N_TM_FMT }
 

Functions

int lstr_idx (CLSTR s, int lng)
 
int lstr_array_idx (CLSTR s, int idx, int n_lng, int lng)
 
const char * lstr_lng (CLSTR s, int lng)
 
void ctry_setup (CTRY_CODE code)
 
void ctry_next (void)
 
const char * clstr_lng (int index,...)
 

Variables

LANGUAGE language
 
CTRY ctry
 

Macro Definition Documentation

◆ _clstr

#define _clstr (   _s)    clstr_lng( language, _s )

Definition at line 202 of file ctry.h.

◆ _ctry_init

#define _ctry_init ( )    ctry_setup( ctry_get_code() )

Definition at line 186 of file ctry.h.

◆ _ext

#define _ext   extern

Definition at line 79 of file ctry.h.

◆ _lstr

#define _lstr (   _s)    lstr_lng( (_s), language )

◆ _next_language

#define _next_language ( )
Value:
{ \
if ( ++language >= N_LNG ) \
language = 0; \
\
}
LANGUAGE language
Definition: mbgstatus.c:125
Definition: ctry.h:106

Definition at line 190 of file ctry.h.

◆ CTRY_DEFINED

#define CTRY_DEFINED

Definition at line 143 of file ctry.h.

◆ CTRY_GERMANY

#define CTRY_GERMANY   49

Definition at line 138 of file ctry.h.

Referenced by ctry_next(), and ctry_setup().

◆ CTRY_UK

#define CTRY_UK   44

Definition at line 137 of file ctry.h.

Referenced by ctry_next(), and ctry_setup().

◆ CTRY_US

#define CTRY_US   1

Definition at line 136 of file ctry.h.

Referenced by ctry_next(), and ctry_setup().

◆ DT_SEP_DOT

#define DT_SEP_DOT   '.'

Definition at line 164 of file ctry.h.

Referenced by ctry_setup().

◆ DT_SEP_LIST

#define DT_SEP_LIST   { DT_SEP_DOT, DT_SEP_MINUS, DT_SEP_SLASH, 0 }

Definition at line 169 of file ctry.h.

◆ DT_SEP_MINUS

#define DT_SEP_MINUS   '-'

Definition at line 165 of file ctry.h.

Referenced by ctry_setup().

◆ DT_SEP_SLASH

#define DT_SEP_SLASH   '/'

Definition at line 166 of file ctry.h.

Referenced by ctry_setup().

◆ LNG_DEFINED

#define LNG_DEFINED

Definition at line 109 of file ctry.h.

◆ TM_SEP_COLON

#define TM_SEP_COLON   ':'

Definition at line 173 of file ctry.h.

Referenced by ctry_setup().

◆ TM_SEP_DOT

#define TM_SEP_DOT   '.'

Definition at line 174 of file ctry.h.

◆ TM_SEP_LIST

#define TM_SEP_LIST   { TM_SEP_COLON, TM_SEP_DOT, 0 }

Definition at line 177 of file ctry.h.

Typedef Documentation

◆ CLSTR

typedef const char* const CLSTR[N_LNG]

Definition at line 118 of file ctry.h.

◆ CTRY_CODE

Definition at line 98 of file ctry.h.

◆ LANGUAGE

typedef uint8_t LANGUAGE

Definition at line 97 of file ctry.h.

◆ LSTR

typedef char* LSTR[N_LNG]

Definition at line 114 of file ctry.h.

◆ PCLSTR

typedef const char* const* PCLSTR

Definition at line 119 of file ctry.h.

◆ PLSTR

typedef char** PLSTR

Definition at line 115 of file ctry.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
LNG_ENGLISH 
LNG_GERMAN 
N_LNG 

Definition at line 102 of file ctry.h.

◆ anonymous enum

anonymous enum
Enumerator
DT_FMT_DDMMYYYY 
DT_FMT_MMDDYYYY 
DT_FMT_YYYYMMDD 
N_DT_FMT 

Definition at line 146 of file ctry.h.

◆ anonymous enum

anonymous enum
Enumerator
TM_FMT_24H 
N_TM_FMT 

Definition at line 155 of file ctry.h.

Function Documentation

◆ clstr_lng()

const char* clstr_lng ( int  index,
  ... 
)

Definition at line 155 of file ctry.c.

◆ ctry_next()

void ctry_next ( void  )

Definition at line 132 of file ctry.c.

References CTRY::code, ctry, CTRY_GERMANY, ctry_setup(), CTRY_UK, and CTRY_US.

◆ ctry_setup()

◆ lstr_array_idx()

int lstr_array_idx ( CLSTR  s,
int  idx,
int  n_lng,
int  lng 
)

Definition at line 73 of file ctry.c.

References mbg_database::idx, and lstr_idx().

◆ lstr_idx()

int lstr_idx ( CLSTR  s,
int  lng 
)

Definition at line 51 of file ctry.c.

References N_LNG.

Referenced by lstr_array_idx(), and lstr_lng().

◆ lstr_lng()

const char* lstr_lng ( CLSTR  s,
int  lng 
)

Definition at line 83 of file ctry.c.

References lstr_idx().

Variable Documentation

◆ ctry

CTRY ctry

Definition at line 126 of file mbgstatus.c.

Referenced by ctry_next(), and ctry_setup().

◆ language

LANGUAGE language