Annotation of libwww/Library/src/HTRules.html, revision 2.4
2.1 timbl 1: <PRE>
2: /* Configuration manager for Hypertext Daemon HTRules.h
3: ** ==========================================
4: **
5: */
6:
7: /* (c) CERN WorldWideWeb project 1990,91. See Copyright.html for details */
8:
9:
10: #ifndef HTRULE_H
11: #define HTRULE_H
12:
13: #include "HTUtils.h"
14:
15: typedef enum _HTRuleOp {HT_Invalid, HT_Map, HT_Pass, HT_Fail} HTRuleOp;
16:
17: /* Add rule to the list HTAddRule()
18: ** --------------------
19: **
20: ** On entry,
21: ** pattern points to 0-terminated string containing a single "*"
22: ** equiv points to the equivalent string with * for the
23: ** place where the text matched by * goes.
24: ** On exit,
25: ** returns 0 if success, -1 if error.
26: */
27: /* Note that if BYTE_ADDRESSING is set, the three blocks required
28: ** are allocated and deallocated as one. This will save time and
29: ** storage, when malloc's allocation units are large.
30: */
31: extern int HTAddRule PARAMS((HTRuleOp op, const char * pattern, const char * equiv));
32:
33:
34: /* Clear all rules HTClearRules()
35: ** ---------------
36: **
37: ** On exit,
38: ** There are no rules
39: ** returns 0 if success, -1 if error.
40: **
41: ** See also
42: ** HTAddRule()
43: */
44: #ifdef __STDC__
45: extern int HTClearRules(void);
46: #else
47: extern int HTClearRules();
48: #endif
49:
50:
51: /* Translate by rules HTTranslate()
52: ** ------------------
53: **
54: ** The most recently defined rules are applied first.
55: **
56: ** On entry,
57: ** required points to a string whose equivalent value is neeed
58: ** On exit,
59: ** returns the address of the equivalent string allocated from
60: ** the heap which the CALLER MUST FREE. If no translation
61: ** occured, then it is a copy of the original.
62: */
63: #ifdef __STDC__
64: extern char * HTTranslate(const char * required);
65: #else
66: extern char * HTTranslate();
67: #endif
68:
69:
70: /* Load the rules from a file HtLoadRules()
71: ** --------------------------
72: **
73: ** On entry,
74: ** Rules can be in any state
75: ** On exit,
76: ** Any existing rules will have been kept.
77: ** Any new rules will have been loaded on top, so as to be tried first.
78: ** Returns 0 if no error.
79: **
80: ** Bugs:
81: ** The strings may not contain spaces.
82: */
83:
84: #ifdef __STDC__
85: extern int HTLoadRules(const char * filename);
86: #else
87: extern int HTLoadRules();
88: #endif
89:
90:
91: #endif /* HTUtils.h */
92:
93: </PRE>
Webmaster