These macros are used to access the value returned by an interpreted VM function, and to return values from engine functions into progs space (that is, builtins).
More...
These macros are used to access the value returned by an interpreted VM function, and to return values from engine functions into progs space (that is, builtins).
- Warning
- No checking is performed against progs types; for example, if you ask for an
int
from a function that returned a float
, you're asking for trouble.
Access the VM function return value as a float
.
- QC type:
float
- Parameters
-
- Returns
- float lvalue
Access the VM function return value as a func_t (a VM function reference)
- QC type:
void()
- Parameters
-
- Returns
- func_t lvalue
Access the VM function return value as a pr_int_t
(AKA int32_t)
- QC type:
integer
- Parameters
-
- Returns
- pr_int_t lvalue
- Examples:
- vm-exec.c.
Access the VM function return value as a pointer_t (a VM "pointer")
- QC type:
void
*
- Parameters
-
- Returns
- pointer_t lvalue
Access the VM function return value as a quat_t
quaternion.
- QC type:
quaternion
- Parameters
-
- Returns
- quat_t lvalue
Access the VM function return value as a string_t (a VM string reference).
- QC type:
string
- Parameters
-
- Returns
- string_t lvalue
Access the VM function return value as a pr_uint_t
(AKA uint32_t)
- QC type:
uinteger
- Parameters
-
- Returns
- pr_int_t lvalue
#define R_var |
( |
|
p, |
|
|
|
t |
|
) |
| ((p)->pr_return->t##_var) |
Access the VM function return value as a vec3_t
vector.
- QC type:
vector
- Parameters
-
- Returns
- vec3_t lvalue
#define RETURN_EDICT |
( |
|
p, |
|
|
|
e |
|
) |
| |
Set the return value to the given C entity pointer.
The pointer is converted into a progs entity address.
- QC type:
entity
- Parameters
-
p | pointer to progs_t VM struct |
e | C entity pointer to be returned |
#define RETURN_POINTER |
( |
|
p, |
|
|
|
ptr |
|
) |
| |
Set the return value to the given C pointer.
NULL is converted to 0.
- QC type:
void
*
- Parameters
-
p | pointer to progs_t VM struct |
ptr | C entity pointer to be returned |
#define RETURN_QUAT |
( |
|
p, |
|
|
|
q |
|
) |
| |
Set the return value to the given quaterion.
- QC type:
vector
- Parameters
-
p | pointer to progs_t VM struct |
q | quaternion to be returned |
#define RETURN_STRING |
( |
|
p, |
|
|
|
s |
|
) |
| |
Set the return value to the given C string.
The returned string will eventually be garbage collected (see PR_SetReturnString()).
- QC type:
string
- Parameters
-
p | pointer to progs_t VM struct |
s | C string to be returned |
#define RETURN_VECTOR |
( |
|
p, |
|
|
|
v |
|
) |
| |
Set the return value to the given vector.
- QC type:
vector
- Parameters
-
p | pointer to progs_t VM struct |
v | vector to be returned |