Change how data is stored in the library. To simplify things, the index
(=directory) entry is now shorter, and additional data necessary for checking in the archiver is not stored in the directory but read from the object file data in the library. git-svn-id: svn://svn.cc65.org/cc65/trunk@4944 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
@@ -70,16 +70,14 @@ ObjData* NewObjData (void)
|
||||
|
||||
/* Initialize the data */
|
||||
O->Name = 0;
|
||||
|
||||
O->Flags = 0;
|
||||
O->MTime = 0;
|
||||
O->Start = 0;
|
||||
O->Size = 0;
|
||||
O->StringCount = 0;
|
||||
O->Strings = 0;
|
||||
O->ImportSize = 0;
|
||||
O->Imports = 0;
|
||||
O->ExportSize = 0;
|
||||
O->Exports = 0;
|
||||
|
||||
O->Strings = EmptyCollection;
|
||||
O->Exports = EmptyCollection;
|
||||
|
||||
/* Add it to the list */
|
||||
CollAppend (&ObjPool, O);
|
||||
@@ -96,17 +94,31 @@ void FreeObjData (ObjData* O)
|
||||
unsigned I;
|
||||
|
||||
xfree (O->Name);
|
||||
xfree (O->Imports);
|
||||
xfree (O->Exports);
|
||||
for (I = 0; I < O->StringCount; ++I) {
|
||||
xfree (O->Strings[I]);
|
||||
for (I = 0; I < CollCount (&O->Strings); ++I) {
|
||||
xfree (CollAt (&O->Strings, I));
|
||||
}
|
||||
xfree (O->Strings);
|
||||
DoneCollection (&O->Strings);
|
||||
DoneCollection (&O->Exports);
|
||||
xfree (O);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void ClearObjData (ObjData* O)
|
||||
/* Remove any data stored in O */
|
||||
{
|
||||
unsigned I;
|
||||
xfree (O->Name);
|
||||
O->Name = 0;
|
||||
for (I = 0; I < CollCount (&O->Strings); ++I) {
|
||||
xfree (CollAt (&O->Strings, I));
|
||||
}
|
||||
CollDeleteAll (&O->Strings);
|
||||
CollDeleteAll (&O->Exports);
|
||||
}
|
||||
|
||||
|
||||
|
||||
ObjData* FindObjData (const char* Module)
|
||||
/* Search for the module with the given name and return it. Return NULL if the
|
||||
* module is not in the list.
|
||||
@@ -157,15 +169,3 @@ void DelObjData (const char* Module)
|
||||
|
||||
|
||||
|
||||
const char* GetObjString (const ObjData* O, unsigned Index)
|
||||
/* Get a string from the string pool of an object file */
|
||||
{
|
||||
if (Index >= O->StringCount) {
|
||||
Error ("Invalid string index (%u) in module `%s'",
|
||||
Index, O->Name);
|
||||
}
|
||||
return O->Strings[Index];
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user