1 /*****************************************************************************/
5 /* Source file line info management */
9 /* (C) 2001-2011, Ullrich von Bassewitz */
10 /* Roemerstrasse 52 */
11 /* 70794 Filderstadt */
12 /* EMail: uz@cc65.org */
15 /* This software is provided 'as-is', without any expressed or implied */
16 /* warranty. In no event will the authors be held liable for any damages */
17 /* arising from the use of this software. */
19 /* Permission is granted to anyone to use this software for any purpose, */
20 /* including commercial applications, and to alter it and redistribute it */
21 /* freely, subject to the following restrictions: */
23 /* 1. The origin of this software must not be misrepresented; you must not */
24 /* claim that you wrote the original software. If you use this software */
25 /* in a product, an acknowledgment in the product documentation would be */
26 /* appreciated but is not required. */
27 /* 2. Altered source versions must be plainly marked as such, and must not */
28 /* be misrepresented as being the original software. */
29 /* 3. This notice may not be removed or altered from any source */
32 /*****************************************************************************/
49 /*****************************************************************************/
51 /*****************************************************************************/
55 /* Opaque structure used to handle line information */
56 typedef struct LineInfo LineInfo;
60 /*****************************************************************************/
62 /*****************************************************************************/
66 void InitLineInfo (void);
67 /* Initialize the line infos */
69 void DoneLineInfo (void);
70 /* Close down line infos */
72 void EndLine (LineInfo* LI);
73 /* End a line that is tracked by the given LineInfo structure */
75 LineInfo* StartLine (const FilePos* Pos, unsigned Type, unsigned Count);
76 /* Start line info for a new line */
78 void NewAsmLine (void);
79 /* Start a new assembler input line. Use this function when generating new
80 * line of LI_TYPE_ASM. It will check if line and/or file have actually
81 * changed, end the old and start the new line as necessary.
84 void GetFullLineInfo (Collection* LineInfos, int ForceRef);
85 /* Return full line infos, that is line infos for currently active Slots. The
86 * function will clear LineInfos before usage. If ForceRef is not zero, a
87 * forced reference will be added to all line infos, with the consequence that
88 * they won't get deleted, even if there is no code or data generated for these
92 const FilePos* GetSourcePos (const LineInfo* LI);
93 /* Return the source file position from the given line info */
95 unsigned GetLineInfoType (const LineInfo* LI);
96 /* Return the type of a line info */
98 void WriteLineInfo (const Collection* LineInfos);
99 /* Write a list of line infos to the object file. */
101 void WriteLineInfos (void);
102 /* Write a list of all line infos to the object file. */
106 /* End of lineinfo.h */