Annotation of libwww/Library/src/HTFWrite.html, revision 2.11
2.1 frystyk 1: <HTML>
2: <HEAD>
2.9 frystyk 3: <TITLE>ANSI C FILE Stream</TITLE>
4: <!-- Changed by: Henrik Frystyk Nielsen, 14-Aug-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.2 frystyk 43: <H2><A NAME="BlackHole">Black Hole Stream</A></H2>
44:
45: This stream simply absorbs data without doing anything what so ever.
46:
47: <PRE>
48: extern HTStream * HTBlackHole NOPARAMS;
49: </PRE>
50:
2.5 frystyk 51: <A NAME="converters"><H2>Converters</H2></A>
2.1 frystyk 52:
2.5 frystyk 53: This is the set of functions that can be registered as
2.8 frystyk 54: converters.
2.1 frystyk 55:
2.5 frystyk 56: <PRE>
57: #ifndef pyramid
58: extern HTConverter HTSaveAndExecute, HTSaveLocally, HTSaveAndCallBack,
2.8 frystyk 59: HTThroughLine;
2.5 frystyk 60: #endif
2.1 frystyk 61: </PRE>
62:
2.5 frystyk 63: <A NAME="tmp"><H2>Location of Temporary Files</H2></A>
2.1 frystyk 64:
2.2 frystyk 65: <CODE>HTSaveAndCallBack</CODE> will save to a cache file and call the
66: request->callback function with the filename as parameter. The
67: destination for temporary files can be managed by the following
68: functions:
69:
70: <PRE>
71: extern BOOL HTTmp_setRoot PARAMS((CONST char * tmp_root));
72: extern CONST char * HTTmp_getRoot NOPARAMS;
73: extern void HTTmp_freeRoot NOPARAMS;
74: </PRE>
75:
76: The <CODE>HTTmp_freeRoot</CODE> is called by the <A
2.11 ! frystyk 77: HREF="HTReq.html#Library">HTLibTerminate</A> function. The default
2.5 frystyk 78: value is defined in <A
2.11 ! frystyk 79: HREF="HTReq.html#Addresses">HTReq.html</A>
2.1 frystyk 80:
2.5 frystyk 81: <H2><A NAME="write">Set up a Stream to a File</A></H2>
2.1 frystyk 82:
2.5 frystyk 83: This function puts up a new stream given an open file descripter. If the file
84: is not to be closed afterwards, then set leave_open = NO.
2.1 frystyk 85:
2.8 frystyk 86: <PRE>
87: extern HTStream * HTFWriter_new PARAMS((FILE * fp,
2.5 frystyk 88: BOOL leave_open));
2.1 frystyk 89:
90: #endif
91: </PRE>
92:
2.8 frystyk 93: End of declaration module
2.1 frystyk 94: </BODY>
95: </HTML>
Webmaster