SCP: Add global variable with the program name

Included from Dave Bryan's V3.11 extensions
This commit is contained in:
Mark Pizzolato 2019-12-28 11:00:59 -08:00
parent 7642d29f2c
commit e611e0ceed
2 changed files with 4 additions and 1 deletions

2
scp.c
View file

@ -563,6 +563,7 @@ static t_stat _sim_debug_flush (void);
/* Global data */
const char *sim_prog_name = NULL; /* pointer to the executable name */
DEVICE *sim_dflt_dev = NULL;
UNIT *sim_clock_queue = QUEUE_LIST_END;
int32 sim_interval = 0;
@ -2546,6 +2547,7 @@ set_prompt (0, "sim>"); /* start with set standa
sim_switches = 0; /* init switches */
lookswitch = TRUE;
stdnul = fopen(NULL_DEVICE,"wb");
sim_prog_name = argv [0]; /* save a pointer to the program name */
for (i = 1; i < argc; i++) { /* loop thru args */
if (argv[i] == NULL) /* paranoia */
continue;

3
scp.h
View file

@ -388,7 +388,8 @@ extern uint32 sim_brk_dflt;
extern uint32 sim_brk_summ;
extern uint32 sim_brk_match_type;
extern t_addr sim_brk_match_addr;
extern BRKTYPTAB *sim_brk_type_desc; /* type descriptions */
extern BRKTYPTAB *sim_brk_type_desc; /* type descriptions */
extern const char *sim_prog_name; /* executable program name */
extern FILE *stdnul;
extern t_bool sim_asynch_enabled;
#if defined(SIM_ASYNCH_IO)