Subversion Repositories SvarDOS

Rev

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

Rev 449 Rev 479
Line 45... Line 45...
45
  int argc;                 /* number of arguments */
45
  int argc;                 /* number of arguments */
46
  const char *argv[256];    /* pointers to each argument */
46
  const char *argv[256];    /* pointers to each argument */
47
  unsigned short env_seg;   /* segment of environment block */
47
  unsigned short env_seg;   /* segment of environment block */
48
  struct rmod_props far *rmod; /* rmod settings */
48
  struct rmod_props far *rmod; /* rmod settings */
49
  unsigned short argoffset; /* offset of cmdline where first argument starts */
49
  unsigned short argoffset; /* offset of cmdline where first argument starts */
50
  const char far *cmdline;  /* original cmdline (terminated by a NULL) */
50
  const char *cmdline;      /* original cmdline (terminated by a NULL) */
51
  char BUFFER[BUFFER_SIZE]; /* a buffer for whatever is needed */
51
  char BUFFER[BUFFER_SIZE]; /* a buffer for whatever is needed */
52
};
52
};
53
 
53
 
54
/* scans argv for the presence of a "/?" parameter. returns 1 if found, 0 otherwise */
54
/* scans argv for the presence of a "/?" parameter. returns 1 if found, 0 otherwise */
55
static int cmd_ishlp(const struct cmd_funcparam *p) {
55
static int cmd_ishlp(const struct cmd_funcparam *p) {
Line 129... Line 129...
129
};
129
};
130
 
130
 
131
 
131
 
132
/* NULL if cmdline is not matching an internal command, otherwise returns a
132
/* NULL if cmdline is not matching an internal command, otherwise returns a
133
 * pointer to a CMD_ID struct */
133
 * pointer to a CMD_ID struct */
134
static const struct CMD_ID *cmd_match(const char far *cmdline, unsigned short *argoffset) {
134
static const struct CMD_ID *cmd_match(const char *cmdline, unsigned short *argoffset) {
135
  unsigned short i;
135
  unsigned short i;
136
  char buff[10];
136
  char buff[10];
137
 
137
 
138
  /* copy command to buffer, until space, NULL, tab, return, dot, slash or backslash */
138
  /* copy command to buffer, until space, NULL, tab, return, dot, slash or backslash */
139
  for (i = 0; i < 9; i++) {
139
  for (i = 0; i < 9; i++) {
Line 187... Line 187...
187
  argvlist[argc] = NULL;
187
  argvlist[argc] = NULL;
188
  return(argc);
188
  return(argc);
189
}
189
}
190
 
190
 
191
 
191
 
192
int cmd_process(struct rmod_props far *rmod, unsigned short env_seg, const char far *cmdline, char *BUFFER) {
192
int cmd_process(struct rmod_props far *rmod, unsigned short env_seg, const char *cmdline, char *BUFFER) {
193
  const struct CMD_ID *cmdptr;
193
  const struct CMD_ID *cmdptr;
194
  unsigned short argoffset;
194
  unsigned short argoffset;
195
  struct cmd_funcparam *p = (void *)BUFFER;
195
  struct cmd_funcparam *p = (void *)BUFFER;
196
 
196
 
197
  /* special case: is this a drive change? (like "E:") */
197
  /* special case: is this a drive change? (like "E:") */