Annotation of 43BSDTahoe/new/xns/examples/filing_client/cmdtab.c, revision 1.1

1.1     ! root        1: /* $Header: cmdtab.c,v 2.4 87/03/23 12:31:00 ed Exp $ */
        !             2: /* $Log:       cmdtab.c,v $
        !             3:  * Revision 2.4  87/03/23  12:31:00  ed
        !             4:  * Added archive, restore and unify commands.
        !             5:  * 
        !             6:  * Revision 2.3  87/01/09  16:52:28  ed
        !             7:  * Use FilingSubset, if rejected attempt Filing
        !             8:  * Allows user override with -F switch
        !             9:  * Maintain FilingSubset mandatory attributes
        !            10:  * User niceties:  echo file name/type on transfer commands
        !            11:  *             prompt on delete
        !            12:  * guess type which will determine file type implied by content
        !            13:  * New commands: (type related) Guess, Whatis
        !            14:  *           (file transfer) Copy, Move, Rename
        !            15:  * 
        !            16:  * Revision 2.2  86/12/11  06:12:07  jqj
        !            17:  * Eliminated form, mode, and struct commands.  Started adding support for
        !            18:  * more file types.
        !            19:  * 
        !            20:  * Revision 2.1  86/06/02  07:10:04  jqj
        !            21:  * bugfix in NCMDS
        !            22:  * 
        !            23:  * Revision 2.0  85/11/21  07:22:43  jqj
        !            24:  * 4.3BSD standard release
        !            25:  * 
        !            26:  * Revision 1.1  85/11/20  14:18:58  jqj
        !            27:  * Initial revision
        !            28:  * 
        !            29:  */
        !            30: #ifndef lint
        !            31: static char sccsid[] = "@(#)cmdtab.c   4.7 (Berkeley) 7/26/83";
        !            32: #endif
        !            33: 
        !            34: #include "ftp_var.h"
        !            35: 
        !            36: /*
        !            37:  * User FTP -- Command Tables.
        !            38:  */
        !            39: int    setascii(), setbell(), setbinary(), setdebug();
        !            40: int    setglob(), sethash(), setpeer();
        !            41: int    setprompt();
        !            42: int    settrace(), settype(), setverbose();
        !            43: int    disconnect();
        !            44: int    cd(), lcd(), delete(), mdelete(), user();
        !            45: int    ls(), mls(), get(), mget(), help(), append(), put(), mput();
        !            46: int    quit(), renamefile(), status();
        !            47: int    shell();
        !            48: int    pwd(), makedir(), removedir();
        !            49: int    setguess(), whatis();
        !            50: int    copyfile(), movefile();
        !            51: int    archive(), restore(), unify();
        !            52: 
        !            53: char   appendhelp[] =  "append to a file";
        !            54: char   archhelp[] =    "serialize a remote file/descendants to a local file";
        !            55: char   asciihelp[] =   "set ascii (tText) transfer type";
        !            56: char   beephelp[] =    "beep when command completed";
        !            57: char   binaryhelp[] =  "set binary (tUnspecified) transfer type";
        !            58: char   cdhelp[] =      "change remote working directory";
        !            59: char   connecthelp[] = "connect to remote file service";
        !            60: char   copyhelp[] =    "make a copy of a remote file";
        !            61: char   deletehelp[] =  "delete remote file";
        !            62: char   debughelp[] =   "toggle/set debugging mode";
        !            63: char   dirhelp[] =     "list contents of remote directory";
        !            64: char   disconhelp[] =  "terminate ftp session";
        !            65: char   globhelp[] =    "toggle metacharacter expansion of local file names";
        !            66: char   guesshelp[] =   "set file type to that of input file";
        !            67: char   hashhelp[] =    "toggle printing `#' for each buffer transferred";
        !            68: char   helphelp[] =    "print local help information";
        !            69: char   lcdhelp[] =     "change local working directory";
        !            70: char   lshelp[] =      "nlist contents of remote directory";
        !            71: char   mdeletehelp[] = "delete multiple files";
        !            72: char   mdirhelp[] =    "list contents of multiple remote directories";
        !            73: char   mgethelp[] =    "get multiple files";
        !            74: char   mkdirhelp[] =   "make directory on the remote machine";
        !            75: char   mlshelp[] =     "nlist contents of multiple remote directories";
        !            76: char   movehelp[] =    "move a remote file to another directory";
        !            77: char   mputhelp[] =    "send multiple files";
        !            78: char   prompthelp[] =  "force interactive prompting on multiple commands";
        !            79: char   pwdhelp[] =     "print working directory on remote machine";
        !            80: char   quithelp[] =    "terminate ftp session and exit";
        !            81: char   quotehelp[] =   "send arbitrary ftp command";
        !            82: char   receivehelp[] = "receive file";
        !            83: char   remotehelp[] =  "get help from remote server";
        !            84: char   renamehelp[] =  "rename a remote file in the same directory";
        !            85: char   restorhelp[] =  "deserialize a local file to a remote file/descendants";
        !            86: char   rmdirhelp[] =   "remove directory on the remote machine";
        !            87: char   sendhelp[] =    "send one file";
        !            88: char   shellhelp[] =   "escape to the shell";
        !            89: char   statushelp[] =  "show current status";
        !            90: char   tracehelp[] =   "toggle packet tracing";
        !            91: char   typehelp[] =    "set file transfer type";
        !            92: char   unifyhelp[] =   "unify access lists for a remote directory";
        !            93: char   userhelp[] =    "send new user information";
        !            94: char   verbosehelp[] = "toggle verbose mode";
        !            95: char   whatishelp[] =  "show assumed type of local file";
        !            96: 
        !            97: struct cmd cmdtab[] = {
        !            98:        { "!",          shellhelp,      0,      0,      shell },
        !            99:        { "append",     appendhelp,     1,      1,      put },
        !           100:        { "archive",    archhelp,       1,      1,      archive },
        !           101:        { "ascii",      asciihelp,      0,      1,      setascii },
        !           102:        { "bell",       beephelp,       0,      0,      setbell },
        !           103:        { "binary",     binaryhelp,     0,      1,      setbinary },
        !           104:        { "bye",        quithelp,       0,      0,      quit },
        !           105:        { "cd",         cdhelp,         0,      1,      cd },
        !           106:        { "close",      disconhelp,     0,      1,      disconnect },
        !           107:        { "copy",       copyhelp,       0,      1,      copyfile },
        !           108:        { "delete",     deletehelp,     0,      1,      delete },
        !           109:        { "debug",      debughelp,      0,      0,      setdebug },
        !           110:        { "dir",        dirhelp,        1,      1,      ls },
        !           111:        { "get",        receivehelp,    1,      1,      get },
        !           112:        { "glob",       globhelp,       0,      0,      setglob },
        !           113:        { "guess",      guesshelp,      0,      1,      setguess },
        !           114:        { "hash",       hashhelp,       0,      0,      sethash },
        !           115:        { "help",       helphelp,       0,      0,      help },
        !           116:        { "lcd",        lcdhelp,        0,      0,      lcd },
        !           117:        { "ls",         lshelp,         1,      1,      ls },
        !           118:        { "mdelete",    mdeletehelp,    1,      1,      mdelete },
        !           119:        { "mdir",       mdirhelp,       1,      1,      mls },
        !           120:        { "mget",       mgethelp,       1,      1,      mget },
        !           121:        { "mkdir",      mkdirhelp,      0,      1,      makedir },
        !           122:        { "mls",        mlshelp,        1,      1,      mls },
        !           123:        { "move",       movehelp,       0,      1,      movefile },
        !           124:        { "mput",       mputhelp,       1,      1,      mput },
        !           125:        { "open",       connecthelp,    0,      0,      setpeer },
        !           126:        { "prompt",     prompthelp,     0,      0,      setprompt },
        !           127:        { "put",        sendhelp,       1,      1,      put },
        !           128:        { "pwd",        pwdhelp,        0,      1,      pwd },
        !           129:        { "quit",       quithelp,       0,      0,      quit },
        !           130:        { "recv",       receivehelp,    1,      1,      get },
        !           131:        { "rename",     renamehelp,     0,      1,      renamefile },
        !           132:        { "restore",    restorhelp,     1,      1,      restore },
        !           133:        { "rmdir",      rmdirhelp,      0,      1,      removedir },
        !           134:        { "send",       sendhelp,       1,      1,      put },
        !           135:        { "status",     statushelp,     0,      0,      status },
        !           136:        { "trace",      tracehelp,      0,      0,      settrace },
        !           137:        { "type",       typehelp,       0,      1,      settype },
        !           138:        { "unify",      unifyhelp,      1,      1,      unify },
        !           139:        { "user",       userhelp,       0,      1,      user },
        !           140:        { "verbose",    verbosehelp,    0,      0,      setverbose },
        !           141:        { "whatis",     whatishelp,     0,      0,      whatis },
        !           142:        { "?",          helphelp,       0,      0,      help },
        !           143:        { 0 },
        !           144: };
        !           145: 
        !           146: int    NCMDS = (sizeof (cmdtab) / sizeof (cmdtab[0]) - 1);
        !           147: 
        !           148: 

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.