Subversion Repositories SvarDOS

Rev

Rev 357 | Rev 364 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
352 mateuszvis 1
/* entry point for internal commands
2
 * matches internal commands and executes them
353 mateuszvis 3
 * returns -1 or exit code if processed
4
 * returns -2 if command unrecognized */
352 mateuszvis 5
 
6
#include <i86.h>
7
#include <stdio.h>
8
 
363 mateuszvis 9
#include "doserr.h"
352 mateuszvis 10
#include "helpers.h"
11
 
363 mateuszvis 12
#include "cmd/cd.c"
352 mateuszvis 13
#include "cmd/set.c"
14
 
15
#include "cmd.h"
16
 
357 mateuszvis 17
int cmd_process(int argc, const char **argv, unsigned short env_seg, const char far *cmdline) {
352 mateuszvis 18
 
363 mateuszvis 19
  if ((imatch(argv[0], "cd")) || (imatch(argv[0], "chdir"))) return(cmd_cd(argc, argv));
357 mateuszvis 20
  if (imatch(argv[0], "set")) return(cmd_set(argc, argv, env_seg, cmdline));
352 mateuszvis 21
 
353 mateuszvis 22
  return(-2); /* command is not recognized as internal */
352 mateuszvis 23
}