home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / misc / volume40 / ncftp / part06 < prev    next >
Encoding:
Text File  |  1993-11-02  |  8.4 KB  |  309 lines

  1. Newsgroups: comp.sources.misc
  2. From: mgleason@cse.unl.edu (Mike Gleason)
  3. Subject: v40i081:  ncftp - Alternative User Interface for FTP, v1.6, Part06/06
  4. Message-ID: <1993Nov2.232510.6623@sparky.sterling.com>
  5. X-Md4-Signature: d12a29156f3bfb1ae9206ee269e30dc6
  6. Keywords: ncftp
  7. Sender: kent@sparky.sterling.com (Kent Landfield)
  8. Organization: NCEMRSoft
  9. Date: Tue, 2 Nov 1993 23:25:10 GMT
  10. Approved: kent@sparky.sterling.com
  11.  
  12. Submitted-by: mgleason@cse.unl.edu (Mike Gleason)
  13. Posting-number: Volume 40, Issue 81
  14. Archive-name: ncftp/part06
  15. Environment: UNIX, ANSI-C, !SVR4
  16. Supersedes: ncftp: Volume 39, Issue 53-57
  17.  
  18. #! /bin/sh
  19. # This is a shell archive.  Remove anything before this line, then feed it
  20. # into a shell via "sh file" or similar.  To overwrite existing files,
  21. # type "sh file -c".
  22. # Contents:  copyright.h ftprc.h main.h open.h set.h
  23. # Wrapped by kent@sparky on Mon Nov  1 16:19:18 1993
  24. PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:/usr/lbin:$PATH ; export PATH
  25. echo If this archive is complete, you will see the following message:
  26. echo '          "shar: End of archive 6 (of 6)."'
  27. if test -f 'copyright.h' -a "${1}" != "-c" ; then 
  28.   echo shar: Will not clobber existing file \"'copyright.h'\"
  29. else
  30.   echo shar: Extracting \"'copyright.h'\" \(1048 characters\)
  31.   sed "s/^X//" >'copyright.h' <<'END_OF_FILE'
  32. X/* Copyright.h */
  33. X
  34. X/*  $RCSfile: copyright.h,v $
  35. X *  $Revision: 14020.12 $
  36. X *  $Date: 93/06/02 13:43:03 $
  37. X */
  38. X
  39. X/*
  40. X * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
  41. X * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
  42. X * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  43. X *
  44. X * Copyright (c) 1992, 1993 Mike Gleason, NCEMRSoft.
  45. X * Copyright (c) 1985, 1989 Regents of the University of California.
  46. X * All rights reserved.
  47. X *
  48. X * Redistribution and use in source and binary forms are permitted provided
  49. X * that: (1) source distributions retain this entire copyright notice and
  50. X * comment, and (2) distributions may not be sold for profit on physicaical
  51. X * media such as disks, tapes, and CD-ROMS, without expressed written
  52. X * permission.
  53. X */
  54. X
  55. X#ifdef _main_c_
  56. X#ifndef lint
  57. Xstatic char copyright[] = "@(#) Copyright (c) 1992, 1993 by NCEMRSoft and Copyright (c) 1985, 1989 Regents of the University of California.\n All rights reserved.\n";
  58. X#endif /* not lint */
  59. X#endif /* _main_c_ */
  60. X
  61. X/* eof copyright.h */
  62. END_OF_FILE
  63.   if test 1048 -ne `wc -c <'copyright.h'`; then
  64.     echo shar: \"'copyright.h'\" unpacked with wrong size!
  65.   fi
  66.   # end of 'copyright.h'
  67. fi
  68. if test -f 'ftprc.h' -a "${1}" != "-c" ; then 
  69.   echo shar: Will not clobber existing file \"'ftprc.h'\"
  70. else
  71.   echo shar: Extracting \"'ftprc.h'\" \(931 characters\)
  72.   sed "s/^X//" >'ftprc.h' <<'END_OF_FILE'
  73. X/* ftprc.h */
  74. X
  75. X#ifndef _ftprc_h_
  76. X#define _ftprc_h_
  77. X
  78. X/*  $RCSfile: ftprc.h,v $
  79. X *  $Revision: 14020.11 $
  80. X *  $Date: 93/05/21 05:45:31 $
  81. X */
  82. X
  83. X#define NETRC "netrc"
  84. X#define FTPRC "ncftprc"
  85. X
  86. X#define RC_DELIM " \n\t,"
  87. X
  88. Xtypedef struct site *siteptr;
  89. Xtypedef struct site {
  90. X    char *name;            /* name (or IP address) of site */
  91. X    siteptr next;
  92. X} site;
  93. X
  94. Xtypedef struct recentsite {
  95. X    char *name;            /* name (or IP address) of site */
  96. X    char *dir;            /* directory we were in last time we called. */
  97. X    time_t lastcall;    /* when this site was called last. */
  98. X} recentsite;
  99. X
  100. Xint thrash_rc(void);
  101. Xvoid AddNewSitePtr(char *word);
  102. Xint ruserpass2(char *host, char **user, char **pass, char **acct);
  103. Xvoid GetFullSiteName(char *host, char *lastdir);
  104. Xvoid ReadRecentSitesFile(void);
  105. Xvoid WriteRecentSitesFile(void);
  106. Xvoid AddRecentSite(char *host, char *lastdir);
  107. Xvoid UpdateRecentSitesList(char *host, char *lastdir);
  108. Xvoid PrintSiteList(void);
  109. X
  110. X#endif
  111. X/* eof */
  112. END_OF_FILE
  113.   if test 931 -ne `wc -c <'ftprc.h'`; then
  114.     echo shar: \"'ftprc.h'\" unpacked with wrong size!
  115.   fi
  116.   # end of 'ftprc.h'
  117. fi
  118. if test -f 'main.h' -a "${1}" != "-c" ; then 
  119.   echo shar: Will not clobber existing file \"'main.h'\"
  120. else
  121.   echo shar: Extracting \"'main.h'\" \(980 characters\)
  122.   sed "s/^X//" >'main.h' <<'END_OF_FILE'
  123. X/* main.h */
  124. X
  125. X#ifndef _main_h_
  126. X#define _main_h_
  127. X
  128. X/*  $RCSfile: main.h,v $
  129. X *  $Revision: 14020.12 $
  130. X *  $Date: 93/05/21 05:45:33 $
  131. X */
  132. X
  133. Xstruct userinfo {
  134. X    str32   username;
  135. X    string  homedir;
  136. X    string  shell;
  137. X    string  hostname;
  138. X    int        uid;
  139. X};
  140. X
  141. Xvoid intr SIG_PARAMS;
  142. Xint getuserinfo(void);
  143. Xint init_arrays(void);
  144. Xvoid init_transfer_buffer(void);
  145. Xvoid init_prompt(void);
  146. Xvoid lostpeer SIG_PARAMS;
  147. Xvoid cmdscanner(int top);
  148. Xchar *strprompt(void);
  149. Xvoid makeargv(void);
  150. Xchar *slurpstring(void);
  151. Xint help(int argc, char **argv);
  152. Xvoid trim_log(void);
  153. Xint CheckNewMail(void);
  154. X
  155. X#ifdef CURSES
  156. X    void tcap_put(char *cap);
  157. X    void termcap_init(void);
  158. X    int termcap_get(char **dest, char *attr);
  159. X#    ifndef TERMH /* <term.h> would take care of this. */
  160. X#        ifdef NO_CONST
  161. X            extern char *tgetstr(char *, char **);
  162. X#        else
  163. X            extern char *tgetstr(const char *, char **);
  164. X#        endif
  165. X#    endif    /* TERMH */
  166. X#endif    /* CURSES */
  167. X
  168. X/* Should be in a 'tips.h,' but... */
  169. Xvoid PrintTip(void);
  170. X
  171. X#endif    /* _main_h_ */
  172. X
  173. END_OF_FILE
  174.   if test 980 -ne `wc -c <'main.h'`; then
  175.     echo shar: \"'main.h'\" unpacked with wrong size!
  176.   fi
  177.   # end of 'main.h'
  178. fi
  179. if test -f 'open.h' -a "${1}" != "-c" ; then 
  180.   echo shar: Will not clobber existing file \"'open.h'\"
  181. else
  182.   echo shar: Extracting \"'open.h'\" \(1178 characters\)
  183.   sed "s/^X//" >'open.h' <<'END_OF_FILE'
  184. X/* open.h */
  185. X
  186. X#ifndef _open_h_
  187. X#define _open_h_ 1
  188. X
  189. X/* Variables for Open() that can be changed from the command line. */
  190. Xtypedef struct OpenOptions {
  191. X    int                openmode;
  192. X    int                ignore_rc;
  193. X    unsigned int    port;
  194. X    int                redial_delay;
  195. X    int                max_dials;
  196. X    int                ftpcat;
  197. X    Hostname        hostname;
  198. X    longstring        cdpath;
  199. X    longstring        colonmodepath;
  200. X} OpenOptions;
  201. X
  202. X/* Open modes. */
  203. X#define openImplicitAnon 1
  204. X#define openImplicitUser 4
  205. X#define openExplicitAnon 3
  206. X#define openExplicitUser 2
  207. X
  208. X#define ISUSEROPEN(a) ((a==openImplicitUser)||(a==openExplicitUser))
  209. X#define ISANONOPEN(a) (!ISUSEROPEN(a))
  210. X#define ISEXPLICITOPEN(a) ((a==openExplicitAnon)||(a==openExplicitUser))
  211. X#define ISIMPLICITOPEN(a) (!ISEXPLICITOPEN(a))
  212. X
  213. X/* ftpcat modes. */
  214. X#define NO_FTPCAT    0
  215. X#define FTPCAT        1
  216. X#define FTPMORE        2
  217. X
  218. X/* Protos: */
  219. Xvoid InitOpenOptions(OpenOptions *openopt);
  220. Xint GetOpenOptions(int argc, char **argv, OpenOptions *openopt);
  221. Xint CheckForColonMode(OpenOptions *openopt, int *login_verbosity);
  222. Xint HookupToRemote(OpenOptions *openopt);
  223. Xvoid CheckRemoteSystemType(int);
  224. Xvoid ColonMode(OpenOptions *openopt);
  225. Xint Open(OpenOptions *openopt);
  226. Xint cmdOpen(int argc, char **argv);
  227. X
  228. X#endif    /* _open_h_ */
  229. END_OF_FILE
  230.   if test 1178 -ne `wc -c <'open.h'`; then
  231.     echo shar: \"'open.h'\" unpacked with wrong size!
  232.   fi
  233.   # end of 'open.h'
  234. fi
  235. if test -f 'set.h' -a "${1}" != "-c" ; then 
  236.   echo shar: Will not clobber existing file \"'set.h'\"
  237. else
  238.   echo shar: Extracting \"'set.h'\" \(1029 characters\)
  239.   sed "s/^X//" >'set.h' <<'END_OF_FILE'
  240. X/* Set.h */
  241. X
  242. X#ifndef _set_h_
  243. X#define _set_h_
  244. X
  245. X/*  $RCSfile: set.h,v $
  246. X *  $Revision: 14020.11 $
  247. X *  $Date: 93/06/26 06:21:32 $
  248. X */
  249. X
  250. X/* Variable types. */
  251. X#define INT        1
  252. X#define LONG    2
  253. X#define STR        3
  254. X#define BOOL    4
  255. X
  256. Xtypedef void (*setvarproc)(char *, int);
  257. Xstruct var {
  258. X    char            *name;
  259. X    short            nmlen;
  260. X    short            type;
  261. X    short            conn_required;
  262. X    void            *var;
  263. X    setvarproc        proc;
  264. X};
  265. X
  266. X#define VARENTRY(n,t,c,v,p)    { (n), (short)(sizeof(n) - 1), (t), (c), (v), (setvarproc)(p) }
  267. X#define NVARS ((int) (sizeof(vars)/sizeof(struct var)))
  268. X
  269. Xvoid set_prompt(char *new, int unset);
  270. Xvoid set_log(char *fname, int unset);
  271. Xvoid set_ldir(char *ldir, int unset);
  272. X#ifdef GATEWAY
  273. Xvoid set_gateway(char *, int);
  274. Xvoid set_gatelogin(char *, int);
  275. X#endif
  276. Xvoid set_pager(char *new, int unset);
  277. Xvoid set_verbose(char *new, int unset);
  278. Xvoid set_type(char *newtype, int unset);
  279. Xstruct var *match_var(char *varname);
  280. Xvoid show_var(struct var *v);
  281. Xvoid show(char *varname);
  282. Xint do_show(int argc, char **argv);
  283. Xint set(int argc, char **argv);
  284. X
  285. X#endif    /* _set_h_ */
  286. END_OF_FILE
  287.   if test 1029 -ne `wc -c <'set.h'`; then
  288.     echo shar: \"'set.h'\" unpacked with wrong size!
  289.   fi
  290.   # end of 'set.h'
  291. fi
  292. echo shar: End of archive 6 \(of 6\).
  293. cp /dev/null ark6isdone
  294. MISSING=""
  295. for I in 1 2 3 4 5 6 ; do
  296.     if test ! -f ark${I}isdone ; then
  297.     MISSING="${MISSING} ${I}"
  298.     fi
  299. done
  300. if test "${MISSING}" = "" ; then
  301.     echo You have unpacked all 6 archives.
  302.     rm -f ark[1-9]isdone
  303. else
  304.     echo You still must unpack the following archives:
  305.     echo "        " ${MISSING}
  306. fi
  307. exit 0
  308. exit 0 # Just in case...
  309.