X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=src%2Fcc65%2Finput.h;h=dfa0ad03b92eaabd56bfa7b863fde985cc1682cc;hb=112ae0e3db511ddd92e769c11328646ebe2a6240;hp=7fc90d247d9a58b51f60476c4523c95aac5d21af;hpb=06b57e6e7e9b651b9db5020b8cb53fd315f423e5;p=cc65 diff --git a/src/cc65/input.h b/src/cc65/input.h index 7fc90d247..dfa0ad03b 100644 --- a/src/cc65/input.h +++ b/src/cc65/input.h @@ -6,10 +6,10 @@ /* */ /* */ /* */ -/* (C) 2000-2004 Ullrich von Bassewitz */ -/* Römerstrasse 52 */ -/* D-70794 Filderstadt */ -/* EMail: uz@cc65.org */ +/* (C) 2000-2010, Ullrich von Bassewitz */ +/* Roemerstrasse 52 */ +/* D-70794 Filderstadt */ +/* EMail: uz@cc65.org */ /* */ /* */ /* This software is provided 'as-is', without any expressed or implied */ @@ -46,11 +46,23 @@ /*****************************************************************************/ -/* data */ +/* data */ /*****************************************************************************/ +/* An enum that describes different types of input files. The members are + * choosen so that it is possible to combine them to bitsets + */ +typedef enum { + IT_MAIN = 0x01, /* Main input file */ + IT_SYSINC = 0x02, /* System include file (using <>) */ + IT_USRINC = 0x04, /* User include file (using "") */ +} InputType; + +/* Forward for an IFile structure */ +struct IFile; + /* The current input line */ extern StrBuf* Line; @@ -58,16 +70,6 @@ extern StrBuf* Line; 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) */ -}; - /*****************************************************************************/ @@ -79,7 +81,7 @@ struct IFile { void OpenMainFile (const char* Name); /* Open the main file. Will call Fatal() in case of failures. */ -void OpenIncludeFile (const char* Name, unsigned DirSpec); +void OpenIncludeFile (const char* Name, InputType IT); /* Open an include file and insert it into the tables. */ void NextChar (void); @@ -99,14 +101,17 @@ StrBuf* InitLine (StrBuf* Buf); int NextLine (void); /* Get a line from the current input. Returns 0 on end of file. */ +const char* GetInputFile (const struct IFile* IF); +/* Return a filename from an IFile struct */ + const char* GetCurrentFile (void); /* Return the name of the current input file */ unsigned GetCurrentLine (void); /* Return the line number in the current input file */ -void WriteDependencies (FILE* F, const char* OutputFile); -/* Write a makefile dependency list to the given file */ +void CreateDependencies (void); +/* Create dependency files requested by the user */