Fixed declaration error in ibm1130 simulator and properly exported the newly renamed routine sim_sub_args.

This commit is contained in:
Mark Pizzolato 2013-04-19 12:55:19 -07:00
parent 5a56c19696
commit 38a0448e01
3 changed files with 9 additions and 8 deletions

View file

@ -723,7 +723,6 @@ static CPCODE cardcode_026C[] = /* 026 commercial */
};
extern int cgi;
extern void sub_args (char *instr, char *tmpbuf, int32 maxstr, int32 nargs, char *arg[]);
static int16 ascii_to_card[256];
@ -735,7 +734,7 @@ static int any_punched = 0;
#define MAXARGLEN 80 /* max length of a saved attach command argument */
#define MAXARGS 10 /* max number of arguments to save */
static char list_save[MAXARGS][MAXARGLEN], *list_arg[MAXARGLEN];
static char list_save[MAXARGS][MAXARGLEN], *list_arg[MAXARGLEN+1];
static int list_nargs = 0;
static char* (*tab_proc)(char* str, int width) = NULL; /* tab reformatting routine */
static int tab_width = 8;
@ -1276,7 +1275,7 @@ static void checkdeck (void)
static t_bool nextdeck (void)
{
char buf[200], tmpbuf[200], *fname, *c, quote;
char buf[200], *fname, *c, quote;
int code;
long fpos;
@ -1390,7 +1389,7 @@ static t_bool nextdeck (void)
break;
}
sub_args(buf, tmpbuf, sizeof(buf), list_nargs, list_arg); /* substitute in stuff from the attach command line */
sim_sub_args(buf, sizeof(buf), list_arg); /* substitute in stuff from the attach command line */
c = buf; /* pick filename from string */
@ -1602,6 +1601,8 @@ static t_stat cr_attach (UNIT *uptr, char *cptr)
list_arg[list_nargs] = list_save[list_nargs]; /* set pointer to permanent storage location */
strncpy(list_arg[list_nargs], arg, MAXARGLEN); /* store copy */
}
list_arg[list_nargs] = NULL; /* NULL terminate the end of the argument list */
if (list_nargs <= 0) /* need at least 1 */
return SCPE_2FARG;

7
scp.c
View file

@ -432,7 +432,6 @@ t_stat dep_addr (int32 flag, char *cptr, t_addr addr, DEVICE *dptr,
UNIT *uptr, int32 dfltinc);
void fprint_fields (FILE *stream, t_value before, t_value after, BITFIELD* bitdefs);
t_stat step_svc (UNIT *ptr);
void sub_args (char *instr, size_t instr_size, char *do_arg[]);
t_stat shift_args (char *do_arg[], size_t arg_count);
t_stat set_on (int32 flag, char *cptr);
t_stat set_verify (int32 flag, char *cptr);
@ -927,7 +926,7 @@ while (stat != SCPE_EXIT) { /* in case exit */
}
if (*cptr == 0) /* ignore blank */
continue;
sub_args (cbuf, sizeof(cbuf), argv);
sim_sub_args (cbuf, sizeof(cbuf), argv);
if (sim_log) /* log cmd */
fprintf (sim_log, "%s%s\n", sim_prompt, cptr);
cptr = get_glyph (cptr, gbuf, 0); /* get command glyph */
@ -1574,7 +1573,7 @@ do {
ocptr = cptr = read_line (cbuf, sizeof(cbuf), fpin);/* get cmd line */
sim_goto_line[sim_do_depth] += 1;
}
sub_args (cbuf, sizeof(cbuf), do_arg); /* substitute args */
sim_sub_args (cbuf, sizeof(cbuf), do_arg); /* substitute args */
if (cptr == NULL) { /* EOF? */
stat = SCPE_OK; /* set good return */
break;
@ -1732,7 +1731,7 @@ return stat | SCPE_NOMESSAGE; /* suppress message sinc
untouched.
*/
void sub_args (char *instr, size_t instr_size, char *do_arg[])
void sim_sub_args (char *instr, size_t instr_size, char *do_arg[])
{
char gbuf[CBUFSIZE];
char *ip = instr, *op, *ap, *oend, *istart, *tmpbuf;

1
scp.h
View file

@ -124,6 +124,7 @@ DEVICE *find_dev (char *ptr);
DEVICE *find_unit (char *ptr, UNIT **uptr);
DEVICE *find_dev_from_unit (UNIT *uptr);
t_stat sim_register_internal_device (DEVICE *dptr);
void sim_sub_args (char *in_str, size_t in_str_size, char *do_arg[]);
REG *find_reg (char *ptr, char **optr, DEVICE *dptr);
CTAB *find_ctab (CTAB *tab, char *gbuf);
C1TAB *find_c1tab (C1TAB *tab, char *gbuf);