[BACK]Return to ftp_var.h CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / usr.bin / ftp

Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.

Diff for /src/usr.bin/ftp/ftp_var.h between version 1.36.2.1 and 1.37

version 1.36.2.1, 1999/12/27 18:36:58 version 1.37, 1999/09/30 23:51:27
Line 1 
Line 1 
 /*      $NetBSD$        */  /*      $NetBSD$        */
   
 /*-  
  * Copyright (c) 1996-1999 The NetBSD Foundation, Inc.  
  * All rights reserved.  
  *  
  * This code is derived from software contributed to The NetBSD Foundation  
  * by Luke Mewburn.  
  *  
  * 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 NetBSD  
  *      Foundation, Inc. and its contributors.  
  * 4. Neither the name of The NetBSD Foundation 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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.  
  */  
   
 /*  /*
  * Copyright (c) 1985, 1989, 1993, 1994   * Copyright (c) 1985, 1989, 1993, 1994
  *      The Regents of the University of California.  All rights reserved.   *      The Regents of the University of California.  All rights reserved.
Line 105 
Line 69 
  */   */
   
 #ifdef SMALL  #ifdef SMALL
   #undef  NO_ABOUT
   #define NO_ABOUT
 #undef  NO_EDITCOMPLETE  #undef  NO_EDITCOMPLETE
 #define NO_EDITCOMPLETE  #define NO_EDITCOMPLETE
 #undef  NO_PROGRESS  #undef  NO_PROGRESS
Line 125 
Line 91 
   
 #include "extern.h"  #include "extern.h"
   
   #define FTPBUFLEN       MAXPATHLEN + 200
   #define MAX_IN_PORT_T   0xffffU
   
 /*  #define HASHBYTES       1024    /* default mark for `hash' command */
  * Format of command table.  
  */  
 struct cmd {  
         char    *c_name;        /* name of command */  
         char    *c_help;        /* help string */  
         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 NO_EDITCOMPLETE  
         char    *c_complete;    /* context sensitive completion list */  
 #endif /* !NO_EDITCOMPLETE */  
         void    (*c_handler) __P((int, char **)); /* function to call */  
 };  
   
 /*  
  * Format of macro table  
  */  
 struct macel {  
         char mac_name[9];       /* macro name */  
         char *mac_start;        /* start of macro in macbuf */  
         char *mac_end;          /* end of macro in macbuf */  
 };  
   
 /*  
  * Format of option table  
  */  
 struct option {  
         char    *name;  
         char    *value;  
 };  
   
   
 /*  
  * Global defines  
  */  
 #define FTPBUFLEN       MAXPATHLEN + 200  
 #define MAX_IN_PORT_T   0xffffU  
   
 #define HASHBYTES       1024    /* default mark for `hash' command */  
 #define DEFAULTINCR     1024    /* default increment for `rate' command */  #define DEFAULTINCR     1024    /* default increment for `rate' command */
 #define STALLTIME       5       /* # of seconds of no xfer before "stalling" */  #define STALLTIME       5       /* # of seconds of no xfer before "stalling" */
   
 #define FTP_PORT        21      /* default if ! getservbyname("ftp/tcp") */  #define FTP_PORT        21      /* default if ! getservbyname("ftp/tcp") */
 #define HTTP_PORT       80      /* default if ! getservbyname("http/tcp") */  #define HTTP_PORT       80      /* default if ! getservbyname("http/tcp") */
Line 178  struct option {
Line 107  struct option {
 #define GATE_SERVER     ""      /* default server */  #define GATE_SERVER     ""      /* default server */
 #endif  #endif
   
 #define DEFAULTPAGER    "more"  /* default pager if $PAGER isn't set */  #define PAGER           "more"  /* default pager if $PAGER isn't set */
 #define DEFAULTPROMPT   "ftp> " /* default prompt  if `set prompt' is empty */  
 #define DEFAULTRPROMPT  ""      /* default rprompt if `set rprompt' is empty */  
   
 #define TMPFILE         "ftpXXXXXXXXXX"  
   
   
 #ifndef GLOBAL  
 #define GLOBAL  extern  
 #endif  
   
 /*  /*
  * Options and other state info.   * Options and other state info.
  */   */
 GLOBAL  int     trace;          /* trace packets exchanged */  int     trace;                  /* trace packets exchanged */
 GLOBAL  int     hash;           /* print # for each buffer transferred */  int     hash;                   /* print # for each buffer transferred */
 GLOBAL  int     mark;           /* number of bytes between hashes */  int     mark;                   /* number of bytes between hashes */
 GLOBAL  int     sendport;       /* use PORT/LPRT cmd for each data connection */  int     sendport;               /* use PORT/LPRT cmd for each data connection */
 GLOBAL  int     verbose;        /* print messages coming back from server */  int     verbose;                /* print messages coming back from server */
 GLOBAL  int     connected;      /* 1 = connected to server, -1 = logged in */  int     connected;              /* 1 = connected to server, -1 = logged in */
 GLOBAL  int     fromatty;       /* input is from a terminal */  int     fromatty;               /* input is from a terminal */
 GLOBAL  int     interactive;    /* interactively prompt on m* cmds */  int     interactive;            /* interactively prompt on m* cmds */
 GLOBAL  int     confirmrest;    /* confirm rest of current m* cmd */  int     confirmrest;            /* confirm rest of current m* cmd */
 GLOBAL  int     debug;          /* debugging level */  int     debug;                  /* debugging level */
 GLOBAL  int     bell;           /* ring bell on cmd completion */  int     bell;                   /* ring bell on cmd completion */
 GLOBAL  int     doglob;         /* glob local file names */  int     doglob;                 /* glob local file names */
 GLOBAL  int     autologin;      /* establish user account on connection */  int     autologin;              /* establish user account on connection */
 GLOBAL  int     proxy;          /* proxy server connection active */  int     proxy;                  /* proxy server connection active */
 GLOBAL  int     proxflag;       /* proxy connection exists */  int     proxflag;               /* proxy connection exists */
 GLOBAL  int     gatemode;       /* use gate-ftp */  int     gatemode;               /* use gate-ftp */
 GLOBAL  char   *gateserver;     /* server to use for gate-ftp */  char   *gateserver;             /* server to use for gate-ftp */
 GLOBAL  int     sunique;        /* store files on server with unique name */  int     sunique;                /* store files on server with unique name */
 GLOBAL  int     runique;        /* store local files with unique name */  int     runique;                /* store local files with unique name */
 GLOBAL  int     mcase;          /* map upper to lower case for mget names */  int     mcase;                  /* map upper to lower case for mget names */
 GLOBAL  int     ntflag;         /* use ntin ntout tables for name translation */  int     ntflag;                 /* use ntin ntout tables for name translation */
 GLOBAL  int     mapflag;        /* use mapin mapout templates on file names */  int     mapflag;                /* use mapin mapout templates on file names */
 GLOBAL  int     preserve;       /* preserve modification time on files */  int     preserve;               /* preserve modification time on files */
 GLOBAL  int     progress;       /* display transfer progress bar */  int     progress;               /* display transfer progress bar */
 GLOBAL  int     code;           /* return/reply code for ftp command */  int     code;                   /* return/reply code for ftp command */
 GLOBAL  int     crflag;         /* if 1, strip car. rets. on ascii gets */  int     crflag;                 /* if 1, strip car. rets. on ascii gets */
 GLOBAL  int     passivemode;    /* passive mode enabled */  char    pasv[BUFSIZ];           /* passive port for proxy data connection */
 GLOBAL  int     activefallback; /* fall back to active mode if passive fails */  int     passivemode;            /* passive mode enabled */
 GLOBAL  char   *altarg;         /* argv[1] with no shell-like preprocessing  */  int     activefallback;         /* fall back to active mode if passive fails */
 GLOBAL  char    ntin[17];       /* input translation table */  char   *altarg;                 /* argv[1] with no shell-like preprocessing  */
 GLOBAL  char    ntout[17];      /* output translation table */  char    ntin[17];               /* input translation table */
 GLOBAL  char    mapin[MAXPATHLEN]; /* input map template */  char    ntout[17];              /* output translation table */
 GLOBAL  char    mapout[MAXPATHLEN]; /* output map template */  char    mapin[MAXPATHLEN];      /* input map template */
 GLOBAL  char    typename[32];   /* name of file transfer type */  char    mapout[MAXPATHLEN];     /* output map template */
 GLOBAL  int     type;           /* requested file transfer type */  char    typename[32];           /* name of file transfer type */
 GLOBAL  int     curtype;        /* current file transfer type */  int     type;                   /* requested file transfer type */
 GLOBAL  char    structname[32]; /* name of file transfer structure */  int     curtype;                /* current file transfer type */
 GLOBAL  int     stru;           /* file transfer structure */  char    structname[32];         /* name of file transfer structure */
 GLOBAL  char    formname[32];   /* name of file transfer format */  int     stru;                   /* file transfer structure */
 GLOBAL  int     form;           /* file transfer format */  char    formname[32];           /* name of file transfer format */
 GLOBAL  char    modename[32];   /* name of file transfer mode */  int     form;                   /* file transfer format */
 GLOBAL  int     mode;           /* file transfer mode */  char    modename[32];           /* name of file transfer mode */
 GLOBAL  char    bytename[32];   /* local byte size in ascii */  int     mode;                   /* file transfer mode */
 GLOBAL  int     bytesize;       /* local byte size in binary */  char    bytename[32];           /* local byte size in ascii */
 GLOBAL  int     anonftp;        /* automatic anonymous login */  int     bytesize;               /* local byte size in binary */
 GLOBAL  int     dirchange;      /* remote directory changed by cd command */  int     anonftp;                /* automatic anonymous login */
 GLOBAL  int     flushcache;     /* set HTTP cache flush headers with request */  int     dirchange;              /* remote directory changed by cd command */
 GLOBAL  int     rate_get;       /* maximum get xfer rate */  int     flushcache;             /* set HTTP cache flush headers with request */
 GLOBAL  int     rate_get_incr;  /* increment for get xfer rate */  int     rate_get;               /* maximum get xfer rate */
 GLOBAL  int     rate_put;       /* maximum put xfer rate */  int     rate_get_incr;          /* increment for get xfer rate */
 GLOBAL  int     rate_put_incr;  /* increment for put xfer rate */  int     rate_put;               /* maximum put xfer rate */
 GLOBAL  int     retry_connect;  /* seconds between retrying connection */  int     rate_put_incr;          /* increment for put xfer rate */
 GLOBAL  int     ttywidth;       /* width of tty */  int     retry_connect;          /* seconds between retrying connection */
 GLOBAL  char   *tmpdir;         /* temporary directory */  int     ttywidth;               /* width of tty */
 GLOBAL  FILE   *ttyout;         /* stdout, or stderr if retrieving to stdout */  char   *tmpdir;                 /* temporary directory */
 GLOBAL  int     epsv4;          /* use EPSV/EPRT on IPv4 connections */  FILE   *ttyout;                 /* stdout, or stderr if retrieving to stdout */
 GLOBAL  int     epsv4bad;       /* EPSV doesn't work on the current server */  int     epsv4;                  /* use EPSV/EPRT on IPv4 connections */
 GLOBAL  int     editing;        /* command line editing enabled */  
   
 #ifndef NO_EDITCOMPLETE  #ifndef NO_EDITCOMPLETE
 GLOBAL  EditLine *el;           /* editline(3) status structure */  int       editing;              /* command line editing enabled */
 GLOBAL  History  *hist;         /* editline(3) history structure */  EditLine *el;                   /* editline(3) status structure */
 GLOBAL  char     *cursor_pos;   /* cursor position we're looking for */  History  *hist;                 /* editline(3) history structure */
 GLOBAL  size_t    cursor_argc;  /* location of cursor in margv */  char     *cursor_pos;           /* cursor position we're looking for */
 GLOBAL  size_t    cursor_argo;  /* offset of cursor in margv[cursor_argc] */  size_t    cursor_argc;          /* location of cursor in margv */
   size_t    cursor_argo;          /* offset of cursor in margv[cursor_argc] */
 #endif /* !NO_EDITCOMPLETE */  #endif /* !NO_EDITCOMPLETE */
   
 GLOBAL  off_t   bytes;          /* current # of bytes read */  off_t   bytes;                  /* current # of bytes read */
 GLOBAL  off_t   filesize;       /* size of file being transferred */  off_t   filesize;               /* size of file being transferred */
 GLOBAL  char   *direction;      /* direction transfer is occurring */  char   *direction;              /* direction transfer is occurring */
 GLOBAL  off_t   restart_point;  /* offset to restart transfer */  off_t   restart_point;          /* offset to restart transfer */
   
 GLOBAL  char   *hostname;       /* name of host connected to */  char   *hostname;               /* name of host connected to */
 GLOBAL  int     unix_server;    /* server is unix, can use binary for ascii */  int     unix_server;            /* server is unix, can use binary for ascii */
 GLOBAL  int     unix_proxy;     /* proxy is unix, can use binary for ascii */  int     unix_proxy;             /* proxy is unix, can use binary for ascii */
 GLOBAL  char    remotepwd[MAXPATHLEN];  /* remote dir */  
 GLOBAL  char   *username;       /* name of user logged in as. (dynamic) */  char    *ftpport;               /* port number to use for FTP connections */
   char    *httpport;              /* port number to use for HTTP connections */
 GLOBAL  char    *ftpport;       /* port number to use for FTP connections */  char    *gateport;              /* port number to use for gateftp connections */
 GLOBAL  char    *httpport;      /* port number to use for HTTP connections */  
 GLOBAL  char    *gateport;      /* port number to use for gateftp connections */  const char      *ftpproxy;      /* ftp:// proxy server */
   const char      *httpproxy;     /* http:// proxy server */
 GLOBAL  char   *outfile;        /* filename to output URLs to */  const char      *no_proxy;      /* list of domains not to proxy */
 GLOBAL  int     restartautofetch; /* restart auto-fetch */  
   char   *outfile;                /* filename to output URLs to */
 GLOBAL  sigjmp_buf toplevel;    /* non-local goto stuff for cmd scanner */  int     restartautofetch;       /* restart auto-fetch */
   
 GLOBAL  char    line[FTPBUFLEN]; /* input line buffer */  jmp_buf toplevel;               /* non-local goto stuff for cmd scanner */
 GLOBAL  char    *stringbase;    /* current scan point in line buffer */  
 GLOBAL  char    argbuf[FTPBUFLEN]; /* argument storage buffer */  char    line[FTPBUFLEN];        /* input line buffer */
 GLOBAL  char    *argbase;       /* current storage point in arg buffer */  char    *stringbase;            /* current scan point in line buffer */
 GLOBAL  StringList *marg_sl;    /* stringlist containing margv */  char    argbuf[FTPBUFLEN];      /* argument storage buffer */
 GLOBAL  int     margc;          /* count of arguments on input line */  char    *argbase;               /* current storage point in arg buffer */
 #define margv (marg_sl->sl_str) /* args parsed from input line */  StringList *marg_sl;            /* stringlist containing margv */
 GLOBAL  int     cpend;          /* flag: if != 0, then pending server reply */  int     margc;                  /* count of arguments on input line */
 GLOBAL  int     mflag;          /* flag: if != 0, then active multi command */  #define margv (marg_sl->sl_str) /* args parsed from input line */
   int     cpend;                  /* flag: if != 0, then pending server reply */
 GLOBAL  int     options;        /* used during socket creation */  int     mflag;                  /* flag: if != 0, then active multi command */
   
 GLOBAL  int     sndbuf_size;    /* socket send buffer size */  
 GLOBAL  int     rcvbuf_size;    /* socket receive buffer size */  
   
 GLOBAL  int     macnum;         /* number of defined macros */  
 GLOBAL  struct macel macros[16];  
 GLOBAL  char    macbuf[4096];  
   
 GLOBAL  char     home[MAXPATHLEN];      /* home directory (for lcd) */  
 GLOBAL  char     reply_string[BUFSIZ];  /* first line of previous reply */  
   
 GLOBAL  FILE    *cin;  int     options;                /* used during socket creation */
 GLOBAL  FILE    *cout;  
 GLOBAL  int      data;  
   
 extern  struct cmd      cmdtab[];  int     sndbuf_size;            /* socket send buffer size */
 extern  struct option   optiontab[];  int     rcvbuf_size;            /* socket receive buffer size */
   
 extern  char    *__progname;            /* from crt0.o */  /*
    * Format of command table.
    */
   struct cmd {
           char    *c_name;        /* name of command */
           char    *c_help;        /* help string */
           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 NO_EDITCOMPLETE
           char    *c_complete;    /* context sensitive completion list */
   #endif /* !NO_EDITCOMPLETE */
           void    (*c_handler) __P((int, char **)); /* function to call */
   };
   
   struct macel {
           char mac_name[9];       /* macro name */
           char *mac_start;        /* start of macro in macbuf */
           char *mac_end;          /* end of macro in macbuf */
   };
   
 #define EMPTYSTRING(x)  ((x) == NULL || (*(x) == '\0'))  int     macnum;                 /* number of defined macros */
 #define FREEPTR(x)      if ((x) != NULL) { free(x); (x) = NULL; }  struct macel macros[16];
   char    macbuf[4096];

Legend:
Removed from v.1.36.2.1  
changed lines
  Added in v.1.37

CVSweb <webmaster@jp.NetBSD.org>