Annotation of libwww/Library/src/HTMIMPrs.html, revision 2.5
2.1 eric 1: <HTML>
2: <HEAD>
3: <!-- Changed by: Eric Prud'hommeaux, 30-May-1996 -->
4: <TITLE>W3C Reference Library libwww MIME header parser managment</TITLE>
5: </HEAD>
6: <BODY>
7: <H1>
2.2 eric 8: MIMEParseSet
2.1 eric 9: </H1>
10: <PRE>
11: /*
12: ** (c) COPYRIGHT MIT 1996.
13: ** Please first read the full copyright statement in the file COPYRIGH.
14: */
15: </PRE>
16: <P>
2.2 eric 17: A MIME<CODE>ParseSet</CODE> associates simple and regex MIME header tokens
18: with <A HREF="HTHeader.html">parsers</A>. Regex tokens are stored in a list,
19: while simple tokens are stored in a hashed list for quick access.
2.1 eric 20: <P>
2.2 eric 21: This module is implemented by <A HREF="HTMIMPrs.c">HTMIMPrs.c</A>, and it
22: is a part of the <A HREF="http://www.w3.org/pub/WWW/Library/"> W3C Reference
2.1 eric 23: Library</A>.
24: <P>
25: <PRE>
26: #ifndef HTMIMPRS_H
27: #define HTMIMPRS_H
28:
29: #include "HTHeader.h"
30:
31: </PRE>
32: <H2>
33: Data Types
34: </H2>
35: <P>
2.2 eric 36: The HTMIMEParseSet contains all registered MIME parses. There are regex parsers,
37: which are stored in a list of HTMIMEParseEl, and simple (no wildcards) parsers
38: stored in a hashed array of lists of HTMIMEParseEl.
2.1 eric 39: <PRE>
40: typedef struct _HTMIMEParseEl HTMIMEParseEl;
41:
42: struct _HTMIMEParseSet {
43: int size;
44: HTMIMEParseEl ** parsers;
45: HTMIMEParseEl * regexParsers;
46: };
47:
48: #define MIMEParseSet_NULL {0, NULL, NULL}
49: </PRE>
50: <H2>
51: Public Functions
52: </H2>
53: <P>
2.2 eric 54: The following methods are available for this HTMIMEParseSets:
2.1 eric 55: <H3>
56: Create and destroy<CODE>HashLists</CODE>
57: </H3>
58: <PRE>
59: extern HTMIMEParseSet * HTMIMEParseSet_new(int hashSize);
2.2 eric 60: extern HTMIMEParseSet_deleteAll (HTMIMEParseSet * me);
2.1 eric 61: </PRE>
62: <H3>
63: Add and remove parsers
64: </H3>
2.2 eric 65: <P>
2.1 eric 66: Register a Header parser to be called if we encounter the token in the protocol
67: response. Tokens can contain a wildcard '*' which will match zero or more
68: arbritary chars.
69: <P>
70: <PRE>
71: extern HTMIMEParseEl * HTMIMEParseSet_add (HTMIMEParseSet * me,
72: const char * token,
73: BOOL caseSensitive,
74: HTParserCallback * callback);
75: extern HTMIMEParseEl * HTMIMEParseSet_addRegex (HTMIMEParseSet * me,
76: const char * token,
77: BOOL caseSensitive,
78: HTParserCallback * callback);
2.2 eric 79: extern int HTMIMEParseSet_delete (HTMIMEParseSet * me, const char * token);
2.1 eric 80: </PRE>
81: <H3>
82: Execute these parsers
83: </H3>
2.2 eric 84: <P>
2.1 eric 85: Find <CODE>HTParserCallback</CODE> which matches the string.
86: <PRE>
87: extern int HTMIMEParseSet_dispatch (HTMIMEParseSet * me, HTRequest * request,
2.5 ! frystyk 88: char * token, char * value, BOOL * pFound);
2.1 eric 89: </PRE>
90: <PRE>
91: #endif /* HTMIMPRS_H */
92: </PRE>
93: <P>
94: <HR>
95: <ADDRESS>
2.5 ! frystyk 96: @(#) $Id: HTMIMPrs.html,v 2.4 1996/09/09 20:53:34 frystyk Exp $
2.1 eric 97: </ADDRESS>
98: </BODY></HTML>
Webmaster