QuakeForge  0.7.2.210-815cf
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages

Typed parameter access macros. More...

Macros

#define P_DSTRING(p, n)
 Access a dstring parameter. More...
 
#define P_EDICT(p, n)
 Access an entity parameter. More...
 
#define P_EDICTNUM(p, n)
 Access an entity parameter. More...
 
#define P_FLOAT(p, n)
 Access a float parameter. More...
 
#define P_FUNCTION(p, n)
 Access a function parameter. More...
 
#define P_GPOINTER(p, n)
 Access a pointer parameter. More...
 
#define P_GSTRING(p, n)
 Access a string parameter, converting it to a C string. More...
 
#define P_INT(p, n)
 Access an integer parameter. More...
 
#define P_POINTER(p, n)
 Access a pointer parameter. More...
 
#define P_QUAT(p, n)
 Access a quaterion parameter. More...
 
#define P_STRING(p, n)
 Access a string index parameter. More...
 
#define P_STRUCT(p, t, n)
 Access a structure pointer parameter. More...
 
#define P_UINT(p, n)
 Access an unsigned integer parameter. More...
 
#define P_var(p, n, t)   ((p)->pr_params[n]->t##_var)
 
#define P_VECTOR(p, n)
 Access a vector parameter. More...
 

Detailed Description

Typed parameter access macros.

No checking is done against the QC type, but the appropriate C type will be used.

Macro Definition Documentation

#define P_DSTRING (   p,
  n 
)

Access a dstring parameter.

Kills the program if the dstring is invalid.

QC type:
string
Parameters
ppointer to progs_t VM struct
nparameter number (0-7)
Returns
dstring_t * to the dstring
#define P_EDICT (   p,
  n 
)

Access an entity parameter.

QC type:
entity
Parameters
ppointer to progs_t VM struct
nparameter number (0-7)
Returns
C pointer to the entity
#define P_EDICTNUM (   p,
  n 
)

Access an entity parameter.

QC type:
entity
Parameters
ppointer to progs_t VM struct
nparameter number (0-7)
Returns
the entity number
#define P_FLOAT (   p,
  n 
)

Access a float parameter.

Can be assigned to.

QC type:
float
Parameters
ppointer to progs_t VM struct
nparameter number (0-7)
Returns
float lvalue
#define P_FUNCTION (   p,
  n 
)

Access a function parameter.

Can be assigned to.

QC type:
void()
Parameters
ppointer to progs_t VM struct
nparameter number (0-7)
Returns
func_t lvalue
#define P_GPOINTER (   p,
  n 
)

Access a pointer parameter.

QC type:
void *
Parameters
ppointer to progs_t VM struct
nparameter number (0-7)
Returns
C pointer represented by the parameter. 0 offset -> NULL
#define P_GSTRING (   p,
  n 
)

Access a string parameter, converting it to a C string.

Kills the program if the string is invalid.

QC type:
string
Parameters
ppointer to progs_t VM struct
nparameter number (0-7)
Returns
const char * to the string
#define P_INT (   p,
  n 
)

Access an integer parameter.

Can be assigned to.

QC type:
integer
Parameters
ppointer to progs_t VM struct
nparameter number (0-7)
Returns
int lvalue
Examples:
vm-exec.c.
#define P_POINTER (   p,
  n 
)

Access a pointer parameter.

Can be assigned to.

QC type:
void *
Parameters
ppointer to progs_t VM struct
nparameter number (0-7)
Returns
pointer_t lvalue
Examples:
vm-exec.c.
#define P_QUAT (   p,
  n 
)

Access a quaterion parameter.

Can be used any way a quat_t variable can.

QC type:
quaterion
Parameters
ppointer to progs_t VM struct
nparameter number (0-7)
Returns
quat_t lvalue
#define P_STRING (   p,
  n 
)

Access a string index parameter.

Can be assigned to.

QC type:
string
Parameters
ppointer to progs_t VM struct
nparameter number (0-7)
Returns
string_t lvalue
#define P_STRUCT (   p,
  t,
  n 
)

Access a structure pointer parameter.

QC type:
void *
Parameters
ppointer to progs_t VM struct
tC type of the structure
nparameter number (0-7)
Returns
structure lvalue. use & to make a pointer of the appropriate type.
#define P_UINT (   p,
  n 
)

Access an unsigned integer parameter.

Can be assigned to.

QC type:
uinteger
Parameters
ppointer to progs_t VM struct
nparameter number (0-7)
Returns
unsigned int lvalue
#define P_var (   p,
  n,
 
)    ((p)->pr_params[n]->t##_var)
#define P_VECTOR (   p,
  n 
)

Access a vector parameter.

Can be used any way a vec3_t variable can.

QC type:
vector
Parameters
ppointer to progs_t VM struct
nparameter number (0-7)
Returns
vec3_t lvalue