Merge from vendor branch TNF:
[pkgsrcv2.git] / www / lynx / patches.v6 / patch-ac
1 $NetBSD: patch-ac,v 1.1 2000/01/15 17:44:21 hubertf Exp $
2
3 diff -x *.orig -urN ./WWW/Library/Implementation/HTAAFile.h /usr/pkgsrc/www/lynx/work.unpatched/lynx2-8-2/WWW/Library/Implementation/HTAAFile.h
4 --- ./WWW/Library/Implementation/HTAAFile.h     Thu Jan  1 01:00:00 1970
5 +++ /usr/pkgsrc/www/lynx/work.unpatched/lynx2-8-2/WWW/Library/Implementation/HTAAFile.h Sat Jan 15 07:57:17 2000
6 @@ -0,0 +1,122 @@
7 +/*                       FILE ROUTINES FOR ACCESS AUTHORIZATION PACKAGE
8 +                                             
9 +   This module implements the routines used for accessing (and parsing) the files used in
10 +   the access authorization:
11 +   
12 +      password file
13 +      
14 +      group file
15 +      
16 +      access control list (ACL) file
17 +      
18 + */
19 +
20 +
21 +#ifndef HTAAFILE_H
22 +#define HTAAFILE_H
23 +
24 +#include <HTList.h>             /* HTList */
25 +
26 +#ifdef SHORT_NAMES
27 +#define HTAAFnRe        HTAAFile_nextRec
28 +#define HTAAFrFi        HTAAFile_readField
29 +#define HTAAFrLi        HTAAFile_readList
30 +#endif /*SHORT_NAMES*/
31 +
32 +
33 +/* Used field separators */
34 +
35 +#define FIELD_SEPARATOR ':'     /* Used to separate fields              */
36 +#define LIST_SEPARATOR  ','     /* Used to separate items in a list     */
37 +                                /* in group and ALC files.              */
38 +
39 +/*
40 +
41 +Naming conventions
42 +
43 +  Record                 is an entire line in file.
44 +                         
45 +  Field                  is an entity separated by colons and/or by end-of-line.
46 +                         
47 +  List                   is a field in which there are items separated by commas.
48 +                         
49 +Record-oriented Read Routines
50 +
51 +   Password, group and ACL are internally read in by the following functions:
52 +   
53 +  HTAAFile_nextRec()      skips to the beginning of the next record (must be called even
54 +                         after the last field of a record is read to proceed to the next
55 +                         record).
56 +                         
57 +  HTAAFile_readField()    reads a field (separated by colons).
58 +                         
59 +  HTAAFile_readList()     reads a field containing a comma-separated list of items.
60 +                         
61 + */
62 +
63 +/* PUBLIC                                               HTAAFile_nextRec()
64 +**                      GO TO THE BEGINNING OF THE NEXT RECORD
65 +** ON ENTRY:
66 +**      fp      is the file from which records are read from.
67 +**
68 +** ON EXIT:
69 +**      returns nothing. File read pointer is located at the beginning
70 +**              of the next record.
71 +**
72 +*/
73 +PUBLIC void HTAAFile_nextRec PARAMS((FILE * fp));
74 +
75 +
76 +/* PUBLIC                                               HTAAFile_readField()
77 +**              READ A FIELD FROM A PASSWORD, GROUP
78 +**              OR ACCESS CONTROL LIST FILE
79 +**              i.e. an item terminated by colon,
80 +**              end-of-line, or end-of-file.
81 +** ON ENTRY:
82 +**      fp              is the file to read the characters from
83 +**      contents        is the character array to put the characters
84 +**      max_len         is the maximum number of characters that may
85 +**                      be read (i.e. the size of dest minus one for
86 +**                      terminating null).
87 +** ON EXIT:
88 +**      returns         the terminating character
89 +**                      (i.e. either separator or CR or LF or EOF).
90 +**      contents        contains a null-terminated string representing
91 +**                      the read field.
92 +** NOTE 1:
93 +**                      Ignores leading and trailing blanks and tabs.
94 +** NOTE 2:
95 +**                      If the field is more than max_len characters
96 +**                      long, the rest of the characters in that item
97 +**                      are ignored.  However, contents is always
98 +**                      null-terminated!
99 +*/
100 +PUBLIC int HTAAFile_readField PARAMS((FILE * fp,
101 +                                      char * contents,
102 +                                      int    max_len));
103 +
104 +
105 +/* PUBLIC                                               HTAAFile_readList()
106 +**
107 +**                      READ A LIST OF STRINGS SEPARATED BY COMMAS
108 +**                      (FROM A GROUP OR ACCESS CONTROL LIST FILE)
109 +** ON ENTRY:
110 +**      fp              is a pointer to the input file.
111 +**      result          is the list to which append the read items.
112 +**      max_len         is the maximum number of characters in each
113 +**                      list entry (extra characters are ignored).
114 +** ON EXIT:
115 +**      returns         the number of items read.
116 +**
117 +*/
118 +PUBLIC int HTAAFile_readList PARAMS((FILE *     fp,
119 +                                     HTList *   result,
120 +                                     int        max_len));
121 +/*
122 +
123 + */
124 +
125 +#endif /* not HTAAFILE_H */
126 +/*
127 +
128 +   End of file HTAAFile.h.  */