home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / misc / volume33 / archie / part07 < prev    next >
Encoding:
Text File  |  1992-11-10  |  41.9 KB  |  1,532 lines

  1. Newsgroups: comp.sources.misc
  2. From: brendan@cygnus.com (Brendan Kehoe)
  3. Subject:  v33i056:  archie - A client to query the Archie FTP databases, v1.4.1, Part07/07
  4. Message-ID: <1992Nov5.210914.26656@sparky.imd.sterling.com>
  5. X-Md4-Signature: 5d1a10e65d90e74b9e51e622a4dabbf4
  6. Date: Thu, 5 Nov 1992 21:09:14 GMT
  7. Approved: kent@sparky.imd.sterling.com
  8.  
  9. Submitted-by: brendan@cygnus.com (Brendan Kehoe)
  10. Posting-number: Volume 33, Issue 56
  11. Archive-name: archie/part07
  12. Environment: UNIX, VMS, DOS
  13. Supersedes: archie: Volume 27, Issue 79-84
  14.  
  15. #! /bin/sh
  16. # This is a shell archive.  Remove anything before this line, then feed it
  17. # into a shell via "sh file" or similar.  To overwrite existing files,
  18. # type "sh file -c".
  19. # Contents:  INSTALL Prospero archie.h atalloc.c get_pauth.c
  20. #   makefile.cut makefile.dos makefile.nfs makefile.os2 patchlevel.h
  21. #   pc-archie.nfs pcompat.h pprot.h ptalloc.c rdgram.h regex.h
  22. #   stcopy.c vl_comp.c vlalloc.c vms.h vms/fd.h vms/multi.opt
  23. #   vms/pseudos.h vms/socket.h vms/time.h vms/types.h vms/ucx.opt
  24. #   vms/woll.opt
  25. # Wrapped by kent@sparky on Thu Nov  5 12:53:10 1992
  26. PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:/usr/lbin ; export PATH
  27. echo If this archive is complete, you will see the following message:
  28. echo '          "shar: End of archive 7 (of 7)."'
  29. if test -f 'INSTALL' -a "${1}" != "-c" ; then 
  30.   echo shar: Will not clobber existing file \"'INSTALL'\"
  31. else
  32.   echo shar: Extracting \"'INSTALL'\" \(1590 characters\)
  33.   sed "s/^X//" >'INSTALL' <<'END_OF_FILE'
  34. X[Version 1.4.1]
  35. X
  36. X This is the minimal set of things you need to build an Archie client
  37. Xthat takes advantage of the Prospero system.  It is derived from the
  38. X4.2beta version of Prospero, currently available as the file prospero.tar.Z
  39. Xon the host cs.washington.edu.  See the README in here for the full scoop.
  40. X
  41. X * To make the client under Unix:
  42. X   * edit the Makefile, changing CC, OPTIONS, LDFLAGS, and RM if
  43. X     necessary (odds are you won't have to do this..see below)
  44. X   * edit the DEFINEs as necessary
  45. X   * if archie.sura.net isn't "close" to you netwise, please edit
  46. X     ARCHIE in the Makefile appropriately.  This is particularly important
  47. X     if you're not in the US.  You don't need to touch archie.h anymore.
  48. X   * type `make'
  49. X
  50. X I've tried to make this as portable as possible.  I'd encourage you
  51. Xto try doing a "make" without any changes to the Makefile, and see how
  52. Xit goes.  If it pukes, and you have to define something, please drop
  53. Xme a line---my goal is for anybody to just type "make" and not have to
  54. Xworry about things like what functions their system supports.
  55. X
  56. X * To make the client under VMS, just type @MAKE and it'll ask you
  57. X   which of the available Archie servers is closest.  That's it!
  58. X   The file `archie.hlp' is a VMS help file which can be added to your
  59. X   system (or private) help library.
  60. X
  61. X * To make the client under MSDOS or OS/2:
  62. X   * with FTP Software's PC/TCP for MSDOS (version 2.1 or higher) and
  63. X     OS/2 (version 1.1 and higher), use makefile.os2 or makefile.dos
  64. X   * with CUTCP (NCSA telnet), use makefile.cut
  65. X
  66. X-- Brendan Kehoe (brendan@cygnus.com)
  67. END_OF_FILE
  68.   if test 1590 -ne `wc -c <'INSTALL'`; then
  69.     echo shar: \"'INSTALL'\" unpacked with wrong size!
  70.   fi
  71.   # end of 'INSTALL'
  72. fi
  73. if test -f 'Prospero' -a "${1}" != "-c" ; then 
  74.   echo shar: Will not clobber existing file \"'Prospero'\"
  75. else
  76.   echo shar: Extracting \"'Prospero'\" \(1409 characters\)
  77.   sed "s/^X//" >'Prospero' <<'END_OF_FILE'
  78. XProspero also allows users to access Archie as if it were part of a
  79. Xfile system.  Here is an example of how Prospero can be used to access
  80. XArchie in this manner.
  81. X
  82. X  Script started on Mon Jul  1 22:36:42 1991
  83. X  % source /home/ftp/archie/pfs/bin/vfsetup.source
  84. X  % vfsetup guest
  85. X  % venable
  86. X  % cd /archive-sites/archie/regex
  87. X  % cd prospero (This command specifies the query)
  88. X  % ls -l
  89. X  total 0
  90. X  -r--r--r--   0 -               0 -            info-prospero.arc
  91. X  dr-xr-xr-x   0 -               0 -            prospero
  92. X  dr-xr-xr-x   0 -               0 -            prospero-papers
  93. X  -r--r--r--   0 -               0 -            prospero.arc
  94. X  -r--r--r--   0 -               0 -            prospero.tar.Z
  95. X  (Note that the "vls" command could have been used)
  96. X  (to show where the files were actually stored    )
  97. X  % ls prospero (list a result if it is a directory)
  98. X  prog.tar.Z      prospero.tar.Z
  99. X  % cat info-prospero.arc  (The file is automatically retrieved and displayed)
  100. X  >From bcn@n1dmm  Tue Dec  4 02:33:36 1990
  101. X  Received: from n1dmm.cs.washington.edu by june.cs.washington.edu (5.64/7.0jh)
  102. X          id AA24763; Tue, 4 Dec 90 02:33:36 -0800
  103. X  Received: by n1dmm.cs.washington.edu (5.64/7.0h)
  104. X          id AA08497; Tue, 4 Dec 90 02:33:31 -0800
  105. X  Date: Tue, 4 Dec 90 02:33:31 -0800
  106. X  From: bcn@cs.washington.edu (Clifford Neuman)
  107. X  ...
  108. X  % vdisable
  109. X  % exit
  110. X  script done on Mon Jul  1 22:39:33 1991
  111. END_OF_FILE
  112.   if test 1409 -ne `wc -c <'Prospero'`; then
  113.     echo shar: \"'Prospero'\" unpacked with wrong size!
  114.   fi
  115.   # end of 'Prospero'
  116. fi
  117. if test -f 'archie.h' -a "${1}" != "-c" ; then 
  118.   echo shar: Will not clobber existing file \"'archie.h'\"
  119. else
  120.   echo shar: Extracting \"'archie.h'\" \(2294 characters\)
  121.   sed "s/^X//" >'archie.h' <<'END_OF_FILE'
  122. X/*
  123. X * archie.h : Definitions for the programmatic Prospero interface to Archie
  124. X *
  125. X *     Written by Brendan Kehoe (brendan@cygnus.com),
  126. X *                George Ferguson (ferguson@cs.rochester.edu), and
  127. X *                Clifford Neuman (bcn@isi.edu).
  128. X */
  129. X
  130. X/* You can't touch this.  */
  131. X#ifndef XARCHIE
  132. X# define ARCHIES    "archie.ans.net (USA [NY])","archie.rutgers.edu (USA [NJ])","archie.sura.net (USA [MD])","archie.unl.edu (USA [NE])","archie.mcgill.ca (Canada)","archie.funet.fi (Finland/Mainland Europe)","archie.au (Australia)","archie.doc.ic.ac.uk (Great Britain/Ireland)","archie.wide.ad.jp (Japan)","archie.ncu.edu.tw (Taiwan)"
  133. X# define NARCHIES    10
  134. X#endif
  135. X
  136. X/*
  137. X * Default value for max hits.  Note that this is normally different
  138. X * for different client implementations.  Doing so makes it easier to
  139. X * collect statistics on the use of the various clients.
  140. X */
  141. X#ifdef VMS
  142. X# define    MAX_HITS    98    /* VMS Client */
  143. X#else
  144. X# ifdef XARCHIE
  145. X#  define    MAX_HITS    99    /* X Client */
  146. X# else
  147. X#  define    MAX_HITS    95    /* Normal client */
  148. X# endif
  149. X#endif
  150. X
  151. X/*
  152. X * CLIENT_VERSION may be used to identify the version of the client if 
  153. X * distributed separately from the Prospero distribution.  The version
  154. X * command should then identify both the client version and the Prospero
  155. X * version identifiers.   
  156. X */
  157. X#ifdef XARCHIE
  158. X# define CLIENT_VERSION    "1.3-X"
  159. X#else
  160. X# define CLIENT_VERSION "1.4.1"
  161. X#endif
  162. X
  163. X/* The different kinds of queries we can make.  */
  164. Xtypedef enum query_type
  165. X{
  166. X  NONE = '\0', EXACT = '=', REGEXP = 'R',
  167. X  SUBSTRING = 'S', SUBSTRING_CASE = 'C'
  168. X} Query;
  169. X
  170. X/* Procedures from user/aquery.c */
  171. Xextern VLINK archie_query (); 
  172. X
  173. X/* defcmplink(p,q) and invdatecmplink(p,q)                             */
  174. Xextern int defcmplink();    /* Compare by host then by filename    */
  175. Xextern int invdatecmplink();    /* Compare links inverted by date      */
  176. X
  177. X/* Definitions for the comparison procedures                           */
  178. X#define AQ_DEFCMP    defcmplink
  179. X#define AQ_INVDATECMP    invdatecmplink
  180. X
  181. X/* Flags                                                               */
  182. X#define AQ_NOSORT    0x01    /* Don't sort                          */
  183. X#define AQ_NOTRANS    0x02    /* Don't translate Archie responses    */
  184. X
  185. X/* To keep the code clean (hah!). */
  186. X#ifdef VMS
  187. X# define ERROR_EXIT    SS$_NORMAL
  188. X#else
  189. X# define ERROR_EXIT    1
  190. X#endif
  191. END_OF_FILE
  192.   if test 2294 -ne `wc -c <'archie.h'`; then
  193.     echo shar: \"'archie.h'\" unpacked with wrong size!
  194.   fi
  195.   # end of 'archie.h'
  196. fi
  197. if test -f 'atalloc.c' -a "${1}" != "-c" ; then 
  198.   echo shar: Will not clobber existing file \"'atalloc.c'\"
  199. else
  200.   echo shar: Extracting \"'atalloc.c'\" \(1796 characters\)
  201.   sed "s/^X//" >'atalloc.c' <<'END_OF_FILE'
  202. X/*
  203. X * Copyright (c) 1989, 1990 by the University of Washington
  204. X *
  205. X * For copying and distribution information, please see the file
  206. X * <copyright.h>.
  207. X */
  208. X
  209. X#include <stdio.h>
  210. X
  211. X#include <pfs.h>
  212. X#include <pmachine.h> /* for correct definition of ZERO */
  213. X
  214. Xstatic PATTRIB    lfree = NULL;
  215. Xint        pattrib_count = 0;
  216. Xint        pattrib_max = 0;
  217. X
  218. X/*
  219. X * atalloc - allocate and initialize vlink structure
  220. X *
  221. X *    ATALLOC returns a pointer to an initialized structure of type
  222. X *    PATTRIB.  If it is unable to allocate such a structure, it
  223. X *    returns NULL.
  224. X */
  225. XPATTRIB
  226. Xatalloc()
  227. X    {
  228. X    PATTRIB    at;
  229. X    if(lfree) {
  230. X        at = lfree;
  231. X        lfree = lfree->next;
  232. X    }
  233. X    else {
  234. X        at = (PATTRIB) malloc(sizeof(PATTRIB_ST));
  235. X        if (!at) return(NULL);
  236. X        pattrib_max++;
  237. X    }
  238. X
  239. X    pattrib_count++;
  240. X
  241. X    ZERO(at);
  242. X    /* Initialize and fill in default values; all items are
  243. X       0 [or NULL] save precedence */
  244. X    at->precedence = ATR_PREC_OBJECT;
  245. X
  246. X    return(at);
  247. X    }
  248. X
  249. X/*
  250. X * atfree - free a PATTRIB structure
  251. X *
  252. X *    ATFREE takes a pointer to a PATTRRIB structure and adds it to
  253. X *    the free list for later reuse.
  254. X */
  255. Xvoid
  256. Xatfree(at)
  257. X    PATTRIB    at;
  258. X    {
  259. X    if(at->aname) stfree(at->aname);
  260. X
  261. X    if((strcmp(at->avtype,"ASCII") == 0) && at->value.ascii) 
  262. X        stfree(at->value.ascii);
  263. X    if((strcmp(at->avtype,"LINK") == 0) && at->value.link) 
  264. X        vlfree(at->value.link);
  265. X    
  266. X    if(at->avtype) stfree(at->avtype);
  267. X
  268. X    at->next = lfree;
  269. X    at->previous = NULL;
  270. X    lfree = at;
  271. X    pattrib_count--;
  272. X    }
  273. X
  274. X/*
  275. X * atlfree - free a PATTRIB structure
  276. X *
  277. X *    ATLFREE takes a pointer to a PATTRIB structure frees it and any linked
  278. X *    PATTRIB structures.  It is used to free an entrie list of PATTRIB
  279. X *    structures.
  280. X */
  281. Xvoid
  282. Xatlfree(at)
  283. X    PATTRIB    at;
  284. X    {
  285. X    PATTRIB    nxt;
  286. X
  287. X    while(at != NULL) {
  288. X        nxt = at->next;
  289. X        atfree(at);
  290. X        at = nxt;
  291. X    }
  292. X    }
  293. X
  294. END_OF_FILE
  295.   if test 1796 -ne `wc -c <'atalloc.c'`; then
  296.     echo shar: \"'atalloc.c'\" unpacked with wrong size!
  297.   fi
  298.   # end of 'atalloc.c'
  299. fi
  300. if test -f 'get_pauth.c' -a "${1}" != "-c" ; then 
  301.   echo shar: Will not clobber existing file \"'get_pauth.c'\"
  302. else
  303.   echo shar: Extracting \"'get_pauth.c'\" \(2063 characters\)
  304.   sed "s/^X//" >'get_pauth.c' <<'END_OF_FILE'
  305. X/*
  306. X * Copyright (c) 1989, 1990 by the University of Washington
  307. X *
  308. X * For copying and distribution information, please see the file
  309. X * <copyright.h>.
  310. X */
  311. X
  312. X#include <stdio.h>
  313. X#ifndef VMS
  314. X# include <sys/types.h> /* this may/will define FD_SET etc */
  315. X# include <pmachine.h>
  316. X#endif
  317. X
  318. X#ifdef NEED_STRING_H
  319. X# include <string.h>
  320. X#else
  321. X# include <strings.h>
  322. X#endif
  323. X
  324. X#ifndef VMS
  325. X# if defined(MSDOS) && !defined(OS2) && !defined(PCNFS)
  326. X#  ifndef CUTCP
  327. X#   include <rwconf.h>
  328. X#  endif
  329. X# else
  330. X#  include <pwd.h>
  331. X# endif
  332. X#else
  333. X# include <jpidef.h>
  334. X# include <vms.h>
  335. X#endif
  336. X
  337. X#include <pcompat.h>
  338. X#include <pauthent.h>
  339. X
  340. XPAUTH
  341. Xget_pauth(type)
  342. X    int        type;
  343. X    {
  344. X    static PAUTH_ST   no_auth_st;
  345. X    static PAUTH          no_auth = NULL;
  346. X#if !defined(VMS) && !defined(MSDOS) || defined(OS2) || defined(PCNFS)
  347. X    struct passwd *whoiampw;
  348. X#else
  349. X    char username[13];
  350. X    unsigned short usernamelen;
  351. X    struct {
  352. X        unsigned short buflen;
  353. X        unsigned short itmcod;
  354. X        char *bufadr;
  355. X        unsigned short *retlenadr;
  356. X        unsigned long null;
  357. X    } jpi_itemlist;
  358. X#endif
  359. X
  360. X    if(no_auth == NULL) {
  361. X        no_auth = &no_auth_st;
  362. X        strcpy(no_auth->auth_type,"UNAUTHENTICATED");
  363. X
  364. X        /* find out who we are */
  365. X#ifndef VMS
  366. X#if defined(MSDOS) && !defined(OS2) && !defined(PCNFS)
  367. X#ifndef CUTCP
  368. X        if (!getconf("general", "user", no_auth->authenticator, 250)
  369. X        || (strlen (no_auth->authenticator) == 0))
  370. X#endif
  371. X          strcpy(no_auth->authenticator,"nobody");
  372. X#else /* not MSDOS */
  373. X        DISABLE_PFS(whoiampw = getpwuid(getuid()));
  374. X        if (whoiampw == 0) strcpy(no_auth->authenticator,"nobody");
  375. X        else strcpy(no_auth->authenticator, whoiampw->pw_name);
  376. X#endif /* not MSDOS */
  377. X#else
  378. X        jpi_itemlist.buflen = sizeof(username);
  379. X        jpi_itemlist.itmcod = JPI$_USERNAME;
  380. X        jpi_itemlist.bufadr = &username;
  381. X        jpi_itemlist.retlenadr = &usernamelen;
  382. X        jpi_itemlist.null = 0;
  383. X        if (SYS$GETJPI(0, 0, 0, &jpi_itemlist, 0, 0, 0) & 0x1)
  384. X        {
  385. X        username[usernamelen] = 0;
  386. X        strcpy(no_auth->authenticator, username);
  387. X        } else
  388. X        strcpy(no_auth->authenticator, "nobody");
  389. X#endif
  390. X    }
  391. X    return(no_auth);
  392. X    }
  393. END_OF_FILE
  394.   if test 2063 -ne `wc -c <'get_pauth.c'`; then
  395.     echo shar: \"'get_pauth.c'\" unpacked with wrong size!
  396.   fi
  397.   # end of 'get_pauth.c'
  398. fi
  399. if test -f 'makefile.cut' -a "${1}" != "-c" ; then 
  400.   echo shar: Will not clobber existing file \"'makefile.cut'\"
  401. else
  402.   echo shar: Extracting \"'makefile.cut'\" \(768 characters\)
  403.   sed "s/^X//" >'makefile.cut' <<'END_OF_FILE'
  404. X#
  405. X# CUTCP/CUTE BC++ version 11/22/91 bkc@omnigate.clarkson.edu
  406. X# Last changed: 12/03/91 1.2.1
  407. X#
  408. X# Makefile for the minimal build for an archie Prospero client.
  409. X#.INCLUDE ../../../builtins
  410. X
  411. XOBJS    = aquery.obj    archie.obj    atalloc.obj \ 
  412. X      get_pauth.obj    get_vdir.obj    perrmesg.obj    procquery.obj    \
  413. X      ptalloc.obj    regex.obj    stcopy.obj    support.obj\
  414. X      vlalloc.obj    vl_comp.obj     dirsend.obj    misc.obj
  415. X
  416. X# dirsend.obj
  417. X
  418. XHDRS    = archie.h    pmachine.h    pcompat.h
  419. X
  420. XDEFINES    = -DDEBUG -DCUTCP
  421. X
  422. XCFLAGS= -k -N -ml -r -v $(DEFINES) -I.
  423. XLFLAGS= /P/m/s
  424. XCC = bccx
  425. X
  426. XEXE    = archie.exe
  427. X
  428. Xall: $(EXE)
  429. X
  430. X$(OBJS): $(HDRS)
  431. X
  432. X.c.obj:
  433. X    $(CC)  $(CFLAGS) -c $<
  434. X
  435. X$(EXE): $(OBJS) Makefile 
  436. X    tlink $(LFLAGS) @&&!
  437. Xc0l $(OBJS)
  438. X!,archie,archie,@&&!
  439. Xlib\tcp lib\sess lib\enet lib\vjc lib\over cl
  440. X!
  441. X
  442. Xclean:
  443. X    +-del *.obj
  444. END_OF_FILE
  445.   if test 768 -ne `wc -c <'makefile.cut'`; then
  446.     echo shar: \"'makefile.cut'\" unpacked with wrong size!
  447.   fi
  448.   # end of 'makefile.cut'
  449. fi
  450. if test -f 'makefile.dos' -a "${1}" != "-c" ; then 
  451.   echo shar: Will not clobber existing file \"'makefile.dos'\"
  452. else
  453.   echo shar: Extracting \"'makefile.dos'\" \(592 characters\)
  454.   sed "s/^X//" >'makefile.dos' <<'END_OF_FILE'
  455. X#
  456. X# Last changed: 11/20/91, v1.2
  457. X#
  458. X# Makefile for the minimal build for an archie Prospero client.
  459. X#.INCLUDE ../../../builtins
  460. X
  461. XOBJS    = aquery.lo    archie.lo    atalloc.lo    dirsend.lo    \
  462. X      get_pauth.lo    get_vdir.lo    perrmesg.lo    procquery.lo    \
  463. X      ptalloc.lo    regex.lo    stcopy.lo    support.lo    \
  464. X      vlalloc.lo    vl_comp.lo
  465. XHDRS    = archie.h    pmachine.h    pcompat.h
  466. X
  467. XDEFINES    = -DDEBUG -DNOREGEX -DUSG
  468. X
  469. XCFLAGS    = -Oeclgsz -Gs -Zi -W4 -I. $(DEFINES)
  470. X
  471. XEXE    = archie.exe
  472. X
  473. Xall: $(EXE)
  474. X
  475. X$(OBJS): $(HDRS)
  476. X
  477. X$(EXE): $(OBJS) Makefile archie.lnk
  478. X    link @archie.lnk
  479. X    exepack archie.unp archie.exe
  480. X
  481. Xclean:
  482. X    +-del *.lo
  483. X    +-del *.exe
  484. X
  485. END_OF_FILE
  486.   if test 592 -ne `wc -c <'makefile.dos'`; then
  487.     echo shar: \"'makefile.dos'\" unpacked with wrong size!
  488.   fi
  489.   # end of 'makefile.dos'
  490. fi
  491. if test -f 'makefile.nfs' -a "${1}" != "-c" ; then 
  492.   echo shar: Will not clobber existing file \"'makefile.nfs'\"
  493. else
  494.   echo shar: Extracting \"'makefile.nfs'\" \(664 characters\)
  495.   sed "s/^X//" >'makefile.nfs' <<'END_OF_FILE'
  496. X#
  497. X# Last changed: 11/20/91, v1.2
  498. X#
  499. X# Makefile for the minimal build for an archie Prospero client.
  500. X#.INCLUDE ../../../builtins
  501. X
  502. XOBJS    = aquery.obj     archie.obj       atalloc.obj      dirsend.obj  \
  503. X      get_paut.obj  get_vdir.obj     perrmesg.obj     procquer.obj \
  504. X      ptalloc.obj    regex.obj        stcopy.obj       support.obj \
  505. X      vlalloc.obj    vl_comp.obj
  506. XHDRS    = archie.h      pmachine.h      pcompat.h
  507. X
  508. XDEFINES = -DDEBUG -DPCNFS
  509. X
  510. XCFLAGS  =  -AL -Gs -Zi -W3 -I. $(DEFINES)
  511. X
  512. XEXE     = archie.exe
  513. X
  514. Xall: $(EXE)
  515. X
  516. X$(OBJS): $(HDRS)
  517. X
  518. X$(EXE): $(OBJS) Makefile.nfs pc-archie.nfs
  519. X    link @pc-archie.nfs
  520. X    exepack archie.unp archie.exe
  521. X
  522. Xclean:
  523. X    del *.obj
  524. X    del *.exe
  525. X
  526. END_OF_FILE
  527.   if test 664 -ne `wc -c <'makefile.nfs'`; then
  528.     echo shar: \"'makefile.nfs'\" unpacked with wrong size!
  529.   fi
  530.   # end of 'makefile.nfs'
  531. fi
  532. if test -f 'makefile.os2' -a "${1}" != "-c" ; then 
  533.   echo shar: Will not clobber existing file \"'makefile.os2'\"
  534. else
  535.   echo shar: Extracting \"'makefile.os2'\" \(800 characters\)
  536.   sed "s/^X//" >'makefile.os2' <<'END_OF_FILE'
  537. X#
  538. X# Last changed: 11/20/91, v1.2
  539. X#
  540. X# Makefile for the minimal build for an archie Prospero client.
  541. X.INCLUDE ../../../builtins
  542. X
  543. XOBJS    = aquery.obj    archie.obj    atalloc.obj    dirsend.obj    \
  544. X      get_pauth.obj    get_vdir.obj    perrmesg.obj    procquery.obj    \
  545. X      ptalloc.obj    regex.obj    stcopy.obj    support.obj    \
  546. X      vlalloc.obj    vl_comp.obj
  547. XHDRS    = archie.h    pmachine.h    pcompat.h
  548. X
  549. XDEFINES    = -DDEBUG -DNOREGEX
  550. X
  551. XIFLAGS    = -I. -I../../../include $(DEFINES)
  552. X
  553. XLFLAGS     = /stack:30000/nod/noe/noi/map/CO
  554. XLIBS    = pctcp bsd ftpcrt socket os2
  555. XEXE    = archie.exe
  556. X
  557. Xall: $(EXE)
  558. X
  559. Xinstall: $(EXE)
  560. X    cp $[m,*.exe,$**] ..\..\..\bin
  561. X    @touch install
  562. X
  563. X$(OBJS): $(HDRS)
  564. X
  565. X$(EXE): $(OBJS) Makefile
  566. X    $(LD) $(LFLAGS) $(L_DEBUG) <@<
  567. X$[s,"+ \n",$[m,*.obj,$**]]
  568. X$*
  569. X$*
  570. X$(LIBS)
  571. X
  572. X<
  573. X    +markexe lfns $@
  574. X    +markexe windowcompat $@
  575. X
  576. Xclean:
  577. X    +-del *.obj
  578. X    +-del *.exe
  579. X
  580. END_OF_FILE
  581.   if test 800 -ne `wc -c <'makefile.os2'`; then
  582.     echo shar: \"'makefile.os2'\" unpacked with wrong size!
  583.   fi
  584.   # end of 'makefile.os2'
  585. fi
  586. if test -f 'patchlevel.h' -a "${1}" != "-c" ; then 
  587.   echo shar: Will not clobber existing file \"'patchlevel.h'\"
  588. else
  589.   echo shar: Extracting \"'patchlevel.h'\" \(980 characters\)
  590.   sed "s/^X//" >'patchlevel.h' <<'END_OF_FILE'
  591. X/*
  592. X * Archie Client version 1.4.1.
  593. X *
  594. X * History:
  595. X *
  596. X * 10/26/92 v1.4.1    Further fixes, avoid alloca.
  597. X * 10/20/92 v1.4    Added PCNFS support, ported to Solaris 2, print domains
  598. X *            using reverse-sort, added archie.el to distribution,
  599. X *            added Alex mode, -V option, use getopt.
  600. X * 04/14/92 v1.3.2    Further porting, add ARCHIE_HOST env var, new version
  601. X *            of make.com (VMS), support for SVR4, merged 4.2E
  602. X *            Prospero changes, CUTCP stack fix.
  603. X * 01/10/92 v1.3.1    Bug.
  604. X * 01/09/92 v1.3    CUTCP (DOS) support, more VMS support (UCX), added
  605. X *            option -L to list hosts & default server.
  606. X * 11/20/91 v1.2    VMS support (Wallongong and Multinet),
  607. X *            DOS and OS/2 support, new regex.c from oz, added
  608. X *            udp.c and the testing info for UDP blockage, cope
  609. X *            with GCC 1.x's bad sparc structure handling, and
  610. X *            total rewrite of dirsend.c to be more modular (more
  611. X *            usable by xarchie).
  612. X * 08/20/91 v1.1    Major revisions and hacks of the Prospero code.
  613. X * 07/31/91 v1.0    Original.
  614. X */
  615. END_OF_FILE
  616.   if test 980 -ne `wc -c <'patchlevel.h'`; then
  617.     echo shar: \"'patchlevel.h'\" unpacked with wrong size!
  618.   fi
  619.   # end of 'patchlevel.h'
  620. fi
  621. if test -f 'pc-archie.nfs' -a "${1}" != "-c" ; then 
  622.   echo shar: Will not clobber existing file \"'pc-archie.nfs'\"
  623. else
  624.   echo shar: Extracting \"'pc-archie.nfs'\" \(236 characters\)
  625.   sed "s/^X//" >'pc-archie.nfs' <<'END_OF_FILE'
  626. Xaquery.obj archie.obj atalloc.obj dirsend.obj+
  627. Xget_paut.obj get_vdir.obj perrmesg.obj procquer.obj+
  628. Xptalloc.obj regex.obj stcopy.obj support.obj+
  629. Xvlalloc.obj vl_comp.obj
  630. Xarchie.unp
  631. Xarchie/map/noi/co/li/stack:45000/seg:256
  632. Xltklib llibce
  633. END_OF_FILE
  634.   if test 236 -ne `wc -c <'pc-archie.nfs'`; then
  635.     echo shar: \"'pc-archie.nfs'\" unpacked with wrong size!
  636.   fi
  637.   # end of 'pc-archie.nfs'
  638. fi
  639. if test -f 'pcompat.h' -a "${1}" != "-c" ; then 
  640.   echo shar: Will not clobber existing file \"'pcompat.h'\"
  641. else
  642.   echo shar: Extracting \"'pcompat.h'\" \(1512 characters\)
  643.   sed "s/^X//" >'pcompat.h' <<'END_OF_FILE'
  644. X/*
  645. X * Copyright (c) 1989, 1990 by the University of Washington
  646. X *
  647. X * For copying and distribution information, please see the file
  648. X * <copyright.h>.
  649. X */
  650. X
  651. X#include <copyright.h>
  652. X
  653. X/* 
  654. X * pcompat.h - Definitions for compatability library
  655. X *
  656. X * This file contains the defintions used by the compatability
  657. X * library.  Among the definitions are the possible values for
  658. X * pfs_disable_flag.  This file also contains the external 
  659. X * declaration of that variable.  Note, however that the 
  660. X * the module pfs_disable_flag.o is included in libpfs.a
  661. X * because some of the routines in that library set it.
  662. X * The only place it is checked, however, is in pfs_access, 
  663. X * found in libpcompat.a
  664. X *
  665. X */
  666. X
  667. Xextern    int        pfs_default;
  668. Xextern    int        pfs_enable;
  669. X
  670. X/* Definitions for values of pfs_enable */
  671. X#define PMAP_DISABLE      0
  672. X#define PMAP_ENABLE       1
  673. X#define PMAP_COLON      2
  674. X#define PMAP_ATSIGN_NF      3
  675. X#define PMAP_ATSIGN      4
  676. X
  677. X#define DISABLE_PFS(stmt) do {int DpfStmp; DpfStmp = pfs_enable;\
  678. X               pfs_enable = PMAP_DISABLE; \
  679. X               stmt; \
  680. X               pfs_enable = DpfStmp;} while (0)
  681. X
  682. X/* Definitions for PFS_ACCESS */
  683. X#define PFA_MAP           0  /* Map the file name only                       */
  684. X#define PFA_CREATE        1  /* Create file if not found                     */
  685. X#define PFA_CRMAP         2  /* Map file name.  Map to new name if not found */
  686. X#define PFA_RO            4  /* Access to file is read only                  */
  687. X
  688. X#define check_pfs_default() \
  689. X    do { if (pfs_default == -1) get_pfs_default(); } while (0)
  690. END_OF_FILE
  691.   if test 1512 -ne `wc -c <'pcompat.h'`; then
  692.     echo shar: \"'pcompat.h'\" unpacked with wrong size!
  693.   fi
  694.   # end of 'pcompat.h'
  695. fi
  696. if test -f 'pprot.h' -a "${1}" != "-c" ; then 
  697.   echo shar: Will not clobber existing file \"'pprot.h'\"
  698. else
  699.   echo shar: Extracting \"'pprot.h'\" \(2159 characters\)
  700.   sed "s/^X//" >'pprot.h' <<'END_OF_FILE'
  701. X/*
  702. X * Copyright (c) 1989, 1990, 1991 by the University of Washington
  703. X *
  704. X * For copying and distribution information, please see the file
  705. X * <copyright.h>.
  706. X */
  707. X
  708. X#include <copyright.h>
  709. X
  710. X#ifndef MAXPATHLEN
  711. X# ifdef VMS
  712. X#  define MAXPATHLEN 32
  713. X# else /* not VMS */
  714. X#  if defined(MSDOS) && !defined(OS2)
  715. X#   define MAXPATHLEN 255
  716. X#  else /* not MSDOS */
  717. X#   ifdef ISC
  718. X#    define MAXPATHLEN 512
  719. X#   else /* not Interactive..normal! (gasp) */
  720. X#    include <sys/param.h>
  721. X#   endif /* ISC */
  722. X#  endif /* MSDOS && !OS2 */
  723. X# endif /* VMS */
  724. X#endif
  725. X
  726. X/* Protocol Definitions */
  727. X
  728. X#define           VFPROT_VNO    1      /* Protocol Version Number           */
  729. X
  730. X#define           DIRSRV_PORT      1525   /* Server port used if not in srvtab */
  731. X#define        PROSPERO_PORT    191    /* Officially assigned prived port   */
  732. X#define           PROS_FIRST_PRIVP 901    /* First privileged port to try      */
  733. X#define        PROS_NUM_PRIVP   20     /* Number of privileged ports to try */
  734. X
  735. X#define           MAXPKT            1024   /* Max size of response from server  */
  736. X#define           SEQ_SIZE        32     /* Max size of sequence text in resp */ 
  737. X#define           MAX_DIR_LINESIZE 160+MAXPATHLEN /* Max linesize in directory */
  738. X
  739. X#define           MAX_FWD_DEPTH    20     /* Max fwd pointers to follow        */
  740. X
  741. X#define S_AD_SZ        sizeof(struct sockaddr_in)
  742. X
  743. X/* Replacement for strtok that doesn't keep state.  Both the variable  */
  744. X/* S and the variable S_next must be defined.  To initialize, assign   */
  745. X/* the string to be stepped through to S_next, then call get_token on  */
  746. X/* S.  The first token will be in S, and S_next will point to the next */
  747. X/* token.  Like strtok, this macro does modify the string passed to it */
  748. X#ifdef __GNUC__
  749. X#define get_token(S,C) \
  750. X  do { \
  751. X    S = S##_next; \
  752. X    if(S) { \
  753. X     while(*S == C) S++; \
  754. X     S##_next = index(S,C); \
  755. X     if(S##_next) *(S##_next++) = '\0'; \
  756. X     if(!*S) S = NULL; \
  757. X    } \
  758. X  } while (0)
  759. X#else
  760. X#define get_token(S,C) \
  761. X    S = S/**/_next; \
  762. X  do { \
  763. X    if(S) { \
  764. X     while(*S == C) S++; \
  765. X     S/**/_next = index(S,C); \
  766. X     if(S/**/_next) *(S/**/_next++) = '\0'; \
  767. X     if(!*S) S = NULL; \
  768. X    } \
  769. X  } while (0)
  770. X#endif /* __GNUC__ */
  771. END_OF_FILE
  772.   if test 2159 -ne `wc -c <'pprot.h'`; then
  773.     echo shar: \"'pprot.h'\" unpacked with wrong size!
  774.   fi
  775.   # end of 'pprot.h'
  776. fi
  777. if test -f 'ptalloc.c' -a "${1}" != "-c" ; then 
  778.   echo shar: Will not clobber existing file \"'ptalloc.c'\"
  779. else
  780.   echo shar: Extracting \"'ptalloc.c'\" \(1601 characters\)
  781.   sed "s/^X//" >'ptalloc.c' <<'END_OF_FILE'
  782. X/*
  783. X * Copyright (c) 1989, 1990, 1991 by the University of Washington
  784. X *
  785. X * For copying and distribution information, please see the file
  786. X * <copyright.h>.
  787. X */
  788. X
  789. X#include <stdio.h>
  790. X
  791. X#include <pfs.h>
  792. X#include <pmachine.h> /* for correct definition of ZERO */
  793. X#ifdef MSDOS
  794. X# define free _pfree   /* otherwise we get conflicts with free() */
  795. X#endif
  796. X
  797. Xstatic PTEXT    free = NULL;
  798. Xint         ptext_count = 0;
  799. Xint        ptext_max = 0;
  800. X
  801. X/*
  802. X * ptalloc - allocate and initialize ptext structure
  803. X *
  804. X *    PTALLOC returns a pointer to an initialized structure of type
  805. X *    PTEXT.  If it is unable to allocate such a structure, it
  806. X *    returns NULL.
  807. X */
  808. XPTEXT
  809. Xptalloc()
  810. X    {
  811. X    PTEXT    vt;
  812. X    if(free) {
  813. X        vt = free;
  814. X        free = free->next;
  815. X    }
  816. X    else {
  817. X        vt = (PTEXT) malloc(sizeof(PTEXT_ST));
  818. X        if (!vt) return(NULL);
  819. X        ptext_max++;
  820. X    }
  821. X    ptext_count++;
  822. X
  823. X    /* nearly all parts are 0 [or NULL] */
  824. X    ZERO(vt);
  825. X    /* The offset is to leave room for additional headers */
  826. X    vt->start = vt->dat + MAX_PTXT_HDR;
  827. X
  828. X    return(vt);
  829. X    }
  830. X
  831. X/*
  832. X * ptfree - free a VTEXT structure
  833. X *
  834. X *    VTFREE takes a pointer to a VTEXT structure and adds it to
  835. X *    the free list for later reuse.
  836. X */
  837. Xvoid
  838. Xptfree(vt)
  839. X    PTEXT    vt;
  840. X    {
  841. X    vt->next = free;
  842. X    vt->previous = NULL;
  843. X    free = vt;
  844. X    ptext_count--;
  845. X    }
  846. X
  847. X/*
  848. X * ptlfree - free a VTEXT structure
  849. X *
  850. X *    VTLFREE takes a pointer to a VTEXT structure frees it and any linked
  851. X *    VTEXT structures.  It is used to free an entrie list of VTEXT
  852. X *    structures.
  853. X */
  854. Xvoid
  855. Xptlfree(vt)
  856. X    PTEXT    vt;
  857. X    {
  858. X    PTEXT    nxt;
  859. X
  860. X    while(vt != NULL) {
  861. X        nxt = vt->next;
  862. X        ptfree(vt);
  863. X        vt = nxt;
  864. X    }
  865. X    }
  866. X
  867. END_OF_FILE
  868.   if test 1601 -ne `wc -c <'ptalloc.c'`; then
  869.     echo shar: \"'ptalloc.c'\" unpacked with wrong size!
  870.   fi
  871.   # end of 'ptalloc.c'
  872. fi
  873. if test -f 'rdgram.h' -a "${1}" != "-c" ; then 
  874.   echo shar: Will not clobber existing file \"'rdgram.h'\"
  875. else
  876.   echo shar: Extracting \"'rdgram.h'\" \(545 characters\)
  877.   sed "s/^X//" >'rdgram.h' <<'END_OF_FILE'
  878. X/*
  879. X * Copyright (c) 1991 by the University of Washington
  880. X *
  881. X * For copying and distribution information, please see the file
  882. X * <copyright.h>.
  883. X */
  884. X
  885. X#include <copyright.h>
  886. X
  887. X/* Queuing priorities for datagrams */
  888. X#define           RDGRAM_MAX_PRI   32765  /* Maximum user proiority          */
  889. X#define           RDGRAM_MAX_SPRI  32767  /* Maximum priority for system use */
  890. X#define           RDGRAM_MIN_PRI  -32765  /* Maximum user proiority          */
  891. X#define           RDGRAM_MIN_SPRI -32768  /* Maximum priority for system use */
  892. X
  893. Xint    rdgram_priority = 0;
  894. END_OF_FILE
  895.   if test 545 -ne `wc -c <'rdgram.h'`; then
  896.     echo shar: \"'rdgram.h'\" unpacked with wrong size!
  897.   fi
  898.   # end of 'rdgram.h'
  899. fi
  900. if test -f 'regex.h' -a "${1}" != "-c" ; then 
  901.   echo shar: Will not clobber existing file \"'regex.h'\"
  902. else
  903.   echo shar: Extracting \"'regex.h'\" \(624 characters\)
  904.   sed "s/^X//" >'regex.h' <<'END_OF_FILE'
  905. X/*
  906. X * regex.h : External defs for Ozan Yigit's regex functions, for systems
  907. X *    that don't have them builtin. See regex.c for copyright and other
  908. X *    details.
  909. X *
  910. X * Note that this file can be included even if we're linking against the
  911. X * system routines, since the interface is (deliberately) identical.
  912. X *
  913. X * George Ferguson, ferguson@cs.rochester.edu, 11 Sep 1991.
  914. X */
  915. X
  916. X#if defined(_AUX_SOURCE) || defined(USG)
  917. X/* Let them use ours if they wish.  */
  918. X# ifndef NOREGEX
  919. Xextern char *regcmp();
  920. Xextern char *regex();
  921. X#define re_comp regcmp
  922. X#define re_exec regex
  923. X# endif
  924. X#else
  925. Xextern char *re_comp();
  926. Xextern int re_exec();
  927. X#endif
  928. END_OF_FILE
  929.   if test 624 -ne `wc -c <'regex.h'`; then
  930.     echo shar: \"'regex.h'\" unpacked with wrong size!
  931.   fi
  932.   # end of 'regex.h'
  933. fi
  934. if test -f 'stcopy.c' -a "${1}" != "-c" ; then 
  935.   echo shar: Will not clobber existing file \"'stcopy.c'\"
  936. else
  937.   echo shar: Extracting \"'stcopy.c'\" \(2054 characters\)
  938.   sed "s/^X//" >'stcopy.c' <<'END_OF_FILE'
  939. X/*
  940. X * Copyright (c) 1989, 1990, 1991 by the University of Washington
  941. X *
  942. X * For copying and distribution information, please see the file
  943. X * <copyright.h>.
  944. X */
  945. X
  946. X#include <stdio.h>
  947. X#include <pmachine.h>
  948. X
  949. X#ifdef NEED_STRING_H
  950. X# include <string.h>
  951. X#else
  952. X# include <strings.h>
  953. X#endif
  954. X
  955. X#if defined(MSDOS)
  956. X# include <stdlib.h>
  957. X#endif
  958. X
  959. Xchar    *stcopyr();
  960. X
  961. Xint    string_count = 0;
  962. Xint    string_max = 0;
  963. X
  964. X/*
  965. X * stcopy - allocate space for and copy a string
  966. X *
  967. X *     STCOPY takes a string as an argument, allocates space for
  968. X *     a copy of the string, copies the string to the allocated space,
  969. X *     and returns a pointer to the copy.
  970. X */
  971. X
  972. Xchar *
  973. Xstcopy(st)
  974. X    char    *st;
  975. X    {
  976. X      if (!st) return(NULL);
  977. X      if (string_max < ++string_count) string_max = string_count;
  978. X
  979. X      return strcpy((char *)malloc(strlen(st) + 1), st);
  980. X    }
  981. X
  982. X/*
  983. X * stcopyr - copy a string allocating space if necessary
  984. X *
  985. X *     STCOPYR takes a string, S, as an argument, and a pointer to a second
  986. X *     string, R, which is to be replaced by S.  If R is long enough to
  987. X *     hold S, S is copied.  Otherwise, new space is allocated, and R is
  988. X *     freed.  S is then copied to the newly allocated space.  If S is
  989. X *     NULL, then R is freed and NULL is returned.
  990. X *
  991. X *     In any event, STCOPYR returns a pointer to the new copy of S,
  992. X *     or a NULL pointer.
  993. X */
  994. Xchar *
  995. Xstcopyr(s,r)
  996. X    char    *s;
  997. X    char    *r;
  998. X    {
  999. X    int    sl;
  1000. X
  1001. X    if(!s && r) {
  1002. X        free(r);
  1003. X        string_count--;
  1004. X        return(NULL);
  1005. X    }
  1006. X    else if (!s) return(NULL);
  1007. X
  1008. X    sl = strlen(s) + 1;
  1009. X
  1010. X    if(r) {
  1011. X        if ((strlen(r) + 1) < sl) {
  1012. X        free(r);
  1013. X        r = (char *) malloc(sl);
  1014. X        }
  1015. X    }
  1016. X    else {
  1017. X        r = (char *) malloc(sl);
  1018. X        string_count++;
  1019. X        if(string_max < string_count) string_max = string_count;
  1020. X    }
  1021. X        
  1022. X    return strcpy(r,s);
  1023. X    }
  1024. X
  1025. X/*
  1026. X * stfree - free space allocated by stcopy or stalloc
  1027. X *
  1028. X *     STFREE takes a string that was returned by stcopy or stalloc 
  1029. X *     and frees the space that was allocated for the string.
  1030. X */
  1031. Xvoid
  1032. Xstfree(st)
  1033. X    char *st;
  1034. X    {
  1035. X    if(st) {
  1036. X        free(st);
  1037. X        string_count--;
  1038. X    }
  1039. X    }
  1040. X
  1041. X
  1042. END_OF_FILE
  1043.   if test 2054 -ne `wc -c <'stcopy.c'`; then
  1044.     echo shar: \"'stcopy.c'\" unpacked with wrong size!
  1045.   fi
  1046.   # end of 'stcopy.c'
  1047. fi
  1048. if test -f 'vl_comp.c' -a "${1}" != "-c" ; then 
  1049.   echo shar: Will not clobber existing file \"'vl_comp.c'\"
  1050. else
  1051.   echo shar: Extracting \"'vl_comp.c'\" \(2114 characters\)
  1052.   sed "s/^X//" >'vl_comp.c' <<'END_OF_FILE'
  1053. X/*
  1054. X * Copyright (c) 1989, 1990, 1991 by the University of Washington
  1055. X *
  1056. X * For copying and distribution information, please see the file
  1057. X * <copyright.h>.
  1058. X */
  1059. X
  1060. X#include <pfs.h>
  1061. X
  1062. X/*
  1063. X * vl_comp - compare the names of two virtual links
  1064. X *
  1065. X *           VL_COMP compares the names of two links.  It returns
  1066. X *           0 if they are equal, negative if vl1 < vl2, and positive if
  1067. X *           vl1 > vl2.
  1068. X *
  1069. X *    ARGS:  vl1,vl2 - Virtual links to be compared
  1070. X * 
  1071. X * RETURNS:  0 if equal, + is vl1 > vl2, - if vl1 < vl2
  1072. X *
  1073. X *   NOTES:  Order of significance is as follows.  Existence,
  1074. X *           name.  If names do not exist, then hosttype, host,
  1075. X *           native filenametype, native filename.  The only time
  1076. X *           the name will not exist if if the link is a union link.
  1077. X */
  1078. Xint
  1079. Xvl_comp(vl1,vl2)
  1080. X    VLINK    vl1;
  1081. X    VLINK    vl2;
  1082. X    {
  1083. X    int    retval;
  1084. X
  1085. X    if(vl1->name && !vl2->name) return(1);
  1086. X    if(!vl1->name && vl2->name) return(-1);
  1087. X    if(vl1->name && vl2->name && (*(vl1->name) || *(vl2->name)))
  1088. X        return(strcmp(vl1->name,vl2->name));
  1089. X
  1090. X    retval = strcmp(vl1->hosttype,vl2->hosttype);
  1091. X    if(!retval) retval = strcmp(vl1->host,vl2->host);
  1092. X    if(!retval) retval = strcmp(vl1->nametype,vl2->nametype);
  1093. X    if(!retval) retval = strcmp(vl1->filename,vl2->filename);
  1094. X    return(retval);
  1095. X    }
  1096. X
  1097. X/*
  1098. X * vl_equal - compare the values of two virtual links
  1099. X *
  1100. X *           VL_EQUAL compares the values of two links.  It returns
  1101. X *           1 if all important fields are the same, and 0 otherwise.
  1102. X *
  1103. X *    ARGS:  vl1,vl2 - Virtual links to be compared
  1104. X * 
  1105. X * RETURNS:  1 if equal, 0 if not equal
  1106. X *
  1107. X */
  1108. Xint
  1109. Xvl_equal(vl1,vl2)
  1110. X    VLINK    vl1;
  1111. X    VLINK    vl2;
  1112. X    {
  1113. X      return strcmp(vl1->name, vl2->name) == 0         &&
  1114. X         vl1->linktype == vl2->linktype            &&
  1115. X         strcmp(vl1->type, vl2->type) == 0         &&
  1116. X         strcmp(vl1->hosttype, vl2->hosttype) == 0 &&
  1117. X         strcmp(vl1->host, vl2->host) == 0         &&
  1118. X         strcmp(vl1->nametype, vl2->nametype) == 0 &&
  1119. X         strcmp(vl1->filename, vl2->filename) == 0 &&
  1120. X         vl1->version == vl2->version              &&
  1121. X         vl1->f_magic_no == vl2->f_magic_no        ;
  1122. X
  1123. X    }
  1124. X
  1125. END_OF_FILE
  1126.   if test 2114 -ne `wc -c <'vl_comp.c'`; then
  1127.     echo shar: \"'vl_comp.c'\" unpacked with wrong size!
  1128.   fi
  1129.   # end of 'vl_comp.c'
  1130. fi
  1131. if test -f 'vlalloc.c' -a "${1}" != "-c" ; then 
  1132.   echo shar: Will not clobber existing file \"'vlalloc.c'\"
  1133. else
  1134.   echo shar: Extracting \"'vlalloc.c'\" \(2298 characters\)
  1135.   sed "s/^X//" >'vlalloc.c' <<'END_OF_FILE'
  1136. X/*
  1137. X * Copyright (c) 1989, 1990, 1991 by the University of Washington
  1138. X *
  1139. X * For copying and distribution information, please see the file
  1140. X * <copyright.h>.
  1141. X */
  1142. X
  1143. X#include <stdio.h>
  1144. X
  1145. X#include <pfs.h>
  1146. X#include <pmachine.h>
  1147. X
  1148. Xstatic VLINK    lfree = NULL;
  1149. Xint        vlink_count = 0;
  1150. Xint        vlink_max = 0;
  1151. X
  1152. X/*
  1153. X * vlalloc - allocate and initialize vlink structure
  1154. X *
  1155. X *    VLALLOC returns a pointer to an initialized structure of type
  1156. X *    VLINK.  If it is unable to allocate such a structure, it
  1157. X *    returns NULL.
  1158. X */
  1159. XVLINK
  1160. Xvlalloc()
  1161. X    {
  1162. X    VLINK    vl;
  1163. X    if(lfree) {
  1164. X        vl = lfree;
  1165. X        lfree = lfree->next;
  1166. X    }
  1167. X    else {
  1168. X        vl = (VLINK) malloc(sizeof(VLINK_ST));
  1169. X        if (!vl) return(NULL);
  1170. X        vlink_max++;
  1171. X    }
  1172. X
  1173. X    vlink_count++;
  1174. X
  1175. X    /* Initialize and fill in default values */
  1176. X    /* Since all but four are set to a zero-value,
  1177. X       why not just wipe it clean?  */
  1178. X    ZERO(vl);
  1179. X
  1180. X    vl->linktype = 'L';
  1181. X    vl->type = stcopy("FILE");
  1182. X    vl->hosttype = stcopy("INTERNET-D");
  1183. X    vl->nametype = stcopy("ASCII");
  1184. X
  1185. X    return(vl);
  1186. X    }
  1187. X
  1188. X/*
  1189. X * vlfree - free a VLINK structure
  1190. X *
  1191. X *    VLFREE takes a pointer to a VLINK structure and adds it to
  1192. X *    the free list for later reuse.
  1193. X */
  1194. Xvoid
  1195. Xvlfree(vl)
  1196. X    VLINK    vl;
  1197. X    {
  1198. X        extern int string_count;
  1199. X
  1200. X    if(vl->dontfree) return;
  1201. X    /* many of these don't need to call stfree(); since a check
  1202. X       for pointer validity's already done before even calling
  1203. X       it, we can just call free() here then do one big decrement
  1204. X       of string_count at the end.  */
  1205. X    if(vl->name) free(vl->name);
  1206. X    stfree(vl->type);
  1207. X    if(vl->replicas) vllfree(vl->replicas);
  1208. X    stfree(vl->hosttype);
  1209. X    if(vl->host) free(vl->host);
  1210. X    stfree(vl->nametype);
  1211. X    if(vl->filename) free(vl->filename);
  1212. X    if(vl->args) free(vl->args);
  1213. X    if(vl->lattrib) atlfree(vl->lattrib);
  1214. X    /* No allocation routines for f_info yet */
  1215. X    vl->f_info = NULL;
  1216. X    vl->next = lfree;
  1217. X    vl->previous = NULL;
  1218. X    lfree = vl;
  1219. X    vlink_count--;
  1220. X    string_count -= 4; /* freed name, host, filename, and args */
  1221. X    }
  1222. X
  1223. X/*
  1224. X * vllfree - free a VLINK structure
  1225. X *
  1226. X *    VLLFREE takes a pointer to a VLINK structure frees it and any linked
  1227. X *    VLINK structures.  It is used to free an entrie list of VLINK
  1228. X *    structures.
  1229. X */
  1230. Xvoid
  1231. Xvllfree(vl)
  1232. X    VLINK    vl;
  1233. X    {
  1234. X    VLINK    nxt;
  1235. X
  1236. X    while((vl != NULL) && !vl->dontfree) {
  1237. X        nxt = vl->next;
  1238. X        vlfree(vl);
  1239. X        vl = nxt;
  1240. X    }
  1241. X    }
  1242. X
  1243. END_OF_FILE
  1244.   if test 2298 -ne `wc -c <'vlalloc.c'`; then
  1245.     echo shar: \"'vlalloc.c'\" unpacked with wrong size!
  1246.   fi
  1247.   # end of 'vlalloc.c'
  1248. fi
  1249. if test -f 'vms.h' -a "${1}" != "-c" ; then 
  1250.   echo shar: Will not clobber existing file \"'vms.h'\"
  1251. else
  1252.   echo shar: Extracting \"'vms.h'\" \(1159 characters\)
  1253.   sed "s/^X//" >'vms.h' <<'END_OF_FILE'
  1254. X#ifndef _ARCHIE_VMS
  1255. X#define _ARCHIE_VMS
  1256. X#include <pmachine.h>
  1257. X
  1258. X#if !defined(MULTINET_30) && !defined(WOLLONGONG) && !defined(UCX)
  1259. X#include "[.vms]pseudos.h"
  1260. X#include "[.vms]types.h"
  1261. X#include "[.vms]in.h"
  1262. X#include "[.vms]signal.h"
  1263. X#include "[.vms]socket.h"
  1264. X#include "[.vms]time.h"
  1265. X
  1266. X#else
  1267. X
  1268. X/* time_t gets multiply defined <ekup> */
  1269. X#ifndef __TYPES
  1270. X#define __TYPES
  1271. X#endif
  1272. X#ifdef MULTINET_30
  1273. X# include "multinet_root:[multinet.include.sys]types.h"
  1274. X# include "multinet_root:[multinet.include.netinet]in.h"
  1275. X# include "multinet_root:[multinet.include.sys]socket.h"
  1276. X# include "multinet_root:[multinet.include.sys]time.h"
  1277. X#endif /* MULTINET_30 */
  1278. X
  1279. X#ifdef WOLLONGONG
  1280. X/* We don't want size_t defined.  */
  1281. X# ifndef __STDDEF
  1282. X#  define __STDDEF
  1283. X# endif
  1284. X# include "twg$tcp:[netdist.include.sys]types.h"
  1285. X# include "twg$tcp:[netdist.include.netinet]in.h"
  1286. X# include "twg$tcp:[netdist.include.sys]socket.h"
  1287. X# include "twg$tcp:[netdist.include.sys]time.h"
  1288. X#endif /* WOLLONGONG */
  1289. X
  1290. X#ifdef UCX
  1291. X# include <types.h>
  1292. X# include <in.h>
  1293. X# include <socket.h>
  1294. X# include <time.h>
  1295. X# include "[.vms]fd.h"
  1296. X#endif /* UCX */
  1297. X
  1298. X#endif /* Multinet or Wallongong or UCX */
  1299. X
  1300. X#endif /* _ARCHIE_VMS */
  1301. END_OF_FILE
  1302.   if test 1159 -ne `wc -c <'vms.h'`; then
  1303.     echo shar: \"'vms.h'\" unpacked with wrong size!
  1304.   fi
  1305.   # end of 'vms.h'
  1306. fi
  1307. if test -f 'vms/fd.h' -a "${1}" != "-c" ; then 
  1308.   echo shar: Will not clobber existing file \"'vms/fd.h'\"
  1309. else
  1310.   echo shar: Extracting \"'vms/fd.h'\" \(393 characters\)
  1311.   sed "s/^X//" >'vms/fd.h' <<'END_OF_FILE'
  1312. X#ifndef _VMS_FD
  1313. X#define _VMS_FD
  1314. X
  1315. Xtypedef struct fd_set
  1316. X{
  1317. X  int fds_bits[1];
  1318. X} fd_set;
  1319. X
  1320. X#define FD_SETSIZE          (sizeof (fd_set) * 8)
  1321. X#define FD_SET(f,s)         ((s)->fds_bits[0] |= (1 << (f)))
  1322. X#define FD_CLR(f,s)         ((s)->fds_bits[0] &= ~(1 << (f)))
  1323. X#define FD_ISSET(f,s)       ((s)->fds_bits[0] & (1 << (f)))
  1324. X#define FD_ZERO(s)          ((s)->fds_bits[0] = 0)
  1325. X
  1326. X#endif /* _VMS_FD */
  1327. END_OF_FILE
  1328.   if test 393 -ne `wc -c <'vms/fd.h'`; then
  1329.     echo shar: \"'vms/fd.h'\" unpacked with wrong size!
  1330.   fi
  1331.   # end of 'vms/fd.h'
  1332. fi
  1333. if test -f 'vms/multi.opt' -a "${1}" != "-c" ; then 
  1334.   echo shar: Will not clobber existing file \"'vms/multi.opt'\"
  1335. else
  1336.   echo shar: Extracting \"'vms/multi.opt'\" \(73 characters\)
  1337.   sed "s/^X//" >'vms/multi.opt' <<'END_OF_FILE'
  1338. Xsys$library:vaxcrtl.exe/share
  1339. Xmultinet:multinet_socket_library.exe/share
  1340. END_OF_FILE
  1341.   if test 73 -ne `wc -c <'vms/multi.opt'`; then
  1342.     echo shar: \"'vms/multi.opt'\" unpacked with wrong size!
  1343.   fi
  1344.   # end of 'vms/multi.opt'
  1345. fi
  1346. if test -f 'vms/pseudos.h' -a "${1}" != "-c" ; then 
  1347.   echo shar: Will not clobber existing file \"'vms/pseudos.h'\"
  1348. else
  1349.   echo shar: Extracting \"'vms/pseudos.h'\" \(439 characters\)
  1350.   sed "s/^X//" >'vms/pseudos.h' <<'END_OF_FILE'
  1351. X/* These are so we don't end up using the MultiNet versions.  */
  1352. X#define socket    VMSsocket
  1353. X#define bind    VMSbind
  1354. X#define connect    VMSconnect
  1355. X#define listen    VMSlisten
  1356. X#define accept    VMSaccept
  1357. X#define select    VMSselect
  1358. X#define recv    VMSrecv
  1359. X#define recvfrom    VMSrecvfrom
  1360. X#define send    VMSsend
  1361. X#define sendto    VMSsendto
  1362. X#define getsockname    VMSgetsockname
  1363. X#define shutdown    VMSshutdown
  1364. X#define getsockopt    VMSgetsockopt
  1365. X#define setsockopt    VMSsetsockopt
  1366. END_OF_FILE
  1367.   if test 439 -ne `wc -c <'vms/pseudos.h'`; then
  1368.     echo shar: \"'vms/pseudos.h'\" unpacked with wrong size!
  1369.   fi
  1370.   # end of 'vms/pseudos.h'
  1371. fi
  1372. if test -f 'vms/socket.h' -a "${1}" != "-c" ; then 
  1373.   echo shar: Will not clobber existing file \"'vms/socket.h'\"
  1374. else
  1375.   echo shar: Extracting \"'vms/socket.h'\" \(527 characters\)
  1376.   sed "s/^X//" >'vms/socket.h' <<'END_OF_FILE'
  1377. X/* sys/socket.h */
  1378. X#define SOCK_STREAM     1
  1379. X#define SOCK_DGRAM      2
  1380. X
  1381. X#define SO_DEBUG        0x01
  1382. X#define SO_ACCEPTCONN   0x02
  1383. X#define SO_REUSEADDR    0x04
  1384. X#define SO_KEEPALIVE    0x08
  1385. X#define SO_LINGER       0x80
  1386. X#define SO_DONTLINGER   (~SO_LINGER)
  1387. X
  1388. X#define AF_UNSPEC       0
  1389. X#define AF_ERROR        0
  1390. X#define AF_INET         2
  1391. X#define AF_CCITT        10
  1392. X#define AF_X25          10
  1393. X
  1394. Xstruct sockaddr
  1395. X{
  1396. X  unsigned short sa_family;
  1397. X  char sa_data[14];
  1398. X};
  1399. X
  1400. X#define SOL_SOCKET      0xffff
  1401. X
  1402. X#define MSG_OOB 1
  1403. X#define MSG_PEEK 2
  1404. END_OF_FILE
  1405.   if test 527 -ne `wc -c <'vms/socket.h'`; then
  1406.     echo shar: \"'vms/socket.h'\" unpacked with wrong size!
  1407.   fi
  1408.   # end of 'vms/socket.h'
  1409. fi
  1410. if test -f 'vms/time.h' -a "${1}" != "-c" ; then 
  1411.   echo shar: Will not clobber existing file \"'vms/time.h'\"
  1412. else
  1413.   echo shar: Extracting \"'vms/time.h'\" \(459 characters\)
  1414.   sed "s/^X//" >'vms/time.h' <<'END_OF_FILE'
  1415. X#ifndef __PKTIME
  1416. X#define __PKTIME
  1417. X
  1418. Xstruct timeval
  1419. X{
  1420. X  long tv_sec;
  1421. X  long tv_usec;
  1422. X};
  1423. X
  1424. Xstruct timezone
  1425. X{
  1426. X  int tz_minuteswest;
  1427. X  int tz_dsttime;
  1428. X};
  1429. X
  1430. Xstruct itimerval
  1431. X{
  1432. X  struct timeval it_interval;
  1433. X  struct timeval it_value;
  1434. X};
  1435. X
  1436. X#define ITIMER_REAL 0
  1437. X#define timerclear(x) (x)->tv_sec = (x)->tv_usec = 0
  1438. X
  1439. X#ifndef __GNUC__
  1440. X# include <sys$library:time.h>
  1441. X#else /* not Gnu C */
  1442. X# include <gnu_cc_include:[000000]time.h>
  1443. X#endif /* Gnu C */
  1444. X
  1445. X#endif /* __PKTIME */
  1446. END_OF_FILE
  1447.   if test 459 -ne `wc -c <'vms/time.h'`; then
  1448.     echo shar: \"'vms/time.h'\" unpacked with wrong size!
  1449.   fi
  1450.   # end of 'vms/time.h'
  1451. fi
  1452. if test -f 'vms/types.h' -a "${1}" != "-c" ; then 
  1453.   echo shar: Will not clobber existing file \"'vms/types.h'\"
  1454. else
  1455.   echo shar: Extracting \"'vms/types.h'\" \(467 characters\)
  1456.   sed "s/^X//" >'vms/types.h' <<'END_OF_FILE'
  1457. X/* sys/types.h */
  1458. X#ifndef _types_
  1459. X#define _types_
  1460. X
  1461. X#ifndef __GNUC__
  1462. X# include <sys$library:stddef.h>
  1463. X#endif /* not Gnu C */
  1464. X
  1465. Xtypedef unsigned char u_char;
  1466. Xtypedef unsigned short u_short;
  1467. Xtypedef unsigned int u_int;
  1468. Xtypedef unsigned long u_long;
  1469. X
  1470. Xtypedef long daddr_t;
  1471. Xtypedef char *caddr_t;
  1472. X
  1473. X#include <sys$library:types.h>
  1474. X
  1475. Xtypedef unsigned short ino_t;
  1476. Xtypedef char *dev_t;
  1477. Xtypedef unsigned int off_t;
  1478. Xtypedef long key_t;
  1479. X
  1480. X#include "[.vms]fd.h"
  1481. X
  1482. X#endif /* _types */
  1483. END_OF_FILE
  1484.   if test 467 -ne `wc -c <'vms/types.h'`; then
  1485.     echo shar: \"'vms/types.h'\" unpacked with wrong size!
  1486.   fi
  1487.   # end of 'vms/types.h'
  1488. fi
  1489. if test -f 'vms/ucx.opt' -a "${1}" != "-c" ; then 
  1490.   echo shar: Will not clobber existing file \"'vms/ucx.opt'\"
  1491. else
  1492.   echo shar: Extracting \"'vms/ucx.opt'\" \(54 characters\)
  1493.   sed "s/^X//" >'vms/ucx.opt' <<'END_OF_FILE'
  1494. Xsys$library:vaxcrtl.exe/share
  1495. Xsys$library:ucx$ipc/lib
  1496. END_OF_FILE
  1497.   if test 54 -ne `wc -c <'vms/ucx.opt'`; then
  1498.     echo shar: \"'vms/ucx.opt'\" unpacked with wrong size!
  1499.   fi
  1500.   # end of 'vms/ucx.opt'
  1501. fi
  1502. if test -f 'vms/woll.opt' -a "${1}" != "-c" ; then 
  1503.   echo shar: Will not clobber existing file \"'vms/woll.opt'\"
  1504. else
  1505.   echo shar: Extracting \"'vms/woll.opt'\" \(66 characters\)
  1506.   sed "s/^X//" >'vms/woll.opt' <<'END_OF_FILE'
  1507. Xsys$library:vaxcrtl.exe/share
  1508. Xtwg$tcp:[netdist.lib]twglib.olb/lib
  1509. END_OF_FILE
  1510.   if test 66 -ne `wc -c <'vms/woll.opt'`; then
  1511.     echo shar: \"'vms/woll.opt'\" unpacked with wrong size!
  1512.   fi
  1513.   # end of 'vms/woll.opt'
  1514. fi
  1515. echo shar: End of archive 7 \(of 7\).
  1516. cp /dev/null ark7isdone
  1517. MISSING=""
  1518. for I in 1 2 3 4 5 6 7 ; do
  1519.     if test ! -f ark${I}isdone ; then
  1520.     MISSING="${MISSING} ${I}"
  1521.     fi
  1522. done
  1523. if test "${MISSING}" = "" ; then
  1524.     echo You have unpacked all 7 archives.
  1525.     rm -f ark[1-9]isdone
  1526. else
  1527.     echo You still must unpack the following archives:
  1528.     echo "        " ${MISSING}
  1529. fi
  1530. exit 0
  1531. exit 0 # Just in case...
  1532.