BSD 4_3_Net_2 release
[unix-history] / usr / src / usr.bin / ftp / cmdtab.c
index 276ce21..6661227 100644 (file)
@@ -2,11 +2,37 @@
  * Copyright (c) 1985, 1989 Regents of the University of California.
  * All rights reserved.
  *
  * Copyright (c) 1985, 1989 Regents of the University of California.
  * All rights reserved.
  *
- * %sccs.include.redist.c%
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *     This product includes software developed by the University of
+ *     California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)cmdtab.c   5.10 (Berkeley) %G%";
+static char sccsid[] = "@(#)cmdtab.c   5.10 (Berkeley) 6/1/90";
 #endif /* not lint */
 
 #include "ftp_var.h"
 #endif /* not lint */
 
 #include "ftp_var.h"
@@ -18,7 +44,7 @@ int   setascii(), setbell(), setbinary(), setdebug(), setform();
 int    setglob(), sethash(), setmode(), setpeer(), setport();
 int    setprompt(), setstruct();
 int    settenex(), settrace(), settype(), setverbose();
 int    setglob(), sethash(), setmode(), setpeer(), setport();
 int    setprompt(), setstruct();
 int    settenex(), settrace(), settype(), setverbose();
-int    disconnect(), syst();
+int    disconnect(), restart(), reget(), syst();
 int    cd(), lcd(), delete(), mdelete(), user();
 int    ls(), mls(), get(), mget(), help(), append(), put(), mput();
 int    quit(), renamefile(), status();
 int    cd(), lcd(), delete(), mdelete(), user();
 int    ls(), mls(), get(), mget(), help(), append(), put(), mput();
 int    quit(), renamefile(), status();
@@ -26,7 +52,8 @@ int   quote(), rmthelp(), shell(), site();
 int    pwd(), makedir(), removedir(), setcr();
 int    account(), doproxy(), reset(), setcase(), setntrans(), setnmap();
 int    setsunique(), setrunique(), cdup(), macdef(), domacro();
 int    pwd(), makedir(), removedir(), setcr();
 int    account(), doproxy(), reset(), setcase(), setntrans(), setnmap();
 int    setsunique(), setrunique(), cdup(), macdef(), domacro();
-int    sizecmd(), modtime(), rmtstatus();
+int    sizecmd(), modtime(), newer(), rmtstatus();
+int    do_chmod(), do_umask(), idle();
 
 char   accounthelp[] = "send account command to remote server";
 char   appendhelp[] =  "append to a file";
 
 char   accounthelp[] = "send account command to remote server";
 char   appendhelp[] =  "append to a file";
@@ -56,10 +83,11 @@ char        mdeletehelp[] = "delete multiple files";
 char   mdirhelp[] =    "list contents of multiple remote directories";
 char   mgethelp[] =    "get multiple files";
 char   mkdirhelp[] =   "make directory on the remote machine";
 char   mdirhelp[] =    "list contents of multiple remote directories";
 char   mgethelp[] =    "get multiple files";
 char   mkdirhelp[] =   "make directory on the remote machine";
-char   mlshelp[] =     "nlist contents of multiple remote directories";
+char   mlshelp[] =     "list contents of multiple remote directories";
 char   modtimehelp[] = "show last modification time of remote file";
 char   modehelp[] =    "set file transfer mode";
 char   mputhelp[] =    "send multiple files";
 char   modtimehelp[] = "show last modification time of remote file";
 char   modehelp[] =    "set file transfer mode";
 char   mputhelp[] =    "send multiple files";
+char   newerhelp[] =   "get file if remote file is newer than local file ";
 char   nlisthelp[] =   "nlist contents of remote directory";
 char   nmaphelp[] =    "set templates for default file name mapping";
 char   ntranshelp[] =  "set translation table for default file name mapping";
 char   nlisthelp[] =   "nlist contents of remote directory";
 char   nmaphelp[] =    "set templates for default file name mapping";
 char   ntranshelp[] =  "set translation table for default file name mapping";
@@ -70,8 +98,10 @@ char pwdhelp[] =     "print working directory on remote machine";
 char   quithelp[] =    "terminate ftp session and exit";
 char   quotehelp[] =   "send arbitrary ftp command";
 char   receivehelp[] = "receive file";
 char   quithelp[] =    "terminate ftp session and exit";
 char   quotehelp[] =   "send arbitrary ftp command";
 char   receivehelp[] = "receive file";
+char   regethelp[] =   "get file restarting at end of local file";
 char   remotehelp[] =  "get help from remote server";
 char   renamehelp[] =  "rename file";
 char   remotehelp[] =  "get help from remote server";
 char   renamehelp[] =  "rename file";
+char   restarthelp[]=  "restart file transfer at bytecount";
 char   rmdirhelp[] =   "remove directory on the remote machine";
 char   rmtstatushelp[]="show status of remote machine";
 char   runiquehelp[] = "toggle store unique for local files";
 char   rmdirhelp[] =   "remove directory on the remote machine";
 char   rmtstatushelp[]="show status of remote machine";
 char   runiquehelp[] = "toggle store unique for local files";
@@ -128,6 +158,7 @@ struct cmd cmdtab[] = {
        { "mode",       modehelp,       0,      1,      1,      setmode },
        { "modtime",    modtimehelp,    0,      1,      1,      modtime },
        { "mput",       mputhelp,       1,      1,      1,      mput },
        { "mode",       modehelp,       0,      1,      1,      setmode },
        { "modtime",    modtimehelp,    0,      1,      1,      modtime },
        { "mput",       mputhelp,       1,      1,      1,      mput },
+       { "newer",      newerhelp,      1,      1,      1,      newer },
        { "nmap",       nmaphelp,       0,      0,      1,      setnmap },
        { "nlist",      nlisthelp,      1,      1,      1,      ls },
        { "ntrans",     ntranshelp,     0,      0,      1,      setntrans },
        { "nmap",       nmaphelp,       0,      0,      1,      setnmap },
        { "nlist",      nlisthelp,      1,      1,      1,      ls },
        { "ntrans",     ntranshelp,     0,      0,      1,      setntrans },
@@ -140,11 +171,12 @@ struct cmd cmdtab[] = {
        { "quit",       quithelp,       0,      0,      0,      quit },
        { "quote",      quotehelp,      1,      1,      1,      quote },
        { "recv",       receivehelp,    1,      1,      1,      get },
        { "quit",       quithelp,       0,      0,      0,      quit },
        { "quote",      quotehelp,      1,      1,      1,      quote },
        { "recv",       receivehelp,    1,      1,      1,      get },
-       { "remotehelp", remotehelp,     0,      1,      1,      rmthelp },
+       { "reget",      regethelp,      1,      1,      1,      reget },
        { "rstatus",    rmtstatushelp,  0,      1,      1,      rmtstatus },
        { "rhelp",      remotehelp,     0,      1,      1,      rmthelp },
        { "rename",     renamehelp,     0,      1,      1,      renamefile },
        { "reset",      resethelp,      0,      1,      1,      reset },
        { "rstatus",    rmtstatushelp,  0,      1,      1,      rmtstatus },
        { "rhelp",      remotehelp,     0,      1,      1,      rmthelp },
        { "rename",     renamehelp,     0,      1,      1,      renamefile },
        { "reset",      resethelp,      0,      1,      1,      reset },
+       { "restart",    restarthelp,    1,      1,      1,      restart },
        { "rmdir",      rmdirhelp,      0,      1,      1,      removedir },
        { "runique",    runiquehelp,    0,      0,      1,      setrunique },
        { "send",       sendhelp,       1,      1,      1,      put },
        { "rmdir",      rmdirhelp,      0,      1,      1,      removedir },
        { "runique",    runiquehelp,    0,      0,      1,      setrunique },
        { "send",       sendhelp,       1,      1,      1,      put },