Annotation of libwww/Library/src/HTStruct.html, revision 2.14

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.14    ! vbancrof   38: #ifdef __cplusplus
        !            39: extern "C" { 
        !            40: #endif 
2.1       frystyk    41: </PRE>
2.10      frystyk    42: <PRE>typedef struct _HTStructured HTStructured;
2.1       frystyk    43: 
                     44: typedef struct _HTStructuredClass {
                     45: 
                     46:     char * name;
                     47: 
2.5       frystyk    48:     int (*flush)       (HTStructured * me);
2.1       frystyk    49: 
2.5       frystyk    50:     int (*_free)       (HTStructured * me);
2.1       frystyk    51: 
2.6       frystyk    52:     int (*abort)       (HTStructured * me, HTList * errorlist);
2.1       frystyk    53: 
2.5       frystyk    54:     int (*put_character)(HTStructured *        me, char ch);
2.1       frystyk    55: 
2.7       frystyk    56:     int (*put_string)  (HTStructured * me, const char * str);
2.1       frystyk    57: 
2.7       frystyk    58:     int (*put_block)   (HTStructured * me, const char * str, int len);
2.1       frystyk    59: </PRE>
2.10      frystyk    60: <P>
                     61: See the <A HREF="HTStream.html">Generic Stream Definition</A> for an explanation
                     62: of these methods. Note that they all have a <CODE>HTStructured</CODE> object
                     63: a the parameter, not a generic stream. This is to avoid <EM>incompatible
                     64: pointer</EM> warnings
2.1       frystyk    65: <PRE>
2.5       frystyk    66:     void (*start_element)(HTStructured *me,
                     67:                          int           element_number,
2.7       frystyk    68:                          const BOOL *  attribute_present,
                     69:                          const char ** attribute_value);
2.1       frystyk    70: 
2.5       frystyk    71:     void (*end_element)        (HTStructured * me, int element_number);
2.1       frystyk    72: 
2.5       frystyk    73:     void (*put_entity) (HTStructured * me, int entity_number);
2.13      frystyk    74: 
                     75:     int (*unparsed_begin_element)(HTStructured * me, const char * str, int len);
                     76: 
                     77:     int (*unparsed_end_element)(HTStructured * me, const char * str, int len);
                     78: 
                     79:     int (*unparsed_entity)(HTStructured * me, const char * str, int len);
2.1       frystyk    80:                
                     81: } HTStructuredClass;
                     82: 
2.14    ! vbancrof   83: #ifdef __cplusplus
        !            84: }
2.1       frystyk    85: #endif
2.14    ! vbancrof   86: 
        !            87: #endif  /* HTSTRUCT_H */
2.1       frystyk    88: </PRE>
2.10      frystyk    89: <P>
                     90:   <HR>
2.9       frystyk    91: <ADDRESS>
2.14    ! vbancrof   92:   @(#) $Id: HTStruct.html,v 2.13 1999/01/06 15:38:47 frystyk Exp $
2.9       frystyk    93: </ADDRESS>
2.10      frystyk    94: </BODY></HTML>

Webmaster