X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=src%2Fld65%2Fexports.h;h=170f80978fa7b57cffdc9512f520f90d68733432;hb=c9b90692080a21fd4e78e5cd1871c35935d5d997;hp=c28d49ed4018954cc4bc0a9da13ed7d8e59d5803;hpb=edde7a3f453ae863d958d6b8db0a95e1062bfe77;p=cc65 diff --git a/src/ld65/exports.h b/src/ld65/exports.h index c28d49ed4..170f80978 100644 --- a/src/ld65/exports.h +++ b/src/ld65/exports.h @@ -6,10 +6,10 @@ /* */ /* */ /* */ -/* (C) 1998-2003 Ullrich von Bassewitz */ -/* Römerstrasse 52 */ -/* D-70794 Filderstadt */ -/* EMail: uz@cc65.org */ +/* (C) 1998-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,8 +46,9 @@ #include "filepos.h" /* ld65 */ -#include "objdata.h" #include "config.h" +#include "memarea.h" +#include "objdata.h" @@ -65,7 +66,8 @@ struct Import { FilePos Pos; /* File position of reference */ struct Export* Exp; /* Matching export for this import */ unsigned Name; /* Name if not in table */ - unsigned char Type; /* Type of import */ + unsigned char Flags; /* Generic flags */ + unsigned char AddrSize; /* Address size of import */ }; @@ -82,6 +84,7 @@ struct Export { FilePos Pos; /* File position of definition */ ExprNode* Expr; /* Expression (0 if not def'd) */ unsigned char Type; /* Type of export */ + unsigned char AddrSize; /* Address size of export */ unsigned char ConDes[CD_TYPE_COUNT]; /* Constructor/destructor decls */ }; @@ -103,11 +106,26 @@ typedef int (*ExpCheckFunc) (unsigned Name, void* Data); +void FreeImport (Import* I); +/* Free an import. NOTE: This won't remove the import from the exports table, + * so it may only be called for unused imports (imports from modules that + * aren't referenced). + */ + Import* ReadImport (FILE* F, ObjData* Obj); /* Read an import from a file and insert it into the table */ -void InsertImport (Import* I); -/* Insert an import into the table */ +Import* GenImport (unsigned Name, unsigned char AddrSize); +/* Generate a new import with the given name and address size and return it */ + +Import* InsertImport (Import* I); +/* Insert an import into the table, return I */ + +void FreeExport (Export* E); +/* Free an export. NOTE: This won't remove the export from the exports table, + * so it may only be called for unused exports (exports from modules that + * aren't referenced). + */ Export* ReadExport (FILE* F, ObjData* Obj); /* Read an export from a file */ @@ -118,7 +136,7 @@ void InsertExport (Export* E); Export* CreateConstExport (unsigned Name, long Value); /* Create an export for a literal date */ -Export* CreateMemoryExport (unsigned Name, Memory* Mem, unsigned long Offs); +Export* CreateMemoryExport (unsigned Name, MemoryArea* Mem, unsigned long Offs); /* Create an relative export for a memory area offset */ Export* CreateSegmentExport (unsigned Name, Segment* Seg, unsigned long Offs); @@ -144,8 +162,13 @@ int IsConstExport (const Export* E); long GetExportVal (const Export* E); /* Get the value of this export */ -void CheckExports (ExpCheckFunc F, void* Data); -/* Check if there are any unresolved symbols. On unresolved symbols, F is +void CheckExports (void); +/* Setup the list of all exports and check for export/import symbol type + * mismatches. + */ + +void CheckUnresolvedImports (ExpCheckFunc F, void* Data); +/* Check if there are any unresolved imports. On unresolved imports, F is * called (see the comments on ExpCheckFunc in the data section). */