Subversion Repositories SvarDOS

Rev

Rev 533 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 533 Rev 989
Line 1... Line 1...
1
/* This file is part of the SvarCOM project and is published under the terms
1
/* This file is part of the SvarCOM project and is published under the terms
2
 * of the MIT license.
2
 * of the MIT license.
3
 *
3
 *
4
 * Copyright (C) 2021 Mateusz Viste
4
 * Copyright (C) 2021-2022 Mateusz Viste
5
 *
5
 *
6
 * Permission is hereby granted, free of charge, to any person obtaining a
6
 * Permission is hereby granted, free of charge, to any person obtaining a
7
 * copy of this software and associated documentation files (the "Software"),
7
 * copy of this software and associated documentation files (the "Software"),
8
 * to deal in the Software without restriction, including without limitation
8
 * to deal in the Software without restriction, including without limitation
9
 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9
 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
Line 28... Line 28...
28
 
28
 
29
static enum cmd_result 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
    nls_outputnl(14,0); /* "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
    nls_outputnl(14,1); /* "Type BREAK without a parameter to display the current BREAK setting." */
38
    return(CMD_OK);
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) {
Line 50... Line 50...
50
 
50
 
51
      pop dx
51
      pop dx
52
      pop ax
52
      pop ax
53
    }
53
    }
54
    if (brkflag == 0) {
54
    if (brkflag == 0) {
55
      outputnl("BREAK is off");
55
      nls_outputnl(14,2); /* "BREAK is off" */
56
    } else {
56
    } else {
57
      outputnl("BREAK is on");
57
      nls_outputnl(14,3); /* "BREAK is on" */
58
    }
58
    }
59
    return(CMD_OK);
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
    nls_outputnl(0,4);
65
    return(CMD_FAIL);
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
    nls_outputnl(0,6); /* "Invalid parameter" */
73
    return(CMD_FAIL);
73
    return(CMD_FAIL);
74
  }
74
  }
75
 
75
 
76
  /* set break accordingly to brkflag */
76
  /* set break accordingly to brkflag */
77
  _asm {
77
  _asm {