X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=src%2Fcc65%2Finput.h;h=ad291c0f82648adec2d2ea022a9c50ede3196d85;hb=73dfa23c987d8a7f1154801b85c171f9e01dcd58;hp=662ab2f599ad604c97787380df15f1f1ac68ebc8;hpb=c31008c78a3d299f14f6c59e99e235a68a20b62b;p=cc65 diff --git a/src/cc65/input.h b/src/cc65/input.h index 662ab2f59..ad291c0f8 100644 --- a/src/cc65/input.h +++ b/src/cc65/input.h @@ -38,6 +38,10 @@ +#include + + + /*****************************************************************************/ /* data */ /*****************************************************************************/ @@ -50,7 +54,21 @@ /* Input line stuff */ extern char* line; -extern char* lptr; +extern const char* lptr; /* ### Remove this */ + +/* Current and next input character */ +extern char CurC; +extern char NextC; + +/* Struct that describes an input file */ +typedef struct IFile IFile; +struct IFile { + unsigned Index; /* File index */ + unsigned Usage; /* Usage counter */ + unsigned long Size; /* File size */ + unsigned long MTime; /* Time of last modification */ + char Name[1]; /* Name of file (dynamically allocated) */ +}; @@ -66,11 +84,20 @@ void OpenMainFile (const char* Name); void OpenIncludeFile (const char* Name, unsigned DirSpec); /* Open an include file and insert it into the tables. */ -int NextLine (void); -/* Get a line from the current input. Returns 0 on end of file. */ - void ClearLine (void); /* Clear the current input line */ + +void InitLine (const char* Buf); +/* Initialize lptr from Buf and read CurC and NextC from the new input line */ + +void NextChar (void); +/* Read the next character from the input stream and make CurC and NextC + * valid. If end of line is reached, both are set to NUL, no more lines + * are read by this function. + */ + +int NextLine (void); +/* Get a line from the current input. Returns 0 on end of file. */ const char* GetCurrentFile (void); /* Return the name of the current input file */ @@ -78,20 +105,8 @@ const char* GetCurrentFile (void); unsigned GetCurrentLine (void); /* Return the line number in the current input file */ -int nch (void); -/* Get the next char in input stream (the one behind the current one) */ - -int cgch (void); -/* Get the current character in the input stream and advance line - * pointer (unless already at end of line). - */ - -int gch (void); -/* Get the current character in the input stream and advance line - * pointer (no end of line check is performed). - */ - - +void WriteDependencies (FILE* F, const char* OutputFile); +/* Write a makefile dependency list to the given file */