Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/ftp split the "SMALL" #ifdefs into ones for NO_ABOUT...



details:   https://anonhg.NetBSD.org/src/rev/33b87f77f132
branches:  trunk
changeset: 473894:33b87f77f132
user:      cgd <cgd%NetBSD.org@localhost>
date:      Sun Jun 20 22:07:28 1999 +0000

description:
split the "SMALL" #ifdefs into ones for NO_ABOUT, NO_EDITCOMPLETE, and
NO_PROGRESS.  -DSMALL still implies all of those.  progress meter support
isn't necessary for the smallest possible ftp client, but it adds very
little space and makes users' lives much better.  Therefore, it should
be enabled for installation media if at all possible.

diffstat:

 usr.bin/ftp/cmds.c     |  12 ++++++------
 usr.bin/ftp/cmdtab.c   |  18 +++++++++---------
 usr.bin/ftp/complete.c |  10 +++++-----
 usr.bin/ftp/extern.h   |   6 +++---
 usr.bin/ftp/fetch.c    |   8 ++++----
 usr.bin/ftp/ftp_var.h  |  23 ++++++++++++++++-------
 usr.bin/ftp/main.c     |  44 +++++++++++++++++++++++---------------------
 usr.bin/ftp/util.c     |  22 ++++++++++++----------
 8 files changed, 78 insertions(+), 65 deletions(-)

diffs (truncated from 524 to 300 lines):

diff -r b327045ecbbb -r 33b87f77f132 usr.bin/ftp/cmds.c
--- a/usr.bin/ftp/cmds.c        Sun Jun 20 20:26:42 1999 +0000
+++ b/usr.bin/ftp/cmds.c        Sun Jun 20 22:07:28 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cmds.c,v 1.50 1999/06/11 14:12:19 lukem Exp $  */
+/*     $NetBSD: cmds.c,v 1.51 1999/06/20 22:07:28 cgd Exp $    */
 
 /*-
  * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@@ -78,7 +78,7 @@
 #if 0
 static char sccsid[] = "@(#)cmds.c     8.6 (Berkeley) 10/9/94";
 #else
-__RCSID("$NetBSD: cmds.c,v 1.50 1999/06/11 14:12:19 lukem Exp $");
+__RCSID("$NetBSD: cmds.c,v 1.51 1999/06/20 22:07:28 cgd Exp $");
 #endif
 #endif /* not lint */
 
@@ -728,9 +728,9 @@
            "Hash mark printing: %s; Mark count: %d; Progress bar: %s.\n",
            onoff(hash), mark, onoff(progress));
        fprintf(ttyout, "Use of PORT cmds: %s.\n", onoff(sendport));
-#ifndef SMALL
+#ifndef NO_EDITCOMPLETE
        fprintf(ttyout, "Command line editing: %s.\n", onoff(editing));
-#endif /* !SMALL */
+#endif /* !NO_EDITCOMPLETE */
        if (macnum > 0) {
                fputs("Macros:\n", ttyout);
                for (i=0; i<macnum; i++) {
@@ -778,7 +778,7 @@
        code = togglevar(argc, argv, &bell, "Bell mode");
 }
 
-#ifndef SMALL
+#ifndef NO_EDITCOMPLETE
 /*
  * Set command line editing
  */
@@ -792,7 +792,7 @@
        code = togglevar(argc, argv, &editing, "Editing mode");
        controlediting();
 }
-#endif /* !SMALL */
+#endif /* !NO_EDITCOMPLETE */
 
 /*
  * Turn on packet tracing.
diff -r b327045ecbbb -r 33b87f77f132 usr.bin/ftp/cmdtab.c
--- a/usr.bin/ftp/cmdtab.c      Sun Jun 20 20:26:42 1999 +0000
+++ b/usr.bin/ftp/cmdtab.c      Sun Jun 20 22:07:28 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cmdtab.c,v 1.20 1999/03/08 03:09:08 lukem Exp $        */
+/*     $NetBSD: cmdtab.c,v 1.21 1999/06/20 22:07:28 cgd Exp $  */
 
 /*
  * Copyright (c) 1985, 1989, 1993, 1994
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = "@(#)cmdtab.c   8.4 (Berkeley) 10/9/94";
 #else
-__RCSID("$NetBSD: cmdtab.c,v 1.20 1999/03/08 03:09:08 lukem Exp $");
+__RCSID("$NetBSD: cmdtab.c,v 1.21 1999/06/20 22:07:28 cgd Exp $");
 #endif
 #endif /* not lint */
 
@@ -65,9 +65,9 @@
 char   dirhelp[] =     "list contents of remote directory";
 char   disconhelp[] =  "terminate ftp session";
 char   domachelp[] =   "execute macro";
-#ifndef SMALL
+#ifndef NO_EDITCOMPLETE
 char   edithelp[] =    "toggle command line editing";
-#endif /* !SMALL */
+#endif /* !NO_EDITCOMPLETE */
 char   formhelp[] =    "set file transfer format";
 char   gatehelp[] =    "toggle gate-ftp; specify host[:port] to change proxy";
 char   globhelp[] =    "toggle metacharacter expansion of local file names";
@@ -129,13 +129,13 @@
 char   userhelp[] =    "send new user information";
 char   verbosehelp[] = "toggle verbose mode";
 
-#ifdef SMALL
+#ifdef NO_EDITCOMPLETE
 #define CMPL(x)
 #define CMPL0
-#else  /* !SMALL */
+#else  /* !NO_EDITCOMPLETE */
 #define CMPL(x)        __STRING(x),
 #define CMPL0  "",
-#endif /* !SMALL */
+#endif /* !NO_EDITCOMPLETE */
 
 struct cmd cmdtab[] = {
        { "!",          shellhelp,      0, 0, 0, CMPL0          shell },
@@ -156,9 +156,9 @@
        { "delete",     deletehelp,     0, 1, 1, CMPL(r)        delete },
        { "dir",        dirhelp,        1, 1, 1, CMPL(rl)       ls },
        { "disconnect", disconhelp,     0, 1, 1, CMPL0          disconnect },
-#ifndef SMALL
+#ifndef NO_EDITCOMPLETE
        { "edit",       edithelp,       0, 0, 0, CMPL0          setedit },
-#endif /* !SMALL */
+#endif /* !NO_EDITCOMPLETE */
        { "exit",       quithelp,       0, 0, 0, CMPL0          quit },
        { "form",       formhelp,       0, 1, 1, CMPL0          setform },
        { "ftp",        connecthelp,    0, 0, 1, CMPL0          setpeer },
diff -r b327045ecbbb -r 33b87f77f132 usr.bin/ftp/complete.c
--- a/usr.bin/ftp/complete.c    Sun Jun 20 20:26:42 1999 +0000
+++ b/usr.bin/ftp/complete.c    Sun Jun 20 22:07:28 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: complete.c,v 1.23 1999/06/12 18:19:53 christos Exp $   */
+/*     $NetBSD: complete.c,v 1.24 1999/06/20 22:07:28 cgd Exp $        */
 
 /*-
  * Copyright (c) 1997, 1998, 1999 The NetBSD Foundation, Inc.
@@ -36,11 +36,9 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef SMALL
-
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: complete.c,v 1.23 1999/06/12 18:19:53 christos Exp $");
+__RCSID("$NetBSD: complete.c,v 1.24 1999/06/20 22:07:28 cgd Exp $");
 #endif /* not lint */
 
 /*
@@ -58,6 +56,8 @@
 
 #include "ftp_var.h"
 
+#ifndef NO_EDITCOMPLETE
+
 static int          comparstr          __P((const void *, const void *));
 static unsigned char complete_ambiguous        __P((char *, int, StringList *));
 static unsigned char complete_command  __P((char *, int));
@@ -411,4 +411,4 @@
        return (CC_ERROR);
 }
 
-#endif /* !SMALL */
+#endif /* !NO_EDITCOMPLETE */
diff -r b327045ecbbb -r 33b87f77f132 usr.bin/ftp/extern.h
--- a/usr.bin/ftp/extern.h      Sun Jun 20 20:26:42 1999 +0000
+++ b/usr.bin/ftp/extern.h      Sun Jun 20 22:07:28 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: extern.h,v 1.28 1999/03/22 07:36:40 lukem Exp $        */
+/*     $NetBSD: extern.h,v 1.29 1999/06/20 22:07:28 cgd Exp $  */
 
 /*-
  * Copyright (c) 1994 The Regents of the University of California.
@@ -54,10 +54,10 @@
 void   cmdabort __P((int));
 void   cmdscanner __P((int));
 int    command __P((const char *, ...));
-#ifndef SMALL
+#ifndef NO_EDITCOMPLETE
 unsigned char complete __P((EditLine *, int));
 void   controlediting __P((void));
-#endif /* !SMALL */
+#endif /* !NO_EDITCOMPLETE */
 int    confirm __P((const char *, const char *));
 FILE   *dataconn __P((const char *));
 void   delete __P((int, char **));
diff -r b327045ecbbb -r 33b87f77f132 usr.bin/ftp/fetch.c
--- a/usr.bin/ftp/fetch.c       Sun Jun 20 20:26:42 1999 +0000
+++ b/usr.bin/ftp/fetch.c       Sun Jun 20 22:07:28 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fetch.c,v 1.55 1999/06/02 02:03:57 lukem Exp $ */
+/*     $NetBSD: fetch.c,v 1.56 1999/06/20 22:07:28 cgd Exp $   */
 
 /*-
  * Copyright (c) 1997, 1998, 1999 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: fetch.c,v 1.55 1999/06/02 02:03:57 lukem Exp $");
+__RCSID("$NetBSD: fetch.c,v 1.56 1999/06/20 22:07:28 cgd Exp $");
 #endif /* not lint */
 
 /*
@@ -1369,7 +1369,7 @@
        const char *url;
 {
 
-#ifndef SMALL
+#ifndef NO_ABOUT
        /*
         * Check for about:*
         */
@@ -1388,7 +1388,7 @@
                }
                return (0);
        }
-#endif /* SMALL */
+#endif /* NO_ABOUT */
 
        /*
         * Check for file:// and http:// URLs.
diff -r b327045ecbbb -r 33b87f77f132 usr.bin/ftp/ftp_var.h
--- a/usr.bin/ftp/ftp_var.h     Sun Jun 20 20:26:42 1999 +0000
+++ b/usr.bin/ftp/ftp_var.h     Sun Jun 20 22:07:28 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ftp_var.h,v 1.31 1999/03/22 07:36:40 lukem Exp $       */
+/*     $NetBSD: ftp_var.h,v 1.32 1999/06/20 22:07:29 cgd Exp $ */
 
 /*
  * Copyright (c) 1985, 1989, 1993, 1994
@@ -39,6 +39,15 @@
  * FTP global variables.
  */
 
+#ifdef SMALL
+#undef NO_ABOUT
+#define        NO_ABOUT
+#undef NO_EDITCOMPLETE
+#define        NO_EDITCOMPLETE
+#undef NO_PROGRESS
+#define        NO_PROGRESS
+#endif
+
 #include <sys/param.h>
 
 #include <netinet/in.h>
@@ -47,9 +56,9 @@
 #include <setjmp.h>
 #include <stringlist.h>
 
-#ifndef SMALL
+#ifndef NO_EDITCOMPLETE
 #include <histedit.h>
-#endif /* !SMALL */
+#endif /* !NO_EDITCOMPLETE */
 
 #include "extern.h"
 
@@ -126,14 +135,14 @@
 char   *tmpdir;                        /* temporary directory */
 FILE   *ttyout;                        /* stdout, or stderr if retrieving to stdout */
 
-#ifndef SMALL
+#ifndef NO_EDITCOMPLETE
 int      editing;              /* command line editing enabled */
 EditLine *el;                  /* editline(3) status structure */
 History  *hist;                        /* editline(3) history structure */
 char    *cursor_pos;           /* cursor position we're looking for */
 size_t   cursor_argc;          /* location of cursor in margv */
 size_t   cursor_argo;          /* offset of cursor in margv[cursor_argc] */
-#endif /* !SMALL */
+#endif /* !NO_EDITCOMPLETE */
 
 off_t  bytes;                  /* current # of bytes read */
 off_t  filesize;               /* size of file being transferred */
@@ -185,9 +194,9 @@
        char     c_bell;        /* give bell when command completes */
        char     c_conn;        /* must be connected to use command */
        char     c_proxy;       /* proxy server may execute */
-#ifndef SMALL
+#ifndef NO_EDITCOMPLETE
        char    *c_complete;    /* context sensitive completion list */
-#endif /* !SMALL */
+#endif /* !NO_EDITCOMPLETE */
        void    (*c_handler) __P((int, char **)); /* function to call */
 };
 
diff -r b327045ecbbb -r 33b87f77f132 usr.bin/ftp/main.c
--- a/usr.bin/ftp/main.c        Sun Jun 20 20:26:42 1999 +0000
+++ b/usr.bin/ftp/main.c        Sun Jun 20 22:07:28 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: main.c,v 1.42 1999/06/02 02:03:58 lukem Exp $  */
+/*     $NetBSD: main.c,v 1.43 1999/06/20 22:07:29 cgd Exp $    */
 
 /*
  * Copyright (c) 1985, 1989, 1993, 1994
@@ -43,7 +43,7 @@
 #if 0
 static char sccsid[] = "@(#)main.c     8.6 (Berkeley) 10/9/94";
 #else
-__RCSID("$NetBSD: main.c,v 1.42 1999/06/02 02:03:58 lukem Exp $");
+__RCSID("$NetBSD: main.c,v 1.43 1999/06/20 22:07:29 cgd Exp $");
 #endif
 #endif /* not lint */
 
@@ -125,7 +125,7 @@
        gatemode = 0;
        outfile = NULL;
        restartautofetch = 0;
-#ifndef SMALL
+#ifndef NO_EDITCOMPLETE
        editing = 0;
        el = NULL;
        hist = NULL;
@@ -178,14 +178,16 @@
        ttyout = stdout;
        if (isatty(fileno(ttyout))) {
                verbose = 1;            /* verbose if to a tty */
-#ifndef SMALL



Home | Main Index | Thread Index | Old Index