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

  1. Newsgroups: comp.sources.misc
  2. From: brendan@cygnus.com (Brendan Kehoe)
  3. Subject:  v33i055:  archie - A client to query the Archie FTP databases, v1.4.1, Part06/07
  4. Message-ID: <1992Nov5.210730.26049@sparky.imd.sterling.com>
  5. X-Md4-Signature: 54eaccb2c68cfb0eb79f99a793f44604
  6. Date: Thu, 5 Nov 1992 21:07:30 GMT
  7. Approved: kent@sparky.imd.sterling.com
  8.  
  9. Submitted-by: brendan@cygnus.com (Brendan Kehoe)
  10. Posting-number: Volume 33, Issue 55
  11. Archive-name: archie/part06
  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:  Makefile archie.hlp copyright.h getopt.h getopt1.c
  20. #   msdos/cutcp.h msdos/hostform.h perrno.h pmachine.h procquery.c
  21. #   vms/network.h
  22. # Wrapped by kent@sparky on Thu Nov  5 12:53:10 1992
  23. PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:/usr/lbin ; export PATH
  24. echo If this archive is complete, you will see the following message:
  25. echo '          "shar: End of archive 6 (of 7)."'
  26. if test -f 'Makefile' -a "${1}" != "-c" ; then 
  27.   echo shar: Will not clobber existing file \"'Makefile'\"
  28. else
  29.   echo shar: Extracting \"'Makefile'\" \(5628 characters\)
  30.   sed "s/^X//" >'Makefile' <<'END_OF_FILE'
  31. X#
  32. X# Makefile for the minimal build for an archie Prospero client.
  33. X#
  34. X# Your C compiler:
  35. X#CC=cc
  36. X
  37. X# For most systems, these OPTIONS will suffice.  Exceptions:
  38. X#
  39. X#    * If you're on a Stardent, add  -43
  40. X#    * If you're running EP/IX, you may need to add  -systype bsd43
  41. X#      but try it without it first.
  42. XOPTIONS= -O -I. -I/usr/netinclude -I/usr/ucbinclude
  43. X
  44. X# For this, DEFINES is usually ok as-is.  Try it without any of these
  45. X# first; if some stuff fails or shows up undefined, then come back and
  46. X# add 'em.  Also please drop me a line if you had to add anything...ideally
  47. X# things will reach a point where this whole section will be unnecessary.
  48. X#
  49. X#     * if you want to include the debugging code (so you
  50. X#       can help with problem-solving if any crop up), add    -DDEBUG
  51. X#     * if you're running Interactive Unix, add              -DISC
  52. X#     * if you're running System V, add                  -DSYSV
  53. X#     * if you're running a USG (System V.2) system, add      -DUSG
  54. X#     * if you're running UTS, add                  -DUTS
  55. X#     * if your system doesn't have the functions index(),
  56. X#       rindex(), bcopy(), or bzero(), add                    -DFUNCS
  57. X#     * if your system is missing the getenv(3) routine, add  -DGETENV
  58. X#     * if your system doesn't have the re_comp/regcmp or re_exec/regex
  59. X#       routines (no regex(3)/regcmp(3X) library), then add   -DNOREGEX
  60. X#     * if your system is lacking strspn(), add               -DSTRSPN
  61. X#     * if you're using the unbundled SparcCompiler on a
  62. X#    Solaris 2 system, add                      -DSOLARIS2
  63. XDEFINES= -DDEBUG
  64. X
  65. X# The default Archie server; choose one of:
  66. X#    archie.ans.net        (USA [NY])
  67. X#    archie.rutgers.edu        (USA [NJ])
  68. X#    archie.sura.net        (USA [MD])
  69. X#    archie.unl.edu        (USA [NE])
  70. X#    archie.mcgill.ca        (Canada)
  71. X#    archie.funet.fi        (Finland/Mainland Europe)
  72. X#    archie.au            (Australia)
  73. X#    archie.doc.ic.ac.uk    (Great Britain/Ireland)
  74. X#    archie.wide.ad.jp        (Japan)
  75. X#    archie.ncu.edu.tw        (Taiwan)
  76. X#
  77. X# Note this only applies to the command-line client; to change the
  78. X# default for the Emacs lisp version, set the archie-server variable.
  79. XARCHIE= archie.sura.net
  80. X
  81. X#    Usually LDFLAGS is empty; if, after you build this, archie
  82. X#     complains that it can't resolve ARCHIE.ANS.NET (or whatever
  83. X#     you defined ARCHIE_HOST as), you need to add `-lresolv'.
  84. X#
  85. X#    * If you need the PW library (e.g. A/UX), add -lPW
  86. XLDFLAGS=
  87. X# If you're using ISC, use:
  88. X#LDFLAGS= -linet
  89. X# If you're using Wallongong TCP/IP on an AT&T box, use:
  90. X#LDFLAGS= -lnet -lnsl_s
  91. X# If you're using UTS, use:
  92. X#LDFLAGS= -lsocket
  93. X# If you're using System V Release 4, use:
  94. X#LDFLAGS= -L/usr/ucblib -lucb -lsockdns -lnsl
  95. X# If you're using Solaris 2.x (don't use /usr/ucb/cc!), use:
  96. X#LDFLAGS= -lnsl -lsocket
  97. X# If you're using Consensus SVR4, use:
  98. X#LDFLAGS= -lnsl_i -lsocket -lucb
  99. X# If you're using Dynix/PTX, use:
  100. X#LDFLAGS= -lsocket -linet -lnsl -lPW
  101. X
  102. X# =========================
  103. X# Yer' done....make archie.
  104. X# =========================
  105. X#
  106. XCFLAGS=$(OPTIONS) $(DEFINES) -DARCHIE_HOST=\"$(ARCHIE)\"
  107. X
  108. XVERSION=1.4.1
  109. XVMS_VERSION=`echo $(VERSION) | sed -e 's,\\.,_,g'`
  110. X
  111. XOBJS=    aquery.o archie.o atalloc.o dirsend.o get_pauth.o get_vdir.o \
  112. X    getopt.o getopt1.o \
  113. X    perrmesg.o procquery.o ptalloc.o regex.o stcopy.o support.o \
  114. X    vlalloc.o vl_comp.o
  115. X
  116. Xall: archie
  117. X
  118. Xarchie: $(OBJS)
  119. X    $(CC) $(CFLAGS) -o $@ $(OBJS) $(LDFLAGS)
  120. X
  121. X$(OBJS): archie.h pmachine.h pcompat.h Makefile
  122. X
  123. Xprocquery.o: copyright.h
  124. X
  125. Xclean:
  126. X    -rm -f *.o archie archie.doc
  127. X
  128. Xgclean: clean
  129. X    -rm -f *~ archie.0* archie$(VMS_VERSION).com archie.tar* gmon.out archie.doc
  130. X
  131. Xunx-deadly:
  132. X    unifdef -UXARCHIE xprocquery.c > procquery.c
  133. X
  134. XFILES=    INSTALL Makefile Prospero README README.ALEX README.dos archie.c \
  135. X    archie.h archie.el archie.lnk archie.doc archie.man archie.hlp \
  136. X    aquery.c atalloc.c dirsend.c get_pauth.c get_vdir.c \
  137. X    getopt.c getopt.h getopt1.c \
  138. X    make.com makefile.cut makefile.dos makefile.os2 makefile.nfs \
  139. X    msdos/cutcp.h msdos/hostform.h msdos/netevent.h pc-archie.nfs \
  140. X    perrmesg.c patchlevel.h pauthent.h pcompat.h perrno.h pfs.h pmachine.h \
  141. X    pprot.h procquery.c ptalloc.c rdgram.h regex.c regex.h stcopy.c \
  142. X    support.c copyright.h vl_comp.c vlalloc.c vms.h vms_support.c \
  143. X    vms/fd.h vms/in.h vms/pseudos.h vms/signal.h vms/socket.h vms/time.h \
  144. X    vms/types.h vms/network.h vms/multi.opt vms/ucx.opt vms/woll.opt
  145. X
  146. XBFILES= $(FILES) xprocquery.c
  147. X
  148. Xdist: tar shar dcl
  149. X
  150. Xshar: archie.doc
  151. X    makekit -narchie-$(VERSION). archie-$(VERSION) `echo $(FILES) | \
  152. X        tr ' ' '\012' | sed -e "s/^/archie-$(VERSION)\//g"` \
  153. X        vms msdos > Manifest
  154. X
  155. Xarchie.doc: archie.man
  156. X    nroff -man archie.man | tr '\010' _ | sed -e s/__//g > archie.doc
  157. X
  158. Xdcl: archie.doc
  159. X    if [ ! -d archie$(VMS_VERSION)/ ]; then ln -s . archie$(VMS_VERSION); fi
  160. X    echo '$$ write sys$$output "Unpacking..."' > archie$(VMS_VERSION).com
  161. X    echo '$$ if f$$search("archie.dir") .eqs. "" then create/dir [.ARCHIE]' >> archie$(VMS_VERSION).com
  162. X    echo '$$ if f$$search("[.archie]vms.dir") .eqs. "" then create/dir [.ARCHIE.VMS]' >> archie$(VMS_VERSION).com
  163. X    echo '$$ if f$$search("[.archie]msdos.dir") .eqs. "" then create/dir [.ARCHIE.MSDOS]' >> archie$(VMS_VERSION).com
  164. X    echo '$$ set noverify' >> archie$(VMS_VERSION).com
  165. X    -rm -f archie
  166. X    ln -s . archie
  167. X    dclshar `echo "$(FILES)" | tr ' ' '\012' | \
  168. X        sed -e "s/^/archie\//g"` >> archie$(VMS_VERSION).com
  169. X    -rm -f archie
  170. X    ver=$(VMS_VERSION); echo '$$ write sys$$output "Ok, now enter the $$ver directory, look at MAKE.COM, then type @MAKE ."' >> archie$(VMS_VERSION).com
  171. X
  172. Xtar: archie.doc
  173. X    if [ ! -d archie-$(VERSION)/ ]; then ln -s . archie-$(VERSION); fi
  174. X    tar cvf archie-$(VERSION).tar `echo $(FILES) |\
  175. X     tr ' ' '\012' | sed -e "s/^/archie-$(VERSION)\//g"`
  176. X    compress -f archie-$(VERSION).tar
  177. END_OF_FILE
  178.   if test 5628 -ne `wc -c <'Makefile'`; then
  179.     echo shar: \"'Makefile'\" unpacked with wrong size!
  180.   fi
  181.   # end of 'Makefile'
  182. fi
  183. if test -f 'archie.hlp' -a "${1}" != "-c" ; then 
  184.   echo shar: Will not clobber existing file \"'archie.hlp'\"
  185. else
  186.   echo shar: Extracting \"'archie.hlp'\" \(6495 characters\)
  187.   sed "s/^X//" >'archie.hlp' <<'END_OF_FILE'
  188. X1 ARCHIE   
  189. XARCHIE is a utility to query the Archie anonymous FTP databases using
  190. XProspero.  It will check the databases for entries about the files that 
  191. Xare available via anonymous FTP from sites around the world.
  192. X
  193. XFormat:             $ ARCHIE [-option] <string>
  194. X
  195. XThis will query an ARCHIE server and ask it to look for all known sites 
  196. Xthat have a file named `string' in their FTP area.  ARCHIE will wait and 
  197. Xthen print out any matches.
  198. X
  199. X2 Options
  200. XARCHIE is originally a Unix utility so its options make use of 
  201. Xthe Unix `-option' and not the VMS `/qualifier' syntax.
  202. X
  203. XWith the `-L' and `-N#' options you must enclose the option in
  204. Xdouble quotes (ie "-L" and "-N#") to prevent the server from
  205. Xtranslating them into lowercase options.
  206. X
  207. X3 -ecsr
  208. XThese are search-modifying options:
  209. X
  210. X     -e   Exact string match.  (This is the default.)
  211. X     -c   Search substrings paying attention to upper and lower case.
  212. X     -s   Search substrings ignoring the case of the letters.
  213. X     -r   Search using a regular expression.
  214. X`-c', `-s' and `-r' are mutually exclusive;  only the last one counts.  
  215. X
  216. XIf you specify `-e' with any of them the server will first check for an 
  217. Xexact match, then fall back to the case-sensitive, case-insensitive, or  
  218. Xregular expression search.  This is so if there are matches that are 
  219. Xparticularly obvious, it will use a minimal amount of search time.
  220. X
  221. X3 -h <hostname>
  222. XInstruct ARCHIE to query another ARCHIE server with the name 
  223. X`hostname', instead of its default server.
  224. X
  225. XARCHIE is compiled with a specific default server host.  
  226. XThis default can be changed by defining the symbol ARCHIE_HOST 
  227. Xas one of the other available hosts.  The `-h' option will 
  228. Xoverride these defaults. 
  229. X
  230. X(Use option -L to get the list of available hosts.)
  231. X
  232. X3 -o <filename>
  233. XTo redirect the output of ARCHIE to a file (rather than use the
  234. Xstandard output), give the `filename' it should store the results in.
  235. X
  236. X3 -l          
  237. XOutput results in a form suitable for parsing by programs.
  238. X
  239. X3 -m#
  240. XSpecifies the maximum number of hits (matches) to return. 
  241. XThe default is 95 hits.
  242. X
  243. X3 -t
  244. XSort the results in reverse date order.
  245. X
  246. X3 -L
  247. XLists the Archie servers known to the program when it was
  248. Xcompiled, as well as the name of the default Archie server.  
  249. X
  250. X      (Note: You MUST put quotes around this argument 
  251. X              or it will be converted to lowercase.)         
  252. X
  253. X3 -N[#]
  254. XSets the `niceness' of a query.  The default niceness is 0.
  255. XUsing `-N' without an argument sets it to 35765 (the maximum).
  256. XIf you use `-N' with an argument between 0 and 35765, it will 
  257. Xadjust itself accordingly.  
  258. X
  259. X      (Note: You MUST put quotes around this argument 
  260. X              or it will be converted to lowercase.)         
  261. X
  262. X(See also the subtopic `Niceness')
  263. X
  264. X3 -V
  265. XProvide some reassuring messages when a search is taking a long time.
  266. X
  267. X3 -v
  268. XPrint the version of the client.
  269. X
  270. X2 String
  271. XThis can be either the name of a file or a substring of a filename.
  272. X
  273. XIf you use a substring, then you must use one of the search-modifying
  274. Xoptions `-c', `-r' or `-s'.  Otherwise ARCHIE will only respond with
  275. Xonly those files that match exactly the substring!
  276. X
  277. XIf the search string starts with a `-' you must precede it with 
  278. Xanother `-'.  For example
  279. X
  280. X     $ archie  -s  - -old
  281. X
  282. Xwill search for all filenames that contain the string `-old'.
  283. X
  284. X2 Examples
  285. X1.          $ archie emacs
  286. X
  287. X     This will find all anonymous FTP sites in the ARCHIE database
  288. X     that have files named `emacs' somewhere in their FTP area.
  289. X     (This particular query would probably return a lot of direc-
  290. X     tories.)  
  291. X
  292. X2.          $ archie -c emacs
  293. X
  294. X     This will produce a list of every file that contains the
  295. X     string `emacs' anywhere in the filename.
  296. X
  297. X3.   Regular expressions may also be used for searches:
  298. X
  299. X            $ archie -r '[xX][lL]isp'
  300. X
  301. X     If a string is enclosed in brackets [] ARCHIE will attempt to 
  302. X     match any single character from the string.  In the above example
  303. X     it will try and match either `x' or `X' plus either `l' or `L' 
  304. X     followed by `isp'.  It is recommended that you enclose the whole
  305. X     expression in single quotes to prevent the server misinterpreting it.
  306. X
  307. X2 Niceness
  308. XNiceness is the (Unix) concept of `being nice' to other users by 
  309. Xlowering the priority of non-urgent jobs.
  310. X
  311. XYou should use the `-N' option whenever you do not demand immediacy,  
  312. Xor when you are requesting things that could generate large responses.  
  313. X
  314. XHere is a list of what would be considered as `nice' values that
  315. Xaccurately reflect the priority of a request to the server.
  316. X
  317. X          Normal              0
  318. X          Nice                500
  319. X          Nicer               1000
  320. X          Very Nice           5000
  321. X          Extremely Nice      10000
  322. X          Nicest              32765
  323. X
  324. XThe last priority, Nicest, would be used when a job should wait until  
  325. Xthe queue is essentially empty before running. You should pick one of
  326. Xthese values to use, possibly modifying it slightly depending on where 
  327. Xyou think your priority should land.  For example, 32760 would mean wait  
  328. Xuntil the queue is empty, but jump ahead of other jobs that are `Nicest'.
  329. X
  330. X2 Bugs
  331. XThere are none; only a few unexpected features.
  332. X
  333. X2 VMS Notes
  334. XPlease note that there are some options (e.g., -a) that aren't very
  335. Xuseful under VMS, so are not documented in this help file.
  336. X
  337. XTo use the ARCHIE program, define it as a symbol to point to the
  338. XARCHIE.EXE image, or the arguments won't get processed properly:
  339. X
  340. X    $ ARCHIE :== $THE$DISK:[SOME.DIR]ARCHIE
  341. X
  342. XAny further enhancements for VMS for this client are welcome and
  343. Xencouraged.
  344. X
  345. X2 Background
  346. XARCHIE runs as a client and queries an Archie anonymous FTP database 
  347. Xlooking for the specified search string, using the Prospero protocol.  
  348. XThis client is based on Prospero version Beta.4.2 and is provided to 
  349. Xencourage non-interactive use of the Archie servers (and subsequently 
  350. Xbetter performance on both sides).  
  351. X
  352. XThe ARCHIE service was conceived and implemented by Alan Emtage
  353. X(bajan@cs.mcgill.ca), Peter Deutsch (peterd@cs.mcgill.ca), and 
  354. XBill Heelan (wheelan@cs.mcgill.ca).  The entire Internet is in 
  355. Xtheir debt.
  356. X
  357. XThe Prospero system was created by Clifford Neuman (bcn@isi.edu); 
  358. Xwrite to info-prospero@isi.edu for more information on the protocol 
  359. Xand its use.
  360. X
  361. XThis stripped client was put together by Brendan Kehoe 
  362. X(brendan@cygnus.com), with modifications by Clifford Neuman 
  363. Xand George Ferguson (ferguson@cs.rochester.edu).
  364. X
  365. XThis help file was written by John Armstrong (armstrong@leva.leeds.ac.uk).
  366. END_OF_FILE
  367.   if test 6495 -ne `wc -c <'archie.hlp'`; then
  368.     echo shar: \"'archie.hlp'\" unpacked with wrong size!
  369.   fi
  370.   # end of 'archie.hlp'
  371. fi
  372. if test -f 'copyright.h' -a "${1}" != "-c" ; then 
  373.   echo shar: Will not clobber existing file \"'copyright.h'\"
  374. else
  375.   echo shar: Extracting \"'copyright.h'\" \(2519 characters\)
  376.   sed "s/^X//" >'copyright.h' <<'END_OF_FILE'
  377. X/* These are the uw-copyright.h and usc-copyright.h files that appear in
  378. X   the Prospero distribution.  */
  379. X
  380. X/* 
  381. X  Copyright (c) 1989, 1990, 1991 by the University of Washington
  382. X
  383. X  Permission to use, copy, modify, and distribute this software and its
  384. X  documentation for non-commercial purposes and without fee is hereby
  385. X  granted, provided that the above copyright notice appear in all copies
  386. X  and that both the copyright notice and this permission notice appear in
  387. X  supporting documentation, and that the name of the University of
  388. X  Washington not be used in advertising or publicity pertaining to
  389. X  distribution of the software without specific, written prior
  390. X  permission.  The University of Washington makes no representations
  391. X  about the suitability of this software for any purpose.  It is
  392. X  provided "as is" without express or implied warranty.
  393. X
  394. X  Prospero was written by Clifford Neuman (bcn@isi.edu).
  395. X
  396. X  Questions concerning this software should be directed to 
  397. X  info-prospero@isi.edu.
  398. X
  399. X  */
  400. X
  401. X/* 
  402. X  Copyright (c) 1991, 1992 by the University of Southern California
  403. X  All rights reserved.
  404. X
  405. X  Permission to use, copy, modify, and distribute this software and its
  406. X  documentation in source and binary forms for non-commercial purposes
  407. X  and without fee is hereby granted, provided that the above copyright
  408. X  notice appear in all copies and that both the copyright notice and
  409. X  this permission notice appear in supporting documentation. and that
  410. X  any documentation, advertising materials, and other materials related
  411. X  to such distribution and use acknowledge that the software was
  412. X  developed by the University of Southern California, Information
  413. X  Sciences Institute.  The name of the University may not be used to
  414. X  endorse or promote products derived from this software without
  415. X  specific prior written permission.
  416. X
  417. X  THE UNIVERSITY OF SOUTHERN CALIFORNIA makes no representations about
  418. X  the suitability of this software for any purpose.  THIS SOFTWARE IS
  419. X  PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES,
  420. X  INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
  421. X  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  422. X
  423. X  Other copyrights might apply to parts of the Prospero distribution
  424. X  and are so noted when applicable.
  425. X
  426. X  Prospero was originally written by Clifford Neuman (bcn@isi.edu).
  427. X  Contributors include Benjamin Britt (britt@isi.edu)
  428. X  and others identified in individual modules.
  429. X
  430. X  Questions concerning this software should be directed to 
  431. X  info-prospero@isi.edu.
  432. X
  433. X  */
  434. END_OF_FILE
  435.   if test 2519 -ne `wc -c <'copyright.h'`; then
  436.     echo shar: \"'copyright.h'\" unpacked with wrong size!
  437.   fi
  438.   # end of 'copyright.h'
  439. fi
  440. if test -f 'getopt.h' -a "${1}" != "-c" ; then 
  441.   echo shar: Will not clobber existing file \"'getopt.h'\"
  442. else
  443.   echo shar: Extracting \"'getopt.h'\" \(4035 characters\)
  444.   sed "s/^X//" >'getopt.h' <<'END_OF_FILE'
  445. X/* Declarations for getopt.
  446. X   Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
  447. X
  448. X   This program is free software; you can redistribute it and/or modify it
  449. X   under the terms of the GNU Library General Public License as published
  450. X   by the Free Software Foundation; either version 2, or (at your option)
  451. X   any later version.
  452. X
  453. X   This program is distributed in the hope that it will be useful,
  454. X   but WITHOUT ANY WARRANTY; without even the implied warranty of
  455. X   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  456. X   GNU General Public License for more details.
  457. X
  458. X   You should have received a copy of the GNU Library General Public
  459. X   License along with this program; if not, write to the Free Software
  460. X   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
  461. X
  462. X#ifndef _GETOPT_H
  463. X#define _GETOPT_H 1
  464. X
  465. X#ifdef    __cplusplus
  466. Xextern "C" {
  467. X#endif
  468. X
  469. X/* For communication from `getopt' to the caller.
  470. X   When `getopt' finds an option that takes an argument,
  471. X   the argument value is returned here.
  472. X   Also, when `ordering' is RETURN_IN_ORDER,
  473. X   each non-option ARGV-element is returned here.  */
  474. X
  475. Xextern char *optarg;
  476. X
  477. X/* Index in ARGV of the next element to be scanned.
  478. X   This is used for communication to and from the caller
  479. X   and for communication between successive calls to `getopt'.
  480. X
  481. X   On entry to `getopt', zero means this is the first call; initialize.
  482. X
  483. X   When `getopt' returns EOF, this is the index of the first of the
  484. X   non-option elements that the caller should itself scan.
  485. X
  486. X   Otherwise, `optind' communicates from one call to the next
  487. X   how much of ARGV has been scanned so far.  */
  488. X
  489. Xextern int optind;
  490. X
  491. X/* Callers store zero here to inhibit the error message `getopt' prints
  492. X   for unrecognized options.  */
  493. X
  494. Xextern int opterr;
  495. X
  496. X/* Describe the long-named options requested by the application.
  497. X   The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector
  498. X   of `struct option' terminated by an element containing a name which is
  499. X   zero.
  500. X
  501. X   The field `has_arg' is:
  502. X   no_argument        (or 0) if the option does not take an argument,
  503. X   required_argument    (or 1) if the option requires an argument,
  504. X   optional_argument     (or 2) if the option takes an optional argument.
  505. X
  506. X   If the field `flag' is not NULL, it points to a variable that is set
  507. X   to the value given in the field `val' when the option is found, but
  508. X   left unchanged if the option is not found.
  509. X
  510. X   To have a long-named option do something other than set an `int' to
  511. X   a compiled-in constant, such as set a value from `optarg', set the
  512. X   option's `flag' field to zero and its `val' field to a nonzero
  513. X   value (the equivalent single-letter option character, if there is
  514. X   one).  For long options that have a zero `flag' field, `getopt'
  515. X   returns the contents of the `val' field.  */
  516. X
  517. Xstruct option
  518. X{
  519. X#if    __STDC__
  520. X  const char *name;
  521. X#else
  522. X  char *name;
  523. X#endif
  524. X  /* has_arg can't be an enum because some compilers complain about
  525. X     type mismatches in all the code that assumes it is an int.  */
  526. X  int has_arg;
  527. X  int *flag;
  528. X  int val;
  529. X};
  530. X
  531. X/* Names for the values of the `has_arg' field of `struct option'.  */
  532. X
  533. Xenum _argtype
  534. X{
  535. X  no_argument,
  536. X  required_argument,
  537. X  optional_argument
  538. X};
  539. X
  540. X#if __STDC__
  541. Xextern int getopt (int argc, char *const *argv, const char *shortopts);
  542. Xextern int getopt_long (int argc, char *const *argv, const char *shortopts,
  543. X                const struct option *longopts, int *longind);
  544. Xextern int getopt_long_only (int argc, char *const *argv,
  545. X                 const char *shortopts,
  546. X                     const struct option *longopts, int *longind);
  547. X
  548. X/* Internal only.  Users should not call this directly.  */
  549. Xextern int _getopt_internal (int argc, char *const *argv,
  550. X                 const char *shortopts,
  551. X                     const struct option *longopts, int *longind,
  552. X                 int long_only);
  553. X#else /* not __STDC__ */
  554. Xextern int getopt ();
  555. Xextern int getopt_long ();
  556. Xextern int getopt_long_only ();
  557. X
  558. Xextern int _getopt_internal ();
  559. X#endif /* not __STDC__ */
  560. X
  561. X#ifdef    __cplusplus
  562. X}
  563. X#endif
  564. X
  565. X#endif /* _GETOPT_H */
  566. END_OF_FILE
  567.   if test 4035 -ne `wc -c <'getopt.h'`; then
  568.     echo shar: \"'getopt.h'\" unpacked with wrong size!
  569.   fi
  570.   # end of 'getopt.h'
  571. fi
  572. if test -f 'getopt1.c' -a "${1}" != "-c" ; then 
  573.   echo shar: Will not clobber existing file \"'getopt1.c'\"
  574. else
  575.   echo shar: Extracting \"'getopt1.c'\" \(3546 characters\)
  576.   sed "s/^X//" >'getopt1.c' <<'END_OF_FILE'
  577. X/* Getopt for GNU.
  578. X   Copyright (C) 1987, 88, 89, 90, 91, 1992 Free Software Foundation, Inc.
  579. X
  580. X   This program is free software; you can redistribute it and/or modify it
  581. X   under the terms of the GNU Library General Public License as published
  582. X   by the Free Software Foundation; either version 2, or (at your option)
  583. X   any later version.
  584. X
  585. X   This program is distributed in the hope that it will be useful,
  586. X   but WITHOUT ANY WARRANTY; without even the implied warranty of
  587. X   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  588. X   GNU General Public License for more details.
  589. X
  590. X   You should have received a copy of the GNU Library General Public
  591. X   License along with this program; if not, write to the Free Software
  592. X   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
  593. X
  594. X#ifdef    LIBC
  595. X/* For when compiled as part of the GNU C library.  */
  596. X#include <ansidecl.h>
  597. X#endif
  598. X
  599. X#include "getopt.h"
  600. X
  601. X#ifndef __STDC__
  602. X#define const
  603. X#endif
  604. X
  605. X#if defined(STDC_HEADERS) || defined(__GNU_LIBRARY__) || defined (LIBC)
  606. X#include <stdlib.h>
  607. X#else /* STDC_HEADERS or __GNU_LIBRARY__ */
  608. Xchar *getenv ();
  609. X#endif /* STDC_HEADERS or __GNU_LIBRARY__ */
  610. X
  611. X#if !defined (NULL)
  612. X#define NULL 0
  613. X#endif
  614. X
  615. Xint
  616. Xgetopt_long (argc, argv, options, long_options, opt_index)
  617. X     int argc;
  618. X     char *const *argv;
  619. X     const char *options;
  620. X     const struct option *long_options;
  621. X     int *opt_index;
  622. X{
  623. X  return _getopt_internal (argc, argv, options, long_options, opt_index, 0);
  624. X}
  625. X
  626. X/* Like getopt_long, but '-' as well as '--' can indicate a long option.
  627. X   If an option that starts with '-' (not '--') doesn't match a long option,
  628. X   but does match a short option, it is parsed as a short option
  629. X   instead. */
  630. X
  631. Xint 
  632. Xgetopt_long_only (argc, argv, options, long_options, opt_index)
  633. X     int argc;
  634. X     char *const *argv;
  635. X     const char *options;
  636. X     const struct option *long_options;
  637. X     int *opt_index;
  638. X{
  639. X  return _getopt_internal (argc, argv, options, long_options, opt_index, 1);
  640. X}
  641. X
  642. X#ifdef TEST
  643. X
  644. X#include <stdio.h>
  645. X
  646. Xint
  647. Xmain (argc, argv)
  648. X     int argc;
  649. X     char **argv;
  650. X{
  651. X  int c;
  652. X  int digit_optind = 0;
  653. X
  654. X  while (1)
  655. X    {
  656. X      int this_option_optind = optind ? optind : 1;
  657. X      int option_index = 0;
  658. X      static struct option long_options[] =
  659. X      {
  660. X    {"add", 1, 0, 0},
  661. X    {"append", 0, 0, 0},
  662. X    {"delete", 1, 0, 0},
  663. X    {"verbose", 0, 0, 0},
  664. X    {"create", 0, 0, 0},
  665. X    {"file", 1, 0, 0},
  666. X    {0, 0, 0, 0}
  667. X      };
  668. X
  669. X      c = getopt_long (argc, argv, "abc:d:0123456789",
  670. X               long_options, &option_index);
  671. X      if (c == EOF)
  672. X    break;
  673. X
  674. X      switch (c)
  675. X    {
  676. X    case 0:
  677. X      printf ("option %s", long_options[option_index].name);
  678. X      if (optarg)
  679. X        printf (" with arg %s", optarg);
  680. X      printf ("\n");
  681. X      break;
  682. X
  683. X    case '0':
  684. X    case '1':
  685. X    case '2':
  686. X    case '3':
  687. X    case '4':
  688. X    case '5':
  689. X    case '6':
  690. X    case '7':
  691. X    case '8':
  692. X    case '9':
  693. X      if (digit_optind != 0 && digit_optind != this_option_optind)
  694. X        printf ("digits occur in two different argv-elements.\n");
  695. X      digit_optind = this_option_optind;
  696. X      printf ("option %c\n", c);
  697. X      break;
  698. X
  699. X    case 'a':
  700. X      printf ("option a\n");
  701. X      break;
  702. X
  703. X    case 'b':
  704. X      printf ("option b\n");
  705. X      break;
  706. X
  707. X    case 'c':
  708. X      printf ("option c with value `%s'\n", optarg);
  709. X      break;
  710. X
  711. X    case 'd':
  712. X      printf ("option d with value `%s'\n", optarg);
  713. X      break;
  714. X
  715. X    case '?':
  716. X      break;
  717. X
  718. X    default:
  719. X      printf ("?? getopt returned character code 0%o ??\n", c);
  720. X    }
  721. X    }
  722. X
  723. X  if (optind < argc)
  724. X    {
  725. X      printf ("non-option ARGV-elements: ");
  726. X      while (optind < argc)
  727. X    printf ("%s ", argv[optind++]);
  728. X      printf ("\n");
  729. X    }
  730. X
  731. X  exit (0);
  732. X}
  733. X
  734. X#endif /* TEST */
  735. END_OF_FILE
  736.   if test 3546 -ne `wc -c <'getopt1.c'`; then
  737.     echo shar: \"'getopt1.c'\" unpacked with wrong size!
  738.   fi
  739.   # end of 'getopt1.c'
  740. fi
  741. if test -f 'msdos/cutcp.h' -a "${1}" != "-c" ; then 
  742.   echo shar: Will not clobber existing file \"'msdos/cutcp.h'\"
  743. else
  744.   echo shar: Extracting \"'msdos/cutcp.h'\" \(1146 characters\)
  745.   sed "s/^X//" >'msdos/cutcp.h' <<'END_OF_FILE'
  746. X/* cutcp.h -- defs for cutcp code */
  747. X
  748. X
  749. Xint         netlisten(unsigned int port);
  750. Xstruct machinfo *Shostlook(char *name);
  751. Xint         Sdomain(char *name);
  752. Xstruct machinfo *Sgethost(char *name);
  753. Xstruct machinfo *Slookip(unsigned long *address);
  754. Xvoid        netgetftp(unsigned int array[], unsigned int port);
  755. Xint         netopen(unsigned long *address, unsigned int port);
  756. Xint         Snetopen(struct machinfo *m, unsigned int port);
  757. Xint        netqlen(int handle);
  758. Xint        netroom(int handle);
  759. Xint        netread(int pnum, unsigned char *buffer, unsigned int n);
  760. Xint        netwrite(int pnum, unsigned char *buffer, unsigned int n);
  761. Xint        netest(int pnum);
  762. Xint        netpush(int pnum);
  763. Xvoid        netulisten(unsigned int portnum);
  764. Xint        netusend(unsigned long *address, unsigned destport, 
  765. X            unsigned sourceport, unsigned char *buffer, int count);
  766. Xint        neturead(unsigned char    *buffer);
  767. Xstruct machinfo *Slooknum(int pnum);
  768. Xint        Snetinit();
  769. Xint        Shostfile(char *name);
  770. Xint        netshut();
  771. Xint        Sgetevent(int classes, int *clss, int *data);
  772. Xint        netclose(int pnum);
  773. Xunsigned int    intswap(unsigned int val);
  774. Xunsigned long    n_clicks(void *p);
  775. Xvoid        Stask();
  776. X
  777. X#define    ntohs(a)    (intswap(a))
  778. X#define    htons(a)    (intswap(a))
  779. END_OF_FILE
  780.   if test 1146 -ne `wc -c <'msdos/cutcp.h'`; then
  781.     echo shar: \"'msdos/cutcp.h'\" unpacked with wrong size!
  782.   fi
  783.   # end of 'msdos/cutcp.h'
  784. fi
  785. if test -f 'msdos/hostform.h' -a "${1}" != "-c" ; then 
  786.   echo shar: Will not clobber existing file \"'msdos/hostform.h'\"
  787. else
  788.   echo shar: Extracting \"'msdos/hostform.h'\" \(5756 characters\)
  789.   sed "s/^X//" >'msdos/hostform.h' <<'END_OF_FILE'
  790. X/* hfile.inc - placed into all .h files to set up for PVCS 
  791. X   $Header: /tmp_mnt/com/projects/archie/msdos/RCS/hostform.h,v 1.2 1991/12/13 20:08:52 brendan Exp $
  792. X   Revision History ----------------------------------------------------
  793. X   $Log: hostform.h,v $
  794. X * Revision 1.2  1991/12/13  20:08:52  brendan
  795. X * entered into RCS
  796. X *
  797. X * 
  798. X *    Rev 1.0   15 Jan 1990 19:30:22   bkc
  799. X*/
  800. X
  801. X
  802. X/*
  803. X*  Host and local machine configuration information.
  804. X*
  805. X****************************************************************************
  806. X*                                                                          *
  807. X*      NCSA Telnet for the PC                                              *
  808. X*      by Tim Krauskopf, VT100 by Gaige Paulsen, Tek by Aaron Contorer     *
  809. X*                                                                          *
  810. X*      National Center for Supercomputing Applications                     *
  811. X*      152 Computing Applications Building                                 *
  812. X*      605 E. Springfield Ave.                                             *
  813. X*      Champaign, IL  61820                                                *
  814. X*                                                                          *
  815. X*      This program is in the public domain.                               *
  816. X*                                                                          *
  817. X****************************************************************************
  818. X*/
  819. X
  820. X/*
  821. X*  Linked list of structures which describe other machines.
  822. X*  Arranged one per session with unique session names.
  823. X*/
  824. X
  825. Xstruct machinfo {
  826. X    unsigned char 
  827. X        *sname,                    /* pointer to name of session */
  828. X        *hname,                 /* pointer to name of that machine */
  829. X        *font,                    /* font name, if we can do it */
  830. X        *keymap,                /* pointer to keymap file name */
  831. X        hostip[4],                /* IP number of this machine */
  832. X        gateway,                /* gateway preference, start with 1 */
  833. X        nameserv,                /* nameserver preference, start with 1 */
  834. X        bksp,                    /* backspace value */
  835. X        halfdup,                /* half duplex required */
  836. X        crmap,                    /* Strange Berkeley 4.3 CR mode needed */
  837. X        vtwrap,                    /* flag on when need wrap mode */
  838. X        vtmargin;                /* col to ring bell at */
  839. X    int
  840. X        clearsave,                /* whether to save cleared lines */
  841. X        fsize,                    /* font size in points */
  842. X        nfcolor[3],                /* normal foreground */
  843. X        nbcolor[3],                /* normal background */
  844. X        bfcolor[3],                /* blink             */
  845. X        bbcolor[3],
  846. X        ufcolor[3],             /* underline */
  847. X        ubcolor[3],
  848. X        mno,                    /* machine number for reference */
  849. X        mstat,                    /* status of this machine entry */
  850. X        bkscroll,                /* how many lines to save */
  851. X        retrans,                /* initial retrans timeout */
  852. X        conto,                    /* time out in seconds to wait for connect */
  853. X        window,                    /* window, will be checked against buffers */
  854. X        maxseg,                    /* maximum receivable segment size */
  855. X        mtu,                    /* maximum transfer unit MTU (out) */
  856. X                domainsremaining,                       /* how many domain search list entries remain */
  857. X                destport,                               /* yepper, you can telnet to a different port than 23 */
  858. X        flags;                    /* general flags holder */        
  859. X#define    MFLAGS_SCRIPT    0x80
  860. X    struct machinfo *next;        /* surprise, its a linked list! */
  861. X};
  862. X
  863. Xstruct machinfo *Sgethost(),*Shostlook(),*Slooknum(),*Slookip(),*Smadd();
  864. X
  865. X/*
  866. X*  status fields for mstat, what do we know about that machine?
  867. X*/
  868. X#define NOIP 1                    /* we don't have IP number */
  869. X#define UDPDOM 3                /* there is a UDP request pending on it */
  870. X/*  The next 20 numbers are reserved for UDPDOM */
  871. X#define HAVEIP 50                /* at least we have the # */
  872. X#define HFILE 70                /* we have IP number from host file */
  873. X#define DOM 71                    /* we have an IP number from DOMAIN */
  874. X#define FROMKIP 72                /* have IP# from KIP server */
  875. X
  876. X
  877. X
  878. X/*
  879. X*   Configuration information which 
  880. X*   the calling program may want to obtain from the hosts file.
  881. X*   The calling program should include hostform.h and call
  882. X*   Sgetconfig(cp)
  883. X*     struct config *cp;
  884. X*   which will copy the information to the user's data structure.
  885. X*/
  886. Xstruct config {
  887. X    unsigned char
  888. X        netmask[4],                /* subnetting mask being used */
  889. X        havemask,                /* do we have a netmask? */
  890. X        irqnum,                    /* which hardware interrupt */
  891. X        myipnum[4],                /* what is my IP #? */
  892. X        me[32],                    /* my name description (first 30 chars) */
  893. X        color[3],                /* default colors to use */
  894. X        hw[10],                    /* hardware type for network */
  895. X        video[10],                /* video graphics hardware available */
  896. X        bios,                    /* flag, do we want to use BIOS for screen access */
  897. X        tek,                    /* flag, enable tektronix graphics */
  898. X        ftp,                    /* flag, enable ftp server */
  899. X        rcp,                    /* flag, enable rcp server */
  900. X        comkeys,                /* flag, commandkeys=yes */
  901. X        *termtype,                /* terminal type specification */
  902. X        *zone,                    /* AppleTalk zone for KIP NBP */
  903. X        *defdom,                /* default domain */
  904. X        *capture,                /* pointer to where the capture file name is */
  905. X        *pass,                    /* pointer to where the password file name is */
  906. X        *hpfile,                /* HP file name */
  907. X        *psfile,                /* PS file name */
  908. X        *tekfile;                /* tek file name */
  909. Xint
  910. X        nstype,                    /* nameserver = 1-domain 2-IEN116  */
  911. X        domto,                    /* time out for UDP domain request */
  912. X        ndom,                    /* number of retries for domain requests */
  913. X        timesl,                    /* time slice */
  914. X        address,                /* segment address */
  915. X        ioaddr;                    /* I/O address */
  916. Xchar            *domainpath;                               /* domain name search path */
  917. Xchar            *map3270;                               /* path to 3270 map */
  918. Xchar            tnmode;                                 /* how we decide to connect to 3270 streams */
  919. Xlong        sys_flags;
  920. X#define    SYS_FLAGS_VISUAL_BELL    0x1        /* use visual bell */
  921. X
  922. X};
  923. X
  924. X
  925. X#define TNMODE_FLAGGED  0
  926. X#define TNMODE_AUTO     1
  927. X#define TNMODE_NOTFLAGGED 2
  928. X#define TNMODE_OFF      3
  929. END_OF_FILE
  930.   if test 5756 -ne `wc -c <'msdos/hostform.h'`; then
  931.     echo shar: \"'msdos/hostform.h'\" unpacked with wrong size!
  932.   fi
  933.   # end of 'msdos/hostform.h'
  934. fi
  935. if test -f 'perrno.h' -a "${1}" != "-c" ; then 
  936.   echo shar: Will not clobber existing file \"'perrno.h'\"
  937. else
  938.   echo shar: Extracting \"'perrno.h'\" \(4624 characters\)
  939.   sed "s/^X//" >'perrno.h' <<'END_OF_FILE'
  940. X/*
  941. X * Copyright (c) 1989, 1990 by the University of Washington
  942. X *
  943. X * For copying and distribution information, please see the file
  944. X * <copyright.h>.
  945. X */
  946. X
  947. X#include <copyright.h>
  948. X
  949. X/* This file and perrmesg.c should be updated simultaneously.  */
  950. X
  951. X/*
  952. X * perrno.h - definitions for perrno
  953. X *
  954. X * This file contains the declarations and defintions of of the external
  955. X * error values in which errors are returned by the pfs and psrv
  956. X * libraries.
  957. X */
  958. X
  959. X#define        P_ERR_STRING_SZ 100     /* Size of error string        */
  960. X
  961. Xextern int    perrno;
  962. Xextern char    p_err_string[];
  963. Xextern char    *p_err_text[];
  964. X
  965. Xextern int    pwarn;
  966. Xextern char    p_warn_string[];
  967. Xextern char    *p_warn_text[];
  968. X
  969. X/* Error codes returned or found in verrno */
  970. X
  971. X#ifndef PSUCCESS
  972. X#define    PSUCCESS        0
  973. X#endif
  974. X
  975. X/* dirsend (perrno) */
  976. X#define DIRSEND_PORT_UNKN    1    /* DIRSRV UDP port unknown      */
  977. X#define DIRSEND_UDP_CANT    2    /* Can't open local UDP port    */
  978. X#define DIRSEND_BAD_HOSTNAME    3    /* Can't resolve hostname       */
  979. X#define DIRSEND_NOT_ALL_SENT    4    /* Didn't send entire message   */
  980. X#define DIRSEND_SELECT_FAILED    5    /* Select failed            */
  981. X#define DIRSEND_BAD_RECV    6    /* Recvfrom failed             */
  982. X
  983. X/* reply */
  984. X#define REPLY_NOTSENT        11    /* Reply: sendto failed            */
  985. X
  986. X/* vl_insert */
  987. X#define VL_INSERT_ALREADY_THERE    21    /* Link already exists            */
  988. X#define VL_INSERT_CONFLICT    22    /* Link exists with same name   */
  989. X
  990. X/* ul_insert */
  991. X#define UL_INSERT_ALREADY_THERE 25    /* Link already exists        */
  992. X#define UL_INSERT_SUPERSEDING   26    /* Replacing existing link    */
  993. X#define UL_INSERT_POS_NOTFOUND  27    /* Prv entry not in dir->ulinks */
  994. X
  995. X/* rd_vdir */
  996. X#define RVD_DIR_NOT_THERE    41    /* Temporary NOT_FOUND            */
  997. X#define RVD_NO_CLOSED_NS    42    /* Namespace not closed w/ object:: */
  998. X#define RVD_NO_NS_ALIAS        43    /* No alias for namespace NS#:      */
  999. X#define RVD_NS_NOT_FOUND    44    /* Specified namespace not found    */
  1000. X
  1001. X/* pfs_access */
  1002. X#define PFSA_AM_NOT_SUPPORTED   51      /* Access method not supported  */
  1003. X
  1004. X/* pmap_cache */
  1005. X#define PMC_DELETE_ON_CLOSE     55    /* Delete cached copy on close   */
  1006. X#define PMC_RETRIEVE_FAILED     56      /* Unable to retrieve file       */
  1007. X
  1008. X/* mk_vdir */
  1009. X/* #define MKVD_ALREADY_EXISTS     61    /* Directory already exists      */
  1010. X/* #define MKVD_NAME_CONFLICT    62    /* Link with name already exists */
  1011. X
  1012. X/* vfsetenv */
  1013. X#define VFSN_NOT_A_VS        65    /* Not a virtual system          */
  1014. X#define VFSN_CANT_FIND_DIR    66    /* Not a virtual system          */
  1015. X
  1016. X/* add_vlink */
  1017. X/* #define ADDVL_ALREADY_EXISTS    71    /* Directory already exists      */
  1018. X/* #define ADDVL_NAME_CONFLICT    72    /* Link with name already exists */
  1019. X
  1020. X/* Local error codes on server */
  1021. X
  1022. X/* dsrdir */
  1023. X#define DSRDIR_NOT_A_DIRECTORY 111    /* Not a directory name        */
  1024. X/* dsrfinfo */
  1025. X#define DSRFINFO_NOT_A_FILE    121      /* Object not found             */
  1026. X#define DSRFINFO_FORWARDED     122      /* Object has moved             */
  1027. X
  1028. X/* Error codes that may be returned by various procedures               */
  1029. X#define PFS_FILE_NOT_FOUND     230      /* File not found               */
  1030. X#define PFS_DIR_NOT_FOUND      231      /* Directory in path not found  */
  1031. X#define PFS_SYMLINK_DEPTH      232    /* Max sym-link depth exceeded  */
  1032. X#define PFS_ENV_NOT_INITIALIZED    233    /* Can't read environment    */
  1033. X#define PFS_EXT_USED_AS_DIR    234    /* Can't use externals as dirs  */
  1034. X#define PFS_MAX_FWD_DEPTH      235    /* Exceeded max forward depth   */
  1035. X
  1036. X/* Error codes returned by directory server                    */
  1037. X/* some of these duplicate errors from individual routines     */
  1038. X/* some of those error codes should be eliminated              */
  1039. X#define DIRSRV_AUTHENT_REQ     242      /* Authentication required       */
  1040. X#define DIRSRV_NOT_AUTHORIZED  243      /* Not authorized                */
  1041. X#define DIRSRV_NOT_FOUND       244      /* Not found                     */
  1042. X#define DIRSRV_BAD_VERS        245
  1043. X#define DIRSRV_NOT_DIRECTORY   246
  1044. X#define DIRSRV_ALREADY_EXISTS  247    /* Identical link already exists */
  1045. X#define DIRSRV_NAME_CONFLICT   248    /* Link with name already exists */
  1046. X
  1047. X#define DIRSRV_UNIMPLEMENTED   251      /* Unimplemented command         */
  1048. X#define DIRSRV_BAD_FORMAT      252
  1049. X#define DIRSRV_ERROR           253
  1050. X#define DIRSRV_SERVER_FAILED   254      /* Unspecified server failure    */
  1051. X
  1052. X#ifndef PFAILURE
  1053. X#define    PFAILURE            255
  1054. X#endif
  1055. X
  1056. X/* Warning codes */
  1057. X
  1058. X#define PNOWARN             0    /* No warning indicated         */
  1059. X#define PWARN_OUT_OF_DATE     1    /* Software is out of date       */
  1060. X#define PWARN_MSG_FROM_SERVER     2      /* Warning in p_warn_string      */
  1061. X#define PWARN_UNRECOGNIZED_RESP  3    /* Unrecognized line in response */
  1062. X#define PWARNING           255    /* Warning in p_warn_string      */
  1063. END_OF_FILE
  1064.   if test 4624 -ne `wc -c <'perrno.h'`; then
  1065.     echo shar: \"'perrno.h'\" unpacked with wrong size!
  1066.   fi
  1067.   # end of 'perrno.h'
  1068. fi
  1069. if test -f 'pmachine.h' -a "${1}" != "-c" ; then 
  1070.   echo shar: Will not clobber existing file \"'pmachine.h'\"
  1071. else
  1072.   echo shar: Extracting \"'pmachine.h'\" \(2958 characters\)
  1073.   sed "s/^X//" >'pmachine.h' <<'END_OF_FILE'
  1074. X/*
  1075. X * This is where we drop in the various dependencies for different systems.
  1076. X * Someday this might be remotely complete.
  1077. X *
  1078. X * I kept the name pmachine.h because it was already in all of the files...this
  1079. X * barely resembles the pmachine.h that comes with the real Prospero, though.
  1080. X *
  1081. X * $Revision: 1.12 $
  1082. X */
  1083. X
  1084. X#ifdef u3b2
  1085. X# define USG
  1086. X# define NOREGEX
  1087. X# define MAXPATHLEN 1024       /* There's no maxpathlen in any 3b2 .h file.  */
  1088. X#endif
  1089. X
  1090. X#ifdef m88k
  1091. X#define MAXPATHLEN 1024
  1092. X#endif
  1093. X
  1094. X#ifdef hpux
  1095. X# ifndef bcopy
  1096. X#  define FUNCS            /* HP/UX 8.0 has the fns.  */
  1097. X# endif
  1098. X# define NOREGEX
  1099. X# define NEED_STRING_H
  1100. X#endif
  1101. X
  1102. X/* These are required for a Sequent running Dynix/PTX, their SysV variant.
  1103. X   Archie builds fine untouched on a system running their BSD-based OS.  */
  1104. X#ifdef _SEQUENT_
  1105. X# define NOREGEX
  1106. X# define USG
  1107. X#endif
  1108. X
  1109. X#if defined(USG) || defined(SYSV)
  1110. X# define FUNCS
  1111. X#endif
  1112. X
  1113. X#ifdef SOLARIS2
  1114. X#define FUNCS
  1115. X#define NOREGEX
  1116. X#define NEED_STRING_H
  1117. X#endif
  1118. X
  1119. X#ifdef ISC
  1120. X# define FUNCS
  1121. X# define STRSPN
  1122. X# define NOREGEX
  1123. X#endif
  1124. X
  1125. X#ifdef PCNFS
  1126. X# define FUNCS
  1127. X# define NEED_STRING_H
  1128. X#ifndef MSDOS
  1129. X# define MSDOS
  1130. X#endif
  1131. X#endif
  1132. X
  1133. X#ifdef CUTCP
  1134. X# define FUNCS
  1135. X# define NOREGEX
  1136. X# define NEED_STRING_H
  1137. X# define SELECTARG int
  1138. X# ifndef MSDOS
  1139. X#  define MSDOS
  1140. X# endif
  1141. X#endif
  1142. X
  1143. X#ifdef _AUX_SOURCE
  1144. X# define AUX
  1145. X# define NOREGEX
  1146. X# define NBBY 8    /* Number of bits in a byte.  */
  1147. Xtypedef long Fd_mask;
  1148. X# define NFDBITS (sizeof(Fd_mask) * NBBY)    /* bits per mask */
  1149. X#endif
  1150. X
  1151. X#ifdef OS2
  1152. X# define NOREGEX
  1153. X# include <pctcp.h>
  1154. X#endif
  1155. X#ifdef MSDOS
  1156. X# define USG
  1157. X# define NOREGEX
  1158. X# include <string.h>
  1159. X# include <stdlib.h>
  1160. X#endif
  1161. X
  1162. X#ifdef _AIX
  1163. X# ifdef u370
  1164. X#  define FUNCS
  1165. X# endif /* AIX/370 */
  1166. X# define _NONSTD_TYPES
  1167. X# define _BSD_INCLUDES
  1168. X# define NEED_STRING_H
  1169. X# define NEED_SELECT_H
  1170. X# define NEED_TIME_H
  1171. X#endif
  1172. X
  1173. X/* General problems.  */
  1174. X
  1175. X#ifdef FUNCS
  1176. X# define index        strchr
  1177. X/* According to mycroft@gnu.ai.mit.edu. */
  1178. X# ifdef _IBMR2
  1179. Xchar *strchr();
  1180. X# endif
  1181. X# define rindex        strrchr
  1182. X# ifndef _AUX_SOURCE
  1183. X#  define bcopy(a,b,n)    memcpy(b,a,n)
  1184. X#  define bzero(a,n)    memset(a,0,n)
  1185. X# ifdef _IBMR2
  1186. Xchar *memset();
  1187. X# endif
  1188. X# endif
  1189. X#endif
  1190. X
  1191. X#if defined(_IBMR2) || defined(_BULL_SOURCE)
  1192. X# define NEED_SELECT_H
  1193. X#endif
  1194. X#if defined(USG) || defined(UTS)
  1195. X# define NEED_STRING_H
  1196. X#endif
  1197. X#if defined(USG) || defined(UTS) || defined(_AUX_SOURCE)
  1198. X# define NEED_TIME_H
  1199. X# ifdef UTS
  1200. X#  define WANT_BOTH_TIME
  1201. X# endif
  1202. X#endif
  1203. X
  1204. X#ifdef VMS
  1205. X/* Get the system status stuff.  */
  1206. X# include <ssdef.h>
  1207. X#endif /* VMS */
  1208. X
  1209. X/*
  1210. X * FD_SET: lib/pfs/dirsend.c, user/vget/ftp.c
  1211. X */
  1212. X#ifndef CUTCP
  1213. X
  1214. X#define SELECTARG fd_set
  1215. X#if !defined(FD_SET) && !defined(VMS) && !defined(NEED_SELECT_H)
  1216. X#define    FD_SETSIZE    32
  1217. X#define    FD_SET(n, p)    ((p)->fds_bits[(n)/NFDBITS] |= (1 << ((n) % NFDBITS)))
  1218. X#define    FD_CLR(n, p)    ((p)->fds_bits[(n)/NFDBITS] &= ~(1 << ((n) % NFDBITS)))
  1219. X#define    FD_ISSET(n, p)    ((p)->fds_bits[(n)/NFDBITS] & (1 << ((n) % NFDBITS)))
  1220. X#undef FD_ZERO
  1221. X#define FD_ZERO(p)    bzero((char *)(p), sizeof(*(p)))
  1222. X#endif
  1223. X
  1224. X#endif /* not CUTCP */
  1225. END_OF_FILE
  1226.   if test 2958 -ne `wc -c <'pmachine.h'`; then
  1227.     echo shar: \"'pmachine.h'\" unpacked with wrong size!
  1228.   fi
  1229.   # end of 'pmachine.h'
  1230. fi
  1231. if test -f 'procquery.c' -a "${1}" != "-c" ; then 
  1232.   echo shar: Will not clobber existing file \"'procquery.c'\"
  1233. else
  1234.   echo shar: Extracting \"'procquery.c'\" \(6645 characters\)
  1235.   sed "s/^X//" >'procquery.c' <<'END_OF_FILE'
  1236. X/*
  1237. X * procquery.c : Routines for processing results from Archie
  1238. X *
  1239. X * Originally part of the Prospero Archie client by Cliff Neuman (bcn@isi.edu).
  1240. X * Modified by Brendan Kehoe (brendan@cygnus.com).
  1241. X * Re-modified by George Ferguson (ferguson@cs.rochester.edu).
  1242. X *
  1243. X * Copyright (c) 1991 by the University of Washington
  1244. X *
  1245. X * For copying and distribution information, please see the file
  1246. X * <copyright.h>.
  1247. X *
  1248. X */
  1249. X
  1250. X#include <stdio.h>
  1251. X#include <pfs.h>
  1252. X#include <perrno.h>
  1253. X#include <pmachine.h>
  1254. X#include <archie.h>
  1255. X
  1256. X#ifdef NEED_TIME_H
  1257. X# include <time.h>
  1258. X# ifdef WANT_BOTH_TIME
  1259. X#  include <sys/time.h>
  1260. X# endif
  1261. X#else
  1262. X# ifndef VMS
  1263. X#  include <sys/time.h>
  1264. X# endif
  1265. X#endif
  1266. X
  1267. X/* Defined in dirsend.c.  */
  1268. Xextern int client_dirsrv_timeout, client_dirsrv_retry;
  1269. X/* In archie.c.  */
  1270. Xextern char *program_name;
  1271. Xextern FILE *archie_out;
  1272. X
  1273. X/*
  1274. X * Functions defined here
  1275. X */
  1276. Xstatic void display_link (), alex_name ();
  1277. Xvoid procquery ();
  1278. X
  1279. X/*
  1280. X * Data defined here
  1281. X */
  1282. Xextern int pwarn, perrno;
  1283. Xextern int listflag, sortflag, alex;
  1284. X
  1285. Xint pfs_debug;
  1286. X
  1287. Xstatic struct tm *presenttime;
  1288. Xstatic char lastpath[MAX_VPATH] = "\001";
  1289. Xstatic char lasthost[MAX_VPATH] = "\001";
  1290. X
  1291. X/* Print the contents of the given virtual link.  */
  1292. Xstatic void
  1293. Xdisplay_link (l)
  1294. X     VLINK l;
  1295. X{
  1296. X    PATTRIB     ap;
  1297. X    char    linkpath[MAX_VPATH];
  1298. X    int        dirflag = 0;
  1299. X#ifdef MSDOS
  1300. X    unsigned long size = 0L;
  1301. X#else
  1302. X    int        size = 0;
  1303. X#endif
  1304. X    char    *modes = "";
  1305. X    char    archie_date[20];
  1306. X    char    *gt_date = "";
  1307. X    int        gt_year = 0;
  1308. X    int        gt_mon = 0;
  1309. X    int        gt_day = 0;
  1310. X    int        gt_hour = 0;
  1311. X    int        gt_min = 0;
  1312. X    int        special = listflag || alex;
  1313. X
  1314. X    /* Initialize local buffers */
  1315. X    *archie_date = '\0';
  1316. X
  1317. X    /* Remember if we're looking at a directory */
  1318. X    if (sindex(l->type,"DIRECTORY"))
  1319. X    dirflag = 1;
  1320. X    else
  1321. X    dirflag = 0;
  1322. X    
  1323. X    /* Extract the linkpath from the filename */
  1324. X    strcpy(linkpath,l->filename);
  1325. X    *(linkpath + (strlen(linkpath) - strlen(l->name) - 1)) = '\0';
  1326. X    
  1327. X    /* Is this a new host? */
  1328. X    if (strcmp(l->host,lasthost) != 0) {
  1329. X    if (!special)
  1330. X        fprintf (archie_out, "\nHost %s\n\n",l->host);
  1331. X    strcpy(lasthost,l->host);
  1332. X    *lastpath = '\001';
  1333. X    }
  1334. X    
  1335. X    /* Is this a new linkpath (location)? */
  1336. X    if(strcmp(linkpath,lastpath) != 0) {
  1337. X    if (!special)
  1338. X        fprintf (archie_out,
  1339. X             "    Location: %s\n",(*linkpath ? linkpath : "/"));
  1340. X    strcpy(lastpath,linkpath);
  1341. X    }
  1342. X    
  1343. X    /* Parse the attibutes of this link */
  1344. X    for (ap = l->lattrib; ap; ap = ap->next) {
  1345. X    if (strcmp(ap->aname,"SIZE") == 0) {
  1346. X#ifdef MSDOS
  1347. X        sscanf(ap->value.ascii,"%lu",&size);
  1348. X#else
  1349. X        sscanf(ap->value.ascii,"%d",&size);
  1350. X#endif
  1351. X    } else if(strcmp(ap->aname,"UNIX-MODES") == 0) {
  1352. X        modes = ap->value.ascii;
  1353. X    } else if(strcmp(ap->aname,"LAST-MODIFIED") == 0) {
  1354. X        gt_date = ap->value.ascii;
  1355. X        sscanf(gt_date,"%4d%2d%2d%2d%2d",>_year,
  1356. X           >_mon, >_day, >_hour, >_min);
  1357. X        if ((12 * (presenttime->tm_year + 1900 - gt_year) + 
  1358. X                    presenttime->tm_mon - gt_mon) > 6) 
  1359. X        sprintf(archie_date,"%s %2d %4d",month_sname(gt_mon),
  1360. X            gt_day, gt_year);
  1361. X        else
  1362. X        sprintf(archie_date,"%s %2d %02d:%02d",month_sname(gt_mon),
  1363. X             gt_day, gt_hour, gt_min);
  1364. X    }
  1365. X    }
  1366. X    
  1367. X    /* Print this link's information */
  1368. X    if (listflag)
  1369. X#if defined(MSDOS)
  1370. X      fprintf (archie_out,
  1371. X           "%s %6lu %s %s%s\n",gt_date,size,l->host,l->filename,
  1372. X           (dirflag ? "/" : ""));
  1373. X#else
  1374. X    fprintf (archie_out,
  1375. X         "%s %6d %s %s%s\n",gt_date,size,l->host,l->filename,
  1376. X         (dirflag ? "/" : ""));
  1377. X#endif
  1378. X    else if (alex)
  1379. X      alex_name (l->host, l->filename, dirflag);
  1380. X    else
  1381. X#ifdef MSDOS
  1382. X    fprintf (archie_out,
  1383. X         "      %9s %s %10lu  %s  %s\n",(dirflag ? "DIRECTORY" : "FILE"),
  1384. X         modes,size,archie_date,l->name);
  1385. X#else
  1386. X    fprintf (archie_out,
  1387. X         "      %9s %s %10d  %s  %s\n",(dirflag ? "DIRECTORY" : "FILE"),
  1388. X         modes,size,archie_date,l->name);
  1389. X#endif /* MSDOS */
  1390. X
  1391. X
  1392. X    /* Free the attibutes */
  1393. X    atlfree(l->lattrib);
  1394. X    l->lattrib = NULL;
  1395. X}
  1396. X
  1397. X/*    -    -    -    -    -    -    -    -    */
  1398. X/*
  1399. X * procquery : Process the given query and display the results. If
  1400. X *    sortflag is non-zero, then the results are sorted by increasing
  1401. X *    date, else by host/filename. If listflag is non-zero then each
  1402. X *    entry is printed on a separate, complete line. Note that listflag
  1403. X *    is ignored by xarchie.
  1404. X */
  1405. Xvoid
  1406. Xprocquery(host,str,max_hits,offset,query)
  1407. Xchar *host,*str;
  1408. Xint max_hits,offset;
  1409. XQuery query;
  1410. X{
  1411. X    VLINK l;
  1412. X    long now;
  1413. X
  1414. X    /* initialize data structures for this query */
  1415. X    (void)time(&now);
  1416. X    presenttime = localtime(&now);
  1417. X
  1418. X    /* Do the query */
  1419. X    if (sortflag == 1)
  1420. X    l = archie_query(host,str,max_hits,offset,query,AQ_INVDATECMP,0);
  1421. X    else
  1422. X    l = archie_query(host,str,max_hits,offset,query,NULL,0);
  1423. X
  1424. X    /* Error? */
  1425. X    if (perrno != PSUCCESS) {
  1426. X    if (p_err_text[perrno]) {
  1427. X        if (*p_err_string)
  1428. X        fprintf(stderr, "%s: failed: %s - %s\n",
  1429. X            program_name, p_err_text[perrno], p_err_string);
  1430. X        else
  1431. X            fprintf(stderr, "%s failed: %s\n",
  1432. X            program_name, p_err_text[perrno]);
  1433. X    } else
  1434. X        fprintf(stderr, "%s failed: Undefined error %d (prospero)",
  1435. X            program_name, perrno);
  1436. X    }
  1437. X
  1438. X    /* Warning? */
  1439. X    if (pwarn != PNOWARN) {
  1440. X    if (*p_warn_string)
  1441. X        fprintf(stderr, "%s: Warning! %s - %s\n", program_name,
  1442. X        p_warn_text[pwarn], p_warn_string);
  1443. X    else
  1444. X        fprintf(stderr, "%s: Warning! %s\n", program_name, p_warn_text[pwarn]);
  1445. X    }
  1446. X
  1447. X
  1448. X    /* Display the results */
  1449. X
  1450. X    if (l == (VLINK)NULL && pwarn == PNOWARN && perrno == PSUCCESS) {
  1451. X    if (! listflag) puts ("No matches.");
  1452. X#ifdef CUTCP
  1453. X    netshut();
  1454. X#endif
  1455. X    exit (1);
  1456. X    }
  1457. X
  1458. X    *lasthost = '\001';
  1459. X    *lastpath = '\001';
  1460. X    while (l != NULL) {
  1461. X    display_link (l);
  1462. X    l = l->next;
  1463. X    }
  1464. X}
  1465. X
  1466. X/* Given a dotted hostname, return its Alex root.  */
  1467. Xstatic char *
  1468. Xalex_reverse (string, len)
  1469. X     char *string;
  1470. X     int len;
  1471. X{
  1472. X  register char *p, *q;
  1473. X  register int i = 0;
  1474. X  char *buf = (char *) malloc (len);
  1475. X
  1476. X  p = buf;
  1477. X  q = (char *) (string + len - 1);
  1478. X  while (q > string)
  1479. X    {
  1480. X      for (i = 0; q > string; q--, i++)
  1481. X    if (*q == '.')
  1482. X      {
  1483. X        q++;
  1484. X        break;
  1485. X      }
  1486. X      if (q == string)
  1487. X    i++;
  1488. X      strncpy (p, q, i);
  1489. X      p += i;
  1490. X      *p++ = '/';
  1491. X      i = 0;
  1492. X      q -= 2;
  1493. X    }
  1494. X  *--p = '\0';
  1495. X  return buf;
  1496. X}
  1497. X
  1498. X/* Emit a string that's the Alex filename for the given host and file.  */
  1499. Xstatic void
  1500. Xalex_name (host, file, dirp)
  1501. X     char *host, *file;
  1502. X     int dirp;
  1503. X{
  1504. X  int hostlen = strlen (host);
  1505. X  int len = 6 + hostlen + strlen (file) + dirp +  1;
  1506. X  char *buf = (char *) malloc (len);
  1507. X
  1508. X  if (! buf)
  1509. X    exit (99);
  1510. X
  1511. X  sprintf (buf, "/alex/%s%s", alex_reverse (host, hostlen), file);
  1512. X  if (dirp)
  1513. X    {
  1514. X      len -= dirp;
  1515. X      buf[len - 1] = '/';
  1516. X      buf[len] = '\0';
  1517. X    }
  1518. X
  1519. X  fputs (buf, archie_out);
  1520. X}
  1521. END_OF_FILE
  1522.   if test 6645 -ne `wc -c <'procquery.c'`; then
  1523.     echo shar: \"'procquery.c'\" unpacked with wrong size!
  1524.   fi
  1525.   # end of 'procquery.c'
  1526. fi
  1527. if test -f 'vms/network.h' -a "${1}" != "-c" ; then 
  1528.   echo shar: Will not clobber existing file \"'vms/network.h'\"
  1529. else
  1530.   echo shar: Extracting \"'vms/network.h'\" \(4939 characters\)
  1531.   sed "s/^X//" >'vms/network.h' <<'END_OF_FILE'
  1532. X/* Miscellaneous things for the networking library.  */
  1533. X
  1534. X/* Actually an itemlist_3, but can be used for itemlist_2's.  */
  1535. Xstruct itemlist
  1536. X{
  1537. X  short length;
  1538. X  short code;
  1539. X  char *dataptr;
  1540. X  short *retlenptr;
  1541. X};
  1542. X
  1543. Xunion socket_addr
  1544. X{
  1545. X  struct sockaddr_in in;
  1546. X};
  1547. X
  1548. X#define   TCP$SEND        (IO$_WRITEVBLK)
  1549. X#define   TCP$RECEIVE     (IO$_READVBLK)
  1550. X#define   TCP$OPEN        (IO$_CREATE)
  1551. X#define   TCP$CLOSE       (IO$_DELETE)
  1552. X#define   TCP$ABORT       (IO$_DEACCESS)
  1553. X#define   TCP$STATUS      (IO$_ACPCONTROL)
  1554. X#define   TCP$INFO        (IO$_MODIFY)
  1555. X#define   GTHST           (IO$_SKIPFILE)
  1556. X
  1557. X#define   IO$_SEND        (IO$_WRITEVBLK)
  1558. X#define   IO$_RECEIVE     (IO$_READVBLK)
  1559. X#ifndef IO$S_FCODE
  1560. X#define IO$S_FCODE 0x0006
  1561. X#endif
  1562. X#define   IO$_SOCKET      (IO$_ACCESS | (0 << IO$S_FCODE))
  1563. X#define   IO$_BIND        (IO$_ACCESS | (1 << IO$S_FCODE))
  1564. X#define   IO$_LISTEN      (IO$_ACCESS | (2 << IO$S_FCODE))
  1565. X#define   IO$_ACCEPT      (IO$_ACCESS | (3 << IO$S_FCODE))
  1566. X#define   IO$_CONNECT     (IO$_ACCESS | (4 << IO$S_FCODE))
  1567. X#define   IO$_SETSOCKOPT  (IO$_ACCESS | (5 << IO$S_FCODE))
  1568. X#define   IO$_GETSOCKOPT  (IO$_ACCESS | (6 << IO$S_FCODE))
  1569. X#define   IO$_IOCTL       (IO$_ACCESS | (8 << IO$S_FCODE))
  1570. X#define   IO$_ACCEPT_WAIT (IO$_ACCESS | (10 << IO$S_FCODE))
  1571. X#define   IO$_NETWORK_PTY (IO$_ACCESS | (11 << IO$S_FCODE))
  1572. X#define   IO$_SHUTDOWN    (IO$_ACCESS | (12 << IO$S_FCODE))
  1573. X#define   IO$_GETSOCKNAME (IO$_ACCESS | (13 << IO$S_FCODE))
  1574. X#define      SETCHAR_HANDOFF (1<<2)
  1575. X
  1576. X#define   NFB$C_DECLNAME   0x15
  1577. X
  1578. X#define TIMER_EFN 1
  1579. X#define TERM_EFN  2
  1580. X#define BUF_SIZE 2000
  1581. X
  1582. X#define INITIALISED 0
  1583. X#define ACTIVE_CONNECTION 1
  1584. X#define PASSIVE_CONNECTION 2
  1585. X#define LISTENING 3
  1586. X#define HANDED_OFF 4
  1587. X
  1588. Xstatic struct fd_entry
  1589. X{
  1590. X  unsigned short int channel;    /* vms channel assigned to this socket */
  1591. X  unsigned short int iosb[4];    /* returned status block */
  1592. X  int fd_buff_size;        /* number of chrs in buffer still to be read */
  1593. X  int accept_pending;        /* a call is waiting to be accepted */
  1594. X  int connect_pending;        /* a connect is outstanding*/
  1595. X  int connected;        /* this descriptor is connected */
  1596. X  unsigned char *fd_buff;    /* pointer to buffer dyn assigned */
  1597. X  unsigned char *fd_leftover;    /* pointer to any chrs still to be read */
  1598. X  FILE *fptr;            /* we need to assgn a file ptr for stream io */
  1599. X  int s;            /* socket number - needed in the ast's */
  1600. X  int namelen;            /* our socket address name */
  1601. X  union socket_addr name;
  1602. X  short int fromdummy;        /* wg - accept wants an int - recvfrom wants a short!!*/
  1603. X  short int fromlen;        /* the from socket address name */
  1604. X  union socket_addr from;
  1605. X  int tolen;            /* wg - sendto wants an int*/
  1606. X  union socket_addr to;        /* the to socket address name */
  1607. X  int passive;            /* still needed because of x25 close ambig */
  1608. X  int backlog;            /* backlog - not handled well! */
  1609. X  int domain;            /* domain of socket AF_INET or AF_X25 */
  1610. X  int type;            /* type of socket stream or datagram */
  1611. X  int protocol;            /* protocol of socket - ignored */
  1612. X  int mbx_channel;        /* mailbox channel - needed for x25 */
  1613. X  unsigned char mbx_buff[255];    /* mailbox buffer */
  1614. X  unsigned short int miosb[4];    /* mailbox status block */
  1615. X  int ncb_size;            /* x25 connection information */
  1616. X  unsigned char ncb[128];
  1617. X  unsigned char masklen;    /* x25 user data mask */
  1618. X  unsigned char mask[16];
  1619. X  int need_header;        /* x25 header field gives data status if req*/
  1620. X  int send_type;        /* x25 data packet type eg more bit set etc */
  1621. X  int status;            /* status of socket */
  1622. X  int closed_by_remote;        /* flag for remote dropouts */
  1623. X  int read_outstanding;        /* flag so we don't hang two reads */
  1624. X  int cmu_open;            /* flag to say whether a cmu open was hung */
  1625. X  int x25_listener;        /* flag to say we are an x25 listener */
  1626. X  int oob_type;            /* handles interrupt messages */
  1627. X  int mother;            /* mother socket for X25 accepts */
  1628. X  int child;            /* child socket for X25 accepts */
  1629. X  int no_more_accepts;        /* don't accept anymore calls */
  1630. X  char int_data;        /* interrupt data - only 1 char supported */
  1631. X  int non_blocking;        /* don't block on a read if no data */
  1632. X  int sig_req;            /* generate SIGIO on data ready */
  1633. X  struct itemlist rhost;    /* descriptor pointing to "p[].from" info for UCX */
  1634. X  unsigned short ucx_accept_chan;    /* Channel returned by a UCX accept via hang_an_accept */
  1635. X} p[32];
  1636. X
  1637. X/* So we can handle select on terminal input.  */
  1638. Xstatic struct term_entry
  1639. X{
  1640. X  int chan;
  1641. X  short int iosb[4];
  1642. X  short int char_available;
  1643. X  short int read_outstanding;
  1644. X  char c[1];
  1645. X} terminal =
  1646. X
  1647. X{
  1648. X  -1, 0, 0, 0, 0, 0, 0
  1649. X};
  1650. X
  1651. X#define CMU 1
  1652. X#define WG  2
  1653. X#define NONE 3
  1654. X#define TGV 4
  1655. X#define UCX 5
  1656. Xstatic int tcp_make = 0;
  1657. X
  1658. Xstruct descriptor
  1659. X{
  1660. X  int size;
  1661. X  char *ptr;
  1662. X};
  1663. X
  1664. X/* Initialize certain things 1st time thru.  */
  1665. Xstatic int p_initialised = 0;
  1666. X
  1667. X/* A routine to point SIGALRM and SIGURG at.  */
  1668. Xstatic int 
  1669. Xsi_dummy ()
  1670. X{
  1671. X}
  1672. Xstatic int (*alarm_function) () = si_dummy;
  1673. Xstatic int (*sigurg_function) () = si_dummy;
  1674. X
  1675. XFILE *fdopen ();
  1676. Xstatic set_tcp_make ();
  1677. Xstatic char *getdevicename ();
  1678. END_OF_FILE
  1679.   if test 4939 -ne `wc -c <'vms/network.h'`; then
  1680.     echo shar: \"'vms/network.h'\" unpacked with wrong size!
  1681.   fi
  1682.   # end of 'vms/network.h'
  1683. fi
  1684. echo shar: End of archive 6 \(of 7\).
  1685. cp /dev/null ark6isdone
  1686. MISSING=""
  1687. for I in 1 2 3 4 5 6 7 ; do
  1688.     if test ! -f ark${I}isdone ; then
  1689.     MISSING="${MISSING} ${I}"
  1690.     fi
  1691. done
  1692. if test "${MISSING}" = "" ; then
  1693.     echo You have unpacked all 7 archives.
  1694.     rm -f ark[1-9]isdone
  1695. else
  1696.     echo You still must unpack the following archives:
  1697.     echo "        " ${MISSING}
  1698. fi
  1699. exit 0
  1700. exit 0 # Just in case...
  1701.