Annotation of libwww/Library/src/HTFWrite.html, revision 2.14

2.1       frystyk     1: <HTML>
                      2: <HEAD>
2.9       frystyk     3: <TITLE>ANSI C FILE Stream</TITLE>
2.14    ! frystyk     4: <!-- Changed by: Henrik Frystyk Nielsen,  6-Dec-1995 -->
2.1       frystyk     5: <NEXTID N="z4">
                      6: </HEAD>
                      7: <BODY>
                      8: 
2.8       frystyk     9: <H1>Wrting to a File using ANSI C</H1>
2.1       frystyk    10: 
                     11: <PRE>
                     12: /*
2.4       frystyk    13: **     (c) COPYRIGHT MIT 1995.
2.1       frystyk    14: **     Please first read the full copyright statement in the file COPYRIGH.
                     15: */
                     16: </PRE>
                     17: 
                     18: It is useful to have both FWriter and Writer for environments in which
2.2       frystyk    19: <CODE>fdopen()</CODE> doesn't exist for example. The module contains
                     20: the following parts:
                     21: 
                     22: <UL>
                     23: <LI><A HREF="#BlackHole">A Balckhole for absorbing data</A>
                     24: <LI><A HREF="#write">A File Writer Stream</A>
                     25: <LI><A HREF="#converters">Converters using the file writer stream</A>
                     26: </UL>
                     27: 
2.1       frystyk    28: 
                     29: This module is implemented by <A HREF="HTFWrite.c">HTFWrite.c</A>,
                     30: and it is a part of the <A
2.10      frystyk    31: HREF="http://www.w3.org/pub/WWW/Library/">
2.7       frystyk    32: W3C Reference Library</A>.
2.1       frystyk    33: 
                     34: 
                     35: <PRE>
                     36: #ifndef HTFWRITE_H
                     37: #define HTFWRITE_H
                     38: 
                     39: #include "HTStream.h"
                     40: #include "HTFormat.h"
                     41: </PRE>
                     42: 
2.14    ! frystyk    43: <H2>Utility Streams</H2>
        !            44: 
        !            45: We have a few dummy streams that can be used when needed.
        !            46: 
        !            47: <H3><A NAME="BlackHole">Black Hole Stream</A></H3>
2.2       frystyk    48: 
                     49: This stream simply absorbs data without doing anything what so ever.
                     50: 
                     51: <PRE>
2.13      frystyk    52: extern HTStream * HTBlackHole (void);
2.14    ! frystyk    53: extern HTConverter HTBlackHoleConverter;
        !            54: </PRE>
        !            55: 
        !            56: <H3>Through Line</H3>
        !            57: 
        !            58: This stream just pumps data right through.
        !            59: 
        !            60: <PRE>
        !            61: extern HTConverter HTThroughLine;
2.2       frystyk    62: </PRE>
                     63: 
2.14    ! frystyk    64: <A NAME="converters"><H2>Local File Dump Converters</H2></A>
2.1       frystyk    65: 
2.5       frystyk    66: This is the set of functions that can be registered as
2.8       frystyk    67: converters.
2.1       frystyk    68: 
2.5       frystyk    69: <PRE>
2.14    ! frystyk    70: extern HTConverter HTSaveAndExecute, HTSaveLocally, HTSaveAndCallback;
2.1       frystyk    71: </PRE>
                     72: 
2.5       frystyk    73: <A NAME="tmp"><H2>Location of Temporary Files</H2></A>
2.1       frystyk    74: 
2.13      frystyk    75: <CODE>HTSaveAndCallback</CODE> will save to a cache file and call the
2.2       frystyk    76: request-&gt;callback function with the filename as parameter. The
                     77: destination for temporary files can be managed by the following
                     78: functions:
                     79: 
                     80: <PRE>
2.13      frystyk    81: extern BOOL  HTTmp_setRoot             (CONST char * tmp_root);
                     82: extern CONST char * HTTmp_getRoot      (void);
                     83: extern void  HTTmp_freeRoot            (void);
2.2       frystyk    84: </PRE>
                     85: 
                     86: The <CODE>HTTmp_freeRoot</CODE> is called by the <A
2.11      frystyk    87: HREF="HTReq.html#Library">HTLibTerminate</A> function. The default
2.13      frystyk    88: value is defined in <A HREF="HTAccess.html#Addresses">HTReq.html</A>
2.1       frystyk    89: 
2.5       frystyk    90: <H2><A NAME="write">Set up a Stream to a File</A></H2>
2.1       frystyk    91: 
2.5       frystyk    92: This function puts up a new stream given an open file descripter. If the file
                     93: is not to be closed afterwards, then set leave_open = NO.
2.1       frystyk    94: 
2.8       frystyk    95: <PRE>
2.13      frystyk    96: extern HTStream * HTFWriter_new        (FILE * fp, BOOL leave_open);
2.1       frystyk    97: 
                     98: #endif
                     99: </PRE>
                    100: 
2.8       frystyk   101: End of declaration module
2.1       frystyk   102: </BODY>
                    103: </HTML>

Webmaster