Annotation of 43BSDTahoe/ucb/ftp/cmdtab.c, revision 1.1

1.1     ! root        1: /*
        !             2:  * Copyright (c) 1985 Regents of the University of California.
        !             3:  * All rights reserved.
        !             4:  *
        !             5:  * Redistribution and use in source and binary forms are permitted
        !             6:  * provided that the above copyright notice and this paragraph are
        !             7:  * duplicated in all such forms and that any documentation,
        !             8:  * advertising materials, and other materials related to such
        !             9:  * distribution and use acknowledge that the software was developed
        !            10:  * by the University of California, Berkeley.  The name of the
        !            11:  * University may not be used to endorse or promote products derived
        !            12:  * from this software without specific prior written permission.
        !            13:  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
        !            14:  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
        !            15:  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
        !            16:  */
        !            17: 
        !            18: #ifndef lint
        !            19: static char sccsid[] = "@(#)cmdtab.c   5.6 (Berkeley) 6/29/88";
        !            20: #endif /* not lint */
        !            21: 
        !            22: #include "ftp_var.h"
        !            23: 
        !            24: /*
        !            25:  * User FTP -- Command Tables.
        !            26:  */
        !            27: int    setascii(), setbell(), setbinary(), setdebug(), setform();
        !            28: int    setglob(), sethash(), setmode(), setpeer(), setport();
        !            29: int    setprompt(), setstruct();
        !            30: int    settenex(), settrace(), settype(), setverbose();
        !            31: int    disconnect();
        !            32: int    cd(), lcd(), delete(), mdelete(), user();
        !            33: int    ls(), mls(), get(), mget(), help(), append(), put(), mput();
        !            34: int    quit(), renamefile(), status();
        !            35: int    quote(), rmthelp(), shell();
        !            36: int    pwd(), makedir(), removedir(), setcr();
        !            37: int    account(), doproxy(), reset(), setcase(), setntrans(), setnmap();
        !            38: int    setsunique(), setrunique(), cdup(), macdef(), domacro();
        !            39: 
        !            40: char   accounthelp[] = "send account command to remote server";
        !            41: char   appendhelp[] =  "append to a file";
        !            42: char   asciihelp[] =   "set ascii transfer type";
        !            43: char   beephelp[] =    "beep when command completed";
        !            44: char   binaryhelp[] =  "set binary transfer type";
        !            45: char   casehelp[] =    "toggle mget upper/lower case id mapping";
        !            46: char   cdhelp[] =      "change remote working directory";
        !            47: char   cduphelp[] =    "change remote working directory to parent directory";
        !            48: char   connecthelp[] = "connect to remote tftp";
        !            49: char   crhelp[] =      "toggle carriage return stripping on ascii gets";
        !            50: char   deletehelp[] =  "delete remote file";
        !            51: char   debughelp[] =   "toggle/set debugging mode";
        !            52: char   dirhelp[] =     "list contents of remote directory";
        !            53: char   disconhelp[] =  "terminate ftp session";
        !            54: char   domachelp[] =   "execute macro";
        !            55: char   formhelp[] =    "set file transfer format";
        !            56: char   globhelp[] =    "toggle metacharacter expansion of local file names";
        !            57: char   hashhelp[] =    "toggle printing `#' for each buffer transferred";
        !            58: char   helphelp[] =    "print local help information";
        !            59: char   lcdhelp[] =     "change local working directory";
        !            60: char   lshelp[] =      "nlist contents of remote directory";
        !            61: char   macdefhelp[] =  "define a macro";
        !            62: char   mdeletehelp[] = "delete multiple files";
        !            63: char   mdirhelp[] =    "list contents of multiple remote directories";
        !            64: char   mgethelp[] =    "get multiple files";
        !            65: char   mkdirhelp[] =   "make directory on the remote machine";
        !            66: char   mlshelp[] =     "nlist contents of multiple remote directories";
        !            67: char   modehelp[] =    "set file transfer mode";
        !            68: char   mputhelp[] =    "send multiple files";
        !            69: char   nmaphelp[] =    "set templates for default file name mapping";
        !            70: char   ntranshelp[] =  "set translation table for default file name mapping";
        !            71: char   porthelp[] =    "toggle use of PORT cmd for each data connection";
        !            72: char   prompthelp[] =  "force interactive prompting on multiple commands";
        !            73: char   proxyhelp[] =   "issue command on alternate connection";
        !            74: char   pwdhelp[] =     "print working directory on remote machine";
        !            75: char   quithelp[] =    "terminate ftp session and exit";
        !            76: char   quotehelp[] =   "send arbitrary ftp command";
        !            77: char   receivehelp[] = "receive file";
        !            78: char   remotehelp[] =  "get help from remote server";
        !            79: char   renamehelp[] =  "rename file";
        !            80: char   rmdirhelp[] =   "remove directory on the remote machine";
        !            81: char   runiquehelp[] = "toggle store unique for local files";
        !            82: char   resethelp[] =   "clear queued command replies";
        !            83: char   sendhelp[] =    "send one file";
        !            84: char   shellhelp[] =   "escape to the shell";
        !            85: char   statushelp[] =  "show current status";
        !            86: char   structhelp[] =  "set file transfer structure";
        !            87: char   suniquehelp[] = "toggle store unique on remote machine";
        !            88: char   tenexhelp[] =   "set tenex file transfer type";
        !            89: char   tracehelp[] =   "toggle packet tracing";
        !            90: char   typehelp[] =    "set file transfer type";
        !            91: char   userhelp[] =    "send new user information";
        !            92: char   verbosehelp[] = "toggle verbose mode";
        !            93: 
        !            94: struct cmd cmdtab[] = {
        !            95:        { "!",          shellhelp,      0,      0,      0,      shell },
        !            96:        { "$",          domachelp,      1,      0,      0,      domacro },
        !            97:        { "account",    accounthelp,    0,      1,      1,      account},
        !            98:        { "append",     appendhelp,     1,      1,      1,      put },
        !            99:        { "ascii",      asciihelp,      0,      1,      1,      setascii },
        !           100:        { "bell",       beephelp,       0,      0,      0,      setbell },
        !           101:        { "binary",     binaryhelp,     0,      1,      1,      setbinary },
        !           102:        { "bye",        quithelp,       0,      0,      0,      quit },
        !           103:        { "case",       casehelp,       0,      0,      1,      setcase },
        !           104:        { "cd",         cdhelp,         0,      1,      1,      cd },
        !           105:        { "cdup",       cduphelp,       0,      1,      1,      cdup },
        !           106:        { "close",      disconhelp,     0,      1,      1,      disconnect },
        !           107:        { "cr",         crhelp,         0,      0,      0,      setcr },
        !           108:        { "delete",     deletehelp,     0,      1,      1,      delete },
        !           109:        { "debug",      debughelp,      0,      0,      0,      setdebug },
        !           110:        { "dir",        dirhelp,        1,      1,      1,      ls },
        !           111:        { "disconnect", disconhelp,     0,      1,      1,      disconnect },
        !           112:        { "form",       formhelp,       0,      1,      1,      setform },
        !           113:        { "get",        receivehelp,    1,      1,      1,      get },
        !           114:        { "glob",       globhelp,       0,      0,      0,      setglob },
        !           115:        { "hash",       hashhelp,       0,      0,      0,      sethash },
        !           116:        { "help",       helphelp,       0,      0,      1,      help },
        !           117:        { "image",      binaryhelp,     0,      1,      1,      setbinary },
        !           118:        { "lcd",        lcdhelp,        0,      0,      0,      lcd },
        !           119:        { "ls",         lshelp,         1,      1,      1,      ls },
        !           120:        { "macdef",     macdefhelp,     0,      0,      0,      macdef },
        !           121:        { "mdelete",    mdeletehelp,    1,      1,      1,      mdelete },
        !           122:        { "mdir",       mdirhelp,       1,      1,      1,      mls },
        !           123:        { "mget",       mgethelp,       1,      1,      1,      mget },
        !           124:        { "mkdir",      mkdirhelp,      0,      1,      1,      makedir },
        !           125:        { "mls",        mlshelp,        1,      1,      1,      mls },
        !           126:        { "mode",       modehelp,       0,      1,      1,      setmode },
        !           127:        { "mput",       mputhelp,       1,      1,      1,      mput },
        !           128:        { "nmap",       nmaphelp,       0,      0,      1,      setnmap },
        !           129:        { "ntrans",     ntranshelp,     0,      0,      1,      setntrans },
        !           130:        { "open",       connecthelp,    0,      0,      1,      setpeer },
        !           131:        { "prompt",     prompthelp,     0,      0,      0,      setprompt },
        !           132:        { "proxy",      proxyhelp,      0,      0,      1,      doproxy },
        !           133:        { "sendport",   porthelp,       0,      0,      0,      setport },
        !           134:        { "put",        sendhelp,       1,      1,      1,      put },
        !           135:        { "pwd",        pwdhelp,        0,      1,      1,      pwd },
        !           136:        { "quit",       quithelp,       0,      0,      0,      quit },
        !           137:        { "quote",      quotehelp,      1,      1,      1,      quote },
        !           138:        { "recv",       receivehelp,    1,      1,      1,      get },
        !           139:        { "remotehelp", remotehelp,     0,      1,      1,      rmthelp },
        !           140:        { "rename",     renamehelp,     0,      1,      1,      renamefile },
        !           141:        { "reset",      resethelp,      0,      1,      1,      reset },
        !           142:        { "rmdir",      rmdirhelp,      0,      1,      1,      removedir },
        !           143:        { "runique",    runiquehelp,    0,      0,      1,      setrunique },
        !           144:        { "send",       sendhelp,       1,      1,      1,      put },
        !           145:        { "status",     statushelp,     0,      0,      1,      status },
        !           146:        { "struct",     structhelp,     0,      1,      1,      setstruct },
        !           147:        { "sunique",    suniquehelp,    0,      0,      1,      setsunique },
        !           148:        { "tenex",      tenexhelp,      0,      1,      1,      settenex },
        !           149:        { "trace",      tracehelp,      0,      0,      0,      settrace },
        !           150:        { "type",       typehelp,       0,      1,      1,      settype },
        !           151:        { "user",       userhelp,       0,      1,      1,      user },
        !           152:        { "verbose",    verbosehelp,    0,      0,      0,      setverbose },
        !           153:        { "?",          helphelp,       0,      0,      1,      help },
        !           154:        { 0 },
        !           155: };
        !           156: 
        !           157: int    NCMDS = (sizeof (cmdtab) / sizeof (cmdtab[0])) - 1;

unix.superglobalmegacorp.com

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