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

Line oriented script parsing. More...

Data Structures

struct  script_s
 

Typedefs

typedef struct script_s script_t
 

Functions

void Script_Delete (script_t *script)
 Delete a script_t object. More...
 
qboolean Script_GetToken (script_t *script, qboolean crossline)
 Get the next token. More...
 
script_tScript_New (void)
 Return a new script_t object. More...
 
void Script_Start (script_t *script, const char *file, const char *data)
 Prepare a script_t object for parsing. More...
 
const char * Script_Token (script_t *script)
 Return a pointer to the current token. More...
 
qboolean Script_TokenAvailable (script_t *script, qboolean crossline)
 Check if a new token is available. More...
 
void Script_UngetToken (script_t *script)
 Unget the current token. More...
 

Detailed Description

Line oriented script parsing.

Multiple scripts being parsed at the same time is supported.

Typedef Documentation

typedef struct script_s script_t

Function Documentation

void Script_Delete ( script_t script)

Delete a script_t object.

Parameters
scriptThe script_t object to be deleted Does not free the memory passed to Script_Start().
qboolean Script_GetToken ( script_t script,
qboolean  crossline 
)

Get the next token.

Generates an error and exits the program if no token is available and crossline is false.

Parameters
scriptThe script_t object being parsed
crosslineTrue to allow passing
Returns
True on success, false on failure (no token available)
script_t* Script_New ( void  )

Return a new script_t object.

Returns
A new, blank, script object. Use Script_Start() to initialize.
void Script_Start ( script_t script,
const char *  file,
const char *  data 
)

Prepare a script_t object for parsing.

The caller is responsible for freeing the memory associated with file and data when parsing is complete.

Parameters
scriptThe script_t object being parsed
fileName of the file being parsed. used only for error reporting
dataThe script to be parsed
const char* Script_Token ( script_t script)

Return a pointer to the current token.

Parameters
scriptThe script_t object being parsed
qboolean Script_TokenAvailable ( script_t script,
qboolean  crossline 
)

Check if a new token is available.

Parameters
scriptThe script_t object being parsed
crosslineTrue to allow passing
Returns
True if a token is available, false if end of file or end of line (if crossline is false) has been hit
void Script_UngetToken ( script_t script)

Unget the current token.

Only one level of unget is supported.

Parameters
scriptThe script_t object being parsed