Use a separate structure for file infos instead of just the name.

git-svn-id: svn://svn.cc65.org/cc65/trunk@749 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
cuz
2001-05-23 21:32:57 +00:00
parent bfbedfa54b
commit 275da22a66
9 changed files with 181 additions and 12 deletions

View File

@@ -34,6 +34,7 @@
/* common */
#include "check.h"
#include "xmalloc.h"
/* ld65 */
@@ -55,6 +56,7 @@ static LineInfo* NewLineInfo (void)
LineInfo* LI = xmalloc (sizeof (LineInfo));
/* Initialize the fields */
LI->File = 0;
InitFilePos (&LI->Pos);
InitCollection (&LI->Fragments);
@@ -73,6 +75,10 @@ LineInfo* ReadLineInfo (FILE* F, ObjData* O)
/* Read the file position */
ReadFilePos (F, &LI->Pos);
/* Resolve the file index to a pointer to FileInfo struct */
CHECK (LI->Pos.Name < O->FileCount);
LI->File = O->Files[LI->Pos.Name];
/* Return the new LineInfo */
return LI;
}