mirror of
https://github.com/open-simh/simtools.git
synced 2026-01-13 15:27:18 +00:00
several compilers: - gcc version 4.5.3 (NetBSD nb2 20110806) - gcc version 4.9.2 (Ubuntu 4.9.2-10ubuntu13) - Ubuntu clang version 3.6.0-2ubuntu1 (tags/RELEASE_360/final) (based on LLVM 3.6.0) The warnings were mostly about local variables shadowing others, unused function parameters, and C++ style comments. Some variables were indeed used before set. Note that on Linux, using -std=c99 does stupid things like *remove* the declaration of strdup() from <string.h>. Therefore I've reluctantly used -std=gnu99.
70 lines
1.5 KiB
C
70 lines
1.5 KiB
C
|
|
#ifndef LISTING__H
|
|
#define LISTING__H
|
|
|
|
#include "stream2.h"
|
|
|
|
/*
|
|
format of a listing line
|
|
Interestingly, no instances of this struct are ever created.
|
|
It lives to be a way to layout the format of a list line.
|
|
I wonder if I should have bothered.
|
|
*/
|
|
|
|
typedef struct lstformat {
|
|
char flag[2]; /* Error flags */
|
|
char line_number[6]; /* Line number */
|
|
char pc[8]; /* Location */
|
|
char words[8][3]; /* three instruction words */
|
|
char source[1]; /* source line */
|
|
} LSTFORMAT;
|
|
|
|
|
|
/* GLOBAL VARIABLES */
|
|
#ifndef LISTING__C
|
|
extern int list_md; /* option to list macro/rept definition = yes */
|
|
|
|
extern int list_me; /* option to list macro/rept expansion = yes */
|
|
|
|
extern int list_bex; /* option to show binary */
|
|
|
|
extern int list_level; /* Listing control level. .LIST
|
|
increments; .NLIST decrements */
|
|
|
|
extern FILE *lstfile;
|
|
|
|
extern int list_pass_0; /* Also list what happens during the first pass */
|
|
|
|
#endif
|
|
|
|
|
|
void list_word(
|
|
STREAM *str,
|
|
unsigned addr,
|
|
unsigned value,
|
|
int size,
|
|
char *flags);
|
|
|
|
void list_value(
|
|
STREAM *str,
|
|
unsigned word);
|
|
|
|
void list_location(
|
|
STREAM *str,
|
|
unsigned word);
|
|
|
|
void list_source(
|
|
STREAM *str,
|
|
char *cp);
|
|
|
|
void list_flush(
|
|
void);
|
|
|
|
void report(
|
|
STREAM *str,
|
|
char *fmt,
|
|
...);
|
|
|
|
|
|
#endif
|