home *** CD-ROM | disk | FTP | other *** search
/ PC Format (South-Africa) 2001 June / PCFJune.iso / mweb / MWEB Utils / ws295sdk.exe / Ws2sdkzp.exe / SAMPLES / WS2CHAT / CHATSOCK.H < prev    next >
Encoding:
C/C++ Source or Header  |  1997-06-06  |  1.8 KB  |  114 lines

  1.  /*++
  2.  
  3. Copyright (c) 1995 Intel Corp
  4.  
  5. Module Name:
  6.  
  7.     chatsock.h
  8.  
  9. Abstract:
  10.  
  11.     Header file containing constants, data structure definitions, and
  12.     function prototypes for socket.c.
  13.  
  14. --*/
  15.  
  16. #ifndef CHTSOCK_H
  17. #define CHTSOCK_H
  18.  
  19. #include "nowarn.h"  /* turn off benign warnings */
  20. #ifndef _WINSOCKAPI_
  21. #define _WINSOCKAPI_   /* Prevent inclusion of winsock.h in windows.h */
  22. #endif
  23. #include <windows.h>
  24. #include "nowarn.h"  /* some warnings may have been turned back on */
  25.  
  26.  
  27. //
  28. // Manifest Constants
  29. //
  30.  
  31. #define WSA_WAIT_EVENT_1  WSA_WAIT_EVENT_0+1
  32. #define WSA_WAIT_EVENT_2  WSA_WAIT_EVENT_0+2
  33.  
  34.  
  35.  
  36.  
  37. //
  38. // Typedefs
  39. //
  40.  
  41. typedef struct _CALLBACK_INFO {
  42.     BOOL  DoneYet;   // has the overlapped I/O completed yet?
  43.     LPSTR Buffer;    // the buffer we gave to WSASend
  44. } CALLBACK_INFO, *PCALLBACK_INFO;
  45.  
  46.  
  47.  
  48.  
  49. //
  50. // Function Prototypes -- Exported Functions
  51. //
  52.  
  53. BOOL
  54. InitWS2(void);
  55.  
  56. BOOL
  57. FindProtocols(void);
  58.  
  59. BOOL
  60. ListenAll(void);
  61.  
  62. void
  63. HandleAcceptMessage(
  64.     IN HWND   ConnectionWindow,
  65.     IN SOCKET Socket,
  66.     IN LPARAM LParam);
  67.  
  68. void
  69. HandleConnectMessage(
  70.     IN HWND   ConnectionWindow,
  71.     IN LPARAM LongParam);
  72.  
  73. BOOL
  74. IsSendable(
  75.     char Character);
  76.  
  77. PCONNDATA
  78. GetConnData(
  79.     IN HWND ConnectionWindow);
  80.  
  81. BOOL
  82. MakeConnection(
  83.     IN HWND WindowHandle);
  84.  
  85. BOOL
  86. FillInFamilies(
  87.     IN HWND  DialogWindow,
  88.     IN DWORD FamilyLB);
  89.  
  90.  
  91. LPWSAPROTOCOL_INFO
  92. GetProtoFromIndex(
  93.     IN int LBIndex);
  94.  
  95. void
  96. CleanUpSockets(void);
  97.  
  98. BOOL
  99. GetAddressString(
  100.     OUT char            *String,
  101.     IN  LPVOID          SockAddr,
  102.     IN  int             SockAddrLen,
  103.     IN  LPWSAPROTOCOL_INFO ProtocolInfo);
  104.  
  105. BOOL
  106. UseProtocol(
  107.     IN LPWSAPROTOCOL_INFO Proto);
  108.  
  109. void
  110. CleanupConnection(
  111.     IN PCONNDATA ConnData);
  112.  
  113. #endif // CHTSOCK_H
  114.