Annotation of libwww/Library/src/HTStream.html, revision 2.10

2.4       timbl       1: <HTML>
                      2: <HEAD>
2.8       frystyk     3: <TITLE>The Generic Stream Class Definition</TITLE>
                      4: </HEAD>
2.1       timbl       5: <BODY>
2.8       frystyk     6: 
2.7       frystyk     7: <H1>Stream Object definition</H1>
                      8: 
2.8       frystyk     9: <PRE>
                     10: /*
                     11: **     (c) COPYRIGHT CERN 1994.
                     12: **     Please first read the full copyright statement in the file COPYRIGH.
                     13: */
                     14: </PRE>
                     15: 
                     16: A Stream object is something which accepts a stream of text. See also
                     17: the <A HREF="SGML.html">Structured stream definition.</A><P>
                     18: 
                     19: The creation methods will vary on the type of Stream Object.  All
                     20: creation methods return a pointer to the stream type below.<P> As you
                     21: can see, but the methods used to write to the stream and close it are
                     22: pointed to be the object itself. <P>
                     23: 
                     24: This module is implemented by <A HREF="HTStream.c">HTStream.c</A>, and
                     25: it is a part of the <A
                     26: HREF="http://info.cern.ch/hypertext/WWW/Library/User/Guide/Guide.html">
                     27: Library of Common Code</A>.
                     28: 
                     29: <PRE>
                     30: #ifndef HTSTREAM_H
2.1       timbl      31: #define HTSTREAM_H
                     32: 
                     33: 
                     34: typedef struct _HTStream HTStream;
                     35: 
                     36: </PRE>These are the common methods of all
                     37: streams.  They should be self-explanatory,
                     38: except for end_document which must
                     39: be called before free.  It should
                     40: be merged with free in fact:  it
2.3       timbl      41: should be dummy for new streams.<P>
2.7       frystyk    42: 
                     43: <B>NOTE: </B>The <CODE>put_block</CODE> method was <CODE>write</CODE>, but this
                     44: upset systems which had macros for <CODE>write()</CODE><P>
                     45: 
                     46: <B>NOTE: </B>The methods <CODE>_free</CODE> and <CODE>abort</CODE> in
                     47: the stream are now integers and not void anymore. The general return
                     48: codes from the methods are:
                     49: 
                     50: <UL>
                     51: <LI>Error: EOF
                     52: <LI>OK: &gt;=0
                     53: </UL>
                     54: 
                     55: The positive return codes can be used freely by the streams.  An
                     56: explanation on an error occured can be parsed using the <A
                     57: HREF="HTError.html">Error Module</A>.
                     58: 
2.1       timbl      59: <PRE>typedef struct _HTStreamClass {
                     60: 
                     61:        char*  name;                            /* Just for diagnostics */
                     62:                
2.7       frystyk    63:        int (*_free) PARAMS((
2.1       timbl      64:                HTStream*       me));
                     65: 
2.7       frystyk    66:        int (*abort) PARAMS((
2.5       timbl      67:                HTStream*       me,
                     68:                HTError         e));
2.1       timbl      69:                
                     70:        void (*put_character) PARAMS((
                     71:                HTStream*       me,
                     72:                char            ch));
                     73:                                
                     74:        void (*put_string) PARAMS((
                     75:                HTStream*       me,
                     76:                CONST char *    str));
                     77:                
2.3       timbl      78:        void (*put_block) PARAMS((
2.1       timbl      79:                HTStream*       me,
                     80:                CONST char *    str,
                     81:                int             len));
                     82:                
                     83:                
2.7       frystyk    84: } HTStreamClass;
2.1       timbl      85: 
                     86: #endif /* HTSTREAM_H */
                     87: 
2.5       timbl      88: </PRE>end of HTStream.h</A></BODY>
2.4       timbl      89: </HTML>

Webmaster