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

1
scp.h
View file

@ -389,6 +389,7 @@ extern uint32 sim_brk_summ;
extern uint32 sim_brk_match_type; extern uint32 sim_brk_match_type;
extern t_addr sim_brk_match_addr; 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 FILE *stdnul;
extern t_bool sim_asynch_enabled; extern t_bool sim_asynch_enabled;
#if defined(SIM_ASYNCH_IO) #if defined(SIM_ASYNCH_IO)