2001-05-23 07:04:09 +00:00
|
|
|
/*****************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* lineinfo.h */
|
|
|
|
/* */
|
2011-01-27 16:39:30 +00:00
|
|
|
/* Source file line info management */
|
2001-05-23 07:04:09 +00:00
|
|
|
/* */
|
|
|
|
/* */
|
|
|
|
/* */
|
2011-01-20 20:54:30 +00:00
|
|
|
/* (C) 2001-2011, Ullrich von Bassewitz */
|
|
|
|
/* Roemerstrasse 52 */
|
|
|
|
/* 70794 Filderstadt */
|
|
|
|
/* EMail: uz@cc65.org */
|
2001-05-23 07:04:09 +00:00
|
|
|
/* */
|
|
|
|
/* */
|
|
|
|
/* This software is provided 'as-is', without any expressed or implied */
|
|
|
|
/* warranty. In no event will the authors be held liable for any damages */
|
|
|
|
/* arising from the use of this software. */
|
|
|
|
/* */
|
|
|
|
/* Permission is granted to anyone to use this software for any purpose, */
|
|
|
|
/* including commercial applications, and to alter it and redistribute it */
|
|
|
|
/* freely, subject to the following restrictions: */
|
|
|
|
/* */
|
|
|
|
/* 1. The origin of this software must not be misrepresented; you must not */
|
|
|
|
/* claim that you wrote the original software. If you use this software */
|
|
|
|
/* in a product, an acknowledgment in the product documentation would be */
|
|
|
|
/* appreciated but is not required. */
|
|
|
|
/* 2. Altered source versions must be plainly marked as such, and must not */
|
|
|
|
/* be misrepresented as being the original software. */
|
|
|
|
/* 3. This notice may not be removed or altered from any source */
|
|
|
|
/* distribution. */
|
|
|
|
/* */
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef LINEINFO_H
|
|
|
|
#define LINEINFO_H
|
|
|
|
|
|
|
|
|
|
|
|
|
2001-05-23 08:51:48 +00:00
|
|
|
/* common */
|
2001-05-23 22:02:19 +00:00
|
|
|
#include "coll.h"
|
2001-05-23 08:51:48 +00:00
|
|
|
#include "filepos.h"
|
2011-08-14 19:23:16 +00:00
|
|
|
#include "hashtab.h"
|
2011-01-29 22:16:03 +00:00
|
|
|
#include "lidefs.h"
|
2001-05-23 08:51:48 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2001-05-23 07:04:09 +00:00
|
|
|
/*****************************************************************************/
|
2011-01-24 22:38:22 +00:00
|
|
|
/* Data */
|
2001-05-23 07:04:09 +00:00
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-08-14 19:23:16 +00:00
|
|
|
/* Opaque structure used to handle line information */
|
2001-05-23 07:04:09 +00:00
|
|
|
typedef struct LineInfo LineInfo;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
/* Code */
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-01-24 22:38:22 +00:00
|
|
|
void InitLineInfo (void);
|
|
|
|
/* Initialize the line infos */
|
|
|
|
|
2011-08-14 19:23:16 +00:00
|
|
|
void DoneLineInfo (void);
|
|
|
|
/* Close down line infos */
|
2011-01-24 22:38:22 +00:00
|
|
|
|
2011-08-14 19:23:16 +00:00
|
|
|
void EndLine (LineInfo* LI);
|
|
|
|
/* End a line that is tracked by the given LineInfo structure */
|
2011-01-24 22:38:22 +00:00
|
|
|
|
2011-08-14 19:23:16 +00:00
|
|
|
LineInfo* StartLine (const FilePos* Pos, unsigned Type, unsigned Count);
|
|
|
|
/* Start line info for a new line */
|
2011-01-24 22:38:22 +00:00
|
|
|
|
2011-08-14 19:23:16 +00:00
|
|
|
void NewAsmLine (void);
|
|
|
|
/* Start a new assembler input line. Use this function when generating new
|
|
|
|
* line of LI_TYPE_ASM. It will check if line and/or file have actually
|
|
|
|
* changed, end the old and start the new line as necessary.
|
2011-01-24 22:38:22 +00:00
|
|
|
*/
|
|
|
|
|
2011-08-18 14:36:38 +00:00
|
|
|
LineInfo* GetAsmLineInfo (void);
|
|
|
|
/* Return the line info for the current assembler file. The function will
|
|
|
|
* bump the reference counter before returning the line info.
|
|
|
|
*/
|
|
|
|
|
|
|
|
void ReleaseLineInfo (LineInfo* LI);
|
|
|
|
/* Decrease the reference count for a line info */
|
|
|
|
|
|
|
|
void GetFullLineInfo (Collection* LineInfos);
|
2011-08-14 19:23:16 +00:00
|
|
|
/* Return full line infos, that is line infos for currently active Slots. The
|
2011-08-18 14:36:38 +00:00
|
|
|
* infos will be added to the given collection, existing entries will be left
|
|
|
|
* intact. The reference count of all added entries will be increased.
|
|
|
|
*/
|
|
|
|
|
|
|
|
void ReleaseFullLineInfo (Collection* LineInfos);
|
|
|
|
/* Decrease the reference count for a collection full of LineInfos, then clear
|
|
|
|
* the collection.
|
2011-01-24 22:38:22 +00:00
|
|
|
*/
|
2001-05-23 07:04:09 +00:00
|
|
|
|
2011-08-14 19:23:16 +00:00
|
|
|
const FilePos* GetSourcePos (const LineInfo* LI);
|
2011-01-27 22:25:32 +00:00
|
|
|
/* Return the source file position from the given line info */
|
|
|
|
|
2011-08-14 19:23:16 +00:00
|
|
|
unsigned GetLineInfoType (const LineInfo* LI);
|
2011-01-27 22:25:32 +00:00
|
|
|
/* Return the type of a line info */
|
|
|
|
|
2011-01-24 22:38:22 +00:00
|
|
|
void WriteLineInfo (const Collection* LineInfos);
|
2011-08-14 19:23:16 +00:00
|
|
|
/* Write a list of line infos to the object file. */
|
2001-05-23 19:03:40 +00:00
|
|
|
|
2011-01-24 22:38:22 +00:00
|
|
|
void WriteLineInfos (void);
|
2001-05-23 19:03:40 +00:00
|
|
|
/* Write a list of all line infos to the object file. */
|
|
|
|
|
2001-05-23 07:04:09 +00:00
|
|
|
|
|
|
|
|
|
|
|
/* End of lineinfo.h */
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-08-11 21:23:37 +00:00
|
|
|
|