Annotation of 43BSDTahoe/new/xns/examples/filing/cmdtab.c, revision 1.1.1.1

1.1       root        1: /* $Header: cmdtab.c,v 2.2 86/12/11 06:12:07 jqj Exp $ */
                      2: /* $Log:       cmdtab.c,v $
                      3:  * Revision 2.2  86/12/11  06:12:07  jqj
                      4:  * Eliminated form, mode, and struct commands.  Started adding support for
                      5:  * more file types.
                      6:  * 
                      7:  * Revision 2.1  86/06/02  07:10:04  jqj
                      8:  * bugfix in NCMDS
                      9:  * 
                     10:  * Revision 2.0  85/11/21  07:22:43  jqj
                     11:  * 4.3BSD standard release
                     12:  * 
                     13:  * Revision 1.1  85/11/20  14:18:58  jqj
                     14:  * Initial revision
                     15:  * 
                     16:  */
                     17: #ifndef lint
                     18: static char sccsid[] = "@(#)cmdtab.c   4.7 (Berkeley) 7/26/83";
                     19: #endif
                     20: 
                     21: #include "ftp_var.h"
                     22: 
                     23: /*
                     24:  * User FTP -- Command Tables.
                     25:  */
                     26: int    setascii(), setbell(), setbinary(), setdebug();
                     27: int    setglob(), sethash(), setpeer();
                     28: int    setprompt();
                     29: int    settrace(), settype(), setverbose();
                     30: int    disconnect();
                     31: int    cd(), lcd(), delete(), mdelete(), user();
                     32: int    ls(), mls(), get(), mget(), help(), append(), put(), mput();
                     33: int    quit(), renamefile(), status();
                     34: int    shell();
                     35: int    pwd(), makedir(), removedir();
                     36: 
                     37: char   appendhelp[] =  "append to a file";
                     38: char   asciihelp[] =   "set ascii (tText) transfer type";
                     39: char   beephelp[] =    "beep when command completed";
                     40: char   binaryhelp[] =  "set binary (tUnspecified) transfer type";
                     41: char   cdhelp[] =      "change remote working directory";
                     42: char   connecthelp[] = "connect to remote tftp";
                     43: char   deletehelp[] =  "delete remote file";
                     44: char   debughelp[] =   "toggle/set debugging mode";
                     45: char   dirhelp[] =     "list contents of remote directory";
                     46: char   disconhelp[] =  "terminate ftp session";
                     47: char   globhelp[] =    "toggle metacharacter expansion of local file names";
                     48: char   hashhelp[] =    "toggle printing `#' for each buffer transferred";
                     49: char   helphelp[] =    "print local help information";
                     50: char   lcdhelp[] =     "change local working directory";
                     51: char   lshelp[] =      "nlist contents of remote directory";
                     52: char   mdeletehelp[] = "delete multiple files";
                     53: char   mdirhelp[] =    "list contents of multiple remote directories";
                     54: char   mgethelp[] =    "get multiple files";
                     55: char   mkdirhelp[] =   "make directory on the remote machine";
                     56: char   mlshelp[] =     "nlist contents of multiple remote directories";
                     57: char   mputhelp[] =    "send multiple files";
                     58: char   prompthelp[] =  "force interactive prompting on multiple commands";
                     59: char   pwdhelp[] =     "print working directory on remote machine";
                     60: char   quithelp[] =    "terminate ftp session and exit";
                     61: char   quotehelp[] =   "send arbitrary ftp command";
                     62: char   receivehelp[] = "receive file";
                     63: char   remotehelp[] =  "get help from remote server";
                     64: char   renamehelp[] =  "rename file";
                     65: char   rmdirhelp[] =   "remove directory on the remote machine";
                     66: char   sendhelp[] =    "send one file";
                     67: char   shellhelp[] =   "escape to the shell";
                     68: char   statushelp[] =  "show current status";
                     69: char   tracehelp[] =   "toggle packet tracing";
                     70: char   typehelp[] =    "set file transfer type";
                     71: char   userhelp[] =    "send new user information";
                     72: char   verbosehelp[] = "toggle verbose mode";
                     73: 
                     74: struct cmd cmdtab[] = {
                     75:        { "!",          shellhelp,      0,      0,      shell },
                     76:        { "append",     appendhelp,     1,      1,      put },
                     77:        { "ascii",      asciihelp,      0,      1,      setascii },
                     78:        { "bell",       beephelp,       0,      0,      setbell },
                     79:        { "binary",     binaryhelp,     0,      1,      setbinary },
                     80:        { "bye",        quithelp,       0,      0,      quit },
                     81:        { "cd",         cdhelp,         0,      1,      cd },
                     82:        { "close",      disconhelp,     0,      1,      disconnect },
                     83:        { "delete",     deletehelp,     0,      1,      delete },
                     84:        { "debug",      debughelp,      0,      0,      setdebug },
                     85:        { "dir",        dirhelp,        1,      1,      ls },
                     86:        { "get",        receivehelp,    1,      1,      get },
                     87:        { "glob",       globhelp,       0,      0,      setglob },
                     88:        { "hash",       hashhelp,       0,      0,      sethash },
                     89:        { "help",       helphelp,       0,      0,      help },
                     90:        { "lcd",        lcdhelp,        0,      0,      lcd },
                     91:        { "ls",         lshelp,         1,      1,      ls },
                     92:        { "mdelete",    mdeletehelp,    1,      1,      mdelete },
                     93:        { "mdir",       mdirhelp,       1,      1,      mls },
                     94:        { "mget",       mgethelp,       1,      1,      mget },
                     95:        { "mkdir",      mkdirhelp,      0,      1,      makedir },
                     96:        { "mls",        mlshelp,        1,      1,      mls },
                     97:        { "mput",       mputhelp,       1,      1,      mput },
                     98:        { "open",       connecthelp,    0,      0,      setpeer },
                     99:        { "prompt",     prompthelp,     0,      0,      setprompt },
                    100:        { "put",        sendhelp,       1,      1,      put },
                    101:        { "pwd",        pwdhelp,        0,      1,      pwd },
                    102:        { "quit",       quithelp,       0,      0,      quit },
                    103:        { "recv",       receivehelp,    1,      1,      get },
                    104:        { "rename",     renamehelp,     0,      1,      renamefile },
                    105:        { "rmdir",      rmdirhelp,      0,      1,      removedir },
                    106:        { "send",       sendhelp,       1,      1,      put },
                    107:        { "status",     statushelp,     0,      0,      status },
                    108:        { "trace",      tracehelp,      0,      0,      settrace },
                    109:        { "type",       typehelp,       0,      1,      settype },
                    110:        { "user",       userhelp,       0,      1,      user },
                    111:        { "verbose",    verbosehelp,    0,      0,      setverbose },
                    112:        { "?",          helphelp,       0,      0,      help },
                    113:        { 0 },
                    114: };
                    115: 
                    116: int    NCMDS = (sizeof (cmdtab) / sizeof (cmdtab[0]) - 1);
                    117: 

unix.superglobalmegacorp.com

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