tron@2186: /* $Id$ */ tron@2186: truelight@543: #ifndef SETTINGS_H truelight@543: #define SETTINGS_H truelight@543: Darkvater@2972: /* Convention/Type of settings. This will be merged mostly with the SaveLoad Darkvater@2972: * SLE_ enums. So it looks a bit strange. The layout is as follows: Darkvater@2972: * bits 0-7: the type (size) of the variable. Eg int8, uint8, bool, etc. Same as VarTypes Darkvater@2972: * bits 8-15: the generic variable type. Eg string, oneofmany, number, intlist Darkvater@2972: * bits 16-31: the size of a string, an intlist (which is an implicit array). */ Darkvater@2972: /* XXX - the GenericType will NOT be shifted in the final implementation, just for compatility */ truelight@543: enum SettingDescType { Darkvater@2972: /* 4 bytes allocated a maximum of 16 types for GenericType */ Darkvater@2972: SDT_NUMX = 0 << 8, // value must be 0!!, refers to any number-type Darkvater@2972: SDT_BOOLX = 1 << 8, // a boolean number Darkvater@2972: SDT_ONEOFMANY = 2 << 8, // bitmasked number where only ONE bit may be set Darkvater@2972: SDT_MANYOFMANY = 3 << 8, // bitmasked number where MULTIPLE bits may be set Darkvater@2972: SDT_INTLIST = 4 << 8, // list of integers seperated by a comma ',' Darkvater@2972: SDT_STRING = 5 << 8, // string which is only a pointer, so needs dynamic allocation Darkvater@2972: SDT_STRINGBUF = 6 << 8, // string with a fixed length, preset buffer Darkvater@2972: SDT_STRINGQUOT = 7 << 8, // string with quotation marks around it (enables spaces in string) Darkvater@2972: SDT_CHAR = 8 << 8, // single character Darkvater@2972: /* 7 more possible primitives */ truelight@543: Darkvater@2972: /* 4 bytes allocated a maximum of 16 types for NumberType */ Darkvater@2972: SDT_INT8 = 0 << 4, Darkvater@2972: SDT_UINT8 = 1 << 4, Darkvater@2972: SDT_INT16 = 2 << 4, Darkvater@2972: SDT_UINT16 = 3 << 4, Darkvater@2972: SDT_INT32 = 4 << 4, Darkvater@2972: SDT_UINT32 = 5 << 4, Darkvater@2972: SDT_INT64 = 6 << 4, Darkvater@2972: SDT_UINT64 = 7 << 4, Darkvater@2972: /* 8 more possible primitives */ truelight@543: Darkvater@2972: /* Shortcut values */ Darkvater@2972: SDT_BOOL = SDT_BOOLX | SDT_UINT8, truelight@543: SDT_UINT = SDT_UINT32, Darkvater@2972: SDT_INT = SDT_INT32, Darkvater@2972: SDT_STR = SDT_STRING, Darkvater@2972: SDT_STRB = SDT_STRINGBUF, Darkvater@2972: SDT_STRQ = SDT_STRINGQUOT, truelight@543: Darkvater@2972: /* The value is read from the configuration file but not saved */ Darkvater@2972: SDT_NOSAVE = 1 << 31, truelight@543: }; truelight@543: dominik@705: typedef enum { dominik@705: IGT_VARIABLES = 0, // values of the form "landscape = hilly" dominik@705: IGT_LIST = 1, // a list of values, seperated by \n and terminated by the next group block dominik@705: } IniGroupType; dominik@705: truelight@543: typedef struct SettingDesc { truelight@543: const char *name; truelight@3020: uint32 flags; truelight@543: const void *def; truelight@543: void *ptr; Darkvater@2972: const void *many; truelight@543: } SettingDesc; truelight@543: Darkvater@1739: void IConsoleSetPatchSetting(const char *name, const char *value); Darkvater@1739: void IConsoleGetPatchSetting(const char *name); Darkvater@1739: truelight@543: #endif /* SETTINGS_H */