|
/*****************************************************************************
* $Id: read.h,v 8.2 1999/04/12 05:55:05 darren Exp $
*
* Copyright (c) 1998-1999, Darren Hiebert
*
* This source code is released for free distribution under the terms of the
* GNU General Public License.
*
* al interface to read.c
*****************************************************************************/
#ifndef _READ_H
#define _READ_H
#define EOF_FILE 256
#define getFileName() File.m_name
#define getFileLine() File.lineNumber
/* Maintains the state of the current source file.
*/
struct inputFile{
CString m_name; /* name of the input file */
// stream used for reading the file
HANDLE hFile;
HANDLE hFileMapping;
char* mapViewOfFile;
char* mapIndexOfFile;
char* mapLastIndexOfFile;
bool newLine; /* will the next character begin a new line? */
langType language; /* language of input file */
/* Contains data pertaining to the original source file in which the tag
* was defined. This may be different from the input file when #line
* directives are processed (i.e. the input file is preprocessor output).
*/
unsigned long lineNumber; /* line number in the source file */
};
extern inputFile File;
bool fileOpen (CString fileName, const langType language = LANG_CPP);
void fileClose ();
int fileGetc ();
void fileUngetc();
char* readLine(int line);
#endif /* _READ_H */
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.
A list of licenses authors might use can be found here
Mike has been programming in C/C++ for 11 years and Visual C++/MFC for 4 years. His background includes pure and applied mathematics, engineering and physics, and he is currently based in Moscow, Russia.