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

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