scriplib.c File Reference

#include "shared.h"
#include "scriplib.h"
Include dependency graph for scriplib.c:

Go to the source code of this file.

Data Structures

struct  script_t

Defines

#define MAX_INCLUDES   2

Functions

int GetScriptLine (void)
static void AddScriptToStack (const char *filename)
void LoadScriptFile (const char *filename)
void ParseFromMemory (char *buffer, int size)
 Parses e.g. the entity string that is already stored in memory.
static qboolean EndOfScript (qboolean crossline)
qboolean GetToken (qboolean crossline)
 Parses the next token from the current script on the stack and store the result in parsedToken.
qboolean TokenAvailable (void)
 Returns true if there is another token on the line.

Variables

static script_t scriptstack [MAX_INCLUDES]
static script_tscript
char parsedToken [MAX_TOKEN_CHARS]

Detailed Description

Todo:
Remove this and use parse.c

Definition in file scriplib.c.


Define Documentation

#define MAX_INCLUDES   2

Definition at line 44 of file scriplib.c.

Referenced by AddScriptToStack(), and ParseFromMemory().


Function Documentation

static void AddScriptToStack ( const char *  filename  )  [static]
static qboolean EndOfScript ( qboolean  crossline  )  [static]
int GetScriptLine ( void   ) 

Definition at line 50 of file scriplib.c.

References script_t::line.

Referenced by ParseBrush().

qboolean GetToken ( qboolean  crossline  ) 

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

Parameters:
[in] crossline The next token may not be seperated by comment or newline if this is true - everything must be on the same line

Definition at line 131 of file scriplib.c.

References script_t::end_p, EndOfScript(), script_t::line, MAX_TOKEN_CHARS, parsedToken, qtrue, script_t::script_p, and Sys_Error().

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

void LoadScriptFile ( const char *  filename  ) 

Definition at line 82 of file scriplib.c.

References AddScriptToStack().

Referenced by LoadMapFile().

void ParseFromMemory ( char *  buffer,
int  size 
)

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

Definition at line 91 of file scriplib.c.

References script_t::buffer, script_t::end_p, script_t::filename, script_t::line, MAX_INCLUDES, Q_strncpyz(), script_t::script_p, and Sys_Error().

Referenced by ParseEntities().

qboolean TokenAvailable ( void   ) 

Returns true if there is another token on the line.

Definition at line 198 of file scriplib.c.

References script_t::end_p, qfalse, qtrue, and script_t::script_p.

Referenced by ParseBrush().


Variable Documentation

char parsedToken[MAX_TOKEN_CHARS]
script_t* script [static]

Definition at line 46 of file scriplib.c.

script_t scriptstack[MAX_INCLUDES] [static]

Definition at line 45 of file scriplib.c.


Generated by  doxygen 1.6.2