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

Typed global access macros. More...

Macros

#define G_DSTRING(p, o)
 Access a dstring global. More...
 
#define G_EDICT(p, o)
 Access an entity global. More...
 
#define G_EDICTNUM(p, o)
 Access an entity global. More...
 
#define G_FLOAT(p, o)
 Access a float global. More...
 
#define G_FUNCTION(p, o)
 Access a function global. More...
 
#define G_GPOINTER(p, o)
 Access a pointer parameter. More...
 
#define G_GSTRING(p, o)
 Access a string global, converting it to a C string. More...
 
#define G_INT(p, o)
 Access an integer global. More...
 
#define G_POINTER(p, o)   G_var (p, o, pointer)
 Access a pointer global. More...
 
#define G_QUAT(p, o)
 Access a quaternion global. More...
 
#define G_STRING(p, o)
 Access a string index global. More...
 
#define G_STRUCT(p, t, o)   (*(t *)G_GPOINTER (p, o))
 Access a structure global. More...
 
#define G_UINT(p, o)
 Access an unsigned integer global. More...
 
#define G_var(p, o, t)   ((p)->pr_globals[o].t##_var)
 
#define G_VECTOR(p, o)
 Access a vector global. More...
 

Detailed Description

Typed global access macros.

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

Macro Definition Documentation

#define G_DSTRING (   p,
 
)

Access a dstring global.

Kills the program if the dstring is invalid.

QC type:
string
Parameters
ppointer to progs_t VM struct
ooffset into global data space
Returns
dstring_t * to the dstring
#define G_EDICT (   p,
 
)

Access an entity global.

QC type:
entity
Parameters
ppointer to progs_t VM struct
ooffset into global data space
Returns
C pointer to the entity
#define G_EDICTNUM (   p,
 
)

Access an entity global.

QC type:
entity
Parameters
ppointer to progs_t VM struct
ooffset into global data space
Returns
the entity number
#define G_FLOAT (   p,
 
)

Access a float global.

Can be assigned to.

QC type:
float
Parameters
ppointer to progs_t VM struct
ooffset into global data space
Returns
float lvalue
#define G_FUNCTION (   p,
 
)

Access a function global.

Can be assigned to.

QC type:
void()
Parameters
ppointer to progs_t VM struct
ooffset into global data space
Returns
func_t lvalue
#define G_GPOINTER (   p,
 
)

Access a pointer parameter.

QC type:
void *
Parameters
ppointer to progs_t VM struct
ooffset into global data space
Returns
C pointer represented by the parameter. 0 offset -> NULL
#define G_GSTRING (   p,
 
)

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

Kills the program if the string is invalid.

QC type:
string
Parameters
ppointer to progs_t VM struct
ooffset into global data space
Returns
const char * to the string
#define G_INT (   p,
 
)

Access an integer global.

Can be assigned to.

QC type:
integer
Parameters
ppointer to progs_t VM struct
ooffset into global data space
Returns
int lvalue
#define G_POINTER (   p,
 
)    G_var (p, o, pointer)

Access a pointer global.

Can be assigned to.

QC type:
void *
Parameters
ppointer to progs_t VM struct
ooffset into global data space
Returns
pointer_t lvalue
#define G_QUAT (   p,
 
)

Access a quaternion global.

Can be assigned to.

QC type:
quaternion
Parameters
ppointer to progs_t VM struct
ooffset into global data space
Returns
quat_t lvalue
#define G_STRING (   p,
 
)

Access a string index global.

Can be assigned to.

QC type:
string
Parameters
ppointer to progs_t VM struct
ooffset into global data space
Returns
string_t lvalue
#define G_STRUCT (   p,
  t,
 
)    (*(t *)G_GPOINTER (p, o))

Access a structure global.

Can be assigned to.

QC type:
void *
Parameters
ppointer to progs_t VM struct
tC type of the structure
ooffset into global data space
Returns
structure lvalue. use & to make a pointer of the appropriate type.
#define G_UINT (   p,
 
)

Access an unsigned integer global.

Can be assigned to.

QC type:
uinteger
Parameters
ppointer to progs_t VM struct
ooffset into global data space
Returns
unsigned int lvalue
#define G_var (   p,
  o,
 
)    ((p)->pr_globals[o].t##_var)
#define G_VECTOR (   p,
 
)

Access a vector global.

Can be assigned to.

QC type:
vector
Parameters
ppointer to progs_t VM struct
ooffset into global data space
Returns
vec3_t lvalue