home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / sources / misc / 4061 < prev    next >
Encoding:
Text File  |  1992-11-05  |  42.1 KB  |  1,538 lines

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