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

Macros

#define PR_RESET_PARAMS(pr)
 Ensure P_* macros point to the right place for passing parameters to progs functions. More...
 

Functions

int PR_CallFunction (progs_t *pr, func_t fnum)
 Setup to call a function. More...
 
void PR_ExecuteProgram (progs_t *pr, func_t fnum)
 Run a progs function. More...
 
void PR_PopFrame (progs_t *pr)
 Pop an execution frame from the VM stack. More...
 
void PR_PushFrame (progs_t *pr)
 Push an execution frame onto the VM stack. More...
 
void PR_RestoreParams (progs_t *pr)
 Restore the parameters saved by PR_SaveParams(). More...
 
void PR_SaveParams (progs_t *pr)
 Save the current parameters. More...
 

Detailed Description

Macro Definition Documentation

#define PR_RESET_PARAMS (   pr)

Ensure P_* macros point to the right place for passing parameters to progs functions.

Parameters
prpointer to progs_t VM struct
Warning
Failure to use this macro before assigning to the P_* macros can cause corruption of the VM data due to "register" based calling. Can be safely ignored for parameterless functions, or forwarding parameters though a builtin.
Examples:
vm-exec.c.

Function Documentation

int PR_CallFunction ( progs_t pr,
func_t  fnum 
)

Setup to call a function.

If fnum is a builtin rather than a progs function, then the function is called immediately. When called from a builtin function, and fnum is not a builtin, the progs function will execute upon return of control to PR_ExecuteProgram().

Parameters
prpointer to progs_t VM struct
fnumnumber of the function to call
Returns
true if fnum was a progs function, false if fnum was a builtin
void PR_ExecuteProgram ( progs_t pr,
func_t  fnum 
)

Run a progs function.

If fnum is a builtin rather than a progs function, PR_ExecuteProgram() will call the function and then immediately return to the caller. Nested calls are fully supported.

Parameters
prpointer to progs_t VM struct
fnumnumber of the function to call
Examples:
vm-exec.c.
void PR_PopFrame ( progs_t pr)
inline

Pop an execution frame from the VM stack.

Restores execution state. Also frees any temporary strings allocated in this frame (via PR_FreeTempStrings()).

Parameters
prpointer to progs_t VM struct
Examples:
vm-exec.c.
void PR_PushFrame ( progs_t pr)
inline

Push an execution frame onto the VM stack.

Saves current execution state.

Parameters
prpointer to progs_t VM struct
Examples:
vm-exec.c.
void PR_RestoreParams ( progs_t pr)

Restore the parameters saved by PR_SaveParams().

Parameters
prpointer to progs_t VM struct
void PR_SaveParams ( progs_t pr)

Save the current parameters.

Parameters
prpointer to progs_t VM struct