Subversion Repositories SvarDOS

Rev

Rev 449 | Rev 475 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 449 Rev 450
Line 27... Line 27...
27
 */
27
 */
28
 
28
 
29
static int cmd_echo(struct cmd_funcparam *p) {
29
static int cmd_echo(struct cmd_funcparam *p) {
30
  unsigned short offs = FP_OFF(p->cmdline) + 5;
30
  unsigned short offs = FP_OFF(p->cmdline) + 5;
31
  unsigned short segm = FP_SEG(p->cmdline);
31
  unsigned short segm = FP_SEG(p->cmdline);
32
  unsigned char far *echostatus = MK_FP(p->rmod->rmodseg, RMOD_OFFSET_ECHOFLAG);
-
 
33
 
32
 
34
  /* display help only if /? is the only argument */
33
  /* display help only if /? is the only argument */
35
  if ((p->argc == 1) && (imatch(p->argv[0], "/?"))) {
34
  if ((p->argc == 1) && (imatch(p->argv[0], "/?"))) {
36
    outputnl("Displays messages, or turns command-echoing on or off");
35
    outputnl("Displays messages, or turns command-echoing on or off");
37
    outputnl("");
36
    outputnl("");
Line 42... Line 41...
42
    return(-1);
41
    return(-1);
43
  }
42
  }
44
 
43
 
45
  /* ECHO without any parameter: display current state */
44
  /* ECHO without any parameter: display current state */
46
  if (p->argc == 0) {
45
  if (p->argc == 0) {
47
    if (*echostatus) {
46
    if (p->rmod->echoflag) {
48
      outputnl("ECHO is on");
47
      outputnl("ECHO is on");
49
    } else {
48
    } else {
50
      outputnl("ECHO is off");
49
      outputnl("ECHO is off");
51
    }
50
    }
52
    return(-1);
51
    return(-1);
53
  }
52
  }
54
 
53
 
55
  /* ECHO ON */
54
  /* ECHO ON */
56
  if ((p->argc == 1) && (imatch(p->argv[0], "on"))) {
55
  if ((p->argc == 1) && (imatch(p->argv[0], "on"))) {
57
    *echostatus = 1;
56
    p->rmod->echoflag = 1;
58
    return(-1);
57
    return(-1);
59
  }
58
  }
60
 
59
 
61
  /* ECHO OFF */
60
  /* ECHO OFF */
62
  if ((p->argc == 1) && (imatch(p->argv[0], "off"))) {
61
  if ((p->argc == 1) && (imatch(p->argv[0], "off"))) {
63
    *echostatus = 0;
62
    p->rmod->echoflag = 0;
64
    return(-1);
63
    return(-1);
65
  }
64
  }
66
 
65
 
67
  /* ECHO MSG (start at cmdline+5 since first 5 are "ECHO" + separator) */
66
  /* ECHO MSG (start at cmdline+5 since first 5 are "ECHO" + separator) */
68
  _asm {
67
  _asm {