Annotation of 43BSDReno/usr.bin/ftp/ftp_var.h, revision 1.1

1.1     ! root        1: /*
        !             2:  * Copyright (c) 1985, 1989 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: (1) source distributions retain this entire copyright
        !             7:  * notice and comment, and (2) distributions including binaries display
        !             8:  * the following acknowledgement:  ``This product includes software
        !             9:  * developed by the University of California, Berkeley and its contributors''
        !            10:  * in the documentation or other materials provided with the distribution
        !            11:  * and in all advertising materials mentioning features or use of this
        !            12:  * software. Neither the name of the University nor the names of its
        !            13:  * contributors may be used to endorse or promote products derived
        !            14:  * from this software without specific prior written permission.
        !            15:  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
        !            16:  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
        !            17:  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
        !            18:  *
        !            19:  *     @(#)ftp_var.h   5.9 (Berkeley) 6/1/90
        !            20:  */
        !            21: 
        !            22: /*
        !            23:  * FTP global variables.
        !            24:  */
        !            25: 
        !            26: /*
        !            27:  * Options and other state info.
        !            28:  */
        !            29: int    trace;                  /* trace packets exchanged */
        !            30: int    hash;                   /* print # for each buffer transferred */
        !            31: int    sendport;               /* use PORT cmd for each data connection */
        !            32: int    verbose;                /* print messages coming back from server */
        !            33: int    connected;              /* connected to server */
        !            34: int    fromatty;               /* input is from a terminal */
        !            35: int    interactive;            /* interactively prompt on m* cmds */
        !            36: int    debug;                  /* debugging level */
        !            37: int    bell;                   /* ring bell on cmd completion */
        !            38: int    doglob;                 /* glob local file names */
        !            39: int    autologin;              /* establish user account on connection */
        !            40: int    proxy;                  /* proxy server connection active */
        !            41: int    proxflag;               /* proxy connection exists */
        !            42: int    sunique;                /* store files on server with unique name */
        !            43: int    runique;                /* store local files with unique name */
        !            44: int    mcase;                  /* map upper to lower case for mget names */
        !            45: int    ntflag;                 /* use ntin ntout tables for name translation */
        !            46: int    mapflag;                /* use mapin mapout templates on file names */
        !            47: int    code;                   /* return/reply code for ftp command */
        !            48: int    crflag;                 /* if 1, strip car. rets. on ascii gets */
        !            49: char   pasv[64];               /* passive port for proxy data connection */
        !            50: char   *altarg;                /* argv[1] with no shell-like preprocessing  */
        !            51: char   ntin[17];               /* input translation table */
        !            52: char   ntout[17];              /* output translation table */
        !            53: #include <sys/param.h>
        !            54: char   mapin[MAXPATHLEN];      /* input map template */
        !            55: char   mapout[MAXPATHLEN];     /* output map template */
        !            56: char   typename[32];           /* name of file transfer type */
        !            57: int    type;                   /* requested file transfer type */
        !            58: int    curtype;                /* current file transfer type */
        !            59: char   structname[32];         /* name of file transfer structure */
        !            60: int    stru;                   /* file transfer structure */
        !            61: char   formname[32];           /* name of file transfer format */
        !            62: int    form;                   /* file transfer format */
        !            63: char   modename[32];           /* name of file transfer mode */
        !            64: int    mode;                   /* file transfer mode */
        !            65: char   bytename[32];           /* local byte size in ascii */
        !            66: int    bytesize;               /* local byte size in binary */
        !            67: 
        !            68: char   *hostname;              /* name of host connected to */
        !            69: int    unix_server;            /* server is unix, can use binary for ascii */
        !            70: int    unix_proxy;             /* proxy is unix, can use binary for ascii */
        !            71: 
        !            72: struct servent *sp;            /* service spec for tcp/ftp */
        !            73: 
        !            74: #include <setjmp.h>
        !            75: jmp_buf        toplevel;               /* non-local goto stuff for cmd scanner */
        !            76: 
        !            77: char   line[200];              /* input line buffer */
        !            78: char   *stringbase;            /* current scan point in line buffer */
        !            79: char   argbuf[200];            /* argument storage buffer */
        !            80: char   *argbase;               /* current storage point in arg buffer */
        !            81: int    margc;                  /* count of arguments on input line */
        !            82: char   *margv[20];             /* args parsed from input line */
        !            83: int     cpend;                  /* flag: if != 0, then pending server reply */
        !            84: int    mflag;                  /* flag: if != 0, then active multi command */
        !            85: 
        !            86: int    options;                /* used during socket creation */
        !            87: 
        !            88: /*
        !            89:  * Format of command table.
        !            90:  */
        !            91: struct cmd {
        !            92:        char    *c_name;        /* name of command */
        !            93:        char    *c_help;        /* help string */
        !            94:        char    c_bell;         /* give bell when command completes */
        !            95:        char    c_conn;         /* must be connected to use command */
        !            96:        char    c_proxy;        /* proxy server may execute */
        !            97:        int     (*c_handler)(); /* function to call */
        !            98: };
        !            99: 
        !           100: struct macel {
        !           101:        char mac_name[9];       /* macro name */
        !           102:        char *mac_start;        /* start of macro in macbuf */
        !           103:        char *mac_end;          /* end of macro in macbuf */
        !           104: };
        !           105: 
        !           106: int macnum;                    /* number of defined macros */
        !           107: struct macel macros[16];
        !           108: char macbuf[4096];
        !           109: 
        !           110: extern char *tail();
        !           111: extern char *index();
        !           112: extern char *rindex();
        !           113: extern char *remglob();
        !           114: extern int errno;
        !           115: extern char *mktemp();
        !           116: extern char *strncpy();
        !           117: extern char *strncat();
        !           118: extern char *strcat();
        !           119: extern char *strcpy();

unix.superglobalmegacorp.com

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