G:/ScriptBasic/source/reader.c File Reference

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include "filesys.h"
#include "report.h"
#include "errcodes.h"
#include "conftree.h"
#include "reader.h"
#include "dynlolib.h"
#include "scriba.h"
#include "ipreproc.h"

Go to the source code of this file.

Defines

#define REPORT(x1, x2, x3, x4)   if( pRo->report )pRo->report(pRo->reportptr,x1,x2,x3,REPORT_ERROR,&(pRo->iErrorCounter),x4,&(pRo->fErrorFlags));
#define FNLEN   1024
#define FNLEN   1024
#define ischardsep(s)   ((s) == '/' || (s) == '\\')

Functions

int strnicmp (char *a, char *b, int n)
int stricmp (char *a, char *b)
static int reader_AllocateInitialBuffer (pReadObject pRo)
int reader_IncreaseBuffer (pReadObject pRo)
int reader_gets (pReadObject pRo, void *fp)
int reader_ReadLines (pReadObject pRo, char *szFileName)
int reader_ReadLines_r (pReadObject pRo, char *szFileName, pSourceLine *pLine)
void reader_ProcessIncludeFiles (pReadObject pRo, pSourceLine *pLine)
void reader_LoadPreprocessors (pReadObject pRo, pSourceLine *pLine)
void reader_StartIteration (pReadObject pRo)
char * reader_NextLine (pReadObject pRo)
int reader_NextCharacter (void *p)
char * reader_FileName (void *p)
long reader_LineNumber (void *p)
static void * reader_malloc (size_t n, void *pMemorySegment)
static void reader_free (void *p, void *pMemorySegment)
static void * _MyOpenFile (char *FileName, void *p)
static int _MyGetCharacter (void *fp, void *p)
static void _MyCloseFile (void *fp, void *p)
void reader_InitStructure (pReadObject pRo)
char * reader_RelateFile (pReadObject pRo, char *pszBaseFile, char *pszRelativeFile)
void reader_DumpLines (pReadObject pRo, FILE *fp)

Variables

int GlobalDebugDisplayFlag


Define Documentation

#define FNLEN   1024
 

#define FNLEN   1024
 

#define ischardsep s   )     ((s) == '/' || (s) == '\\')
 

Referenced by reader_RelateFile().

#define REPORT x1,
x2,
x3,
x4   )     if( pRo->report )pRo->report(pRo->reportptr,x1,x2,x3,REPORT_ERROR,&(pRo->iErrorCounter),x4,&(pRo->fErrorFlags));
 

Definition at line 131 of file reader.c.


Function Documentation

static void _MyCloseFile void *  fp,
void *  p
[static]
 

Definition at line 730 of file reader.c.

References file_fclose().

Referenced by reader_InitStructure().

static int _MyGetCharacter void *  fp,
void *  p
[static]
 

Definition at line 727 of file reader.c.

References file_fgetc().

Referenced by reader_InitStructure().

static void* _MyOpenFile char *  FileName,
void *  p
[static]
 

Definition at line 724 of file reader.c.

References file_fopen().

Referenced by reader_InitStructure().

static int reader_AllocateInitialBuffer pReadObject  pRo  )  [static]
 

Definition at line 133 of file reader.c.

Referenced by reader_IncreaseBuffer().

void reader_DumpLines pReadObject  pRo,
FILE *  fp
 

Definition at line 878 of file reader.c.

References p.

char* reader_FileName void *  p  ) 
 

Definition at line 690 of file reader.c.

Referenced by HttpExtensionProc(), main(), and scriba_DoLexicalAnalysis().

static void reader_free void *  p,
void *  pMemorySegment
[static]
 

Definition at line 719 of file reader.c.

References free().

Referenced by reader_InitStructure().

int reader_gets pReadObject  pRo,
void *  fp
 

Definition at line 187 of file reader.c.

References ch, i, and reader_IncreaseBuffer().

Referenced by reader_ReadLines_r().

int reader_IncreaseBuffer pReadObject  pRo  ) 
 

Definition at line 154 of file reader.c.

References q, r, reader_AllocateInitialBuffer(), and s.

Referenced by reader_gets().

void reader_InitStructure pReadObject  pRo  ) 
 

Definition at line 742 of file reader.c.

References _MyCloseFile(), _MyGetCharacter(), _MyOpenFile(), NULL, reader_free(), and reader_malloc().

Referenced by HttpExtensionProc(), main(), scriba_LoadProgramString(), and scriba_ReadSource().

long reader_LineNumber void *  p  ) 
 

Definition at line 706 of file reader.c.

Referenced by HttpExtensionProc(), main(), and scriba_DoLexicalAnalysis().

void reader_LoadPreprocessors pReadObject  pRo,
pSourceLine *  pLine
 

Definition at line 552 of file reader.c.

References FNLEN, iError, ipreproc_LoadInternalPreprocessor(), NULL, p, prev, REPORT, s, strcpy(), and strnicmp().

Referenced by reader_ReadLines().

static void* reader_malloc size_t  n,
void *  pMemorySegment
[static]
 

Definition at line 716 of file reader.c.

Referenced by reader_InitStructure().

int reader_NextCharacter void *  p  ) 
 

Definition at line 668 of file reader.c.

Referenced by HttpExtensionProc(), main(), and scriba_DoLexicalAnalysis().

char* reader_NextLine pReadObject  pRo  ) 
 

Definition at line 640 of file reader.c.

References NULL.

void reader_ProcessIncludeFiles pReadObject  pRo,
pSourceLine *  pLine
 

Definition at line 394 of file reader.c.

References cft_EnumNext(), cft_GetEx(), cft_GetKey(), FNLEN, fp, NULL, p, reader_ReadLines_r(), reader_RelateFile(), REPORT, s, strcpy(), and strnicmp().

Referenced by reader_ReadLines().

int reader_ReadLines pReadObject  pRo,
char *  szFileName
 

Definition at line 217 of file reader.c.

References ipreproc_Process(), iResult, next, NULL, p, reader_LoadPreprocessors(), reader_ProcessIncludeFiles(), and reader_ReadLines_r().

Referenced by HttpExtensionProc(), main(), scriba_LoadProgramString(), and scriba_ReadSource().

int reader_ReadLines_r pReadObject  pRo,
char *  szFileName,
pSourceLine *  pLine
 

Definition at line 306 of file reader.c.

References fp, NULL, pL, reader_gets(), REPORT, and strcpy().

Referenced by reader_ProcessIncludeFiles(), and reader_ReadLines().

char* reader_RelateFile pReadObject  pRo,
char *  pszBaseFile,
char *  pszRelativeFile
 

Definition at line 783 of file reader.c.

References ischardsep, lLen, NULL, pszBuffer, q, r, REPORT, s, and strcpy().

Referenced by reader_ProcessIncludeFiles().

void reader_StartIteration pReadObject  pRo  ) 
 

Definition at line 620 of file reader.c.

Referenced by HttpExtensionProc(), main(), and scriba_DoLexicalAnalysis().

int stricmp char *  a,
char *  b
 

Definition at line 117 of file reader.c.

int strnicmp char *  a,
char *  b,
int  n
 

Definition at line 104 of file reader.c.

Referenced by reader_LoadPreprocessors(), reader_ProcessIncludeFiles(), and WinMain().


Variable Documentation

int GlobalDebugDisplayFlag
 

Definition at line 57 of file dynlolib.c.


Generated on Sun Mar 12 23:56:37 2006 for ScriptBasic by  doxygen 1.4.6-NO