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

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

Webmaster