X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=src%2Fld65%2Ffileinfo.c;h=7965d574f6c987a32faf4aab4a8a8317b3b449ba;hb=7bd19b737aacfcf0d81e2bc3a6e537ee72a4eb2f;hp=97dba6aa11b5377fb6e117f888990d9350228ae8;hpb=453a8b704fdcefb5ce88185d233281415a47a992;p=cc65 diff --git a/src/ld65/fileinfo.c b/src/ld65/fileinfo.c index 97dba6aa1..7965d574f 100644 --- a/src/ld65/fileinfo.c +++ b/src/ld65/fileinfo.c @@ -6,10 +6,10 @@ /* */ /* */ /* */ -/* (C) 2001 Ullrich von Bassewitz */ -/* Wacholderweg 14 */ -/* D-70597 Stuttgart */ -/* EMail: uz@cc65.org */ +/* (C) 2001-2010, Ullrich von Bassewitz */ +/* Roemerstrasse 52 */ +/* D-70794 Filderstadt */ +/* EMail: uz@cc65.org */ /* */ /* */ /* This software is provided 'as-is', without any expressed or implied */ @@ -51,25 +51,31 @@ static FileInfo* NewFileInfo (void) /* Allocate and initialize a new FileInfo struct and return it */ { + /* We will assign file info ids in increasing order of creation */ + static unsigned Id = 0; + /* Allocate memory */ FileInfo* FI = xmalloc (sizeof (FileInfo)); + /* Initialize stuff */ + FI->Id = Id++; + /* Return the new struct */ return FI; } -FileInfo* ReadFileInfo (FILE* F, ObjData* O attribute ((unused))) +FileInfo* ReadFileInfo (FILE* F, ObjData* O) /* Read a file info from a file and return it */ { /* Allocate a new FileInfo structure */ FileInfo* FI = NewFileInfo (); /* Read the fields from the file */ + FI->Name = MakeGlobalStringId (O, ReadVar (F)); FI->MTime = Read32 (F); FI->Size = Read32 (F); - FI->Name = ReadStr (F); /* Return the new struct */ return FI;