11,6 → 11,7 |
#include "doserr.h" |
#include "env.h" |
#include "helpers.h" |
#include "rmodinit.h" |
|
#define BUFFER_SIZE 2048 /* make sure this is not bigger than the static buffer in command.c */ |
|
18,8 → 19,9 |
int argc; /* number of arguments */ |
const char *argv[256]; /* pointers to each argument */ |
unsigned short env_seg; /* segment of environment block */ |
unsigned short rmod_seg; /* segment of the resident module */ |
unsigned short argoffset; /* offset of cmdline where first argument starts */ |
const char far *cmdline; /* original cmdline (terminated by \r) */ |
const char far *cmdline; /* original cmdline (terminated by a NULL) */ |
char BUFFER[BUFFER_SIZE]; /* a buffer for whatever is needed */ |
}; |
|
39,6 → 41,7 |
#include "cmd/del.c" |
#include "cmd/vol.c" /* must be included before dir.c due to dependency */ |
#include "cmd/dir.c" |
#include "cmd/echo.c" |
#include "cmd/exit.c" |
#include "cmd/mkdir.c" |
#include "cmd/path.c" |
70,7 → 73,7 |
{"DATE", cmd_notimpl}, |
{"DEL", cmd_del}, |
{"DIR", cmd_dir}, |
{"ECHO", cmd_notimpl}, |
{"ECHO", cmd_echo}, |
{"ERASE", cmd_del}, |
{"EXIT", cmd_exit}, |
{"LH", cmd_notimpl}, |
155,7 → 158,7 |
} |
|
|
int cmd_process(unsigned short env_seg, const char far *cmdline, char *BUFFER) { |
int cmd_process(unsigned short rmod_seg, unsigned short env_seg, const char far *cmdline, char *BUFFER) { |
const struct CMD_ID *cmdptr; |
unsigned short argoffset; |
struct cmd_funcparam *p = (void *)BUFFER; |
196,6 → 199,7 |
/* prepare function parameters and feed it to the cmd handling function */ |
p->argc = cmd_explode(BUFFER + sizeof(*p), cmdline + argoffset, p->argv); |
p->env_seg = env_seg; |
p->rmod_seg = rmod_seg; |
p->argoffset = argoffset; |
p->cmdline = cmdline; |
|