home *** CD-ROM | disk | FTP | other *** search
/ Borland Programmer's Resource / Borland_Programmers_Resource_CD_1995.iso / winsock / wsftp32 / ws_glob.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-05-19  |  6.5 KB  |  176 lines

  1. /***************************************************************************
  2.   Windows Sockets FTP Client Application Suport Module
  3.  
  4.   Written by:
  5.       John A. Junod             Internet: <junodj@gordon-emh2.army.mil>
  6.       267 Hillwood Street                 <zj8549@trotter.usma.edu>
  7.       Martinez, GA 30907      Compuserve: 72321,366 
  8.  
  9.   This program executable and all source code is released into the public
  10.   domain.  It would be nice (but is not required) to give me a little 
  11.   credit for any use of this code.  
  12.  
  13.   THE INFORMATION AND CODE PROVIDED IS PROVIDED AS IS WITHOUT WARRANTY 
  14.   OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO 
  15.   THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
  16.   PURPOSE. IN NO EVENT SHALL JOHN A. JUNOD BE LIABLE FOR ANY DAMAGES 
  17.   WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS 
  18.   OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF JOHN A. JUNOD HAS BEEN 
  19.   ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
  20.  
  21. *****************************************************************************/
  22. /*
  23.   MODULE: WS_GLOB.H  (global header file)
  24. */
  25.  
  26. #include <stdio.h>
  27. #include <string.h>
  28.  
  29. #ifdef _MSC_
  30. #include <direct.h>
  31. #else
  32. #include <dir.h>
  33. #endif
  34.  
  35. #include <winsock.h>
  36. #include <time.h>
  37.  
  38. #ifndef WS_GLOBHEADER
  39.  
  40. #define WS_GLOBHEADER
  41.  
  42. #ifndef INADDR_NONE
  43. #define INADDR_NONE 0xffffffff
  44. #endif
  45.  
  46. #ifndef MAXHOSTNAMELEN
  47. #define MAXHOSTNAMELEN 64
  48. #endif
  49.  
  50. #ifndef MAXPACKET
  51. #define MAXPACKET 4096
  52. #endif
  53.  
  54. // some miscellaneous definitions that we use
  55.  
  56. #define FTP_PRELIM   1
  57. #define FTP_COMPLETE 2
  58. #define FTP_CONTINUE 3
  59. #define FTP_RETRY    4
  60. #define FTP_ERROR    5
  61.  
  62. #ifndef IS_GLOBAL_C
  63.  
  64. extern BOOL bAutoStart;
  65. extern BOOL bAborted;
  66.  
  67. extern u_int uiTimeOut;              // 30 second timeout??
  68.  
  69. extern int uiRetries;
  70. extern int uiFtpPort;
  71. extern char szMsgBuf[MAXPACKET];     // main i/o buffer
  72. extern char szMsgBuf2[MAXPACKET];     // main i/o buffer
  73. extern u_char szSendPkt[MAXPACKET];  // output transfer buffer
  74. extern char szString[512];           // temp string area
  75. extern char szMailAddress[];
  76. extern char szViewer[];
  77. extern char szDlgPrompt[80];         // used by input dialog as prompt
  78. extern char szDlgEdit[80];           // used by input dialog for output
  79. extern char szUserID[80];            // used by host dialog for userid
  80. extern char szPassWord[80];          // used by host dialog for password
  81. extern char szRemoteHost[80];        // remote host name/addr to connect to
  82. extern char szGateUserID[80];        // used by host dialog for gateway userid
  83. extern char szGatePassWord[80];      // used by host dialog for gateway password
  84. extern char szGateHost[80];        // gateway host name/addr to connect to
  85. extern char szAppName[20];           // this programs name "ws_ftp"
  86. extern char szTmpFile[];             // used for directory listings
  87. extern char szTmp1File[];            // used for remote file displays
  88. extern char szIniFile[];             // INI file name
  89.  
  90. extern char szFormName[10];          // ** not used in this version
  91. extern char szModeName[10];          // ** not used in this version
  92. extern char szStructName[10];        // ** not used in this version
  93. extern char szTypeName[10];          // ** not used in this version
  94.  
  95. extern BOOLEAN globalsucceed;
  96.  
  97. extern char fType;                   // file transfer type
  98. extern char cType;                   // current transfer type
  99. extern char cForm;                   // format (not used???)
  100. extern char cMode;                   // mode (not used???)
  101.  
  102. extern GLOBALHANDLE hGMem[100];      // memory for debug window display
  103.  
  104. extern HCURSOR hStdCursor;           // cursors
  105. extern HCURSOR hWaitCursor;          // cursors
  106.  
  107. extern HWND hInst;                   // handle of instance
  108. extern HWND hWndMain;                // handle of main window
  109. // child window handles
  110. // lgk new boxes for dir selection
  111. extern HWND hLdirBox, hRdirBox , hBtnAbort;
  112. extern HWND hLbxLDir,hLbxLFiles,hLbxRDir,hLbxRFiles;
  113. extern HWND hBtnLCWD,hBtnLMKD,hBtnLRMD,hBtnLDisplay,hBtnLREN,hBtnLDEL;
  114. extern HWND hBtnRCWD,hBtnRMKD,hBtnRRMD,hBtnRDisplay,hBtnRREN,hBtnRDEL;
  115. extern HWND hBtnLtoR,hBtnRtoL;
  116. extern HWND hBtnConnect,hBtnClose,hBtnLong,hBtnOption,hBtnAbout,hBtnExit;
  117. extern HWND hTxtLDir,hTxtRHost,hTxtRDir,hTxtStatus,hTxtLBytes,hTxtRBytes;
  118. extern HWND hRBascii,hRBbinary,hRBl8,   hTxtStatus1;
  119. extern HWND hScroll;
  120. #define SCRLWND 7531
  121.  
  122.  
  123. // lgk new variables for totalbytes transfered
  124. extern long totalbytestransfered;
  125. extern time_t totaltimefortransfer;
  126. extern int totalfilestransfered;
  127. extern int totaldirscreated;
  128. extern BOOLEAN mirrorinprogress;
  129.  
  130. extern int bConnected;               // connected flag
  131. extern int bCmdInProgress;           // command in progress flag
  132. extern int bSendPort;                // use PORT commands (must be 1!!!)
  133. extern int use_gateway ;
  134.  
  135. extern int nWndx;                    // the x axis multiplier
  136. extern int nWndy;                    // the y axis multiplier
  137.  
  138. // options
  139. extern int bBell;          // completion bell (not used in this version)
  140. extern int bCRstrip;       // crlf conversion (not used in this version)
  141. extern int bDoGlob;        // globbing (not used in this version)
  142. extern int bHash;          // show hash (not used in this version)
  143. extern int bInteractive;   // prompting (not used in this version)
  144. extern int bMCase;         // case conversion (not used in this version)
  145. extern int bRecvUniq;      // unique name on receive (not used in this ver)
  146. extern int bStorUniq;      // unique name on transmit (not used in this ver)
  147. extern int bVerbose;       // maximum verbosity (turns extra debug msgs on)
  148.  
  149. extern int iCode;          // return code from last command(..)
  150.  
  151. extern int ptrhGMem;
  152.  
  153. extern volatile SOCKET ctrl_socket;           // control channel socket
  154. extern volatile SOCKET data_socket;           // data channel socket
  155. extern volatile SOCKET listen_socket;         // data listen socket
  156.  
  157. extern struct sockaddr saDestAddr;     
  158. extern struct sockaddr_in saSockAddr;         // endpoint address
  159. extern struct sockaddr_in saSockAddr1;        // used when bSendPort==0
  160. extern struct sockaddr_in saCtrlAddr;
  161.  
  162. extern WORD sVPos;                   // scroll pos for debug window
  163.  
  164. extern WSADATA WSAData;              // windows sockets dll information
  165.  
  166. // lgk new globals for mutli threading
  167.  
  168. extern HANDLE threadhandle;
  169. extern DWORD threadid;
  170. extern BOOLEAN  DEBUGGING_ON;
  171.  
  172. #endif /* if IS_GLOBAL_C */
  173.  
  174. #endif /* if WS_GLOBHEADER */
  175.  
  176.