File:  [Public] / libwww / Library / src / WWWStream.html
Revision 2.10: download - view: text, annotated - select for diffs
Sun Feb 14 04:00:10 1999 UTC (25 years, 3 months ago) by frystyk
Branches: MAIN
CVS tags: repeat-requests, candidate-5-4-1, before_webdav, Release-5-4-0, Release-5-3-1, Release-5-2-8, Release-5-2-6, HEAD, Before-New-Trace-Messages, Amaya_2_4, Amaya-6-3, Amaya-6-1, Amaya-5-2, Amaya-4-3-2, Amaya-4-3-1, Amaya-4-3, Amaya-4-1-2, Amaya-4-1-0, Amaya-4-0-0, Amaya-3-2-1, Amaya-3-2, Amaya
Incorporated the external parse stream into the wwwstream module

<HTML>
<HEAD>
  <!-- Changed by: Henrik Frystyk Nielsen, 16-Apr-1996 -->
  <TITLE>W3C Sample Code Library libwww Streams</TITLE>
</HEAD>
<BODY>
<H1>
  Declaration of W3C Sample Code Library Streams
</H1>
<PRE>
/*
**	(c) COPYRIGHT MIT 1995.
**	Please first read the full copyright statement in the file COPYRIGH.
*/
</PRE>
<P>
The stream part of the Library is a set of streams that can be used in many
contexts throughout the Library. It also contains conversions between streams
and other memory containers, for example <A HREF="HTChunk.html">Chunks</A>.
<PRE>
#ifndef WWWSTREAM_H
#define WWWSTREAM_H
</PRE>
<PRE>
#ifdef __cplusplus
extern "C" { 
#endif
</PRE>
<H3>
  System dependencies
</H3>
<P>
The <A HREF="wwwsys.html">wwwsys.h</A> file includes system-specific include
files and flags for I/O to network and disk. The only reason for this file
is that the Internet world is more complicated than Posix and ANSI.
<PRE>#include "wwwsys.h"
</PRE>
<H3>
  Content Length Counter
</H3>
<P>
This stream also buffers the result to find out the content length. If a
maximum buffer limit is reached Content-Length is calculated for logs but
it is not sent to the client -- rather the buffer is flushed right away.
<PRE>
#include "<A HREF="HTConLen.html">HTConLen.h</A>"			/* Content Length Counter */
</PRE>
<H3>
  File Writer Streams
</H3>
<P>
This module contains a set of basic file writer streams that are used to
dump data objects to disk at various places within the Library core. Most
notably, we use these streams in the <A HREF="HTFWrite.html">Format Manager</A>
in order to handle external presenters, for example post script viewers etc.
These streams can of course also be used in other contexts by the application.
<PRE>
#include "<A HREF="HTFWrite.html">HTFWrite.h</A>"
#include "<A HREF="HTFWrite.html">HTFSave.h</A>"
</PRE>
<H3>
  Content Guess Stream
</H3>
<P>
This interface provides functionality for guessing unknown media types from
magic words. The stream is a one that reads first a chunk of stuff, tries
to figure out the format, and calls <CODE>HTStreamStack()</CODE>. This is
a kind of lazy-evaluation of <CODE>HTStreamStack()</CODE>. This could be
extended arbitrarily to recognize all the possible file formats in the world,
if someone only had time to do it.
<PRE>
#include "<A HREF="HTGuess.html">HTGuess.h</A>"			/* Guess stream */
</PRE>
<H3>
  Tee Stream
</H3>
<P>
The Tee stream just writes everything you put into it into two oter streams.
One use (the only use?!) is for taking a cached copey on disk while loading
the main copy, without having to wait for the disk copy to be finished and
reread it.
<PRE>
#include "<A HREF="HTTee.html">HTTee.h</A>"
</PRE>
<H3>
  Merge Stream
</H3>
<P>
The Merge stream can be used to merge multiple streams into a single target
stream. The Merge stream does not prevent any of the streams from writing
and no ordering is imposed. The main feature is basically that the free and
abort methods can be called <B>n</B> times where <B>n</B> equals the number
of <I>feeds</I> that put data to the stream.
<PRE>
#include "<A HREF="HTMerge.html">HTMerge.h</A>"
</PRE>
<H3>
  Stream to Chunk Conversion
</H3>
<P>
If you do not like the stream model in libwww, then you can use this stream
to convert a <A HREF="HTStream.html">stream object </A>into a
<A HREF="HTChunk.html">Chunk object</A> which is a dynamic character string
buffer in memory.
<PRE>
#include "<A HREF="HTSChunk.html">HTSChunk.h</A>"
</PRE>
<H3>
  Stream to Memory Object Conversion
</H3>
<P>
This version of the stream object is a hook for clients that want an unparsed
stream from libwww. The HTXParse_put_* and HTXParse_write routines copy the
content of the incoming buffer into a buffer that is realloced whenever
necessary. This buffer is handed over to the client in
<CODE>HTXParse_free</CODE>.
<PRE>
#include "<A HREF="HTXParse.html">HTXParse.h</A>"			/* External parse stream */
#include "<A HREF="HTEPtoCl.html">HTEPtoCl.h</A>"			/* Client callbacks */
</PRE>
<H3>
  Network Telnet To Internal Character Text
</H3>
<P>
This is a filter stream suitable for taking text from a socket and passing
it into a stream which expects text in the local C representation.
<PRE>
#include "<A HREF="HTNetTxt.html">HTNetTxt.h</A>"
</PRE>
<PRE>
#ifdef __cplusplus
} /* end extern C definitions */
#endif

#endif
</PRE>
<P>
  <HR>
<ADDRESS>
  @(#) $Id: WWWStream.html,v 2.10 1999/02/14 04:00:10 frystyk Exp $
</ADDRESS>
</BODY></HTML>

Webmaster