    /*********************************************************************\
    *  Copyright (c) 1992 by Wen-King Su (wen-king@vlsi.cs.caltech.edu)   *
    *                                                                     *
    *  You may copy or modify this file in any manner you wish, provided  *
    *  that this notice is always included, and that you hold the author  *
    *  harmless for any loss or damage resulting from the installation or *
    *  use of this software.                                              *
    \*********************************************************************/

#include "tweak.h"
#include <stdio.h>

int main PROTO3(int, argc, char **, argv, char **, envp)
{
  char *p, *q;

 int i;
  
#ifdef VMS
  q=argv[1]; /* fsp command */
  argv++; argc--; /* strip first argument (=FMERGE) */
#else
  for(p = q = argv[0]; *p; p++) if(*p == '/') q = p+1;
#endif
  
  if(!strcmp(q,"fcatcmd")) fcatcmd_main(argc,argv,envp);
  else if(!strcmp(q,"fcdcmd")) fcdcmd_main(argc,argv,envp);
  else if(!strcmp(q,"fgetcmd")) fgetcmd_main(argc,argv,envp);
  else if(!strcmp(q,"fgrabcmd")) fgrabcmd_main(argc,argv,envp);
  else if(!strcmp(q,"flscmd")) flscmd_main(argc,argv,envp);
  else if(!strcmp(q,"fmkdir")) fmkdir_main(argc,argv,envp);
  else if(!strcmp(q,"fprocmd")) fprocmd_main(argc,argv,envp);
  else if(!strcmp(q,"fput")) fput_main(argc,argv,envp);
  else if(!strcmp(q,"frmcmd")) frmcmd_main(argc,argv,envp);
  else if(!strcmp(q,"frmdircmd")) frmdircmd_main(argc,argv,envp);
  else if(!strcmp(q,"fver")) fver_main(argc,argv,envp);
  else if(!strcmp(q,"fducmd")) fducmd_main(argc,argv,envp);
  else if(!strcmp(q,"fhostcmd")) fhostcmd_main(argc,argv,envp);
  else if(!strcmp(q,"ffindcmd")) ffindcmd_main(argc,argv,envp);
  else {
    fprintf(stderr,"Unknown FSP client command: %s\n",q);
    exit(1);
  }
  exit(0);
}
