Files
@ r1820:335b057adac7
Branch filter:
Location: cpp/openttd-patchpack/source/strings.h - annotation
r1820:335b057adac7
404 B
text/x-c
(svn r2324) Introduce _cmd_text for passing strings with a command instead of abusing _decode_parameters as text buffer. This should prevent several possible buffer overruns and is a bit cleaner to use. As bonus it reduces the size of most command packets by 79 bytes.
r1309:4100b4013e37 r1309:4100b4013e37 r1309:4100b4013e37 r1553:e0831bf58344 r1553:e0831bf58344 r1553:e0831bf58344 r1553:e0831bf58344 r1553:e0831bf58344 r1553:e0831bf58344 r1553:e0831bf58344 r1553:e0831bf58344 r1312:cc3799d5ff15 r1309:4100b4013e37 r1309:4100b4013e37 r1309:4100b4013e37 r1309:4100b4013e37 r1309:4100b4013e37 r1309:4100b4013e37 r1309:4100b4013e37 r1309:4100b4013e37 r1309:4100b4013e37 r1309:4100b4013e37 r1309:4100b4013e37 | #ifndef STRINGS_H
#define STRINGS_H
static inline char* InlineString(char* buf, uint16 string)
{
*buf++ = '\x81';
*buf++ = string & 0xFF;
*buf++ = string >> 8;
return buf;
}
char *GetString(char *buffr, uint16 string);
void InjectDParam(int amount);
int32 GetParamInt32(void);
int GetParamInt16(void);
int GetParamInt8(void);
int GetParamUint16(void);
uint GetCurrentCurrencyRate(void);
#endif
|