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

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