/* Copyright (C) 1999-2006 Id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. GtkRadiant is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. GtkRadiant is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GtkRadiant; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #pragma once #include "cmdlib.h" #define MAXTOKEN 1024 extern char token[MAXTOKEN]; extern int scriptline; void LoadScriptFile( const char *filename, int index, bool verbose = true ); void ParseFromMemory( char *buffer, int size ); /// \param[in] crossline true: write next token to \c token or return false on EOF /// \param[in] crossline false: find next token on the current line or emit \c Error bool GetToken( bool crossline ); /// \brief Signals that the current token was not used, and should be reported for the next \c GetToken(). /// Only may be used once between the \c GetToken() calls. void UnGetToken( void ); /// \brief /// \return true, if there is another token on the line. bool TokenAvailable( void ); /// \brief Parses next token and emits \c Error, if it's not equal to \p match. /// Allowed to cross a line. void MatchToken( const char *match ); template void Parse1DMatrix( int x, T *m ); void Parse2DMatrix( int y, int x, float *m ); void Parse3DMatrix( int z, int y, int x, float *m ); void Write1DMatrix( FILE *f, int x, float *m ); void Write2DMatrix( FILE *f, int y, int x, float *m ); void Write3DMatrix( FILE *f, int z, int y, int x, float *m );