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

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: #include "HTUtils.h"
                     34: 
                     35: typedef struct _HTStream HTStream;
                     36: 
                     37: </PRE>These are the common methods of all
                     38: streams.  They should be self-explanatory,
                     39: except for end_document which must
                     40: be called before free.  It should
                     41: be merged with free in fact:  it
2.3       timbl      42: should be dummy for new streams.<P>
2.7       frystyk    43: 
                     44: <B>NOTE: </B>The <CODE>put_block</CODE> method was <CODE>write</CODE>, but this
                     45: upset systems which had macros for <CODE>write()</CODE><P>
                     46: 
                     47: <B>NOTE: </B>The methods <CODE>_free</CODE> and <CODE>abort</CODE> in
                     48: the stream are now integers and not void anymore. The general return
                     49: codes from the methods are:
                     50: 
                     51: <UL>
                     52: <LI>Error: EOF
                     53: <LI>OK: &gt;=0
                     54: </UL>
                     55: 
                     56: The positive return codes can be used freely by the streams.  An
                     57: explanation on an error occured can be parsed using the <A
                     58: HREF="HTError.html">Error Module</A>.
                     59: 
2.1       timbl      60: <PRE>typedef struct _HTStreamClass {
                     61: 
                     62:        char*  name;                            /* Just for diagnostics */
                     63:                
2.7       frystyk    64:        int (*_free) PARAMS((
2.1       timbl      65:                HTStream*       me));
                     66: 
2.7       frystyk    67:        int (*abort) PARAMS((
2.5       timbl      68:                HTStream*       me,
                     69:                HTError         e));
2.1       timbl      70:                
                     71:        void (*put_character) PARAMS((
                     72:                HTStream*       me,
                     73:                char            ch));
                     74:                                
                     75:        void (*put_string) PARAMS((
                     76:                HTStream*       me,
                     77:                CONST char *    str));
                     78:                
2.3       timbl      79:        void (*put_block) PARAMS((
2.1       timbl      80:                HTStream*       me,
                     81:                CONST char *    str,
                     82:                int             len));
                     83:                
                     84:                
2.7       frystyk    85: } HTStreamClass;
2.1       timbl      86: 
                     87: #endif /* HTSTREAM_H */
                     88: 
2.5       timbl      89: </PRE>end of HTStream.h</A></BODY>
2.4       timbl      90: </HTML>

Webmaster