/svarcom/trunk/cmd/echo.c |
---|
43,7 → 43,7 |
/* ECHO without any parameter: display current state */ |
if (p->argc == 0) { |
if (p->rmod->echoflag) { |
if (p->rmod->flags & FLAG_ECHOFLAG) { |
outputnl("ECHO is on"); |
} else { |
outputnl("ECHO is off"); |
53,13 → 53,13 |
/* ECHO ON */ |
if ((p->argc == 1) && (imatch(p->argv[0], "on"))) { |
p->rmod->echoflag = 1; |
p->rmod->flags |= FLAG_ECHOFLAG; |
return(-1); |
} |
/* ECHO OFF */ |
if ((p->argc == 1) && (imatch(p->argv[0], "off"))) { |
p->rmod->echoflag = 0; |
p->rmod->flags &= ~FLAG_ECHOFLAG; |
return(-1); |
} |
/svarcom/trunk/cmd/ver.c |
---|
52,7 → 52,6 |
printf("rmod->origparent = %04X:%04X\r\n", p->rmod->origparent >> 16, p->rmod->origparent & 0xffff); |
printf("rmod->origenvseg = 0x%04X\r\n", p->rmod->origenvseg); |
printf("rmod->flags = 0x%02X\r\n", p->rmod->flags); |
printf("rmod->echoflag = %u\r\n", p->rmod->echoflag); |
printf("[rmod:RMOD_OFFSET_ENVSEG] = 0x%04X\r\n", *rmod_envseg); |
printf("environment allocated size: %u bytes\r\n", env_allocsz(*rmod_envseg)); |
for (fptr = MK_FP(p->rmod->rmodseg, RMOD_OFFSET_BOOTDRIVE), i = 0; *fptr != 0; fptr++) buff[i++] = *fptr; |
/svarcom/trunk/command.c |
---|
421,7 → 421,7 |
rmod->batnextline = 0; |
/* remember the echo flag (in case bat file disables echo) */ |
rmod->flags &= ~FLAG_ECHO_BEFORE_BAT; |
if (rmod->echoflag) rmod->flags |= FLAG_ECHO_BEFORE_BAT; |
if (rmod->flags & FLAG_ECHOFLAG) rmod->flags |= FLAG_ECHO_BEFORE_BAT; |
return; |
} |
625,8 → 625,8 |
} |
/* look at command line parameters */ |
parse_argv(&cfg); |
/* copy flags to rmod's storage */ |
rmod->flags = cfg.flags; |
/* copy flags to rmod's storage (and enable ECHO) */ |
rmod->flags = cfg.flags | FLAG_ECHOFLAG; |
/* printf("rmod installed at %Fp\r\n", rmod); */ |
} else { |
/* printf("rmod found at %Fp\r\n", rmod); */ |
653,7 → 653,7 |
do { |
char far *cmdline; |
if (rmod->echoflag != 0) outputnl(""); /* terminate the previous command with a CR/LF */ |
if (rmod->flags & FLAG_ECHOFLAG) outputnl(""); /* terminate the previous command with a CR/LF */ |
SKIP_NEWLINE: |
678,13 → 678,13 |
if (getbatcmd(tmpbuff, rmod) != 0) { /* end of batch */ |
redir_revert(); /* cancel redirections (if there were any) */ |
/* restore echo flag as it was before running the bat file */ |
rmod->echoflag = 0; |
if (rmod->flags & FLAG_ECHO_BEFORE_BAT) rmod->echoflag = 1; |
rmod->flags &= ~FLAG_ECHOFLAG; |
if (rmod->flags & FLAG_ECHO_BEFORE_BAT) rmod->flags |= FLAG_ECHOFLAG; |
continue; |
} |
/* output prompt and command on screen if echo on and command is not |
* inhibiting it with the @ prefix */ |
if ((rmod->echoflag != 0) && (tmpbuff[1] != '@')) { |
if ((rmod->flags & FLAG_ECHOFLAG) && (tmpbuff[1] != '@')) { |
build_and_display_prompt(BUFFER, *rmod_envseg); |
outputnl(tmpbuff + 1); |
} |
697,7 → 697,7 |
} else { |
/* interactive mode: display prompt (if echo enabled) and wait for user |
* command line */ |
if (rmod->echoflag != 0) build_and_display_prompt(BUFFER, *rmod_envseg); |
if (rmod->flags & FLAG_ECHOFLAG) build_and_display_prompt(BUFFER, *rmod_envseg); |
/* revert input history terminator to \r so DOS or DOSKEY are not confused */ |
cmdline[(unsigned short)(cmdline[-1])] = '\r'; |
/* collect user input */ |
/svarcom/trunk/rmodinit.c |
---|
140,7 → 140,6 |
_fmemset(res, 0, sizeof(*res)); /* zero out */ |
res->rmodseg = rmodseg; /* rmod segment */ |
res->inputbuf[0] = 128; /* input buffer for INT 0x21, AH=0Ah*/ |
res->echoflag = 1; /* ECHO ON */ |
res->origenvseg = origenvseg; /* original environment segment */ |
/* write env segment to rmod's PSP */ |
/svarcom/trunk/rmodinit.h |
---|
27,6 → 27,7 |
#define FLAG_EXEC_AND_QUIT 1 |
#define FLAG_PERMANENT 2 |
#define FLAG_ECHOFLAG 4 |
#define FLAG_ECHO_BEFORE_BAT 8 |
struct rmod_props { |
35,7 → 36,7 |
unsigned long origparent; /* original parent (far ptr) of the shell */ |
unsigned short origenvseg; /* original environment segment */ |
unsigned char flags; /* command line parameters */ |
unsigned char echoflag; /* ECHO ON / ECHO OFF */ |
unsigned char FFU; /* FOR FUTURE USE */ |
char batfile[130]; /* truename of batch file being processed */ |
char batargs[130]; /* arguments of the processed batch files */ |
unsigned long batnextline; /* offset in file of next bat line to process */ |
/svarcom/trunk/todo.txt |
---|
10,7 → 10,6 |
pipes redirections |
autoexec.bat processing (with F5 skipping) |
make cmdline a near pointer for better performance (maybe a separate buffer) |
put the rmod->echoflag inside rmod->flags |
=== AT SOME LATER TIME ======================================================= |