Subversion Repositories SvarDOS

Rev

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

Rev 421 Rev 533
Line 24... Line 24...
24
 
24
 
25
/*
25
/*
26
 * break
26
 * break
27
 */
27
 */
28
 
28
 
29
static int cmd_break(struct cmd_funcparam *p) {
29
static enum cmd_result cmd_break(struct cmd_funcparam *p) {
30
  unsigned char brkflag = 0;
30
  unsigned char brkflag = 0;
31
 
31
 
32
  if (cmd_ishlp(p)) {
32
  if (cmd_ishlp(p)) {
33
    outputnl("Sets or clears extended CTRL+C checking");
33
    outputnl("Sets or clears extended CTRL+C checking");
34
    outputnl("");
34
    outputnl("");
35
    outputnl("BREAK [ON | OFF]");
35
    outputnl("BREAK [ON | OFF]");
36
    outputnl("");
36
    outputnl("");
37
    outputnl("Type BREAK without a parameter to display the current BREAK setting.");
37
    outputnl("Type BREAK without a parameter to display the current BREAK setting.");
38
    return(-1);
38
    return(CMD_OK);
39
  }
39
  }
40
 
40
 
41
  /* no params: display current break state */
41
  /* no params: display current break state */
42
  if (p->argc == 0) {
42
  if (p->argc == 0) {
43
    _asm {
43
    _asm {
Line 54... Line 54...
54
    if (brkflag == 0) {
54
    if (brkflag == 0) {
55
      outputnl("BREAK is off");
55
      outputnl("BREAK is off");
56
    } else {
56
    } else {
57
      outputnl("BREAK is on");
57
      outputnl("BREAK is on");
58
    }
58
    }
59
    return(-1);
59
    return(CMD_OK);
60
  }
60
  }
61
 
61
 
62
  /* too many params? */
62
  /* too many params? */
63
  if (p->argc > 1) {
63
  if (p->argc > 1) {
64
    outputnl("Too many parameters");
64
    outputnl("Too many parameters");
65
    return(-1);
65
    return(CMD_FAIL);
66
  }
66
  }
67
 
67
 
68
  /* exactly 1 parameter - "on" or "off" */
68
  /* exactly 1 parameter - "on" or "off" */
69
  if (imatch(p->argv[0], "on")) {
69
  if (imatch(p->argv[0], "on")) {
70
    brkflag = 1;
70
    brkflag = 1;
71
  } else if (!imatch(p->argv[0], "off")) {
71
  } else if (!imatch(p->argv[0], "off")) {
72
    outputnl("Invalid parameter");
72
    outputnl("Invalid parameter");
73
    return(-1);
73
    return(CMD_FAIL);
74
  }
74
  }
75
 
75
 
76
  /* set break accordingly to brkflag */
76
  /* set break accordingly to brkflag */
77
  _asm {
77
  _asm {
78
    push ax
78
    push ax
Line 84... Line 84...
84
 
84
 
85
    pop dx
85
    pop dx
86
    pop ax
86
    pop ax
87
  }
87
  }
88
 
88
 
89
  return(-1);
89
  return(CMD_OK);
90
}
90
}