Builtin management functions.
More...
Builtin management functions.
Builtins are arranged into groups of 65536 to allow for diffent expantion sets. eg, stock id is 0x0000xxxx, quakeforge is 0x000fxxxx. predefined groups go up to 0x0fffxxxx allowing 4096 different groups. Builtins 0x10000000 to 0x7fffffff are reserved for auto-allocation. The range 0x8000000 to 0xffffffff is unavailable due to the builtin number being a negative statement address.
#define PR_RANGE_AUTO 0x1000 |
#define PR_RANGE_MASK 0xffff0000 |
#define PR_RANGE_MAX 0x7fff |
#define PR_RANGE_NONE 0xffff |
#define PR_RANGE_QF 0x000f |
#define PR_RANGE_SHIFT 16 |
Lookup a builtin function referred by name.
- Parameters
-
pr | pointer to progs_t VM struct |
name | name of the builtin function to lookup |
- Returns
- pointer to the builtin function entry, or NULL if not found
Lookup a builtin function by builtin number.
- Parameters
-
pr | pointer to progs_t VM struct |
num | number of the builtin function to lookup |
- Returns
- pointer to the builtin function entry, or NULL if not found
Register a set of builtin functions with the VM.
Different VMs within the same program can have different builtin sets. May be called multiple times for the same VM, but redefining a builtin is an error.
- Parameters
-
Fixup all automatically resolved builtin functions (func = #0 in QC).
Performs any necessary builtin function number mapping. Also builds the bfunction_t table. Called automatically during progs load.
- Parameters
-
- Returns
- true for success, false for failure