Inexor
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Macros | Typedefs | Enumerations | Functions | Variables
command.hpp File Reference

Cubescript API Deprecated. More...

#include "inexor/network/SharedTree.hpp"
#include "inexor/shared/cube_vector.hpp"
#include "inexor/shared/cube_formatting.hpp"
#include "inexor/shared/cube_types.hpp"
#include "inexor/shared/cube_tools.hpp"
#include "inexor/util/InexorException.hpp"

Go to the source code of this file.

Classes

struct  identval
 
struct  tagval
 
struct  identstack
 
union  identvalptr
 
struct  ident
 
union  identval.__unnamed__
 
union  ident.__unnamed__
 
union  ident.__unnamed__
 
struct  ident.__unnamed__.__unnamed__
 
union  ident.__unnamed__.__unnamed__.__unnamed__
 
struct  ident.__unnamed__.__unnamed__.__unnamed__.__unnamed__
 
struct  ident.__unnamed__.__unnamed__.__unnamed__.__unnamed__
 
struct  ident.__unnamed__.__unnamed__
 
struct  ident.__unnamed__.__unnamed__
 

Macros

#define loopstart(id, stack)   if((id)->type != ID_ALIAS) return; identstack stack;
 
#define KEYWORD(name, type)   UNUSED static bool __dummy_##name = addkeyword(type, #name)
 
#define COMMANDN(name, fun, nargs)   UNUSED static bool __dummy_##fun = addcommand(#name, (identfun)fun, nargs); SharedFunc(name)
 
#define COMMAND(name, nargs)   COMMANDN(name, name, nargs)
 
#define _VAR(name, global, min, cur, max, persist)   SharedVar<int> global((int)cur); UNUSED int dummy_register_##global = variable(#name, min, cur, max, &global, NULL, persist)
 
#define _VAR_NOSYNC(name, global, min, cur, max, persist)   int global((int)cur); UNUSED int dummy_register_##global = variable(#name, min, cur, max, &global, NULL, persist)
 Version of VAR which doesnt sync with the tree api. More...
 
#define VARN(name, global, min, cur, max)   _VAR(name, global, min, cur, max, 0)
 
#define VARN_NOSYNC(name, global, min, cur, max)   _VAR_NOSYNC(name, global, min, cur, max, 0)
 
#define VARNP(name, global, min, cur, max)   _VAR(name, global, min, cur, max, IDF_PERSIST)
 
#define VARNR(name, global, min, cur, max)   _VAR(name, global, min, cur, max, IDF_OVERRIDE)
 
#define VAR(name, min, cur, max)   _VAR(name, name, min, cur, max, 0)
 
#define VAR_NOSYNC(name, min, cur, max)   _VAR_NOSYNC(name, name, min, cur, max, 0)
 
#define VARP(name, min, cur, max)   _VAR(name, name, min, cur, max, IDF_PERSIST)
 
#define VARR(name, min, cur, max)   _VAR(name, name, min, cur, max, IDF_OVERRIDE)
 
#define _VARF(name, global, min, cur, max, body, persist)   void var_##name(); SharedVar<int> global((int)cur); UNUSED int dummy_register_##global = variable(#name, min, cur, max, &global, var_##name, persist); void var_##name() { body; }
 
#define VARFN(name, global, min, cur, max, body)   _VARF(name, global, min, cur, max, body, 0)
 
#define VARF(name, min, cur, max, body)   _VARF(name, name, min, cur, max, body, 0)
 
#define VARFP(name, min, cur, max, body)   _VARF(name, name, min, cur, max, body, IDF_PERSIST)
 
#define VARFR(name, min, cur, max, body)   _VARF(name, name, min, cur, max, body, IDF_OVERRIDE)
 
#define _HVAR(name, global, min, cur, max, persist)   SharedVar<int> global(cur); UNUSED int dummy_register_##global = variable(#name, min, cur, max, &global, NULL, persist | IDF_HEX)
 
#define HVARN(name, global, min, cur, max)   _HVAR(name, global, min, cur, max, 0)
 
#define HVARNP(name, global, min, cur, max)   _HVAR(name, global, min, cur, max, IDF_PERSIST)
 
#define HVARNR(name, global, min, cur, max)   _HVAR(name, global, min, cur, max, IDF_OVERRIDE)
 
#define HVAR(name, min, cur, max)   _HVAR(name, name, min, cur, max, 0)
 
#define HVARP(name, min, cur, max)   _HVAR(name, name, min, cur, max, IDF_PERSIST)
 
#define HVARR(name, min, cur, max)   _HVAR(name, name, min, cur, max, IDF_OVERRIDE)
 
#define _HVARF(name, global, min, cur, max, body, persist)   void var_##name(); SharedVar<int> global((int)cur); UNUSED int dummy_register_##global = variable(#name, min, cur, max, &global, var_##name, persist | IDF_HEX); void var_##name() { body; }
 
#define HVARFN(name, global, min, cur, max, body)   _HVARF(name, global, min, cur, max, body, 0)
 
#define HVARF(name, min, cur, max, body)   _HVARF(name, name, min, cur, max, body, 0)
 
#define HVARFP(name, min, cur, max, body)   _HVARF(name, name, min, cur, max, body, IDF_PERSIST)
 
#define HVARFR(name, min, cur, max, body)   _HVARF(name, name, min, cur, max, body, IDF_OVERRIDE)
 
#define _FVAR(name, global, min, cur, max, persist)   SharedVar<float> global((float)cur); UNUSED float dummy_register_##global = fvariable(#name, min, cur, max, &global, NULL, persist)
 
#define FVARN(name, global, min, cur, max)   _FVAR(name, global, min, cur, max, 0)
 
#define FVARNP(name, global, min, cur, max)   _FVAR(name, global, min, cur, max, IDF_PERSIST)
 
#define FVARNR(name, global, min, cur, max)   _FVAR(name, global, min, cur, max, IDF_OVERRIDE)
 
#define FVAR(name, min, cur, max)   _FVAR(name, name, min, cur, max, 0)
 
#define FVARP(name, min, cur, max)   _FVAR(name, name, min, cur, max, IDF_PERSIST)
 
#define FVARR(name, min, cur, max)   _FVAR(name, name, min, cur, max, IDF_OVERRIDE)
 
#define _FVARF(name, global, min, cur, max, body, persist)   void var_##name(); SharedVar<float> global((float)cur); UNUSED float dummy_register_##global = fvariable(#name, min, cur, max, &global, var_##name, persist); void var_##name() { body; }
 
#define FVARFN(name, global, min, cur, max, body)   _FVARF(name, global, min, cur, max, body, 0)
 
#define FVARF(name, min, cur, max, body)   _FVARF(name, name, min, cur, max, body, 0)
 
#define FVARFP(name, min, cur, max, body)   _FVARF(name, name, min, cur, max, body, IDF_PERSIST)
 
#define FVARFR(name, min, cur, max, body)   _FVARF(name, name, min, cur, max, body, IDF_OVERRIDE)
 
#define _SVAR(name, global, cur, persist)   SharedVar<char*> global((char *)cur); UNUSED char* dummy_register_##global = *global = (char*)svariable(#name, cur, &global, NULL, persist)
 
#define SVARN(name, global, cur)   _SVAR(name, global, cur, 0)
 
#define SVARNP(name, global, cur)   _SVAR(name, global, cur, IDF_PERSIST)
 
#define SVARNR(name, global, cur)   _SVAR(name, global, cur, IDF_OVERRIDE)
 
#define SVAR(name, cur)   _SVAR(name, name, cur, 0)
 
#define SVARP(name, cur)   _SVAR(name, name, cur, IDF_PERSIST)
 
#define SVARR(name, cur)   _SVAR(name, name, cur, IDF_OVERRIDE)
 
#define _SVARF(name, global, cur, body, persist)   void var_##name(); SharedVar<char*> global((char*)cur); UNUSED char* dummy_register_##global = *global = (char*)svariable(#name, cur, &global, var_##name, persist); void var_##name() { body; }
 
#define SVARFN(name, global, cur, body)   _SVARF(name, global, cur, body, 0)
 
#define SVARF(name, cur, body)   _SVARF(name, name, cur, body, 0)
 
#define SVARFP(name, cur, body)   _SVARF(name, name, cur, body, IDF_PERSIST)
 
#define SVARFR(name, cur, body)   _SVARF(name, name, cur, body, IDF_OVERRIDE)
 
#define ICOMMANDNS(name, cmdname, nargs, proto, b)
 
#define ICOMMANDN(name, cmdname, nargs, proto, b)   ICOMMANDNS(#name, cmdname, nargs, proto, b)
 
#define ICOMMANDNAME(name)   _icmd_##name
 
#define ICOMMAND(name, nargs, proto, b)   ICOMMANDN(name, ICOMMANDNAME(name), nargs, proto, b)
 
#define ICOMMANDSNAME   _icmds_
 
#define ICOMMANDS(name, nargs, proto, b)   ICOMMANDNS(name, ICOMMANDSNAME, nargs, proto, b)
 
#define ICOMMANDERR(name, nargs, proto, b)
 Version of the ICOMMAND macro that automatically catches errors and prints them to the console. More...
 

Typedefs

typedef void(__cdeclidentfun )()
 

Enumerations

enum  {
  VAL_NULL = 0, VAL_INT, VAL_FLOAT, VAL_STR,
  VAL_ANY, VAL_CODE, VAL_MACRO, VAL_IDENT
}
 
enum  {
  CODE_START = 0, CODE_OFFSET, CODE_POP, CODE_ENTER,
  CODE_EXIT, CODE_VAL, CODE_VALI, CODE_MACRO,
  CODE_BOOL, CODE_BLOCK, CODE_COMPILE, CODE_FORCE,
  CODE_RESULT, CODE_IDENT, CODE_IDENTU, CODE_IDENTARG,
  CODE_COM, CODE_COMD, CODE_COMC, CODE_COMV,
  CODE_CONC, CODE_CONCW, CODE_CONCM, CODE_DOWN,
  CODE_SVAR, CODE_SVAR1, CODE_IVAR, CODE_IVAR1,
  CODE_IVAR2, CODE_IVAR3, CODE_FVAR, CODE_FVAR1,
  CODE_LOOKUP, CODE_LOOKUPU, CODE_LOOKUPARG, CODE_ALIAS,
  CODE_ALIASU, CODE_ALIASARG, CODE_CALL, CODE_CALLU,
  CODE_CALLARG, CODE_PRINT, CODE_LOCAL, CODE_OP_MASK = 0x3F,
  CODE_RET = 6, CODE_RET_MASK = 0xC0, RET_NULL = VAL_NULL<<CODE_RET, RET_STR = VAL_STR<<CODE_RET,
  RET_INT = VAL_INT<<CODE_RET, RET_FLOAT = VAL_FLOAT<<CODE_RET
}
 
enum  {
  ID_VAR, ID_FVAR, ID_SVAR, ID_NOSYNC_VAR,
  ID_COMMAND, ID_ALIAS, ID_LOCAL
}
 
enum  {
  IDF_PERSIST = 1<<0, IDF_OVERRIDE = 1<<1, IDF_HEX = 1<<2, IDF_READONLY = 1<<3,
  IDF_OVERRIDDEN = 1<<4, IDF_UNKNOWN = 1<<5, IDF_ARG = 1<<6
}
 
enum  { KR_CONSOLE = 1<<0, KR_GUI = 1<<1, KR_EDITMODE = 1<<2 }
 

Functions

void addident (ident *id)
 
const char * intstr (int v)
 
void intret (int v)
 
const char * floatstr (float v)
 
void floatret (float v)
 
void stringret (char *s)
 
void result (tagval &v)
 
void result (const char *s)
 
static int parseint (const char *s)
 
static float parsefloat (const char *s)
 
static void intformat (char *buf, int v, int len=20)
 
static void floatformat (char *buf, float v, int len=20)
 
static const char * getstr (const identval &v, int type)
 
static int getint (const identval &v, int type)
 
static float getfloat (const identval &v, int type)
 
int variable (const char *name, int min, int cur, int max, SharedVar< int > *storage, identfun fun, int flags)
 
int variable (const char *name, int min, int cur, int max, int *storage, identfun fun, int flags)
 
float fvariable (const char *name, float min, float cur, float max, SharedVar< float > *storage, identfun fun, int flags)
 
char * svariable (const char *name, const char *cur, SharedVar< char * > *storage, identfun fun, int flags)
 
void setvar (const char *name, int i, bool dofunc=true, bool doclamp=true)
 
void setfvar (const char *name, float f, bool dofunc=true, bool doclamp=true)
 
void setsvar (const char *name, const char *str, bool dofunc=true)
 
void setvarchecked (ident *id, int val)
 
void setfvarchecked (ident *id, float val)
 
void setsvarchecked (ident *id, const char *val)
 
void touchvar (const char *name)
 
int getvar (const char *name)
 
int getvarmin (const char *name)
 
int getvarmax (const char *name)
 
bool identexists (const char *name)
 
identgetident (const char *name)
 
identnewident (const char *name, int flags=0)
 
identreadident (const char *name)
 
identwriteident (const char *name, int flags=0)
 
bool addcommand (const char *name, identfun fun, const char *narg)
 
bool addkeyword (int type, const char *name)
 
uintcompilecode (const char *p)
 
void keepcode (uint *p)
 
void freecode (uint *p)
 
void executeret (const uint *code, tagval &result=*commandret)
 
void executeret (const char *p, tagval &result=*commandret)
 
char * executestr (const uint *code)
 
char * executestr (const char *p)
 
int execute (const uint *code)
 
int execute (const char *p)
 
bool executebool (const uint *code)
 
bool executebool (const char *p)
 
bool execfile (const char *cfgfile, bool msg=true)
 
const char * getcurexecdir ()
 
void alias (const char *name, const char *action)
 
void alias (const char *name, tagval &v)
 
const char * getalias (const char *name)
 
const char * escapestring (const char *s)
 
const char * escapeid (const char *s)
 
static const char * escapeid (ident &id)
 
bool validateblock (const char *s)
 
void explodelist (const char *s, vector< char * > &elems, int limit=-1)
 
char * indexlist (const char *s, int pos)
 
int listlen (const char *s)
 
void printvar (ident *id)
 
void printvar (ident *id, int i)
 
void printfvar (ident *id, float f)
 
void printsvar (ident *id, const char *s)
 
int clampvar (ident *id, int i, int minval, int maxval)
 
float clampfvar (ident *id, float f, float minval, float maxval)
 
void loopiter (ident *id, identstack &stack, const tagval &v)
 
void loopend (ident *id, identstack &stack)
 
static void loopiter (ident *id, identstack &stack, int i)
 
static void loopiter (ident *id, identstack &stack, float f)
 
static void loopiter (ident *id, identstack &stack, const char *s)
 
void clearoverrides ()
 
void writecfg (const char *name=nullptr)
 
void loadhistory ()
 
void writehistory ()
 
void checksleep (int millis)
 
void clearsleep (bool clearoverrides=true)
 

Variables

tagvalcommandret
 
hashnameset< identidents
 
int identflags
 

Detailed Description

Cubescript API Deprecated.


Class Documentation

struct identstack
Class Members
identstack * next
identval val
int valtype
union identvalptr
Class Members
SharedVar< float > * f
SharedVar< int > * i
int * iold
SharedVar< char * > * s
union identval.__unnamed__
Class Members
const uint * code
float f
int i
ident * id
char * s
union ident.__unnamed__
Class Members
uchar numargs
uchar valtype
union ident.__unnamed__
Class Members
__unnamed__ __unnamed__
__unnamed__ __unnamed__
__unnamed__ __unnamed__
struct ident.__unnamed__.__unnamed__
Class Members
__unnamed__ __unnamed__
identval overrideval
identvalptr storage
union ident.__unnamed__.__unnamed__.__unnamed__
Class Members
__unnamed__ __unnamed__
__unnamed__ __unnamed__
struct ident.__unnamed__.__unnamed__.__unnamed__.__unnamed__
Class Members
int maxval
int minval
struct ident.__unnamed__.__unnamed__.__unnamed__.__unnamed__
Class Members
float maxvalf
float minvalf
struct ident.__unnamed__.__unnamed__
Class Members
uint * code
identstack * stack
identval val
struct ident.__unnamed__.__unnamed__
Class Members
uint argmask
const char * args

Macro Definition Documentation

#define _FVAR (   name,
  global,
  min,
  cur,
  max,
  persist 
)    SharedVar<float> global((float)cur); UNUSED float dummy_register_##global = fvariable(#name, min, cur, max, &global, NULL, persist)
#define _FVARF (   name,
  global,
  min,
  cur,
  max,
  body,
  persist 
)    void var_##name(); SharedVar<float> global((float)cur); UNUSED float dummy_register_##global = fvariable(#name, min, cur, max, &global, var_##name, persist); void var_##name() { body; }
#define _HVAR (   name,
  global,
  min,
  cur,
  max,
  persist 
)    SharedVar<int> global(cur); UNUSED int dummy_register_##global = variable(#name, min, cur, max, &global, NULL, persist | IDF_HEX)
#define _HVARF (   name,
  global,
  min,
  cur,
  max,
  body,
  persist 
)    void var_##name(); SharedVar<int> global((int)cur); UNUSED int dummy_register_##global = variable(#name, min, cur, max, &global, var_##name, persist | IDF_HEX); void var_##name() { body; }
#define _SVAR (   name,
  global,
  cur,
  persist 
)    SharedVar<char*> global((char *)cur); UNUSED char* dummy_register_##global = *global = (char*)svariable(#name, cur, &global, NULL, persist)
#define _SVARF (   name,
  global,
  cur,
  body,
  persist 
)    void var_##name(); SharedVar<char*> global((char*)cur); UNUSED char* dummy_register_##global = *global = (char*)svariable(#name, cur, &global, var_##name, persist); void var_##name() { body; }
#define _VAR (   name,
  global,
  min,
  cur,
  max,
  persist 
)    SharedVar<int> global((int)cur); UNUSED int dummy_register_##global = variable(#name, min, cur, max, &global, NULL, persist)
#define _VAR_NOSYNC (   name,
  global,
  min,
  cur,
  max,
  persist 
)    int global((int)cur); UNUSED int dummy_register_##global = variable(#name, min, cur, max, &global, NULL, persist)

Version of VAR which doesnt sync with the tree api.

#define _VARF (   name,
  global,
  min,
  cur,
  max,
  body,
  persist 
)    void var_##name(); SharedVar<int> global((int)cur); UNUSED int dummy_register_##global = variable(#name, min, cur, max, &global, var_##name, persist); void var_##name() { body; }
#define COMMAND (   name,
  nargs 
)    COMMANDN(name, name, nargs)
#define COMMANDN (   name,
  fun,
  nargs 
)    UNUSED static bool __dummy_##fun = addcommand(#name, (identfun)fun, nargs); SharedFunc(name)
#define FVAR (   name,
  min,
  cur,
  max 
)    _FVAR(name, name, min, cur, max, 0)
#define FVARF (   name,
  min,
  cur,
  max,
  body 
)    _FVARF(name, name, min, cur, max, body, 0)
#define FVARFN (   name,
  global,
  min,
  cur,
  max,
  body 
)    _FVARF(name, global, min, cur, max, body, 0)
#define FVARFP (   name,
  min,
  cur,
  max,
  body 
)    _FVARF(name, name, min, cur, max, body, IDF_PERSIST)
#define FVARFR (   name,
  min,
  cur,
  max,
  body 
)    _FVARF(name, name, min, cur, max, body, IDF_OVERRIDE)
#define FVARN (   name,
  global,
  min,
  cur,
  max 
)    _FVAR(name, global, min, cur, max, 0)
#define FVARNP (   name,
  global,
  min,
  cur,
  max 
)    _FVAR(name, global, min, cur, max, IDF_PERSIST)
#define FVARNR (   name,
  global,
  min,
  cur,
  max 
)    _FVAR(name, global, min, cur, max, IDF_OVERRIDE)
#define FVARP (   name,
  min,
  cur,
  max 
)    _FVAR(name, name, min, cur, max, IDF_PERSIST)
#define FVARR (   name,
  min,
  cur,
  max 
)    _FVAR(name, name, min, cur, max, IDF_OVERRIDE)
#define HVAR (   name,
  min,
  cur,
  max 
)    _HVAR(name, name, min, cur, max, 0)
#define HVARF (   name,
  min,
  cur,
  max,
  body 
)    _HVARF(name, name, min, cur, max, body, 0)
#define HVARFN (   name,
  global,
  min,
  cur,
  max,
  body 
)    _HVARF(name, global, min, cur, max, body, 0)
#define HVARFP (   name,
  min,
  cur,
  max,
  body 
)    _HVARF(name, name, min, cur, max, body, IDF_PERSIST)
#define HVARFR (   name,
  min,
  cur,
  max,
  body 
)    _HVARF(name, name, min, cur, max, body, IDF_OVERRIDE)
#define HVARN (   name,
  global,
  min,
  cur,
  max 
)    _HVAR(name, global, min, cur, max, 0)
#define HVARNP (   name,
  global,
  min,
  cur,
  max 
)    _HVAR(name, global, min, cur, max, IDF_PERSIST)
#define HVARNR (   name,
  global,
  min,
  cur,
  max 
)    _HVAR(name, global, min, cur, max, IDF_OVERRIDE)
#define HVARP (   name,
  min,
  cur,
  max 
)    _HVAR(name, name, min, cur, max, IDF_PERSIST)
#define HVARR (   name,
  min,
  cur,
  max 
)    _HVAR(name, name, min, cur, max, IDF_OVERRIDE)
#define ICOMMAND (   name,
  nargs,
  proto,
 
)    ICOMMANDN(name, ICOMMANDNAME(name), nargs, proto, b)
#define ICOMMANDERR (   name,
  nargs,
  proto,
 
)
Value:
ICOMMAND(name, nargs, proto, \
try { \
b; \
Log.std->error("EXCEPTION in {0}: {1}", #name, e.message()); \
} \
)
static Logger std
Logger for everything not fitting elsewhere.
Definition: Logging.hpp:89
virtual std::string message()
Generates an error message appropriate for logging.
Definition: InexorException.hpp:57
inexor::util::log_manager Log
Definition: Logging.cpp:241
Basic exception type for use in inexor.
Definition: InexorException.hpp:24
#define ICOMMAND(name, nargs, proto, b)
Definition: command.hpp:448

Version of the ICOMMAND macro that automatically catches errors and prints them to the console.

#define ICOMMANDN (   name,
  cmdname,
  nargs,
  proto,
 
)    ICOMMANDNS(#name, cmdname, nargs, proto, b)
#define ICOMMANDNAME (   name)    _icmd_##name
#define ICOMMANDNS (   name,
  cmdname,
  nargs,
  proto,
 
)
Value:
template<int N> struct cmdname; \
template<> struct cmdname<__LINE__> \
{ \
static bool init; \
static void run proto; \
}; \
{ b; }
typedef void(APIENTRYP PFNGLUNIFORMMATRIX2X3FVPROC)(GLint location
void init(int slices, int stacks)
Definition: explosion.cpp:38
void run(int dir, int mode)
Definition: octaedit.cpp:1964
bool addcommand(const char *name, identfun fun, const char *narg)
Definition: command.cpp:740
void(__cdecl * identfun)()
Definition: command.hpp:131
#define ICOMMANDS (   name,
  nargs,
  proto,
 
)    ICOMMANDNS(name, ICOMMANDSNAME, nargs, proto, b)
#define ICOMMANDSNAME   _icmds_
#define KEYWORD (   name,
  type 
)    UNUSED static bool __dummy_##name = addkeyword(type, #name)
#define loopstart (   id,
  stack 
)    if((id)->type != ID_ALIAS) return; identstack stack;
#define SVAR (   name,
  cur 
)    _SVAR(name, name, cur, 0)
#define SVARF (   name,
  cur,
  body 
)    _SVARF(name, name, cur, body, 0)
#define SVARFN (   name,
  global,
  cur,
  body 
)    _SVARF(name, global, cur, body, 0)
#define SVARFP (   name,
  cur,
  body 
)    _SVARF(name, name, cur, body, IDF_PERSIST)
#define SVARFR (   name,
  cur,
  body 
)    _SVARF(name, name, cur, body, IDF_OVERRIDE)
#define SVARN (   name,
  global,
  cur 
)    _SVAR(name, global, cur, 0)
#define SVARNP (   name,
  global,
  cur 
)    _SVAR(name, global, cur, IDF_PERSIST)
#define SVARNR (   name,
  global,
  cur 
)    _SVAR(name, global, cur, IDF_OVERRIDE)
#define SVARP (   name,
  cur 
)    _SVAR(name, name, cur, IDF_PERSIST)
#define SVARR (   name,
  cur 
)    _SVAR(name, name, cur, IDF_OVERRIDE)
#define VAR (   name,
  min,
  cur,
  max 
)    _VAR(name, name, min, cur, max, 0)
#define VAR_NOSYNC (   name,
  min,
  cur,
  max 
)    _VAR_NOSYNC(name, name, min, cur, max, 0)
#define VARF (   name,
  min,
  cur,
  max,
  body 
)    _VARF(name, name, min, cur, max, body, 0)
#define VARFN (   name,
  global,
  min,
  cur,
  max,
  body 
)    _VARF(name, global, min, cur, max, body, 0)
#define VARFP (   name,
  min,
  cur,
  max,
  body 
)    _VARF(name, name, min, cur, max, body, IDF_PERSIST)
#define VARFR (   name,
  min,
  cur,
  max,
  body 
)    _VARF(name, name, min, cur, max, body, IDF_OVERRIDE)
#define VARN (   name,
  global,
  min,
  cur,
  max 
)    _VAR(name, global, min, cur, max, 0)
#define VARN_NOSYNC (   name,
  global,
  min,
  cur,
  max 
)    _VAR_NOSYNC(name, global, min, cur, max, 0)
#define VARNP (   name,
  global,
  min,
  cur,
  max 
)    _VAR(name, global, min, cur, max, IDF_PERSIST)
#define VARNR (   name,
  global,
  min,
  cur,
  max 
)    _VAR(name, global, min, cur, max, IDF_OVERRIDE)
#define VARP (   name,
  min,
  cur,
  max 
)    _VAR(name, name, min, cur, max, IDF_PERSIST)
#define VARR (   name,
  min,
  cur,
  max 
)    _VAR(name, name, min, cur, max, IDF_OVERRIDE)

Typedef Documentation

typedef void(__cdecl * identfun)()

Enumeration Type Documentation

anonymous enum
Enumerator
IDF_PERSIST 
IDF_OVERRIDE 
IDF_HEX 
IDF_READONLY 
IDF_OVERRIDDEN 
IDF_UNKNOWN 
IDF_ARG 
anonymous enum
Enumerator
KR_CONSOLE 
KR_GUI 
KR_EDITMODE 
anonymous enum
Enumerator
VAL_NULL 
VAL_INT 
VAL_FLOAT 
VAL_STR 
VAL_ANY 
VAL_CODE 
VAL_MACRO 
VAL_IDENT 
anonymous enum
Enumerator
CODE_START 
CODE_OFFSET 
CODE_POP 
CODE_ENTER 
CODE_EXIT 
CODE_VAL 
CODE_VALI 
CODE_MACRO 
CODE_BOOL 
CODE_BLOCK 
CODE_COMPILE 
CODE_FORCE 
CODE_RESULT 
CODE_IDENT 
CODE_IDENTU 
CODE_IDENTARG 
CODE_COM 
CODE_COMD 
CODE_COMC 
CODE_COMV 
CODE_CONC 
CODE_CONCW 
CODE_CONCM 
CODE_DOWN 
CODE_SVAR 
CODE_SVAR1 
CODE_IVAR 
CODE_IVAR1 
CODE_IVAR2 
CODE_IVAR3 
CODE_FVAR 
CODE_FVAR1 
CODE_LOOKUP 
CODE_LOOKUPU 
CODE_LOOKUPARG 
CODE_ALIAS 
CODE_ALIASU 
CODE_ALIASARG 
CODE_CALL 
CODE_CALLU 
CODE_CALLARG 
CODE_PRINT 
CODE_LOCAL 
CODE_OP_MASK 
CODE_RET 
CODE_RET_MASK 
RET_NULL 
RET_STR 
RET_INT 
RET_FLOAT 
anonymous enum
Enumerator
ID_VAR 
ID_FVAR 
ID_SVAR 
ID_NOSYNC_VAR 
ID_COMMAND 
ID_ALIAS 
ID_LOCAL 

Function Documentation

bool addcommand ( const char *  name,
identfun  fun,
const char *  narg 
)
void addident ( ident id)

References addident().

bool addkeyword ( int  type,
const char *  name 
)

References addident().

void alias ( const char *  name,
const char *  action 
)
void alias ( const char *  name,
tagval v 
)

References setalias().

void checksleep ( int  millis)
float clampfvar ( ident id,
float  f,
float  minval,
float  maxval 
)

References debugcode(), floatstr(), and ident::name.

Referenced by setfvarchecked().

int clampvar ( ident id,
int  i,
int  minval,
int  maxval 
)

References debugcode(), ident::flags, IDF_HEX, and ident::name.

Referenced by setvarchecked().

void clearoverrides ( )

References clearoverride(), enumerate, and idents.

Referenced by resetmap().

void clearsleep ( bool  clearoverrides = true)
uint* compilecode ( const char *  p)
const char* escapeid ( const char *  s)

References gle::end(), and escapestring().

Referenced by escapeid(), writecfg(), and writecompletions().

static const char* escapeid ( ident id)
inlinestatic

References escapeid().

const char* escapestring ( const char *  s)
bool execfile ( const char *  cfgfile,
bool  msg = true 
)
int execute ( const uint code)
int execute ( const char *  p)
bool executebool ( const uint code)
bool executebool ( const char *  p)
void executeret ( const uint code,
tagval result = *commandret 
)
void executeret ( const char *  p,
tagval result = *commandret 
)
char* executestr ( const uint code)

References forcestr(), result(), runcode(), tagval::type, and VAL_NULL.

Referenced by gl_drawhud().

char* executestr ( const char *  p)
void explodelist ( const char *  s,
vector< char * > &  elems,
int  limit = -1 
)
static void floatformat ( char *  buf,
float  v,
int  len = 20 
)
inlinestatic

References nformatstring().

Referenced by conc(), and floatstr().

void floatret ( float  v)

References commandret, and tagval::setfloat().

Referenced by getfps_().

const char* floatstr ( float  v)
void freecode ( uint p)
float fvariable ( const char *  name,
float  min,
float  cur,
float  max,
SharedVar< float > *  storage,
identfun  fun,
int  flags 
)

References addident(), cur, and ID_FVAR.

const char* getalias ( const char *  name)
const char* getcurexecdir ( )

References execdir.

Referenced by autograss(), execfile(), fonttex(), newfont(), and texlayer().

static float getfloat ( const identval v,
int  type 
)
inlinestatic
ident* getident ( const char *  name)

References idents.

Referenced by load_world(), and game::parsemessages().

static int getint ( const identval v,
int  type 
)
inlinestatic
static const char* getstr ( const identval v,
int  type 
)
inlinestatic
int getvar ( const char *  name)

References ID_NOSYNC_VAR, ID_VAR, idents, and ident::type.

int getvarmax ( const char *  name)

References ID_NOSYNC_VAR, ID_VAR, idents, and ident::type.

Referenced by guislider().

int getvarmin ( const char *  name)

References ID_NOSYNC_VAR, ID_VAR, idents, and ident::type.

Referenced by guislider().

bool identexists ( const char *  name)
char* indexlist ( const char *  s,
int  pos 
)
static void intformat ( char *  buf,
int  v,
int  len = 20 
)
inlinestatic

References nformatstring().

Referenced by conc(), and intstr().

void intret ( int  v)
const char* intstr ( int  v)
void keepcode ( uint p)

References CODE_OFFSET, CODE_OP_MASK, and CODE_START.

int listlen ( const char *  s)

References parselist().

Referenced by prettylist().

void loadhistory ( )
void loopend ( ident id,
identstack stack 
)

References poparg().

void loopiter ( ident id,
identstack stack,
const tagval v 
)

References cleancode(), IDF_UNKNOWN, pusharg(), and VAL_STR.

Referenced by loopiter().

static void loopiter ( ident id,
identstack stack,
int  i 
)
inlinestatic

References loopiter(), and tagval::setint().

static void loopiter ( ident id,
identstack stack,
float  f 
)
inlinestatic

References loopiter(), and tagval::setfloat().

static void loopiter ( ident id,
identstack stack,
const char *  s 
)
inlinestatic
ident* newident ( const char *  name,
int  flags = 0 
)
static float parsefloat ( const char *  s)
inlinestatic
static int parseint ( const char *  s)
inlinestatic
void printfvar ( ident id,
float  f 
)
void printsvar ( ident id,
const char *  s 
)

References Log, ident::name, and inexor::util::log_manager::std.

Referenced by printvar().

void printvar ( ident id)
void printvar ( ident id,
int  i 
)
ident* readident ( const char *  name)
void result ( tagval v)
void result ( const char *  s)
void setfvar ( const char *  name,
float  f,
bool  dofunc = true,
bool  doclamp = true 
)

References _GETVAR, f(), ID_FVAR, and OVERRIDEVAR.

Referenced by load_world(), and game::parsemessages().

void setfvarchecked ( ident id,
float  val 
)
void setsvar ( const char *  name,
const char *  str,
bool  dofunc = true 
)
void setsvarchecked ( ident id,
const char *  val 
)
void setvar ( const char *  name,
int  i,
bool  dofunc = true,
bool  doclamp = true 
)
void setvarchecked ( ident id,
int  val 
)
void stringret ( char *  s)

References commandret, and tagval::setstr().

Referenced by tabify().

char* svariable ( const char *  name,
const char *  cur,
SharedVar< char * > *  storage,
identfun  fun,
int  flags 
)

References addident(), ID_SVAR, and newstring().

void touchvar ( const char *  name)
bool validateblock ( const char *  s)

References parsestring().

Referenced by writebinds(), writecfg(), and writecompletions().

int variable ( const char *  name,
int  min,
int  cur,
int  max,
SharedVar< int > *  storage,
identfun  fun,
int  flags 
)

References addident(), cur, and ID_VAR.

int variable ( const char *  name,
int  min,
int  cur,
int  max,
int *  storage,
identfun  fun,
int  flags 
)

References addident(), cur, and ID_NOSYNC_VAR.

void writecfg ( const char *  name = nullptr)
void writehistory ( )
ident* writeident ( const char *  name,
int  flags = 0 
)

Variable Documentation

tagval* commandret
int identflags
hashnameset<ident> idents