Annotation of libwww/Library/src/HTStruct.html, revision 2.12
2.1 frystyk 1: <HTML>
2: <HEAD>
2.10 frystyk 3: <!-- Changed by: Henrik Frystyk Nielsen, 23-Mar-1996 -->
2.11 frystyk 4: <TITLE>W3C Sample Code Library libwww Structured Stream Class</TITLE>
2.1 frystyk 5: </HEAD>
6: <BODY>
2.10 frystyk 7: <H1>
8: Structured Stream Class
9: </H1>
2.1 frystyk 10: <PRE>
11: /*
2.2 frystyk 12: ** (c) COPYRIGHT MIT 1995.
2.1 frystyk 13: ** Please first read the full copyright statement in the file COPYRIGH.
14: */
15: </PRE>
2.10 frystyk 16: <P>
17: The Structured stream class defines objects which accepts a <I>structured</I>
18: sequence of characters for eaxmple a SGML document. I'll rephrase that. A
19: structured object is am ordered tree-structured arrangement of data which
20: is representable as text. An example is the <A HREF="SGML.html">SGML parser</A>
21: which outputs to a Structured Object. A Structured object can output its
22: contents to another <CODE>Structured Object</CODE>. It's a kind of typed
23: stream. The architecure is largely Dan Conolly's. Elements and entities are
24: passed to the sob by number, implying a knowledge of the DTD.
25: <P>
26: The <CODE>Structured Stream</CODE> is a subclass of a
27: <A HREF="HTStream.html">Generic Stream Object</A>. As always, we don't have
28: classes in basic C so we have to do this by hand!
29: <P>
2.12 ! frystyk 30: This module is a part of the <A HREF="http://www.w3.org/Library/">
2.11 frystyk 31: W3C Sample Code Library</A>.
2.10 frystyk 32: <PRE>#ifndef HTSTRUCT_H
2.1 frystyk 33: #define HTSTRUCT_H
34:
35: #include "HTStream.h"
2.6 frystyk 36: #include "HTList.h"
2.10 frystyk 37:
2.1 frystyk 38: </PRE>
2.10 frystyk 39: <PRE>typedef struct _HTStructured HTStructured;
2.1 frystyk 40:
41: typedef struct _HTStructuredClass {
42:
43: char * name;
44:
2.5 frystyk 45: int (*flush) (HTStructured * me);
2.1 frystyk 46:
2.5 frystyk 47: int (*_free) (HTStructured * me);
2.1 frystyk 48:
2.6 frystyk 49: int (*abort) (HTStructured * me, HTList * errorlist);
2.1 frystyk 50:
2.5 frystyk 51: int (*put_character)(HTStructured * me, char ch);
2.1 frystyk 52:
2.7 frystyk 53: int (*put_string) (HTStructured * me, const char * str);
2.1 frystyk 54:
2.7 frystyk 55: int (*put_block) (HTStructured * me, const char * str, int len);
2.1 frystyk 56: </PRE>
2.10 frystyk 57: <P>
58: See the <A HREF="HTStream.html">Generic Stream Definition</A> for an explanation
59: of these methods. Note that they all have a <CODE>HTStructured</CODE> object
60: a the parameter, not a generic stream. This is to avoid <EM>incompatible
61: pointer</EM> warnings
2.1 frystyk 62: <PRE>
2.5 frystyk 63: void (*start_element)(HTStructured *me,
64: int element_number,
2.7 frystyk 65: const BOOL * attribute_present,
66: const char ** attribute_value);
2.1 frystyk 67:
2.5 frystyk 68: void (*end_element) (HTStructured * me, int element_number);
2.1 frystyk 69:
2.5 frystyk 70: void (*put_entity) (HTStructured * me, int entity_number);
2.1 frystyk 71:
72: } HTStructuredClass;
73:
74: #endif
75: </PRE>
2.10 frystyk 76: <P>
77: <HR>
2.9 frystyk 78: <ADDRESS>
2.12 ! frystyk 79: @(#) $Id: HTStruct.html,v 2.11 1997/02/16 18:43:01 frystyk Exp $
2.9 frystyk 80: </ADDRESS>
2.10 frystyk 81: </BODY></HTML>
Webmaster