OpenTTD Source  20240919-master-gdf0233f4c2
strgen_tables.h File Reference

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. More...
 
static const char *const _pragmas [][4]
 All pragmas used. More...
 

Detailed Description

Tables of commands for strgen

Definition in 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.

Variable Documentation

◆ _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 171 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 202 of file strgen_tables.h.