OpenClonk
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
StdResStr2.cpp
Go to the documentation of this file.
1 /*
2  * OpenClonk, http://www.openclonk.org
3  *
4  * Copyright (c) 2001-2009, RedWolf Design GmbH, http://www.clonk.de/
5  * Copyright (c) 2010-2016, The OpenClonk Team and contributors
6  *
7  * Distributed under the terms of the ISC license; see accompanying file
8  * "COPYING" for details.
9  *
10  * "Clonk" is a registered trademark of Matthes Bender, used with permission.
11  * See accompanying file "TRADEMARK" for details.
12  *
13  * To redistribute this file separately, substitute the full license texts
14  * for the above references.
15  */
16 
17 /* Load strings from a primitive memory string table */
18 
19 #include "C4Include.h"
20 #include "c4group/C4Language.h"
21 
22 const int ResStrMaxLen = 4096;
23 static char strResult[ResStrMaxLen + 1];
24 const char *LoadResStrNoAmp(const char *id)
25 {
26  const char * str = LoadResStr(id);
27  char * cpd = strResult;
28  for (const char * cps = str; *cps; ++cps, ++cpd)
29  {
30  if (*cps == '&')
31  --cpd;
32  else
33  *cpd = *cps;
34  }
35  *cpd = 0;
36  return strResult;
37 }
const int ResStrMaxLen
Definition: StdResStr2.cpp:22
const char * LoadResStr(const char *id)
Definition: C4Language.h:83
const char * LoadResStrNoAmp(const char *id)
Definition: StdResStr2.cpp:24