OpenTTD Source 20241224-master-gee860a5c8e
strgen_tables.h File Reference

Tables of commands for strgen. More...

Go to the source code of this file.

Data Structures

struct  CmdStruct
 
struct  PluralForm
 Description of a plural form. More...
 

Typedefs

typedef void(* ParseCmdProc) (Buffer *buffer, char *buf, int value)
 

Enumerations

enum  CmdFlags { C_NONE = 0x0 , C_DONTCOUNT = 0x1 , C_CASE = 0x2 , C_GENDER = 0x4 }
 

Functions

void EmitSingleChar (Buffer *buffer, char *buf, int value)
 
void EmitPlural (Buffer *buffer, char *buf, int value)
 
void EmitGender (Buffer *buffer, char *buf, int value)
 

Variables

static const CmdStruct _cmd_structs []
 
static const int MAX_PLURALS = 5
 The maximum number of plurals.
 
static const PluralForm _plural_forms []
 All plural forms used.
 
static const char *const _pragmas [][4]
 All pragmas used.
 

Detailed Description

Tables of commands for strgen.

Definition in file strgen_tables.h.

Typedef Documentation

◆ ParseCmdProc

typedef void(* ParseCmdProc) (Buffer *buffer, char *buf, int value)

Definition at line 21 of file strgen_tables.h.

Enumeration Type Documentation

◆ CmdFlags

enum CmdFlags
Enumerator
C_NONE 

Nothing special about this command.

C_DONTCOUNT 

These commands aren't counted for comparison.

C_CASE 

These commands support cases.

C_GENDER 

These commands support genders.

Definition at line 12 of file strgen_tables.h.

Function Documentation

◆ EmitGender()

void EmitGender ( Buffer buffer,
char *  buf,
int  value 
)
extern

Definition at line 386 of file strgen_base.cpp.

◆ EmitPlural()

void EmitPlural ( Buffer buffer,
char *  buf,
int  value 
)
extern

Definition at line 334 of file strgen_base.cpp.

◆ EmitSingleChar()

void EmitSingleChar ( Buffer buffer,
char *  buf,
int  value 
)
extern

Definition at line 238 of file strgen_base.cpp.

Variable Documentation

◆ _cmd_structs

const CmdStruct _cmd_structs[]
static

Definition at line 36 of file strgen_tables.h.

◆ _plural_forms

const PluralForm _plural_forms[]
static
Initial value:
= {
{ 2, "Two forms: special case for 1.", "\"1\" \"other\"" },
{ 1, "Only one form.", "\"other\"" },
{ 2, "Two forms: special case for 0 to 1.", "\"0..1\" \"other\"" },
{ 3, "Three forms: special cases for 0, and numbers ending in 1 except when ending in 11.", "\"1,21,31,...\" \"other\" \"0\"" },
{ 5, "Five forms: special cases for 1, 2, 3 to 6, and 7 to 10.", "\"1\" \"2\" \"3..6\" \"7..10\" \"other\"" },
{ 3, "Three forms: special cases for numbers ending in 1 except when ending in 11, and 2 to 9 except when ending in 12 to 19.", "\"1,21,31,...\" \"2..9,22..29,32..39,...\" \"other\"" },
{ 3, "Three forms: special cases for numbers ending in 1 except when ending in 11, and 2 to 4 except when ending in 12 to 14.", "\"1,21,31,...\" \"2..4,22..24,32..34,...\" \"other\"" },
{ 3, "Three forms: special cases for 1, and numbers ending in 2 to 4 except when ending in 12 to 14.", "\"1\" \"2..4,22..24,32..34,...\" \"other\"" },
{ 4, "Four forms: special cases for numbers ending in 01, 02, and 03 to 04.", "\"1,101,201,...\" \"2,102,202,...\" \"3..4,103..104,203..204,...\" \"other\"" },
{ 2, "Two forms: special case for numbers ending in 1 except when ending in 11.", "\"1,21,31,...\" \"other\"" },
{ 3, "Three forms: special cases for 1, and 2 to 4.", "\"1\" \"2..4\" \"other\"" },
{ 2, "Two forms: cases for numbers ending with a consonant, and with a vowel.", "\"yeong,il,sam,yuk,chil,pal\" \"i,sa,o,gu\"" },
{ 4, "Four forms: special cases for 1, 0 and numbers ending in 02 to 10, and numbers ending in 11 to 19.", "\"1\" \"0,2..10,102..110,202..210,...\" \"11..19,111..119,211..219,...\" \"other\"" },
{ 4, "Four forms: special cases for 1 and 11, 2 and 12, 3..10 and 13..19.", "\"1,11\" \"2,12\" \"3..10,13..19\" \"other\"" },
{ 3, "Three forms: special cases for 1, 0 and numbers ending in 01 to 19.", "\"1\" \"0,2..19,101..119,201..219,...\" \"other\"" },
}

All plural forms used.

Definition at line 172 of file strgen_tables.h.

Referenced by HeaderFileWriter::Finalise(), and StringReader::HandlePragma().

◆ _pragmas

const char* const _pragmas[][4]
static
Initial value:
= {
{ "name", "0", "", "English name for the language" },
{ "ownname", "t", "", "Localised name for the language" },
{ "isocode", "0", "", "ISO code for the language" },
{ "plural", "tp", "0", "Plural form to use" },
{ "textdir", "tl", "ltr", "Text direction. Either ltr (left-to-right) or rtl (right-to-left)" },
{ "digitsep", "td", ",", "Digit grouping separator for non-currency numbers" },
{ "digitsepcur", "td", ",", "Digit grouping separator for currency numbers" },
{ "decimalsep", "td", ".", "Decimal separator" },
{ "winlangid", "x2", "0x0000", "Language ID for Windows" },
{ "grflangid", "x1", "0x00", "Language ID for NewGRFs" },
{ "gender", "tag", "", "List of genders" },
{ "case", "tac", "", "List of cases" },
}

All pragmas used.

Definition at line 203 of file strgen_tables.h.

◆ MAX_PLURALS

const int MAX_PLURALS = 5
static

The maximum number of plurals.

Definition at line 169 of file strgen_tables.h.