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

  1. Newsgroups: comp.sources.misc
  2. Path: sparky!kent
  3. From: brendan@cygnus.com (Brendan Kehoe)
  4. Subject:  v33i054:  archie - A client to query the Archie FTP databases, v1.4.1, Part05/07
  5. Message-ID: <1992Nov5.210636.25870@sparky.imd.sterling.com>
  6. Followup-To: comp.sources.d
  7. X-Md4-Signature: d91f21192ca2044f889bc39d6401d715
  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:06:36 GMT
  12. Approved: kent@sparky.imd.sterling.com
  13. Lines: 1524
  14.  
  15. Submitted-by: brendan@cygnus.com (Brendan Kehoe)
  16. Posting-number: Volume 33, Issue 54
  17. Archive-name: archie/part05
  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:  aquery.c archie.doc archie.man pauthent.h perrmesg.c pfs.h
  26. # Wrapped by kent@sparky on Thu Nov  5 12:53:09 1992
  27. PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:/usr/lbin ; export PATH
  28. echo If this archive is complete, you will see the following message:
  29. echo '          "shar: End of archive 5 (of 7)."'
  30. if test -f 'aquery.c' -a "${1}" != "-c" ; then 
  31.   echo shar: Will not clobber existing file \"'aquery.c'\"
  32. else
  33.   echo shar: Extracting \"'aquery.c'\" \(8163 characters\)
  34.   sed "s/^X//" >'aquery.c' <<'END_OF_FILE'
  35. X/*
  36. X * aquery.c : Programmatic Prospero interface to Archie
  37. X *
  38. X * Copyright (c) 1991 by the University of Washington
  39. X *
  40. X * For copying and distribution information, please see the file
  41. X * <copyright.h>.
  42. X */
  43. X
  44. X#include <stdio.h>
  45. X
  46. X#include <pfs.h>
  47. X#include <perrno.h>
  48. X#include <archie.h>
  49. X
  50. X#include <pmachine.h>
  51. X#ifdef NEED_STRING_H
  52. X# include <string.h>            /* for char *index() */
  53. X#else
  54. X# include <strings.h>            /* for char *index() */
  55. X#endif
  56. X
  57. X#ifdef __GNUC__
  58. X#define INLINE __inline__
  59. X#else
  60. X#define INLINE
  61. X#endif
  62. X
  63. Xstatic void translateArchieResponse();
  64. XINLINE static int hostnamecmp();
  65. X
  66. Xextern int pwarn;
  67. Xextern char p_warn_string[];
  68. X
  69. X/*
  70. X * archie_query : Sends a request to _host_, telling it to search for
  71. X *                _string_ using _query_ as the search method.
  72. X *                No more than _max_hits_ matches are to be returned
  73. X *                skipping over _offset_ matches.
  74. X *
  75. X *          archie_query returns a linked list of virtual links. 
  76. X *                If _flags_ does not include AQ_NOTRANS, then the Archie
  77. X *                responses will be translated. If _flags_ does not include 
  78. X *                AQ_NOSORT, then the list will be sorted using _cmp_proc_ to
  79. X *                compare pairs of links.  If _cmp_proc_ is NULL or AQ_DEFCMP,
  80. X *                then the default comparison procedure, defcmplink(), is used
  81. X *                sorting by host, then filename. If cmp_proc is AQ_INVDATECMP
  82. X *                then invdatecmplink() is used, sorting inverted by date.
  83. X *                otherwise a user-defined comparison procedure is called.
  84. X *
  85. X *                archie_query returns NULL and sets perrno if the query
  86. X *                failed. Note that it can return NULL with perrno == PSUCCESS
  87. X *                if the query didn't fail but there were simply no matches.
  88. X *
  89. X *        query:  S  Substring search ignoring case   
  90. X *                C  Substring search with case significant
  91. X *                R  Regular expression search
  92. X *                =  Exact String Match
  93. X *            s,c,e  Tries exact match first and falls back to S, C, or R 
  94. X *                   if not found.
  95. X *
  96. X *     cmp_proc:  AQ_DEFCMP      Sort by host, then filename
  97. X *                AQ_INVDATECMP  Sort inverted by date
  98. X *
  99. X *        flags:  AQ_NOSORT      Don't sort results
  100. X *                AQ_NOTRANS     Don't translate results
  101. X */
  102. XVLINK 
  103. Xarchie_query(host,string,max_hits,offset,query,cmp_proc,flags)
  104. X    char    *host,*string;
  105. X    int        max_hits,offset;
  106. X    Query    query;
  107. X    int        (*cmp_proc)();
  108. X    int        flags;
  109. X    {
  110. X    char qstring[MAX_VPATH];    /* For construting the query  */
  111. X    VLINK    links;        /* Matches returned by server */
  112. X    VDIR_ST    dir_st;         /* Filled in by get_vdir      */
  113. X    PVDIR    dir= &dir_st;
  114. X    
  115. X    VLINK    p,q,r,lowest,nextp,pnext,pprev;
  116. X    int    tmp;
  117. X
  118. X    /* Set the cmp_proc if not given */
  119. X    if (cmp_proc == NULL) cmp_proc = defcmplink;
  120. X
  121. X    /* Make the query string */
  122. X    sprintf(qstring,"ARCHIE/MATCH(%d,%d,%c)/%s",
  123. X        max_hits,offset, (char) query,string);
  124. X
  125. X    /* Initialize Prospero structures */
  126. X    perrno = PSUCCESS; *p_err_string = '\0';
  127. X    pwarn = PNOWARN; *p_warn_string = '\0';
  128. X    vdir_init(dir);
  129. X    
  130. X    /* Retrieve the list of matches, return error if there was one */
  131. X#if defined(MSDOS)
  132. X    if(tmp = get_vdir(host, qstring, "", dir, (long)GVD_ATTRIB|GVD_NOSORT,
  133. X        NULL, NULL)) {
  134. X#else
  135. X    if(tmp = get_vdir(host,qstring,"",dir,GVD_ATTRIB|GVD_NOSORT,NULL,NULL)) {
  136. X# endif
  137. X        perrno = tmp;
  138. X        return(NULL);
  139. X    }
  140. X
  141. X    /* Save the links, and clear in dir in case it's used again   */
  142. X    links = dir->links; dir->links = NULL;
  143. X
  144. X    /* As returned, list is sorted by suffix, and conflicting     */
  145. X    /* suffixes appear on a list of "replicas".  We want to       */
  146. X    /* create a one-dimensional list sorted by host then filename */
  147. X    /* and maybe by some other parameter                          */
  148. X
  149. X    /* First flatten the doubly-linked list */
  150. X    for (p = links; p != NULL; p = nextp) {
  151. X        nextp = p->next;
  152. X        if (p->replicas != NULL) {
  153. X        p->next = p->replicas;
  154. X        p->next->previous = p;
  155. X        for (r = p->replicas; r->next != NULL; r = r->next)
  156. X            /*EMPTY*/ ;
  157. X        r->next = nextp;
  158. X        nextp->previous = r;
  159. X        p->replicas = NULL;
  160. X        }
  161. X    }
  162. X
  163. X    /* Translate the filenames unless NOTRANS was given */
  164. X    if (!(flags & AQ_NOTRANS))
  165. X        for (p = links; p != NULL; p = p->next)
  166. X        translateArchieResponse(p);
  167. X
  168. X    /* If NOSORT given, then just hand it back */
  169. X    if (flags & AQ_NOSORT) {
  170. X        perrno = PSUCCESS;
  171. X        return(links);
  172. X    }
  173. X
  174. X    /* Otherwise sort it using a selection sort and the given cmp_proc */
  175. X    for (p = links; p != NULL; p = nextp) {
  176. X        nextp = p->next;
  177. X        lowest = p;
  178. X        for (q = p->next; q != NULL; q = q->next)
  179. X        if ((*cmp_proc)(q,lowest) < 0)
  180. X            lowest = q;
  181. X        if (p != lowest) {
  182. X        /* swap the two links */
  183. X        pnext = p->next;
  184. X        pprev = p->previous;
  185. X        if (lowest->next != NULL)
  186. X            lowest->next->previous = p;
  187. X        p->next = lowest->next;
  188. X        if (nextp == lowest) {
  189. X            p->previous = lowest;
  190. X        } else {
  191. X            lowest->previous->next = p;
  192. X            p->previous = lowest->previous;
  193. X        }
  194. X        if (nextp == lowest) {
  195. X            lowest->next = p;
  196. X        } else {
  197. X            pnext->previous = lowest;
  198. X            lowest->next = pnext;
  199. X        }
  200. X        if (pprev != NULL)
  201. X            pprev->next = lowest;
  202. X        lowest->previous = pprev;
  203. X        /* keep the head of the list in the right place */
  204. X        if (links == p)
  205. X            links = lowest;
  206. X        }
  207. X    }
  208. X
  209. X    /* Return the links */
  210. X    perrno = PSUCCESS;
  211. X    return(links);
  212. X    }
  213. X
  214. X/*
  215. X * translateArchieResponse: 
  216. X *
  217. X *   If the given link is for an archie-pseudo directory, fix it. 
  218. X *   This is called unless AQ_NOTRANS was given to archie_query().
  219. X */
  220. Xstatic void
  221. XtranslateArchieResponse(l)
  222. X    VLINK l;
  223. X    {
  224. X    char *slash;
  225. X
  226. X    if (strcmp(l->type,"DIRECTORY") == 0) {
  227. X        if (strncmp(l->filename,"ARCHIE/HOST",11) == 0) {
  228. X        l->type = stcopyr("EXTERNAL(AFTP,DIRECTORY)",l->type);
  229. X        l->host = stcopyr(l->filename+12,l->host);
  230. X        slash = (char *)index(l->host,'/');
  231. X        if (slash) {
  232. X            l->filename = stcopyr(slash,l->filename);
  233. X            *slash++ = '\0';
  234. X        } else
  235. X            l->filename = stcopyr("",l->filename);
  236. X        }
  237. X    }
  238. X    }
  239. X
  240. X
  241. X/* hostnamecmp: Compare two hostnames based on domain,
  242. X *              right-to-left.  Returns <0 if a belongs before b, >0
  243. X *              if b belongs before a, and 0 if they are identical.
  244. X *              Contributed by asami@cs.berkeley.edu (Satoshi ASAMI).
  245. X */
  246. XINLINE
  247. Xstatic int
  248. Xhostnamecmp(a,b)
  249. X    char *a,*b;
  250. X    {
  251. X    char    *pa, *pb;
  252. X    int    result;
  253. X
  254. X    for (pa = a ; *pa ; pa++)
  255. X        ;
  256. X    for (pb = b ; *pb ; pb++)
  257. X        ;
  258. X
  259. X    while (pa > a && pb > b) {
  260. X        for (; pa > a ; pa--)
  261. X        if (*pa == '.')    {
  262. X            pa++;
  263. X            break;
  264. X        }
  265. X        for (; pb > b ; pb--)
  266. X        if (*pb == '.')    {
  267. X            pb++;
  268. X            break;
  269. X        }
  270. X        if (result = strcmp(pa, pb))
  271. X        return (result);
  272. X        pa -= 2;
  273. X        pb -= 2;
  274. X    }
  275. X    if (pa <= a) {
  276. X        if (pb <= b)
  277. X        return (0);
  278. X        else
  279. X        return (-1);
  280. X    } else
  281. X        return (1);
  282. X    }
  283. X
  284. X/*
  285. X * defcmplink: The default link comparison function for sorting. Compares
  286. X *           links p and q first by host then by filename. Returns < 0 if p
  287. X *             belongs before q, > 0 if p belongs after q, and == 0 if their
  288. X *             host and filename fields are identical.
  289. X */
  290. Xint
  291. Xdefcmplink(p,q)
  292. X    VLINK p,q;
  293. X    {
  294. X    int result;
  295. X
  296. X    if ((result=hostnamecmp(p->host,q->host)) != 0)
  297. X        return(result);
  298. X    else
  299. X        return(strcmp(p->filename,q->filename));
  300. X    }
  301. X
  302. X/*
  303. X * invdatecmplink: An alternative comparison function for sorting that
  304. X *               compares links p and q first by LAST-MODIFIED date,
  305. X *                 if they both have that attribute. If both links
  306. X *                 don't have that attribute or the dates are the
  307. X *                 same, it then calls defcmplink() and returns its 
  308. X *           value.
  309. X */
  310. Xint
  311. Xinvdatecmplink(p,q)
  312. X    VLINK p,q;
  313. X    {
  314. X    PATTRIB pat,qat;
  315. X    char *pdate,*qdate;
  316. X    int result;
  317. X    
  318. X    pdate = qdate = NULL;
  319. X    for (pat = p->lattrib; pat; pat = pat->next)
  320. X        if(strcmp(pat->aname,"LAST-MODIFIED") == 0)
  321. X        pdate = pat->value.ascii;
  322. X    for (qat = q->lattrib; qat; qat = qat->next)
  323. X        if(strcmp(qat->aname,"LAST-MODIFIED") == 0)
  324. X        qdate = qat->value.ascii;
  325. X    if(!pdate && !qdate) return(defcmplink(p,q));
  326. X    if(!pdate) return(1); 
  327. X    if(!qdate) return(-1);
  328. X    if((result=strcmp(qdate,pdate)) == 0) return(defcmplink(p,q));
  329. X    else return(result);
  330. X    }
  331. END_OF_FILE
  332.   if test 8163 -ne `wc -c <'aquery.c'`; then
  333.     echo shar: \"'aquery.c'\" unpacked with wrong size!
  334.   fi
  335.   # end of 'aquery.c'
  336. fi
  337. if test -f 'archie.doc' -a "${1}" != "-c" ; then 
  338.   echo shar: Will not clobber existing file \"'archie.doc'\"
  339. else
  340.   echo shar: Extracting \"'archie.doc'\" \(11259 characters\)
  341.   sed "s/^X//" >'archie.doc' <<'END_OF_FILE'
  342. X
  343. X
  344. X
  345. XARCHIE(1)                 User Commands                 ARCHIE(1)
  346. X
  347. X
  348. X
  349. XN_N_N_NA_A_A_AM_M_M_ME_E_E_E
  350. X     archie - query the  Archie  anonymous  FTP  databases  using
  351. X     Prospero
  352. X
  353. XS_S_S_SY_Y_Y_YN_N_N_NO_O_O_OP_P_P_PS_S_S_SI_I_I_IS_S_S_S
  354. X     a_a_a_ar_r_r_rc_c_c_ch_h_h_hi_i_i_ie_e_e_e [_[_[_[ -_-_-_-c_c_c_ce_e_e_er_r_r_rs_s_s_s ] [ -_-_-_-a_a_a_a ] [ -_-_-_-l_l_l_l ] [ -_-_-_-t_t_t_t ] [ -_-_-_-m_m_m_m hits ]
  355. X            [ -_-_-_-N_N_N_N [_[_[_[ level ] ] [ -_-_-_-h_h_h_h hostname ] [ -_-_-_-o_o_o_o filename ]
  356. X            [ -_-_-_-L_L_L_L ] [ -_-_-_-V_V_V_V ] [ -_-_-_-v_v_v_v ] string
  357. X
  358. XD_D_D_DE_E_E_ES_S_S_SC_C_C_CR_R_R_RI_I_I_IP_P_P_PT_T_T_TI_I_I_IO_O_O_ON_N_N_N
  359. X     a_a_a_ar_r_r_rc_c_c_ch_h_h_hi_i_i_ie_e_e_e queries an archie anonymous FTP database looking  for
  360. X     the  specified  string  using  the  P_P_P_Pr_r_r_ro_o_o_os_s_s_sp_p_p_pe_e_e_er_r_r_ro_o_o_o protocol.  This
  361. X     client is based on P_P_P_Pr_r_r_ro_o_o_os_s_s_sp_p_p_pe_e_e_er_r_r_ro_o_o_o version Beta.4.2 and is provided
  362. X     to  encourage non-interactive use of the Archie servers (and
  363. X     subsequently better performance on both  sides).   This  man
  364. X     page describes version 1.3 of the client.
  365. X
  366. X     The general method of use is of the form
  367. X
  368. X          % a_a_a_ar_r_r_rc_c_c_ch_h_h_hi_i_i_ie_e_e_e s_s_s_st_t_t_tr_r_r_ri_i_i_in_n_n_ng_g_g_g
  369. X
  370. X     This will go to the archie server and ask it to look for all
  371. X     known  systems  that have a file named `string' in their FTP
  372. X     area.  a_a_a_ar_r_r_rc_c_c_ch_h_h_hi_i_i_ie_e_e_e will wait, and print out any matches.
  373. X
  374. X     For example,
  375. X
  376. X          % a_a_a_ar_r_r_rc_c_c_ch_h_h_hi_i_i_ie_e_e_e e_e_e_em_m_m_ma_a_a_ac_c_c_cs_s_s_s
  377. X
  378. X     will find all anonymous FTP sites  in  the  archie  database
  379. X     that  have  files  named  e_e_e_em_m_m_ma_a_a_ac_c_c_cs_s_s_s somewhere in their FTP area.
  380. X     (This particular query would probably return a lot of direc-
  381. X     tories.)  If you want a list of every filename that contains
  382. X     e_e_e_em_m_m_ma_a_a_ac_c_c_cs_s_s_s anywhere in it, you'd use
  383. X
  384. X          % a_a_a_ar_r_r_rc_c_c_ch_h_h_hi_i_i_ie_e_e_e -_-_-_-c_c_c_c e_e_e_em_m_m_ma_a_a_ac_c_c_cs_s_s_s
  385. X
  386. X     Regular expressions, such as
  387. X
  388. X          % a_a_a_ar_r_r_rc_c_c_ch_h_h_hi_i_i_ie_e_e_e -_-_-_-r_r_r_r '_'_'_'[_[_[_[x_x_x_xX_X_X_X]_]_]_][_[_[_[l_l_l_lL_L_L_L]_]_]_]i_i_i_is_s_s_sp_p_p_p'_'_'_'
  389. X
  390. X     may also be used for searches.  (See the manual of a reason-
  391. X     ably good editor, like GNU Emacs or vi, for more information
  392. X     on using regular expressions.)
  393. X
  394. X
  395. XO_O_O_OP_P_P_PT_T_T_TI_I_I_IO_O_O_ON_N_N_NS_S_S_S
  396. X     The options currently available to this a_a_a_ar_r_r_rc_c_c_ch_h_h_hi_i_i_ie_e_e_e client are:
  397. X
  398. X     -_-_-_-c_c_c_c          Search substrings paying attention  to  upper  &
  399. X                 lower case.
  400. X     -_-_-_-e_e_e_e          Exact string match.  (This is the default.)
  401. X
  402. X
  403. X
  404. XArchie (Prospero) Last change: 26 October 1992                  1
  405. X
  406. X
  407. X
  408. X
  409. X
  410. X
  411. XARCHIE(1)                 User Commands                 ARCHIE(1)
  412. X
  413. X
  414. X
  415. X     -_-_-_-r_r_r_r          Search using a regular expression.
  416. X     -_-_-_-s_s_s_s          Search  substrings  ignoring  the  case  of  the
  417. X                 letters.
  418. X     -_-_-_-o_o_o_ofilename  If specified, place the results of the search in
  419. X                 filename.
  420. X     -_-_-_-a_a_a_a          Output results as Alex filenames.
  421. X     -_-_-_-l_l_l_l          Output results in a form suitable for parsing by
  422. X                 programs.
  423. X     -_-_-_-t_t_t_t          Sort the results inverted by date.
  424. X     -_-_-_-m_m_m_mhits      Specifies the maximum number of  hits  (matches)
  425. X                 to return (default of 9_9_9_95_5_5_5).
  426. X     -_-_-_-N_N_N_Nlevel     Sets the niceness of a query; by  default,  it's
  427. X                 set  to 0.  Without an argument, ``-N'' defaults
  428. X                 to 3_3_3_35_5_5_57_7_7_76_6_6_65_5_5_5.   If  you  use  -_-_-_-N_N_N_N  with  an  argument
  429. X                 between 0 and 35765, it'll adjust itself accord-
  430. X                 ingly.  (N_N_N_No_o_o_ot_t_t_te_e_e_e: VMS users will have to put quotes
  431. X                 around  this  argument, and -_-_-_-L_L_L_L, like "-_-_-_-N_N_N_N4_4_4_45_5_5_5"; VMS
  432. X                 will otherwise convert it to lowercase.)
  433. X     -_-_-_-h_h_h_h hostname Tells the client  to  query  the  Archie  server
  434. X                 hostname.
  435. X     -_-_-_-L_L_L_L          Lists the Archie servers known  to  the  program
  436. X                 when it was compiled, as well as the name of the
  437. X                 default Archie server.  For an up-to-date  list,
  438. X                 write  to  ``archie@archie.mcgill.ca''  (or  any
  439. X                 Archie  server)  with  the  single  command   of
  440. X                 servers.
  441. X     -_-_-_-V_V_V_V          With the verbose option, a_a_a_ar_r_r_rc_c_c_ch_h_h_hi_i_i_ie_e_e_e will  make  some
  442. X                 comments  along  the way if a search is going to
  443. X                 take some time, to pacify the user.
  444. X
  445. X     The three search-modifying arguments  (``-c'',  ``-r'',  and
  446. X     ``-s'')  are  all  mutually  exclusive;  only  the  last one
  447. X     counts.  If you specify -_-_-_-e_e_e_e with any of  ``-c'',  ``-r'',  or
  448. X     ``-s'', the server will first check for an exact match, then
  449. X     fall back to the case-sensitive, case-insensitive, or  regu-
  450. X     lar expression search.  This is so if there are matches that
  451. X     are particularly obvious, it will take a minimal  amount  of
  452. X     time to satisfy your request.
  453. X
  454. X     If you list a single `-' by itself,  any  further  arguments
  455. X     will  be  taken  as  part  of  the  search  string.  This is
  456. X     intended to enable searching for strings that begin  with  a
  457. X     `-'; for example:
  458. X
  459. X          % a_a_a_ar_r_r_rc_c_c_ch_h_h_hi_i_i_ie_e_e_e -_-_-_-s_s_s_s -_-_-_- -_-_-_-o_o_o_ol_l_l_ld_d_d_d
  460. X
  461. X     will search for all filenames that contain the string `-old'
  462. X     in them.
  463. X
  464. XR_R_R_RE_E_E_ES_S_S_SP_P_P_PO_O_O_ON_N_N_NS_S_S_SE_E_E_E
  465. X     Archie servers are set up to respond to a number of requests
  466. X     in  a  queued fashion.  That is, smaller requests get served
  467. X
  468. X
  469. X
  470. XArchie (Prospero) Last change: 26 October 1992                  2
  471. X
  472. X
  473. X
  474. X
  475. X
  476. X
  477. XARCHIE(1)                 User Commands                 ARCHIE(1)
  478. X
  479. X
  480. X
  481. X     much more quickly than do large requests.  As a result,  the
  482. X     more  often  you query the Archie server, or the larger your
  483. X     requests, the longer the queue will become, resulting  in  a
  484. X     longer  waiting  period  for everyone's requests.  Please be
  485. X     frugal when possible, for your benefit as well  as  for  the
  486. X     other users.
  487. X
  488. XQ_Q_Q_QU_U_U_UE_E_E_ER_R_R_RY_Y_Y_Y P_P_P_PR_R_R_RI_I_I_IO_O_O_OR_R_R_RI_I_I_IT_T_T_TY_Y_Y_Y
  489. X     Please use the  ``-N''  option  whenever  you  don't  demand
  490. X     immediacy,  or when you're requesting things that could gen-
  491. X     erate large responses.  Even when using the nice option, you
  492. X     should  still  try  to  avoid  big jobs during busy periods.
  493. X     Here is a list of what we consider to be  nice  values  that
  494. X     accurately reflect the priority of a job to the server.
  495. X
  496. X          N_N_N_No_o_o_or_r_r_rm_m_m_ma_a_a_al_l_l_l              0
  497. X          N_N_N_Ni_i_i_ic_c_c_ce_e_e_e                500
  498. X          N_N_N_Ni_i_i_ic_c_c_ce_e_e_er_r_r_r               1000
  499. X          V_V_V_Ve_e_e_er_r_r_ry_y_y_y N_N_N_Ni_i_i_ic_c_c_ce_e_e_e           5000
  500. X          E_E_E_Ex_x_x_xt_t_t_tr_r_r_re_e_e_em_m_m_me_e_e_el_l_l_ly_y_y_y N_N_N_Ni_i_i_ic_c_c_ce_e_e_e      10000
  501. X          N_N_N_Ni_i_i_ic_c_c_ce_e_e_es_s_s_st_t_t_t              32765
  502. X
  503. X     The last priority, N_N_N_Ni_i_i_ic_c_c_ce_e_e_es_s_s_st_t_t_t, would be used when a  job  should
  504. X     wait  until  the  queue is essentially empty before running.
  505. X     You should pick one of these values to use, possibly modify-
  506. X     ing  it  slightly depending on where you think your priority
  507. X     should land.  For example, 32760 would mean wait  until  the
  508. X     queue  is  empty,  but  jump  ahead  of other jobs that have
  509. X     selected N_N_N_Ni_i_i_ic_c_c_ce_e_e_es_s_s_st_t_t_t.
  510. X
  511. X     There are certain types of  things  that  we  suggest  using
  512. X     N_N_N_Ni_i_i_ic_c_c_ce_e_e_es_s_s_st_t_t_t  for,  irregardless.  In particular, any searches for
  513. X     which you would have a hard time justifying the use of  any-
  514. X     thing but extra resources.  (We all know what those searches
  515. X     would be for.)
  516. X
  517. XE_E_E_EN_N_N_NV_V_V_VI_I_I_IR_R_R_RO_O_O_ON_N_N_NM_M_M_ME_E_E_EN_N_N_NT_T_T_T
  518. X     ARCHIE_HOST
  519. X             This will change the host archie will  consult  when
  520. X             making  queries.   (The default value is what's been
  521. X             compiled in.)  The ``-h'' option will override this.
  522. X             If  you're  running  VMS,  create  a  symbol  called
  523. X             ARCHIE_HOST.
  524. X
  525. XS_S_S_SE_E_E_EE_E_E_E A_A_A_AL_L_L_LS_S_S_SO_O_O_O
  526. X     For more information on regular expressions, see the  manual
  527. X     pages on:
  528. X
  529. X     r_r_r_re_e_e_eg_g_g_ge_e_e_ex_x_x_x(3),_,_,_, e_e_e_ed_d_d_d(1)
  530. X
  531. X     Also   read    the    file    a_a_a_ar_r_r_rc_c_c_ch_h_h_hi_i_i_ie_e_e_e/_/_/_/d_d_d_do_o_o_oc_c_c_c/_/_/_/w_w_w_wh_h_h_ha_a_a_at_t_t_ti_i_i_is_s_s_s._._._.a_a_a_ar_r_r_rc_c_c_ch_h_h_hi_i_i_ie_e_e_e    on
  532. X     a_a_a_ar_r_r_rc_c_c_ch_h_h_hi_i_i_ie_e_e_e._._._.m_m_m_mc_c_c_cg_g_g_gi_i_i_il_l_l_ll_l_l_l._._._.c_c_c_ca_a_a_a for a detailed paper on Archie as a whole.
  533. X
  534. X
  535. X
  536. XArchie (Prospero) Last change: 26 October 1992                  3
  537. X
  538. X
  539. X
  540. X
  541. X
  542. X
  543. XARCHIE(1)                 User Commands                 ARCHIE(1)
  544. X
  545. X
  546. X
  547. X     Read the file README.ALEX distributed with this  client  for
  548. X     more information on what Alex is and how you can take advan-
  549. X     tage of it.
  550. XA_A_A_AU_U_U_UT_T_T_TH_H_H_HO_O_O_OR_R_R_RS_S_S_S
  551. X     The a_a_a_ar_r_r_rc_c_c_ch_h_h_hi_i_i_ie_e_e_e service was conceived  and  implemented  by  Alan
  552. X     Emtage       (b_b_b_ba_a_a_aj_j_j_ja_a_a_an_n_n_n@_@_@_@c_c_c_cs_s_s_s._._._.m_m_m_mc_c_c_cg_g_g_gi_i_i_il_l_l_ll_l_l_l._._._.c_c_c_ca_a_a_a),       Peter       Deutsch
  553. X     (p_p_p_pe_e_e_et_t_t_te_e_e_er_r_r_rd_d_d_d@_@_@_@c_c_c_cs_s_s_s._._._.m_m_m_mc_c_c_cg_g_g_gi_i_i_il_l_l_ll_l_l_l._._._.c_c_c_ca_a_a_a),        and        Bill         Heelan
  554. X     (w_w_w_wh_h_h_he_e_e_ee_e_e_el_l_l_la_a_a_an_n_n_n@_@_@_@c_c_c_cs_s_s_s._._._.m_m_m_mc_c_c_cg_g_g_gi_i_i_il_l_l_ll_l_l_l._._._.c_c_c_ca_a_a_a).   The  entire  Internet  is in their
  555. X     debt.
  556. X
  557. X     The  P_P_P_Pr_r_r_ro_o_o_os_s_s_sp_p_p_pe_e_e_er_r_r_ro_o_o_o  system  was  created   by   Clifford   Neuman
  558. X     (b_b_b_bc_c_c_cn_n_n_n@_@_@_@i_i_i_is_s_s_si_i_i_i._._._.e_e_e_ed_d_d_du_u_u_u);   write  to  i_i_i_in_n_n_nf_f_f_fo_o_o_o-_-_-_-p_p_p_pr_r_r_ro_o_o_os_s_s_sp_p_p_pe_e_e_er_r_r_ro_o_o_o@_@_@_@i_i_i_is_s_s_si_i_i_i._._._.e_e_e_ed_d_d_du_u_u_u  for  more
  559. X     information on the protocol and its use.
  560. X
  561. X     This stripped client  was  put  together  by  Brendan  Kehoe
  562. X     (b_b_b_br_r_r_re_e_e_en_n_n_nd_d_d_da_a_a_an_n_n_n@_@_@_@c_c_c_cy_y_y_yg_g_g_gn_n_n_nu_u_u_us_s_s_s._._._.c_c_c_co_o_o_om_m_m_m),  with modifications by Clifford Neuman
  563. X     and George Ferguson (f_f_f_fe_e_e_er_r_r_rg_g_g_gu_u_u_us_s_s_so_o_o_on_n_n_n@_@_@_@c_c_c_cs_s_s_s._._._.r_r_r_ro_o_o_oc_c_c_ch_h_h_he_e_e_es_s_s_st_t_t_te_e_e_er_r_r_r._._._.e_e_e_ed_d_d_du_u_u_u).
  564. X
  565. XB_B_B_BU_U_U_UG_G_G_GS_S_S_S
  566. X     There are none; only a few unexpected features.
  567. X
  568. X
  569. X
  570. X
  571. X
  572. X
  573. X
  574. X
  575. X
  576. X
  577. X
  578. X
  579. X
  580. X
  581. X
  582. X
  583. X
  584. X
  585. X
  586. X
  587. X
  588. X
  589. X
  590. X
  591. X
  592. X
  593. X
  594. X
  595. X
  596. X
  597. X
  598. X
  599. X
  600. X
  601. X
  602. XArchie (Prospero) Last change: 26 October 1992                  4
  603. X
  604. X
  605. X
  606. END_OF_FILE
  607.   if test 11259 -ne `wc -c <'archie.doc'`; then
  608.     echo shar: \"'archie.doc'\" unpacked with wrong size!
  609.   fi
  610.   # end of 'archie.doc'
  611. fi
  612. if test -f 'archie.man' -a "${1}" != "-c" ; then 
  613.   echo shar: Will not clobber existing file \"'archie.man'\"
  614. else
  615.   echo shar: Extracting \"'archie.man'\" \(6945 characters\)
  616.   sed "s/^X//" >'archie.man' <<'END_OF_FILE'
  617. X.\" Originally by Jeff Kellem (composer@chem.bu.edu).
  618. X.\"
  619. X.\" This is from rn (1):
  620. X.de Ip
  621. X.br
  622. X.ie \\n.$>=3 .ne \\$3
  623. X.el .ne 3
  624. X.IP "\\$1" \\$2
  625. X..
  626. X.\"
  627. X.TH ARCHIE 1 "26 October 1992" "Archie (Prospero)"
  628. X.SH NAME
  629. Xarchie \- query the Archie anonymous FTP databases using Prospero
  630. X.SH SYNOPSIS
  631. X.in +\w'\fBarchie \fR'u
  632. X.ti -\w'\fBarchie \fR'u
  633. X.B archie\
  634. X\ [\ \fB\-cers\fR\ ]\
  635. X\ [\ \fB\-a\fR\ ]\ [\ \fB\-l\fR\ ]\ [\ \fB\-t\fR\ ]\
  636. X\ [\ \fB\-m\ \fIhits\fR\ ]
  637. X[\ \fB\-N\ [\ \fIlevel\fR\ ]\ ]\
  638. X\ [\ \fB\-h\fR\ \fIhostname\fR\ ]\
  639. X\ [\ \fB\-o\fR\ \fIfilename\fR\ ]
  640. X[\ \fB\-L\fR\ ]\ [\ \fB\-V\fR\ ]\ [\ \fB\-v\fR\ ]\ \fIstring\fR
  641. X.SH DESCRIPTION
  642. X.B archie
  643. Xqueries an archie anonymous FTP database looking for the specified
  644. X.I string
  645. Xusing the
  646. X.B Prospero
  647. Xprotocol.  This client is based on
  648. X.B Prospero
  649. Xversion Beta.4.2 and is provided to encourage non-interactive use of
  650. Xthe Archie servers (and subsequently better performance on both
  651. Xsides).  This man page describes version 1.3 of the client.
  652. X
  653. XThe general method of use is of the form
  654. X
  655. X.RS
  656. X%
  657. X.B archie string
  658. X.RE
  659. X.PP
  660. X
  661. XThis will go to the archie server and ask it to look for all known
  662. Xsystems that have a file named `string' in their FTP area.  \fBarchie\fP
  663. Xwill wait, and print out any matches.
  664. X
  665. XFor example,
  666. X
  667. X.RS
  668. X%
  669. X.B archie emacs
  670. X.RE
  671. X.PP
  672. X
  673. Xwill find all anonymous FTP sites in the archie database that have files
  674. Xnamed
  675. X.B emacs
  676. Xsomewhere in their FTP area.  (This particular query would probably
  677. Xreturn a lot of directories.)  If you want a list of every filename
  678. Xthat contains \fBemacs\fR \fIanywhere\fR in it, you'd use
  679. X
  680. X.RS
  681. X%
  682. X.B archie -c emacs
  683. X.RE
  684. X.PP
  685. X
  686. XRegular expressions, such as
  687. X
  688. X.RS
  689. X%
  690. X.B archie -r '[xX][lL]isp'
  691. X.RE
  692. X.PP
  693. X
  694. Xmay also be used for searches.  (See the manual of a reasonably good
  695. Xeditor, like GNU Emacs or vi, for more information on using regular
  696. Xexpressions.)
  697. X
  698. X.SH OPTIONS
  699. XThe options currently available to this
  700. X.B archie
  701. Xclient are:
  702. X
  703. X.PD 0
  704. X.TP 12
  705. X.BR \-c
  706. XSearch substrings paying attention to upper & lower case.
  707. X.TP
  708. X.BR \-e
  709. XExact string match.  (This is the default.)
  710. X.TP
  711. X.BR \-r
  712. XSearch using a regular expression.
  713. X.TP
  714. X.BR \-s
  715. XSearch substrings ignoring the case of the letters.
  716. X.TP
  717. X.BI \-o filename
  718. XIf specified, place the results of the search in \fIfilename\fR.
  719. X.TP
  720. X.BR \-a
  721. XOutput results as Alex filenames.
  722. X.TP
  723. X.BR \-l
  724. XOutput results in a form suitable for parsing by programs.
  725. X.TP
  726. X.BR \-t
  727. XSort the results inverted by date.
  728. X.TP
  729. X.BI \-m hits
  730. XSpecifies the maximum number of hits (matches) to return (default of 
  731. X\fB95\fR).
  732. X.TP
  733. X.BI \-N level
  734. XSets the \fIniceness\fR of a query; by default, it's set to 0.
  735. XWithout an argument, ``\-N'' defaults to \fB35765\fR.  If you use
  736. X\fB\-N\fR with an argument between 0 and 35765, it'll adjust itself
  737. Xaccordingly.  (\fBNote\fR: VMS users will have to put quotes around
  738. Xthis argument, and \fB\-L\fR, like "\fB\-N45\fR"; VMS will otherwise convert
  739. Xit to lowercase.)
  740. X.TP
  741. X.BI \-h\ \fIhostname\fR
  742. XTells the client to query the Archie server \fIhostname\fR.
  743. X.TP
  744. X.BI \-L
  745. XLists the Archie servers known to the program when it was compiled, as
  746. Xwell as the name of the default Archie server.  For an up-to-date
  747. Xlist, write to ``archie@archie.mcgill.ca'' (or any Archie server) with
  748. Xthe single command of \fIservers\fR.
  749. X.TP
  750. X.BI \-V
  751. XWith the verbose option, \fBarchie\fR will make some comments along
  752. Xthe way if a search is going to take some time, to pacify the user.
  753. X
  754. X.PP
  755. XThe three search-modifying arguments (``\-c'', ``\-r'', and ``\-s'')
  756. Xare all mutually exclusive; only the last one counts.  If you specify
  757. X\fB\-e\fR with any of ``\-c'', ``\-r'', or ``\-s'',
  758. Xthe server will first check for an exact match, then fall back to the
  759. Xcase-sensitive, case-insensitive, or regular expression search.  This is
  760. Xso if there are matches that are particularly obvious, it will take a
  761. Xminimal amount of time to satisfy your request.
  762. X
  763. XIf you list a single `\-' by itself, any further arguments will be
  764. Xtaken as part of the search string.  This is intended to enable
  765. Xsearching for strings that begin with a `\-'; for example:
  766. X
  767. X.RS
  768. X%
  769. X.B archie \-s \- \-old
  770. X.RE
  771. X
  772. Xwill search for all filenames that contain the string `\-old' in them.
  773. X
  774. X.SH RESPONSE
  775. XArchie servers are set up to respond to a number of requests in a
  776. Xqueued fashion.  That is, smaller requests get served much more
  777. Xquickly than do large requests.  As a result, the more often you query
  778. Xthe Archie server, or the larger your requests, the longer the queue
  779. Xwill become, resulting in a longer waiting period for everyone's
  780. Xrequests.  Please be frugal when possible, for your benefit as well as
  781. Xfor the other users.
  782. X
  783. X.SH QUERY PRIORITY
  784. XPlease use the ``-N'' option whenever you don't demand immediacy, or
  785. Xwhen you're requesting things that could generate large responses.
  786. XEven when using the nice option, you should still try to avoid big
  787. Xjobs during busy periods.  Here is a list of what we consider to be
  788. Xnice values that accurately reflect the priority of a job to the server.
  789. X
  790. X.RS
  791. X.TP 20
  792. X.B Normal
  793. X0
  794. X.TP
  795. X.B Nice
  796. X500
  797. X.TP
  798. X.B Nicer
  799. X1000
  800. X.TP
  801. X.B Very Nice
  802. X5000
  803. X.TP
  804. X.B Extremely Nice
  805. X10000
  806. X.TP
  807. X.B Nicest
  808. X32765
  809. X.RE
  810. X
  811. XThe last priority, \fBNicest\fR, would be used when a job should wait until
  812. Xthe queue is essentially empty before running.  You should pick one of
  813. Xthese values to use, possibly modifying it slightly depending on where
  814. Xyou think your priority should land.  For example, 32760 would mean
  815. Xwait until the queue is empty, but jump ahead of other jobs that have
  816. Xselected \fBNicest\fR.
  817. X
  818. XThere are certain types of things that we suggest using \fBNicest\fR
  819. Xfor, irregardless.  In particular, any searches for which you would
  820. Xhave a hard time justifying the use of anything but extra resources.
  821. X(We all know what those searches would be for.)
  822. X
  823. X.SH ENVIRONMENT
  824. X.Ip "ARCHIE_HOST" 8
  825. XThis will change the host
  826. X.IR archie
  827. Xwill consult when making queries.  (The default value is what's been
  828. Xcompiled in.)  The ``\-h'' option will override this.  If you're
  829. Xrunning VMS, create a symbol called ARCHIE_HOST.
  830. X
  831. X.SH SEE ALSO
  832. XFor more information on regular expressions, see the manual pages on:
  833. X
  834. X.BR regex (3) ,
  835. X.BR ed (1)
  836. X
  837. XAlso read the file \fBarchie/doc/whatis.archie\fR on
  838. X\fBarchie.mcgill.ca\fR for a detailed paper on Archie as a whole.
  839. X
  840. XRead the file README.ALEX distributed with this client for more
  841. Xinformation on what Alex is and how you can take advantage of it.
  842. X.SH AUTHORS
  843. XThe 
  844. X.B archie
  845. Xservice was conceived and implemented by Alan Emtage (\fBbajan@cs.mcgill.ca\fR),
  846. XPeter Deutsch (\fBpeterd@cs.mcgill.ca\fR), and Bill Heelan
  847. X(\fBwheelan@cs.mcgill.ca\fR).  The entire Internet is in their debt.
  848. X
  849. XThe \fBProspero\fR system was created by Clifford Neuman
  850. X(\fBbcn@isi.edu\fR); write to \fBinfo\-prospero@isi.edu\fR for more
  851. Xinformation on the protocol and its use.
  852. X
  853. XThis stripped client was put together by Brendan Kehoe
  854. X(\fBbrendan@cygnus.com\fR), with modifications by
  855. XClifford Neuman and George Ferguson (\fBferguson@cs.rochester.edu\fR).
  856. X
  857. X.SH BUGS
  858. XThere are none; only a few unexpected features.
  859. X
  860. END_OF_FILE
  861.   if test 6945 -ne `wc -c <'archie.man'`; then
  862.     echo shar: \"'archie.man'\" unpacked with wrong size!
  863.   fi
  864.   # end of 'archie.man'
  865. fi
  866. if test -f 'pauthent.h' -a "${1}" != "-c" ; then 
  867.   echo shar: Will not clobber existing file \"'pauthent.h'\"
  868. else
  869.   echo shar: Extracting \"'pauthent.h'\" \(885 characters\)
  870.   sed "s/^X//" >'pauthent.h' <<'END_OF_FILE'
  871. X/*
  872. X * Copyright (c) 1989, 1990, 1991 by the University of Washington
  873. X *
  874. X * For copying and distribution information, please see the file
  875. X * <copyright.h>.
  876. X */
  877. X
  878. X#include <copyright.h>
  879. X
  880. X#define PFSA_UNAUTHENTICATED        1
  881. X
  882. Xstruct pfs_auth_info {
  883. X    char            auth_type[100];
  884. X    char            authenticator[250];
  885. X};
  886. X
  887. Xtypedef struct pfs_auth_info *PAUTH;
  888. Xtypedef struct pfs_auth_info PAUTH_ST;
  889. X
  890. XPAUTH get_pauth();
  891. X
  892. X#ifndef VMS
  893. X# ifndef IN_H
  894. X#  ifdef PCNFS
  895. X#   include <tklib.h>
  896. X#  endif
  897. X#  include <netinet/in.h>
  898. X#  define IN_H
  899. X# endif
  900. X#else
  901. X# ifndef _ARCHIE_VMS
  902. X#  include <vms.h>
  903. X# endif
  904. X#endif
  905. X
  906. Xstruct client_info {
  907. X    int                ainfo_type;
  908. X    char            *auth_type;
  909. X    char            *authenticator;
  910. X    char            *userid;
  911. X    short            port;
  912. X    struct in_addr        haddr;
  913. X    struct pfs_auth_info    *previous;
  914. X    struct pfs_auth_info    *next;
  915. X};
  916. X
  917. Xtypedef struct client_info *CINFO;
  918. Xtypedef struct client_info CINFO_ST;
  919. END_OF_FILE
  920.   if test 885 -ne `wc -c <'pauthent.h'`; then
  921.     echo shar: \"'pauthent.h'\" unpacked with wrong size!
  922.   fi
  923.   # end of 'pauthent.h'
  924. fi
  925. if test -f 'perrmesg.c' -a "${1}" != "-c" ; then 
  926.   echo shar: Will not clobber existing file \"'perrmesg.c'\"
  927. else
  928.   echo shar: Extracting \"'perrmesg.c'\" \(9004 characters\)
  929.   sed "s/^X//" >'perrmesg.c' <<'END_OF_FILE'
  930. X/*
  931. X * Copyright (c) 1989, 1990, 1991 by the University of Washington
  932. X *
  933. X * For copying and distribution information, please see the file
  934. X * <copyright.h>.
  935. X */
  936. X
  937. X#include <perrno.h>
  938. X#include <stdio.h>
  939. X
  940. X/* This file and perrno.h should always be updated simultaneously */
  941. X
  942. Xint    perrno = 0;
  943. Xint    pwarn = 0;
  944. Xchar    p_err_string[P_ERR_STRING_SZ];
  945. Xchar    p_warn_string[P_ERR_STRING_SZ];
  946. X
  947. Xchar    *p_err_text[256] = {
  948. X    /*   0 */ "Success (prospero)",
  949. X    /*   1 */ "Port unknown (dirsend)",
  950. X    /*   2 */ "Can't open local UDP port (dirsend)",
  951. X    /*   3 */ "Can't resolve hostname (dirsend)",
  952. X    /*   4 */ "Unable to send entire message (dirsend)",
  953. X    /*   5 */ "Timed out (dirsend)",
  954. X    /*   6 */ "Recvfrom failed (dirsend)",
  955. X    /*   7 */ "",    /*   8 */ "",    /*   9 */ "",    /*  10 */ "",
  956. X    /*  11 */ "Sendto failed (reply)",
  957. X    /*  12 */ "",    /*  13 */ "",    /*  14 */ "",    /*  15 */ "",
  958. X    /*  16 */ "",    /*  17 */ "",    /*  18 */ "",    /*  19 */ "",
  959. X    /*  20 */ "",
  960. X    /*  21 */ "Link already exists (vl_insert)",
  961. X    /*  22 */ "Link with same name already exists (vl_insert)",
  962. X    /*  23 */ "",    /*  24 */ "",
  963. X    /*  25 */ "Link already exists (ul_insert)",
  964. X    /*  26 */ "Replacing existing link (ul_insert)",
  965. X    /*  27 */ "Previous entry not found in dir->ulinks (ul_insert)",
  966. X    /*  28 */ "",    /*  29 */ "",    /*  30 */ "",    /*  31 */ "",
  967. X    /*  32 */ "",    /*  33 */ "",    /*  34 */ "",    /*  35 */ "",
  968. X    /*  36 */ "",    /*  37 */ "",    /*  38 */ "",    /*  39 */ "",
  969. X    /*  40 */ "",
  970. X    /*  41 */ "Temporary not found (rd_vdir)",
  971. X    /*  42 */ "Namespace not closed with object (rd_vdir)",
  972. X    /*  43 */ "Alias for namespace not defined (rd_vdir)",
  973. X    /*  44 */ "Specified namespace not found (rd_vdir)",
  974. X    /*  45 */ "",    /*  46 */ "",    /*  47 */ "",    /*  48 */ "",
  975. X    /*  49 */ "",    /*  50 */ "",
  976. X    /*  51 */ "File access method not supported (pfs_access)",
  977. X    /*  52 */ "",    /*  53 */ "",    /*  54 */ "",
  978. X    /*  55 */ "Pointer to cached copy - delete on close (pmap_cache)",
  979. X    /*  56 */ "Unable to retrieve file (pmap_cache)",
  980. X    /*  57 */ "",    /*  58 */ "",    /*  59 */ "",    /*  60 */ "",
  981. X    /*  61 */ "Directory already exists (mk_vdir)",
  982. X    /*  62 */ "Link with same name already exists (mk_vdir)",
  983. X    /*  63 */ "",    /*  64 */ "",
  984. X    /*  65 */ "Not a virtual system (vfsetenv)",
  985. X    /*  66 */ "Can't find directory (vfsetenv)",
  986. X    /*  67 */ "",    /*  68 */ "",    /*  69 */ "",    /*  70 */ "",
  987. X    /*  71 */ "Link already exists (add_vlink)",
  988. X    /*  72 */ "Link with same name already exists (add_vlink)",
  989. X    /*  73 */ "",    /*  74 */ "",    /*  75 */ "",    /*  76 */ "",
  990. X    /*  77 */ "",    /*  78 */ "",    /*  79 */ "",    /*  80 */ "",
  991. X    /*  81 */ "",    /*  82 */ "",    /*  83 */ "",    /*  84 */ "",
  992. X    /*  85 */ "",    /*  86 */ "",    /*  87 */ "",    /*  88 */ "",
  993. X    /*  89 */ "",    /*  90 */ "",    /*  91 */ "",    /*  92 */ "",
  994. X    /*  93 */ "",    /*  94 */ "",    /*  95 */ "",    /*  96 */ "",
  995. X    /*  97 */ "",    /*  98 */ "",    /*  99 */ "",    /* 100 */ "",
  996. X    /* 101 */ "",    /* 102 */ "",    /* 103 */ "",    /* 104 */ "",
  997. X    /* 105 */ "",    /* 106 */ "",    /* 107 */ "",    /* 108 */ "",
  998. X    /* 109 */ "",    /* 110 */ "",    /* 111 */ "",    /* 112 */ "",
  999. X    /* 113 */ "",    /* 114 */ "",    /* 115 */ "",    /* 116 */ "",
  1000. X    /* 117 */ "",    /* 118 */ "",    /* 119 */ "",    /* 120 */ "",
  1001. X    /* 121 */ "",    /* 122 */ "",    /* 123 */ "",    /* 124 */ "",
  1002. X    /* 125 */ "",    /* 126 */ "",    /* 127 */ "",    /* 128 */ "",
  1003. X    /* 129 */ "",    /* 130 */ "",    /* 131 */ "",    /* 132 */ "",
  1004. X    /* 133 */ "",    /* 134 */ "",    /* 135 */ "",    /* 136 */ "",
  1005. X    /* 137 */ "",    /* 138 */ "",    /* 139 */ "",    /* 140 */ "",
  1006. X    /* 141 */ "",    /* 142 */ "",    /* 143 */ "",    /* 144 */ "",
  1007. X    /* 145 */ "",    /* 146 */ "",    /* 147 */ "",    /* 148 */ "",
  1008. X    /* 149 */ "",    /* 150 */ "",    /* 151 */ "",    /* 152 */ "",
  1009. X    /* 153 */ "",    /* 154 */ "",    /* 155 */ "",    /* 156 */ "",
  1010. X    /* 157 */ "",    /* 158 */ "",    /* 159 */ "",    /* 160 */ "",
  1011. X    /* 161 */ "",    /* 162 */ "",    /* 163 */ "",    /* 164 */ "",
  1012. X    /* 165 */ "",    /* 166 */ "",    /* 167 */ "",    /* 168 */ "",
  1013. X    /* 169 */ "",    /* 170 */ "",    /* 171 */ "",    /* 172 */ "",
  1014. X    /* 173 */ "",    /* 174 */ "",    /* 175 */ "",    /* 176 */ "",
  1015. X    /* 177 */ "",    /* 178 */ "",    /* 179 */ "",    /* 180 */ "",
  1016. X    /* 181 */ "",    /* 182 */ "",    /* 183 */ "",    /* 184 */ "",
  1017. X    /* 185 */ "",    /* 186 */ "",    /* 187 */ "",    /* 188 */ "",
  1018. X    /* 189 */ "",    /* 190 */ "",    /* 191 */ "",    /* 192 */ "",
  1019. X    /* 193 */ "",    /* 194 */ "",    /* 195 */ "",    /* 196 */ "",
  1020. X    /* 197 */ "",    /* 198 */ "",    /* 199 */ "",    /* 200 */ "",
  1021. X    /* 201 */ "",    /* 202 */ "",    /* 203 */ "",    /* 204 */ "",
  1022. X    /* 205 */ "",    /* 206 */ "",    /* 207 */ "",    /* 208 */ "",
  1023. X    /* 209 */ "",    /* 210 */ "",    /* 211 */ "",    /* 212 */ "",
  1024. X    /* 213 */ "",    /* 214 */ "",    /* 215 */ "",    /* 216 */ "",
  1025. X    /* 217 */ "",    /* 218 */ "",    /* 219 */ "",    /* 220 */ "",
  1026. X    /* 221 */ "",    /* 222 */ "",    /* 223 */ "",    /* 224 */ "",
  1027. X    /* 225 */ "",    /* 226 */ "",    /* 227 */ "",    /* 228 */ "",
  1028. X    /* 229 */ "",
  1029. X    /* 230 */ "File not found (prospero)",
  1030. X    /* 231 */ "Directory not found (prospero)",
  1031. X    /* 232 */ "Symbolic links nested too deep (prospero)",
  1032. X    /* 233 */ "Environment not initialized - source vfsetup.source then run vfsetup",
  1033. X    /* 234 */ "Can't traverse an external file (prospero)",
  1034. X    /* 235 */ "Forwarding chain is too long (prospero)",
  1035. X    /* 236 */ "",    /* 237 */ "",    /* 238 */ "",    /* 239 */ "",
  1036. X    /* 240 */ "",    /* 241 */ "",
  1037. X    /* 242 */ "Authentication required (prospero server)",
  1038. X    /* 243 */ "Not authorized (prospero server)",
  1039. X    /* 244 */ "Not found (prospero server)",
  1040. X    /* 245 */ "Bad version number (prospero server)",
  1041. X    /* 246 */ "Not a directory (prospero server)",
  1042. X    /* 247 */ "Already exists (prospero server)",
  1043. X    /* 248 */ "Link with same name already exists (prospero server)",
  1044. X    /* 249 */ "",    /* 250 */ "",
  1045. X    /* 251 */ "Command not implemented on server (dirsrv)",
  1046. X    /* 252 */ "Bad format for response (dirsrv)",
  1047. X    /* 253 */ "Protocol error (prospero server)",
  1048. X    /* 254 */ "Unspecified server failure (prospero server)",
  1049. X    /* 255 */ "Generic Failure (prospero)"};
  1050. X
  1051. Xchar    *p_warn_text[256] = {
  1052. X    /*   0 */ "No warning",
  1053. X    /*   1 */ "You are using an old version of this program",
  1054. X    /*   2 */ "From server",
  1055. X    /*   3 */ "Unrecognized line in response from server",
  1056. X  /* 4-254 */ "", "", "", "", "", "", "", "", "", "", "", "", "",
  1057. X  "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "",
  1058. X  "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "",
  1059. X  "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "",
  1060. X  "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "",
  1061. X  "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "",
  1062. X  "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "",
  1063. X  "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "",
  1064. X  "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "",
  1065. X  "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "",
  1066. X  "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "",
  1067. X  "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "",
  1068. X  "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "",
  1069. X  "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "",
  1070. X  "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "",
  1071. X    /* 255 */ ""};
  1072. X
  1073. X#ifndef ARCHIE
  1074. Xperrmesg(prefix,no,text)
  1075. X    char    *prefix;
  1076. X    int        no;
  1077. X    char    *text;
  1078. X    {
  1079. X    fprintf(stderr,"%s%s%s%s\n", (prefix ? prefix : ""),
  1080. X        (no ? p_err_text[no] : p_err_text[perrno]),
  1081. X        ((text ? (*text ? " - " : "") : 
  1082. X          (!no && *p_err_string ? " - " : ""))),
  1083. X        (text ? text : (no ? "" : p_err_string)));
  1084. X    }
  1085. X
  1086. Xsperrmesg(buf,prefix,no,text)
  1087. X    char    *buf;
  1088. X    char    *prefix;
  1089. X    int        no;
  1090. X    char    *text;
  1091. X    {
  1092. X    sprintf(buf,"%s%s%s%s\n", (prefix ? prefix : ""),
  1093. X        (no ? p_err_text[no] : p_err_text[perrno]),
  1094. X        ((text ? (*text ? " - " : "") : 
  1095. X          (!no && *p_err_string ? " - " : ""))),
  1096. X        (text ? text : (no ? "" : p_err_string)));
  1097. X    }
  1098. X
  1099. Xpwarnmesg(prefix,no,text)
  1100. X    char    *prefix;
  1101. X    int        no;
  1102. X    char    *text;
  1103. X    {
  1104. X    fprintf(stderr,"%s%s%s%s\n", (prefix ? prefix : ""),
  1105. X        (no ? p_warn_text[no] : p_warn_text[pwarn]),
  1106. X        ((text ? (*text ? " - " : "") : 
  1107. X          (!no && *p_warn_string ? " - " : ""))),
  1108. X        (text ? text : (no ? "" : p_warn_string)));
  1109. X    }
  1110. X
  1111. Xspwarnmesg(buf,prefix,no,text)
  1112. X    char    *buf;
  1113. X    char    *prefix;
  1114. X    int        no;
  1115. X    char    *text;
  1116. X    {
  1117. X    sprintf(buf,"%s%s%s%s\n", (prefix ? prefix : ""),
  1118. X        (no ? p_warn_text[no] : p_warn_text[pwarn]),
  1119. X        ((text ? (*text ? " - " : "") : 
  1120. X          (!no && *p_warn_string ? " - " : ""))),
  1121. X        (text ? text : (no ? "" : p_warn_string)));
  1122. X    }
  1123. X#endif
  1124. END_OF_FILE
  1125.   if test 9004 -ne `wc -c <'perrmesg.c'`; then
  1126.     echo shar: \"'perrmesg.c'\" unpacked with wrong size!
  1127.   fi
  1128.   # end of 'perrmesg.c'
  1129. fi
  1130. if test -f 'pfs.h' -a "${1}" != "-c" ; then 
  1131.   echo shar: Will not clobber existing file \"'pfs.h'\"
  1132. else
  1133.   echo shar: Extracting \"'pfs.h'\" \(14049 characters\)
  1134.   sed "s/^X//" >'pfs.h' <<'END_OF_FILE'
  1135. X/*
  1136. X * Copyright (c) 1989, 1990, 1991 by the University of Washington
  1137. X *
  1138. X * For copying and distribution information, please see the file
  1139. X * <copyright.h>.
  1140. X */
  1141. X
  1142. X#include <copyright.h>
  1143. X
  1144. X#ifdef PCNFS
  1145. X#include <tklib.h>
  1146. X#include <tk_errno.h>
  1147. X#include <sys/nfs_time.h>
  1148. X#endif
  1149. X#ifdef VMS
  1150. X# include <vms.h>
  1151. X#else /* not VMS */
  1152. X# ifndef _TYPES_
  1153. X#  include <sys/types.h>
  1154. X# endif /* _TYPES_ */
  1155. X# ifndef IN_H
  1156. X#  include <netinet/in.h> 
  1157. X#  define IN_H
  1158. X# endif
  1159. X#endif /* VMS */
  1160. X
  1161. X#ifndef NULL
  1162. X# ifdef MSDOS
  1163. X#  include <stdio.h>
  1164. X# else
  1165. X#  define NULL 0
  1166. X# endif /* MSDOS */
  1167. X#endif /* NULL */
  1168. X
  1169. X#define        PFS_RELEASE    "Beta.4.2E"
  1170. X#define        PFS_SW_ID    "B42E"
  1171. X
  1172. X/* moved up for vdir_init */
  1173. X#define ZERO(p)        bzero((char *)(p), sizeof(*(p)))
  1174. X
  1175. X/* General Definitions */
  1176. X
  1177. X#define        MAX_PTXT_LEN    1250     /* Max length of PTEXT structure   */
  1178. X#define        MAX_PTXT_HDR    32       /* Max offset for start            */
  1179. X#define        P_ERR_STRING_SZ 100     /* Size of error string        */
  1180. X#define        MAX_VPATH    1024     /* Max length of virtual pathname  */
  1181. X
  1182. X/* Definition of text structure used to pass text around */
  1183. X
  1184. Xstruct ptext {
  1185. X    int            length;          /* Length of text (from start)    */
  1186. X    char        *start;          /* Start of text            */
  1187. X    char        dat[MAX_PTXT_LEN+2*MAX_PTXT_HDR];/* The data itself */
  1188. X    unsigned long     mbz;          /* ZERO to catch runaway strings  */
  1189. X    struct ptext    *previous;        /* Previous element in list       */
  1190. X    struct ptext    *next;          /* Next element in linked list    */
  1191. X    int            seq;          /* Sequence Number            */
  1192. X};
  1193. X
  1194. Xtypedef struct ptext *PTEXT;
  1195. Xtypedef struct ptext PTEXT_ST;
  1196. X
  1197. X/* Request structure: maintains information about server requests */
  1198. Xstruct preq {
  1199. X    int            cid;          /* Connection ID                  */
  1200. X    short        priority;      /* Connection priority            */
  1201. X    int            pf_priority;      /* Priority assigned by pri_func  */
  1202. X    int            recv_tot;      /* Total # of packets received    */
  1203. X    int            trns_tot;      /* Total # of packets to transmit */
  1204. X    struct ptext    *cpkt;          /* Current packet being filled in */
  1205. X    struct ptext    *recv;          /* Received packets               */
  1206. X    struct ptext    *trns;          /* Transmitted packets            */
  1207. X    int            rcvd_thru;      /* Received all packets through # */
  1208. X    struct preq        *previous;        /* Previous element in list       */
  1209. X    struct preq        *next;          /* Next element in linked list    */
  1210. X    struct sockaddr_in    fromto;       /* Sender/Destination            */
  1211. X};
  1212. X
  1213. Xtypedef struct preq *PREQ;
  1214. Xtypedef struct preq PREQ_ST;
  1215. X
  1216. X
  1217. X/* Definition of structure containing information on virtual link */
  1218. X
  1219. Xstruct vlink {
  1220. X    int            dontfree;      /* Flag: don't free this link     */
  1221. X    char        *name;          /* Component of path name        */
  1222. X    char        linktype;      /* L = Link, U = Union, N= Native */
  1223. X    int            expanded;      /* Has a union link been expanded */
  1224. X    char        *type;            /* Type of object pointed to      */
  1225. X    struct vlink    *filters;      /* Filters associated with link   */
  1226. X    struct vlink    *replicas;      /* Replicas (* see comment below) */
  1227. X    char        *hosttype;      /* Type of hostname            */
  1228. X    char        *host;          /* Files physical location        */
  1229. X    char        *nametype;      /* Type of filename            */
  1230. X    char        *filename;      /* System level filename        */
  1231. X    long        version;      /* Version number of destination  */
  1232. X    long        f_magic_no;      /* File's magic number        */
  1233. X    struct acl        *acl;          /* ACL for link            */
  1234. X    long        dest_exp;      /* Expiration for dest of link    */
  1235. X    long        link_exp;      /* Expiration of link itself      */
  1236. X    char        *args;          /* Arguments if this is a filter  */
  1237. X    struct pattrib    *lattrib;      /* Attributes associated w/ link  */
  1238. X    struct pfile    *f_info;      /* Info to be assoicated w/ file  */
  1239. X    struct vlink    *previous;        /* Previous elt in linked list    */
  1240. X    struct vlink    *next;          /* Next element in linked list    */
  1241. X};
  1242. X
  1243. Xtypedef struct vlink *VLINK;
  1244. Xtypedef struct vlink VLINK_ST;
  1245. X
  1246. X/* * Note that vlink->replicas is not really a list of replicas of the  */
  1247. X/*   object.  Instead, it is a list of the objects returned during name */
  1248. X/*   resolution that share the same name as the current object.  Such   */
  1249. X/*   an object should only be considered a replica if it also shares    */
  1250. X/*   the same non-zero magic number.                                    */
  1251. X
  1252. X/* Definition of structure continiaing virtual directory information    */
  1253. X
  1254. Xstruct vdir {
  1255. X    int            version;      /* Version of local directory fmt  */
  1256. X    int            inc_native;      /* Include the native directory    */
  1257. X    long        magic_no;      /* Magic number of current file    */
  1258. X    struct acl        *dacl;            /* Default acl for links in dir    */
  1259. X    struct pfile    *f_info;      /* Directory file info             */
  1260. X    struct vlink    *links;          /* The directory entries         */
  1261. X    struct vlink    *lastlink;      /* Last directory entry            */
  1262. X    struct vlink    *ulinks;      /* The entries for union links     */
  1263. X    struct vdir        *previous;        /* Previous element in linked list */
  1264. X    struct vdir        *next;          /* Next element in linked list     */
  1265. X};
  1266. X
  1267. Xtypedef struct vdir *PVDIR;
  1268. Xtypedef struct vdir VDIR_ST;
  1269. X
  1270. X/* Initialize directory */
  1271. X#define vdir_init(dir)  ZERO(dir)
  1272. X/* XXX: was
  1273. X
  1274. X  dir->version = 0;     dir->inc_native = 0; \
  1275. X  dir->magic_no = 0;    dir->f_info = NULL; \
  1276. X  dir->links = NULL;    dir->lastlink = NULL; \
  1277. X  dir->ulinks = NULL;   dir->dacl = NULL; \
  1278. X  dir->previous = NULL; dir->next = NULL;
  1279. X*/
  1280. X
  1281. X#define vdir_copy(d1,d2) d2->version = d1->version; \
  1282. X                         d2->inc_native = d1->inc_native; \
  1283. X                         d2->magic_no = d1->magic_no; \
  1284. X                 d2->f_info = d1->f_info; \
  1285. X                         d2->links = d1->links; \
  1286. X                         d2->lastlink = d1->lastlink; \
  1287. X                         d2->ulinks = d1->ulinks; \
  1288. X                         d2->dacl = d1->dacl; \
  1289. X                         d2->previous = d1->previous; \
  1290. X                         d2->next = d1->next; 
  1291. X                         
  1292. X/* Values of ->inc_native in vdir structure */
  1293. X#define VDIN_REALONLY    -1   /* Include native files, but not . and ..       */
  1294. X#define VDIN_NONATIVE     0   /* Do not include files from native directory   */
  1295. X#define VDIN_INCLNATIVE     1   /* Include files from native directory          */
  1296. X#define VDIN_NATIVEONLY  2   /* All entries in directory are from native dir */
  1297. X#define VDIN_PSEUDO      3   /* Directory is not real                        */
  1298. X
  1299. X
  1300. X/* Definition of structure containing information on a specific file */
  1301. X
  1302. Xunion avalue {
  1303. X    char        *ascii;        /* Character string                */
  1304. X    struct vlink    *link;        /* A link               */
  1305. X};
  1306. X
  1307. X
  1308. Xstruct pattrib {
  1309. X    char        precedence;    /* Precedence for link attribute   */
  1310. X    char        *aname;        /* Name of the attribute           */
  1311. X    char        *avtype;    /* Type of the attribute value     */
  1312. X    union avalue    value;        /* Attribute Value                 */
  1313. X    struct pattrib    *previous;      /* Previous element in linked list */
  1314. X    struct pattrib    *next;        /* Next element in linked list     */
  1315. X};
  1316. X
  1317. Xtypedef struct pattrib *PATTRIB;
  1318. Xtypedef struct pattrib PATTRIB_ST;
  1319. X
  1320. X#define     ATR_PREC_OBJECT  'O'   /* Authoritative answer for object */
  1321. X#define     ATR_PREC_LINK    'L'   /* Authoritative answer for link   */
  1322. X#define     ATR_PREC_CACHED  'C'   /* Object info cached w/ link      */
  1323. X#define     ATR_PREC_REPLACE 'R'   /* From link (replaces O)          */
  1324. X#define     ATR_PREC_ADD     'A'   /* From link (additional value)    */
  1325. X
  1326. X/* **** Incomplete **** */
  1327. Xstruct pfile {
  1328. X    int            version;      /* Version of local finfo format   */
  1329. X    long        f_magic_no;      /* Magic number of current file    */
  1330. X    long        exp;          /* Expiration date of timeout      */
  1331. X    long        ttl;          /* Time to live after reference    */
  1332. X    long        last_ref;      /* Time of last reference          */
  1333. X    struct vlink    *forward;      /* List of forwarding pointers     */
  1334. X    struct vlink    *backlinks;      /* Partial list of back links      */
  1335. X    struct pattrib    *attributes;      /* List of file attributes         */
  1336. X    struct pfile    *previous;        /* Previous element in linked list */
  1337. X    struct pfile    *next;          /* Next element in linked list     */
  1338. X};
  1339. X
  1340. Xtypedef struct pfile *PFILE;
  1341. Xtypedef struct pfile PFILE_ST;
  1342. X
  1343. X/* Definition of structure contining an access control list entry */
  1344. X
  1345. Xstruct acl {
  1346. X    int            acetype;      /* Access Contol Entry type       */
  1347. X    char        *atype;           /* Authentication type            */
  1348. X    char        *rights;          /* Rights                         */
  1349. X    char        *principals;      /* Authorized principals          */
  1350. X    struct restrict     *restrictions;    /* Restrictions on use            */
  1351. X    struct acl        *previous;        /* Previous elt in linked list    */
  1352. X    struct acl        *next;          /* Next element in linked list    */
  1353. X};
  1354. Xtypedef struct acl *ACL;
  1355. Xtypedef struct acl ACL_ST;
  1356. X
  1357. X#define ACL_NONE        0         /* Nobody authorized by ths entry */
  1358. X#define ACL_DEFAULT        1         /* System default                 */
  1359. X#define ACL_SYSTEM        2         /* System administrator           */
  1360. X#define ACL_OWNER               3         /* Directory owner                */
  1361. X#define ACL_DIRECTORY           4         /* Same as directory              */
  1362. X#define ACL_ANY                 5         /* Any user                       */
  1363. X#define ACL_AUTHENT             6         /* Authenticated principal        */
  1364. X#define ACL_LGROUP              7         /* Local group                    */
  1365. X#define ACL_GROUP               8         /* External group                 */
  1366. X#define ACL_ASRTHOST            10        /* Check host and asserted userid */
  1367. X#define ACL_TRSTHOST            11        /* ASRTHOST from privileged port  */
  1368. X
  1369. X
  1370. X/* Definition of structure contining access restrictions */
  1371. X/* for future extensions                                 */
  1372. Xstruct restrict {
  1373. X    struct acl        *previous;        /* Previous elt in linked list    */
  1374. X    struct acl        *next;          /* Next element in linked list    */
  1375. X};
  1376. X
  1377. X/* Definitions for send_to_dirsrv */
  1378. X#define    CLIENT_DIRSRV_TIMEOUT        4    /* time between retries      */
  1379. X#define CLIENT_DIRSRV_BACKOFF(x)  (2 * x)    /* Backoff algorithm         */
  1380. X#define CLIENT_DIRSRV_RETRY        3    /* retry this many times     */
  1381. X
  1382. X/* Definitions for rd_vlink and rd_vdir */
  1383. X#define        SYMLINK_NESTING 10       /* Max nesting depth for sym links */
  1384. X
  1385. X/* Definition fo check_acl */
  1386. X#define        ACL_NESTING     10       /* Max depth for ACL group nesting */
  1387. X
  1388. X/* Flags for mk_vdir */
  1389. X#define         MKVD_LPRIV     1   /* Minimize privs for creator in new ACL    */
  1390. X
  1391. X/* Flags for get_vdir */
  1392. X#define         GVD_UNION      0    /* Do not expand union links              */
  1393. X#define      GVD_EXPAND     1   /* Expand union links locally             */
  1394. X#define         GVD_LREMEXP    3   /* Request remote expansion of local links   */
  1395. X#define         GVD_REMEXP     7   /* Request remote expansion of all links     */
  1396. X#define         GVD_VERIFY     8    /* Only verify args are for a directory      */
  1397. X#define      GVD_FIND       16   /* Stop expanding when match is found        */
  1398. X#define         GVD_ATTRIB    32   /* Request attributes from remote server     */
  1399. X#define         GVD_NOSORT       64   /* Do not sort links when adding to dir      */
  1400. X
  1401. X/* Flags for rd_vdir */
  1402. X#define         RVD_UNION      GVD_UNION
  1403. X#define         RVD_EXPAND     GVD_EXPAND 
  1404. X#define         RVD_LREMEXP    GVD_LREMEXP
  1405. X#define         RVD_REMEXP     GVD_REMEXP
  1406. X#define         RVD_DFILE_ONLY GVD_VERIFY /* Only return ptr to dir file        */
  1407. X#define      RVD_FIND       GVD_FIND   
  1408. X#define      RVD_ATTRIB     GVD_ATTRIB
  1409. X#define         RVD_NOSORT        GVD_NOSORT
  1410. X#define         RVD_NOCACHE    128
  1411. X
  1412. X/* Flags for add_vlink */
  1413. X#define         AVL_UNION      1   /* Link is a union link                      */
  1414. X
  1415. X/* Flags for vl_insert */
  1416. X#define         VLI_NOCONFLICT 0   /* Do not insert links w/ conflicting names  */
  1417. X#define      VLI_ALLOW_CONF 1   /* Allow links with conflicting names        */
  1418. X#define         VLI_NOSORT     2   /* Allow conflicts and don't sort            */
  1419. X
  1420. X/* Flags for mapname */
  1421. X#define      MAP_READWRITE  0   /* Named file to be read and written         */
  1422. X#define         MAP_READONLY   1   /* Named file to be read only                */
  1423. X
  1424. X/* Flags for modify_acl */
  1425. X#define         MACL_NOSYSTEM   0x01
  1426. X#define      MACL_NOSELF     0x02
  1427. X#define      MACL_DEFAULT    0x08
  1428. X#define      MACL_SET        0x0C
  1429. X#define      MACL_INSERT     0x14
  1430. X#define      MACL_DELETE     0x10
  1431. X#define      MACL_ADD        0x1C
  1432. X#define      MACL_SUBTRACT   0x18
  1433. X#define      MACL_LINK       0x00
  1434. X#define      MACL_DIRECTORY  0x20
  1435. X#define      MACL_OBJECT     0x60
  1436. X#define      MACL_INCLUDE    0x40
  1437. X
  1438. X#define      MACL_OP    (MACL_DEFAULT|MACL_SET|MACL_INSERT|\
  1439. X             MACL_DELETE|MACL_ADD|MACL_SUBTRACT)
  1440. X
  1441. X#define      MACL_OTYPE (MACL_LINK|MACL_DIRECTORY|MACL_OBJECT|MACL_INCLUDE)
  1442. X
  1443. X/* Flags for dsrdir */
  1444. X#define DSRD_ATTRIBUTES                      0x1 /* Fill in attributes for links */
  1445. X
  1446. X/* Access methods returned by Pget_am */
  1447. X#define P_AM_ERROR            0
  1448. X#define P_AM_FTP            1
  1449. X#define P_AM_AFTP            2  /* Anonymous FTP  */
  1450. X#define P_AM_NFS            4
  1451. X#define P_AM_KNFS            8  /* Kerberized NFS */
  1452. X#define P_AM_AFS               16
  1453. X
  1454. X/* Return codes */
  1455. X
  1456. X#define        PSUCCESS    0
  1457. X#define        PFAILURE    255
  1458. X
  1459. X/* Hush up warnings.  */
  1460. Xvoid vllfree();
  1461. X
  1462. X/* Procedures in libpfs.a */
  1463. X
  1464. Xchar *pget_wdhost(), *pget_wdfile(), *pget_wd(), *pget_hdhost();
  1465. Xchar *pget_hdfile(), *pget_hd(), *pget_rdhost(), *pget_rdfile();
  1466. Xchar *pget_dhost(), *pget_dfile(), *pget_vsname(), *nlsindex();
  1467. Xchar *sindex(), *strtok(), *nxtline(), *unquote(), *stcopy();
  1468. Xchar *stcopyr(), *readheader(), *month_sname();
  1469. X
  1470. Xlong        asntotime();
  1471. Xvoid        procquery();
  1472. X
  1473. XPTEXT        ptalloc();
  1474. XPTEXT        dirsend();
  1475. Xvoid        ptfree();
  1476. Xvoid        ptlfree();
  1477. X
  1478. XPREQ        pralloc();
  1479. XPREQ        get_next_request();
  1480. X
  1481. XVLINK        rd_slink();
  1482. XVLINK        rd_vlink();
  1483. XVLINK        vl_delete();
  1484. XVLINK        vlalloc();
  1485. XVLINK        vlcopy();
  1486. Xvoid        vlfree();
  1487. X
  1488. XPFILE        pfalloc();
  1489. X
  1490. XPATTRIB         parse_attribute();
  1491. XPATTRIB         atalloc();
  1492. XPATTRIB     pget_at();
  1493. Xvoid        atfree();
  1494. Xvoid        atlfree();
  1495. X
  1496. XACL             acalloc();
  1497. XACL             get_acl();
  1498. X
  1499. Xvoid        stfree();
  1500. X
  1501. X/* Miscellaneous useful definitions */
  1502. X#ifndef TRUE
  1503. X#define TRUE        1
  1504. X#define FALSE        0
  1505. X#endif
  1506. X
  1507. X#define AUTHORIZED      1
  1508. X#define NOT_AUTHORIZED  0
  1509. X#define NEG_AUTHORIZED  -1
  1510. X
  1511. X#ifndef NULL
  1512. X#define NULL        0
  1513. X#endif
  1514. X
  1515. X#define FAILED        -1
  1516. END_OF_FILE
  1517.   if test 14049 -ne `wc -c <'pfs.h'`; then
  1518.     echo shar: \"'pfs.h'\" unpacked with wrong size!
  1519.   fi
  1520.   # end of 'pfs.h'
  1521. fi
  1522. echo shar: End of archive 5 \(of 7\).
  1523. cp /dev/null ark5isdone
  1524. MISSING=""
  1525. for I in 1 2 3 4 5 6 7 ; do
  1526.     if test ! -f ark${I}isdone ; then
  1527.     MISSING="${MISSING} ${I}"
  1528.     fi
  1529. done
  1530. if test "${MISSING}" = "" ; then
  1531.     echo You have unpacked all 7 archives.
  1532.     rm -f ark[1-9]isdone
  1533. else
  1534.     echo You still must unpack the following archives:
  1535.     echo "        " ${MISSING}
  1536. fi
  1537. exit 0
  1538. exit 0 # Just in case...
  1539.