home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1997 January / macformat46.iso / Shareware Plus / Developers / Library / Grant's CGI Framework / Grant's CGI Framework / grantscgi / Util / TCPUtil.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-09-20  |  1.4 KB  |  57 lines

  1. #pragma once
  2. /*****
  3.  *
  4.  *    TCPUtil.h
  5.  *
  6.  *    This is a support file for "Grant's CGI Framework".
  7.  *    Please see the license agreement that accompanies the distribution package
  8.  *    for licensing details.
  9.  *
  10.  *    Copyright ©1996 by Grant Neufeld
  11.  *    grant@acm.com
  12.  *    http://arpp.carleton.ca/cgi/framework/
  13.  *
  14.  *****/
  15.  
  16. #include "MyConfiguration.h"
  17. #if kCompileWithTCPCode
  18.  
  19. #if kCompilingForWSAPI
  20. #include <WSAPI.h>
  21. #endif
  22.  
  23. #include "CGI.h"
  24.  
  25.  
  26. /***  CONSTANTS  ***/
  27.  
  28. /** TCP/IP conection status codes **/
  29.  
  30. typedef enum {
  31.     #ifndef WSAPI_ConnectionStatus
  32.     TCPStatus_Closed    = 0,    /* not connected */
  33.     TCPStatus_Open        = 1,    /* connected */
  34.     TCPStatus_Data        = 2,    /* data is available to read */
  35.     TCPStatus_Unknown    = 3        /* error state */
  36.     #else
  37.     TCPStatus_Closed    = WSAPI_IP_Closed,
  38.     TCPStatus_Open        = WSAPI_IP_Open,
  39.     TCPStatus_Data        = WSAPI_IP_Data,
  40.     TCPStatus_Unknown    = WSAPI_IP_Unknown
  41.     #endif
  42. } TCPStreamStatus;
  43.  
  44.  
  45. /***  FUNCTION PROTOTYPES  ***/
  46.  
  47. p_export    SInt32    TCPOpenClientStream        ( CGIHdl, UInt32, UInt16 );
  48. p_export    SInt32    TCPCloseClientStream    ( CGIHdl, UInt32, UInt16 );
  49. p_export    SInt32    TCPReadFromClientStream    ( CGIHdl, void *, UInt32 * );
  50. p_export    SInt32    TCPWriteToClientStream    ( CGIHdl, void *, UInt32 );
  51. p_export    SInt32    TCPClientStreamStatus    ( CGIHdl, UInt32, TCPStreamStatus *, UInt32 * );
  52. p_export    SInt32    TCPNameToIPAddress        ( CGIHdl, char *, UInt32 * );
  53.  
  54.  
  55. #endif /* kCompileWithTCPCode */
  56. /***** EOF *****/
  57.