0
0
mirror of https://github.com/netwide-assembler/nasm.git synced 2025-10-10 00:25:06 -04:00

Change nasmlist/ListGen to lfmt/struct lfmt

For consistency with ofmt/dfmt, change the listing structure
to "struct lfmt" and "lfmt" and move it to listing.h.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
This commit is contained in:
H. Peter Anvin
2016-02-18 01:16:18 -08:00
parent 15a6aa7ade
commit 8ac25aa020
12 changed files with 126 additions and 125 deletions

66
nasm.h
View File

@@ -126,72 +126,6 @@ typedef void (*ldfunc)(char *label, int32_t segment, int64_t offset,
void define_label(char *label, int32_t segment, int64_t offset,
char *special, bool is_norm, bool isextrn);
/*
* List-file generators should look like this:
*/
typedef struct {
/*
* Called to initialize the listing file generator. Before this
* is called, the other routines will silently do nothing when
* called. The `char *' parameter is the file name to write the
* listing to.
*/
void (*init)(const char *fname);
/*
* Called to clear stuff up and close the listing file.
*/
void (*cleanup)(void);
/*
* Called to output binary data. Parameters are: the offset;
* the data; the data type. Data types are similar to the
* output-format interface, only OUT_ADDRESS will _always_ be
* displayed as if it's relocatable, so ensure that any non-
* relocatable address has been converted to OUT_RAWDATA by
* then. Note that OUT_RAWDATA,0 is a valid data type, and is a
* dummy call used to give the listing generator an offset to
* work with when doing things like uplevel(LIST_TIMES) or
* uplevel(LIST_INCBIN).
*/
void (*output)(int32_t offset, const void *data, enum out_type type, uint64_t size);
/*
* Called to send a text line to the listing generator. The
* `int' parameter is LIST_READ or LIST_MACRO depending on
* whether the line came directly from an input file or is the
* result of a multi-line macro expansion.
*/
void (*line)(int type, char *line);
/*
* Called to change one of the various levelled mechanisms in
* the listing generator. LIST_INCLUDE and LIST_MACRO can be
* used to increase the nesting level of include files and
* macro expansions; LIST_TIMES and LIST_INCBIN switch on the
* two binary-output-suppression mechanisms for large-scale
* pseudo-instructions.
*
* LIST_MACRO_NOLIST is synonymous with LIST_MACRO except that
* it indicates the beginning of the expansion of a `nolist'
* macro, so anything under that level won't be expanded unless
* it includes another file.
*/
void (*uplevel)(int type);
/*
* Reverse the effects of uplevel.
*/
void (*downlevel)(int type);
/*
* Called on a warning or error, with the error message.
*/
void (*error)(int severity, const char *pfx, const char *msg);
} ListGen;
extern const ListGen *nasmlist;
/*
* Token types returned by the scanner, in addition to ordinary
* ASCII character values, and zero for end-of-string.