UFO: Alien Invasion
Loading...
Searching...
No Matches
scriplib.cpp File Reference
#include "shared.h"
#include "scriplib.h"
Include dependency graph for scriplib.cpp:

Go to the source code of this file.

Data Structures

struct  script_t

Functions

void LoadScriptFile (const char *filenamefilename)
void ParseFromMemory (char *buffer, int sizesize)
 Parses e.g. the entity string that is already stored in memory.
const char * GetToken ()
 Parses the next token from the current script on the stack and store the result in parsedToken.
bool TokenAvailable (void)
 Returns true if there is another token on the line.

Variables

static script_t script
char parsedToken [MAX_TOKEN_CHARS]

Detailed Description

Todo
Remove this and use parse.c

Definition in file scriplib.cpp.

Function Documentation

◆ GetToken()

const char * GetToken ( )

Parses the next token from the current script on the stack and store the result in parsedToken.

Definition at line 75 of file scriplib.cpp.

References script_t::buffer, Com_Parse(), script_t::filename, GetToken(), Mem_Free, parsedToken, Q_streq, Q_strnull(), script, and script_t::script_p.

Referenced by GetToken(), ParseBrush(), ParseEntity(), ParseEpair(), and ParseMapEntity().

◆ LoadScriptFile()

void LoadScriptFile ( const char * filename)

◆ ParseFromMemory()

void ParseFromMemory ( char * buffer,
int size )

Parses e.g. the entity string that is already stored in memory.

Definition at line 62 of file scriplib.cpp.

References script_t::buffer, script_t::end_p, script_t::filename, ParseFromMemory(), Q_strncpyz(), script, and script_t::script_p.

Referenced by ParseEntities(), and ParseFromMemory().

◆ TokenAvailable()

bool TokenAvailable ( void )

Returns true if there is another token on the line.

Definition at line 92 of file scriplib.cpp.

References script_t::end_p, script, script_t::script_p, and TokenAvailable().

Referenced by ParseBrush(), and TokenAvailable().

Variable Documentation

◆ parsedToken

◆ script

script_t script
static

Definition at line 43 of file scriplib.cpp.

Referenced by GetToken(), LoadScriptFile(), ParseFromMemory(), and TokenAvailable().