Annotation of libwww/Library/src/WWWStream.html, revision 2.9

2.1       frystyk     1: <HTML>
                      2: <HEAD>
2.3       frystyk     3:   <!-- Changed by: Henrik Frystyk Nielsen, 16-Apr-1996 -->
2.6       frystyk     4:   <TITLE>W3C Sample Code Library libwww Streams</TITLE>
2.1       frystyk     5: </HEAD>
                      6: <BODY>
2.3       frystyk     7: <H1>
2.6       frystyk     8:   Declaration of W3C Sample Code Library Streams
2.3       frystyk     9: </H1>
2.1       frystyk    10: <PRE>
                     11: /*
                     12: **     (c) COPYRIGHT MIT 1995.
                     13: **     Please first read the full copyright statement in the file COPYRIGH.
                     14: */
                     15: </PRE>
2.3       frystyk    16: <P>
                     17: The stream part of the Library is a set of streams that can be used in many
2.4       frystyk    18: contexts throughout the Library. It also contains conversions between streams
                     19: and other memory containers, for example <A HREF="HTChunk.html">Chunks</A>.
2.1       frystyk    20: <PRE>
                     21: #ifndef WWWSTREAM_H
                     22: #define WWWSTREAM_H
                     23: </PRE>
                     24: <PRE>
2.2       frystyk    25: #ifdef __cplusplus
                     26: extern "C" { 
                     27: #endif
2.1       frystyk    28: </PRE>
2.3       frystyk    29: <H3>
                     30:   System dependencies
                     31: </H3>
                     32: <P>
2.7       frystyk    33: The <A HREF="wwwsys.html">wwwsys.h</A> file includes system-specific include
2.3       frystyk    34: files and flags for I/O to network and disk. The only reason for this file
                     35: is that the Internet world is more complicated than Posix and ANSI.
2.7       frystyk    36: <PRE>#include "wwwsys.h"
2.1       frystyk    37: </PRE>
2.3       frystyk    38: <H3>
                     39:   Content Length Counter
                     40: </H3>
                     41: <P>
                     42: This stream also buffers the result to find out the content length. If a
                     43: maximum buffer limit is reached Content-Length is calculated for logs but
                     44: it is not sent to the client -- rather the buffer is flushed right away.
2.9     ! frystyk    45: <PRE>
        !            46: #include "<A HREF="HTConLen.html">HTConLen.h</A>"                      /* Content Length Counter */
        !            47: </PRE>
        !            48: <H3>
        !            49:   File Writer Streams
        !            50: </H3>
        !            51: <P>
        !            52: This module contains a set of basic file writer streams that are used to
        !            53: dump data objects to disk at various places within the Library core. Most
        !            54: notably, we use these streams in the <A HREF="HTFWrite.html">Format Manager</A>
        !            55: in order to handle external presenters, for example post script viewers etc.
        !            56: These streams can of course also be used in other contexts by the application.
        !            57: <PRE>
        !            58: #include "<A HREF="HTFWrite.html">HTFWrite.h</A>"
        !            59: #include "<A HREF="HTFWrite.html">HTFSave.h</A>"
2.3       frystyk    60: </PRE>
                     61: <H3>
                     62:   Content Guess Stream
                     63: </H3>
                     64: <P>
                     65: This interface provides functionality for guessing unknown media types from
                     66: magic words. The stream is a one that reads first a chunk of stuff, tries
                     67: to figure out the format, and calls <CODE>HTStreamStack()</CODE>. This is
                     68: a kind of lazy-evaluation of <CODE>HTStreamStack()</CODE>. This could be
                     69: extended arbitrarily to recognize all the possible file formats in the world,
                     70: if someone only had time to do it.
2.5       frystyk    71: <PRE>
                     72: #include "<A HREF="HTGuess.html">HTGuess.h</A>"                        /* Guess stream */
2.3       frystyk    73: </PRE>
                     74: <H3>
                     75:   Tee Stream
                     76: </H3>
                     77: <P>
                     78: The Tee stream just writes everything you put into it into two oter streams.
                     79: One use (the only use?!) is for taking a cached copey on disk while loading
                     80: the main copy, without having to wait for the disk copy to be finished and
                     81: reread it.
2.5       frystyk    82: <PRE>
                     83: #include "<A HREF="HTTee.html">HTTee.h</A>"
                     84: </PRE>
                     85: <H3>
                     86:   Merge Stream
                     87: </H3>
                     88: <P>
                     89: The Merge stream can be used to merge multiple streams into a single target
                     90: stream. The Merge stream does not prevent any of the streams from writing
                     91: and no ordering is imposed. The main feature is basically that the free and
                     92: abort methods can be called <B>n</B> times where <B>n</B> equals the number
                     93: of <I>feeds</I> that put data to the stream.
                     94: <PRE>
                     95: #include "<A HREF="HTMerge.html">HTMerge.h</A>"
2.4       frystyk    96: </PRE>
                     97: <H3>
                     98:   Stream to Chunk Conversion
                     99: </H3>
                    100: <P>
                    101: If you do not like the stream model in libwww, then you can use this stream
                    102: to convert a <A HREF="HTStream.html">stream object </A>into a
                    103: <A HREF="HTChunk.html">Chunk object</A> which is a dynamic character string
                    104: buffer in memory.
2.5       frystyk   105: <PRE>
                    106: #include "<A HREF="HTSChunk.html">HTSChunk.h</A>"
2.3       frystyk   107: </PRE>
                    108: <H3>
2.4       frystyk   109:   Stream to Memory Object Conversion
2.3       frystyk   110: </H3>
                    111: <P>
                    112: This version of the stream object is a hook for clients that want an unparsed
                    113: stream from libwww. The HTXParse_put_* and HTXParse_write routines copy the
                    114: content of the incoming buffer into a buffer that is realloced whenever
2.4       frystyk   115: necessary. This buffer is handed over to the client in
                    116: <CODE>HTXParse_free</CODE>.
2.5       frystyk   117: <PRE>
                    118: #include "<A HREF="HTXParse.html">HTXParse.h</A>"                      /* External parse stream */
2.1       frystyk   119: </PRE>
                    120: <PRE>
                    121: #ifdef __cplusplus
                    122: } /* end extern C definitions */
                    123: #endif
                    124: 
                    125: #endif
                    126: </PRE>
2.3       frystyk   127: <P>
                    128:   <HR>
2.1       frystyk   129: <ADDRESS>
2.9     ! frystyk   130:   @(#) $Id: WWWStream.html,v 2.8 1999/02/01 18:41:11 frystyk Exp $
2.1       frystyk   131: </ADDRESS>
2.3       frystyk   132: </BODY></HTML>

Webmaster