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

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...

Macros

#define R_FLOAT(p)
 Access the VM function return value as a float. More...
 
#define R_FUNCTION(p)
 Access the VM function return value as a func_t (a VM function reference) More...
 
#define R_INT(p)
 Access the VM function return value as a pr_int_t (AKA int32_t) More...
 
#define R_POINTER(p)
 Access the VM function return value as a pointer_t (a VM "pointer") More...
 
#define R_QUAT(p)
 Access the VM function return value as a quat_t quaternion. More...
 
#define R_STRING(p)
 Access the VM function return value as a string_t (a VM string reference). More...
 
#define R_UINT(p)
 Access the VM function return value as a pr_uint_t (AKA uint32_t) More...
 
#define R_var(p, t)   ((p)->pr_return->t##_var)
 
#define R_VECTOR(p)
 Access the VM function return value as a vec3_t vector. More...
 
#define RETURN_EDICT(p, e)
 Set the return value to the given C entity pointer. More...
 
#define RETURN_POINTER(p, ptr)
 Set the return value to the given C pointer. More...
 
#define RETURN_QUAT(p, q)
 Set the return value to the given quaterion. More...
 
#define RETURN_STRING(p, s)
 Set the return value to the given C string. More...
 
#define RETURN_VECTOR(p, v)
 Set the return value to the given vector. More...
 

Detailed Description

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.

Macro Definition Documentation

#define R_FLOAT (   p)

Access the VM function return value as a float.

QC type:
float
Parameters
ppointer to progs_t VM struct
Returns
float lvalue
#define R_FUNCTION (   p)

Access the VM function return value as a func_t (a VM function reference)

QC type:
void()
Parameters
ppointer to progs_t VM struct
Returns
func_t lvalue
#define R_INT (   p)

Access the VM function return value as a pr_int_t (AKA int32_t)

QC type:
integer
Parameters
ppointer to progs_t VM struct
Returns
pr_int_t lvalue
Examples:
vm-exec.c.
#define R_POINTER (   p)

Access the VM function return value as a pointer_t (a VM "pointer")

QC type:
void *
Parameters
ppointer to progs_t VM struct
Returns
pointer_t lvalue
#define R_QUAT (   p)

Access the VM function return value as a quat_t quaternion.

QC type:
quaternion
Parameters
ppointer to progs_t VM struct
Returns
quat_t lvalue
#define R_STRING (   p)

Access the VM function return value as a string_t (a VM string reference).

QC type:
string
Parameters
ppointer to progs_t VM struct
Returns
string_t lvalue
#define R_UINT (   p)

Access the VM function return value as a pr_uint_t (AKA uint32_t)

QC type:
uinteger
Parameters
ppointer to progs_t VM struct
Returns
pr_int_t lvalue
#define R_var (   p,
 
)    ((p)->pr_return->t##_var)
#define R_VECTOR (   p)

Access the VM function return value as a vec3_t vector.

QC type:
vector
Parameters
ppointer to progs_t VM struct
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
ppointer to progs_t VM struct
eC 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
ppointer to progs_t VM struct
ptrC entity pointer to be returned
#define RETURN_QUAT (   p,
 
)

Set the return value to the given quaterion.

QC type:
vector
Parameters
ppointer to progs_t VM struct
qquaternion to be returned
#define RETURN_STRING (   p,
 
)

Set the return value to the given C string.

The returned string will eventually be garbage collected (see PR_SetReturnString()).

QC type:
string
Parameters
ppointer to progs_t VM struct
sC string to be returned
#define RETURN_VECTOR (   p,
 
)

Set the return value to the given vector.

QC type:
vector
Parameters
ppointer to progs_t VM struct
vvector to be returned