Typed parameter access macros.
More...
|
#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...
|
|
Typed parameter access macros.
No checking is done against the QC type, but the appropriate C type will be used.
#define P_DSTRING |
( |
|
p, |
|
|
|
n |
|
) |
| |
Access a dstring parameter.
Kills the program if the dstring is invalid.
- QC type:
string
- Parameters
-
p | pointer to progs_t VM struct |
n | parameter number (0-7) |
- Returns
- dstring_t * to the dstring
Access an entity parameter.
- QC type:
entity
- Parameters
-
p | pointer to progs_t VM struct |
n | parameter number (0-7) |
- Returns
- C pointer to the entity
#define P_EDICTNUM |
( |
|
p, |
|
|
|
n |
|
) |
| |
Access an entity parameter.
- QC type:
entity
- Parameters
-
p | pointer to progs_t VM struct |
n | parameter number (0-7) |
- Returns
- the entity number
Access a float parameter.
Can be assigned to.
- QC type:
float
- Parameters
-
p | pointer to progs_t VM struct |
n | parameter number (0-7) |
- Returns
- float lvalue
#define P_FUNCTION |
( |
|
p, |
|
|
|
n |
|
) |
| |
Access a function parameter.
Can be assigned to.
- QC type:
void()
- Parameters
-
p | pointer to progs_t VM struct |
n | parameter number (0-7) |
- Returns
- func_t lvalue
#define P_GPOINTER |
( |
|
p, |
|
|
|
n |
|
) |
| |
Access a pointer parameter.
- QC type:
void
*
- Parameters
-
p | pointer to progs_t VM struct |
n | parameter 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
-
p | pointer to progs_t VM struct |
n | parameter number (0-7) |
- Returns
- const char * to the string
Access an integer parameter.
Can be assigned to.
- QC type:
integer
- Parameters
-
p | pointer to progs_t VM struct |
n | parameter 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
-
p | pointer to progs_t VM struct |
n | parameter number (0-7) |
- Returns
- pointer_t lvalue
- Examples:
- vm-exec.c.
Access a quaterion parameter.
Can be used any way a quat_t variable can.
- QC type:
quaterion
- Parameters
-
p | pointer to progs_t VM struct |
n | parameter 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
-
p | pointer to progs_t VM struct |
n | parameter number (0-7) |
- Returns
- string_t lvalue
#define P_STRUCT |
( |
|
p, |
|
|
|
t, |
|
|
|
n |
|
) |
| |
Access a structure pointer parameter.
- QC type:
void
*
- Parameters
-
p | pointer to progs_t VM struct |
t | C type of the structure |
n | parameter number (0-7) |
- Returns
- structure lvalue. use & to make a pointer of the appropriate type.
Access an unsigned integer parameter.
Can be assigned to.
- QC type:
uinteger
- Parameters
-
p | pointer to progs_t VM struct |
n | parameter number (0-7) |
- Returns
- unsigned int lvalue
#define P_var |
( |
|
p, |
|
|
|
n, |
|
|
|
t |
|
) |
| ((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
-
p | pointer to progs_t VM struct |
n | parameter number (0-7) |
- Returns
- vec3_t lvalue