/* */
/* */
/* */
-/* (C) 2000-2009, Ullrich von Bassewitz */
+/* (C) 2000-2010, Ullrich von Bassewitz */
/* Roemerstrasse 52 */
/* D-70794 Filderstadt */
/* EMail: uz@cc65.org */
-static IFile* NewIFile (const char* Name)
+static IFile* NewIFile (const char* Name, InputType Type)
/* Create and return a new IFile */
{
/* Get the length of the name */
IF->Usage = 0;
IF->Size = 0;
IF->MTime = 0;
+ IF->Type = Type;
memcpy (IF->Name, Name, Len+1);
/* Insert the new structure into the IFile collection */
if (strcmp (Name, IF->Name) == 0) {
/* Found, return the struct */
return IF;
- }
+ }
}
/* Not found */
/* Setup a new IFile structure for the main file */
- IFile* IF = NewIFile (Name);
+ IFile* IF = NewIFile (Name, IT_MAIN);
/* Open the file for reading */
FILE* F = fopen (Name, "r");
*/
IF = FindFile (N);
if (IF == 0) {
- IF = NewIFile (N);
+ IF = NewIFile (N, (DirSpec == INC_SYS)? IT_SYSINC : IT_USERINC);
}
/* We don't need N any longer, since we may now use IF->Name */
/* */
/* */
/* */
-/* (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 */
/*****************************************************************************/
-/* data */
+/* data */
/*****************************************************************************/
+/* An enum that describes different types of input files */
+typedef enum {
+ IT_MAIN, /* Main input file */
+ IT_SYSINC, /* System include file (using <>) */
+ IT_USERINC, /* User include file (using "") */
+} InputType;
+
/* The current input line */
extern StrBuf* Line;
unsigned Usage; /* Usage counter */
unsigned long Size; /* File size */
unsigned long MTime; /* Time of last modification */
+ InputType Type; /* Type of input file */
char Name[1]; /* Name of file (dynamically allocated) */
};