home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / sdk / netds / sna / cpic / cpicsr.h < prev    next >
Text File  |  1997-04-09  |  3KB  |  97 lines

  1. /* cpicsr.h */
  2. /* (C) COPYRIGHT DATA CONNECTION LIMITED 1993 */
  3.  
  4. /*****************************************************************************/
  5. /* Change History                                                            */
  6. /*                                                                           */
  7. /*       30/06/93 NGR Created.                                               */
  8. /*****************************************************************************/
  9.  
  10. /* Global variables */
  11.  
  12. BOOL TPDead;
  13. BOOL FirstConv;
  14. CM_INT32 return_code;
  15. CM_INT32 request_to_send_received;
  16. int last_verb;
  17. char * DataPtr;
  18. unsigned short ConvCount;
  19. unsigned char conversation_ID[8];
  20. HWND hWndMain;
  21. unsigned short ASYNC_COMPLETE;
  22. char title[30]={'\0'};
  23. typedef DWORD RESULT;
  24. RESULT ConvStarted;
  25. RESULT * ResultPtr;
  26. RESULT * ResultBuf;
  27.  
  28. #ifdef CPICSEND
  29. char datach;
  30. unsigned short SendCount;
  31. unsigned short ConfirmCount;
  32. #else
  33. CM_INT32 status_received;
  34. CM_INT32 data_received;
  35. CM_INT32 received_length;
  36. BOOL Deallocated;
  37. #endif
  38.  
  39. /* Config parameters */
  40.  
  41. CM_INT32 SendSize;
  42. unsigned short NumConversations;
  43. BOOL wait_mode;
  44. BOOL blocking;
  45. char FileName[60];
  46. #ifdef CPICSEND
  47. char SymDestName[9];
  48. unsigned short NumSends;
  49. unsigned short ConfirmEvery;
  50. #else
  51. char LocalTPName[64];
  52. #endif
  53.  
  54. /* Function prototypes */
  55.  
  56. int PASCAL WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
  57.                    LPSTR lpCmdLine, int nCmdShow);
  58. BOOL InitialiseWinMain(HINSTANCE hInstance);
  59. LONG FAR PASCAL TPWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
  60. void InitialiseMain(void);
  61. void IssueNextVerb(void);
  62. void ProcessReturns(void);
  63. void ReadConfig(void);
  64. void NewConversation(void);
  65. int ReadString(char * lpValueName, char * lpData, int maxlen);
  66. void PadString(char * string, int length);
  67. void OutputResults(void);
  68. void Build_TP_ENDED(void);
  69. void GenerateData(void);
  70. void Do_cminit(void);
  71. void Do_cmallc(void);
  72. void Do_cmsend(void);
  73. void Do_cmrcv(void);
  74. void Do_cmcfm(void);
  75. void Do_cmcfmd(void);
  76. void Do_cmdeal(void);
  77. void Do_cmaccp(void);
  78.  
  79.  
  80. /* Macros */
  81. #define C_INIT 1
  82. #define C_ALLC 2
  83. #define C_SEND 3
  84. #define C_CFM  4
  85. #define C_RCV  5
  86. #define C_ACCP 6
  87. #define C_CFMD 7
  88. #define C_DEAL 8
  89.  
  90. #ifdef CPICSEND
  91. #define OUTPUTNUMBER sprintf(title,"CPI-C Send TP %d",ConvCount); \
  92.                      SetWindowText(hWndMain,title);
  93. #else
  94. #define OUTPUTNUMBER sprintf(title,"CPI-C Receive TP %d",ConvCount); \
  95.                      SetWindowText(hWndMain,title);
  96. #endif
  97.