HTWriter.h
上传用户:zlh9724
上传日期:2007-01-04
资源大小:1991k
文件大小:2k
源码类别:

浏览器

开发平台:

Unix_Linux

  1. /*                                                                       Socket Writer Stream
  2.                           UNIX FILE DESCRIPTOR OR SOCKET WRITER
  3.                                              
  4.  */
  5. /*
  6. **      (c) COPYRIGHT MIT 1995.
  7. **      Please first read the full copyright statement in the file COPYRIGH.
  8. */
  9. /*
  10.    This version of the stream object just writes to a socket. The socket is assumed open
  11.    and closed afterward.There are two versions (identical on ASCII machines) one of which
  12.    converts to ASCII on output. We have to have the Net Manager involved as we want to
  13.    have control of how many sockets we are using simultanously. This means that
  14.    applications should use the ANSI C FILE writer stream for writing to an output. Proxy
  15.    servers will have to go through the Net Manager anyway, so this will not be a problem
  16.    for them.
  17.    
  18.    This module is implemented by HTWriter.c, and it is a part of the  W3C Reference
  19.    Library.
  20.    
  21.  */
  22. #ifndef HTWRITE_H
  23. #define HTWRITE_H
  24. #include "HTStream.h"
  25. #include "HTNet.h"
  26. /*
  27. Unbuffered output
  28.    This is a non-buffered output stream which remembers state using the write_pointer. As
  29.    normally we have a big buffer somewhere else in the stream chain an extra output buffer
  30.    will often not be needed. There is also a small buffer stream that can be used if this
  31.    is not the case.
  32.    
  33.  */
  34. extern HTStream * HTWriter_new (HTNet *net, BOOL leave_open);
  35. /*
  36. Buffered Output
  37.    This is a buffer output stream writing to a socket. However, it uses a "one-time"
  38.    buffer in that you can specify the total amount of bytes to be buffered. From that
  39.    point it goes into transparent mode. If buf_size > 0 then we set up buffered output
  40.    used for at most buf_size bytes. Otherwise we'll use nonbuffered output.
  41.    
  42.  */
  43. extern HTStream * HTBufWriter_new (HTNet *net, BOOL leave_open, int buf_size);
  44. /*
  45. ASCII Stream Converter
  46.    If you are on a non-ASCII machine then this stream converts to ASCII before data is
  47.    written to the socket.
  48.    
  49.  */
  50. #ifdef NOT_ASCII
  51. extern HTStream * HTASCIIWriter (HTNet *net, BOOL leave_open);
  52. #endif
  53. #endif
  54. /*
  55.    End of socket stream declaration  */