listing: move LIST_* enums to listing.h

The LIST_* enums belongs in listing.h, move them there and actually
use them in listing.c.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
This commit is contained in:
H. Peter Anvin (Intel) 2026-03-04 14:14:02 -08:00
parent 89e1d6203a
commit b1909cf39b
3 changed files with 18 additions and 18 deletions

View file

@ -260,7 +260,7 @@ static void list_output(const struct out_data *data)
}
}
static void list_line(int type, int32_t lineno, const char *line)
static void list_line(enum list_type type, int32_t lineno, const char *line)
{
(void)type;
@ -279,7 +279,7 @@ static void list_line(int type, int32_t lineno, const char *line)
listlevel_e = listlevel;
}
static void list_uplevel(int type, int64_t size)
static void list_uplevel(enum list_type type, int64_t size)
{
if (!listfp)
return;
@ -305,7 +305,7 @@ static void list_uplevel(int type, int64_t size)
}
}
static void list_downlevel(int type)
static void list_downlevel(enum list_type type)
{
if (!listfp)
return;

View file

@ -13,6 +13,18 @@
/* List options implied by -L+ */
#define LIST_PLUS_OPTIONS "bdefFmps"
/* Listing type values flags */
enum list_type {
/* Flags for lfmt->line() */
LIST_READ,
LIST_MACRO,
LIST_INFO,
/* Flags for lfmt->uplevel() */
LIST_INCLUDE,
LIST_INCBIN,
LIST_TIMES
};
/*
* List-file generators should look like this:
*/
@ -49,7 +61,7 @@ struct lfmt {
* If a line number is provided, print it; if the line number is
* -1 then use the same line number as the previous call.
*/
void (*line)(int type, int32_t lineno, const char *line);
void (*line)(enum list_type type, int32_t lineno, const char *line);
/*
* Called to change one of the various levelled mechanisms in the
@ -65,12 +77,12 @@ struct lfmt {
* macro, so anything under that level won't be expanded unless
* it includes another file.
*/
void (*uplevel)(int type, int64_t size);
void (*uplevel)(enum list_type type, int64_t size);
/*
* Reverse the effects of uplevel.
*/
void (*downlevel)(int type);
void (*downlevel)(enum list_type type);
/*
* Called on a warning or error, with the error message.

View file

@ -520,18 +520,6 @@ static inline char *nasm_skip_identifier(const char *str)
return (char *)p;
}
/*
* Data-type flags that get passed to listing-file routines.
*/
enum {
LIST_READ,
LIST_MACRO,
LIST_INFO,
LIST_INCLUDE,
LIST_INCBIN,
LIST_TIMES
};
/*
* -----------------------------------------------------------
* Format of the `insn' structure returned from `parser.c' and