X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=src%2Fld65%2Flineinfo.h;h=84be249bd21b0ed4af1f493c0b82060de4009aea;hb=df80d071e8eeb799bd1d8ec55acd1ee92714c752;hp=6a04a4a37aaee26354bad50a3c84a99b179fa3ee;hpb=17972357946aa829674175d1df76b2bf2b0486e1;p=cc65 diff --git a/src/ld65/lineinfo.h b/src/ld65/lineinfo.h index 6a04a4a37..84be249bd 100644 --- a/src/ld65/lineinfo.h +++ b/src/ld65/lineinfo.h @@ -1,12 +1,12 @@ /*****************************************************************************/ /* */ -/* lineinfo.h */ +/* lineinfo.h */ /* */ -/* Source file line info structure */ +/* Source file line info structure */ /* */ /* */ /* */ -/* (C) 2001-2011, Ullrich von Bassewitz */ +/* (C) 2001-2012, Ullrich von Bassewitz */ /* Roemerstrasse 52 */ /* D-70794 Filderstadt */ /* EMail: uz@cc65.org */ @@ -51,7 +51,7 @@ /*****************************************************************************/ -/* Forwards */ +/* Forwards */ /*****************************************************************************/ @@ -62,28 +62,28 @@ struct Segment; /*****************************************************************************/ -/* Data */ +/* Data */ /*****************************************************************************/ /* Structure holding line information. The Pos.Name field is always the - * global string id of the file name. If the line info was read from the - * object file, the File pointer is valid, otherwise it is NULL. - */ +** global string id of the file name. If the line info was read from the +** object file, the File pointer is valid, otherwise it is NULL. +*/ typedef struct LineInfo LineInfo; struct LineInfo { unsigned Id; /* Line info id */ - struct FileInfo* File; /* File struct for this line if any */ + struct FileInfo* File; /* File struct for this line if any */ unsigned Type; /* Type of line info */ FilePos Pos; /* Position in file */ - Collection Spans; /* Spans for this line */ + unsigned* Spans; /* Spans for this line */ }; /*****************************************************************************/ -/* Code */ +/* Code */ /*****************************************************************************/ @@ -97,15 +97,18 @@ LineInfo* ReadLineInfo (FILE* F, struct ObjData* O); void FreeLineInfo (LineInfo* LI); /* Free a LineInfo structure. */ +LineInfo* DupLineInfo (const LineInfo* LI); +/* Creates a duplicate of a line info structure */ + void ReadLineInfoList (FILE* F, struct ObjData* O, Collection* LineInfos); /* Read a list of line infos stored as a list of indices in the object file, - * make real line infos from them and place them into the passed collection. - */ +** make real line infos from them and place them into the passed collection. +*/ const LineInfo* GetAsmLineInfo (const Collection* LineInfos); -/* Find a line info of type LI_TYPE_ASM in the given collection and return it. - * Return NULL if no such line info was found. - */ +/* Find a line info of type LI_TYPE_ASM and count zero in the given collection +** and return it. Return NULL if no such line info was found. +*/ #if defined(HAVE_INLINE) INLINE const FilePos* GetSourcePos (const LineInfo* LI) @@ -128,7 +131,7 @@ INLINE const char* GetSourceName (const LineInfo* LI) #endif #if defined(HAVE_INLINE) -INLINE unsigned long GetSourceLine (const LineInfo* LI) +INLINE unsigned GetSourceLine (const LineInfo* LI) /* Return the source file line from the given line info */ { return LI->Pos.Line; @@ -160,7 +163,7 @@ INLINE const char* GetSourceNameFromList (const Collection* LineInfos) #endif #if defined(HAVE_INLINE) -INLINE unsigned long GetSourceLineFromList (const Collection* LineInfos) +INLINE unsigned GetSourceLineFromList (const Collection* LineInfos) /* Return the source file line from a list of line infos */ { /* The relevant entry is in slot zero */ @@ -171,6 +174,9 @@ INLINE unsigned long GetSourceLineFromList (const Collection* LineInfos) GetSourceLine ((const LineInfo*) CollConstAt ((LineInfos), 0)) #endif +unsigned LineInfoCount (void); +/* Return the total number of line infos */ + void AssignLineInfoIds (void); /* Assign the ids to the line infos */ @@ -180,7 +186,5 @@ void PrintDbgLineInfo (FILE* F); /* End of lineinfo.h */ -#endif - - +#endif