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

2.1       frystyk     1: <HTML>
                      2: <HEAD>
                      3: <TITLE>Structured Stream Definition</TITLE>
2.5     ! frystyk     4: <!-- Changed by: Henrik Frystyk Nielsen,  2-Nov-1995 -->
2.1       frystyk     5: </HEAD>
                      6: <BODY>
                      7: 
                      8: <H1>Structured Stream Definition</H1>
                      9: 
                     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>
                     16: 
                     17: This module is a part of the <A
2.4       frystyk    18: HREF="http://www.w3.org/pub/WWW/Library/">
2.3       frystyk    19: W3C Reference Library</A>.
2.1       frystyk    20: 
                     21: <PRE>
                     22: #ifndef HTSTRUCT_H
                     23: #define HTSTRUCT_H
                     24: 
                     25: #include "HTStream.h"
                     26: </PRE>
                     27: 
                     28: A structured object is something which can reasonably be represented
                     29: in for eaxmple SGML.  I'll rephrase that.  A structured object is am
                     30: ordered tree-structured arrangement of data which is representable as
                     31: text. An example is the SGML parser which outputs to a
                     32: <CODE>Structured Object</CODE>. A Structured object can output its
                     33: contents to another <CODE>Structured Object</CODE>. It's a kind of
                     34: typed stream. The architecure is largely Dan Conolly's. Elements and
                     35: entities are passed to the sob by number, implying a knowledge of the
                     36: DTD.<P>
                     37: 
                     38: The <CODE>Streuctured Stream</CODE> is a subclass of a <A
                     39: HREF="HTStream.html">Generic Stream Object</A>. As always, we don't
                     40: have classes in basic C so we have to do this by hand! <P>
                     41: 
                     42: <B>NOTE:</B> The <CODE>put_block</CODE> method was <CODE>write</CODE>,
                     43: but this upset systems which had macros for <CODE>write()</CODE>. See
                     44: the <A HREF="HTStream.html">Generic Stream Definition</A> for valid
                     45: return codes.<P>
                     46: 
                     47: <PRE>
                     48: typedef struct _HTStructured HTStructured;
                     49: 
                     50: typedef struct _HTStructuredClass {
                     51: 
                     52:     char * name;
                     53: 
2.5     ! frystyk    54:     int (*flush)       (HTStructured * me);
2.1       frystyk    55: 
2.5     ! frystyk    56:     int (*_free)       (HTStructured * me);
2.1       frystyk    57: 
2.5     ! frystyk    58:     int (*abort)       (HTStructured * me, HTError e);
2.1       frystyk    59: 
2.5     ! frystyk    60:     int (*put_character)(HTStructured *        me, char ch);
2.1       frystyk    61: 
2.5     ! frystyk    62:     int (*put_string)  (HTStructured * me, CONST char * str);
2.1       frystyk    63: 
2.5     ! frystyk    64:     int (*put_block)   (HTStructured * me, CONST char * str, int len);
2.1       frystyk    65: </PRE>
                     66: 
                     67: See the <A HREF="HTStream.html">Generic Stream Definition</A> for an
                     68: explanation of these methods. Note that they all have a
                     69: <CODE>HTStructured</CODE> object a the parameter, not a generic
                     70: stream. This is to avoid <EM>incompatible pointer</EM> warnings
                     71: 
                     72: <PRE>
2.5     ! frystyk    73:     void (*start_element)(HTStructured *me,
        !            74:                          int           element_number,
        !            75:                          CONST BOOL *  attribute_present,
        !            76:                          CONST char ** attribute_value);
2.1       frystyk    77: 
2.5     ! frystyk    78:     void (*end_element)        (HTStructured * me, int element_number);
2.1       frystyk    79: 
2.5     ! frystyk    80:     void (*put_entity) (HTStructured * me, int entity_number);
2.1       frystyk    81:                
                     82: } HTStructuredClass;
                     83: 
                     84: #endif
                     85: </PRE>
                     86: End of Structured Stream definition
                     87: </BODY>
                     88: </HTML>

Webmaster