Subversion Repositories SvarDOS

Rev

Rev 421 | Rev 538 | 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
 * type
26
 * type
27
 */
27
 */
28
 
28
 
29
static int cmd_type(struct cmd_funcparam *p) {
29
static enum cmd_result cmd_type(struct cmd_funcparam *p) {
30
  char *buff = p->BUFFER;
30
  char *buff = p->BUFFER;
31
  const char *fname = p->argv[0];
31
  const char *fname = p->argv[0];
32
  unsigned short err = 0;
32
  unsigned short err = 0;
33
 
33
 
34
  if (cmd_ishlp(p)) {
34
  if (cmd_ishlp(p)) {
35
    outputnl("Displays the contents of a text file.");
35
    outputnl("Displays the contents of a text file.");
36
    outputnl("");
36
    outputnl("");
37
    outputnl("TYPE [drive:][path]filename");
37
    outputnl("TYPE [drive:][path]filename");
38
    return(-1);
38
    return(CMD_OK);
39
  }
39
  }
40
 
40
 
41
  if (p->argc == 0) {
41
  if (p->argc == 0) {
42
    outputnl("Required parameter missing");
42
    outputnl("Required parameter missing");
43
    return(-1);
43
    return(CMD_FAIL);
44
  }
44
  }
45
 
45
 
46
  if (p->argc > 1) {
46
  if (p->argc > 1) {
47
    outputnl("Too many parameters");
47
    outputnl("Too many parameters");
48
    return(-1);
48
    return(CMD_FAIL);
49
  }
49
  }
50
 
50
 
51
  /* if here then display the file */
51
  /* if here then display the file */
52
  _asm {
52
  _asm {
53
    push ax
53
    push ax
Line 102... Line 102...
102
    pop cx
102
    pop cx
103
    pop bx
103
    pop bx
104
    pop ax
104
    pop ax
105
  }
105
  }
106
 
106
 
-
 
107
  if (err != 0) {
107
  if (err != 0) outputnl(doserr(err));
108
    outputnl(doserr(err));
-
 
109
    return(CMD_FAIL);
-
 
110
  }
108
 
111
 
109
  return(-1);
112
  return(CMD_OK);
110
}
113
}