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

  1. /***************************************************************************
  2.   Windows Sockets Client Application Support 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.   Contains all global variables.
  22.  
  23. *****************************************************************************/
  24.  
  25. #define IS_GLOBAL_C   /* prevent externs from being read in ws_glob.h */
  26. #include "ws_glob.h"
  27. #include "ws_ftp.h"     
  28. #include <time.h>
  29.  
  30. #ifndef MAXPACKET
  31. #define MAXPACKET 4096
  32. #endif
  33.  
  34. BOOL bAutoStart=TRUE;                  // automatically prompt for connect
  35. BOOL bAborted=FALSE;                   // set by timeout routine
  36.  
  37. u_int uiTimeOut=120;  // 120 second timeout
  38. int   uiRetries=0;
  39. int uiFtpPort = 21;
  40.  
  41. char szMsgBuf[MAXPACKET];              // main i/o buffer
  42.  
  43. // lgk need a new szmsgbuf since one is already being used during downloads and conflicts
  44. // with local commands
  45. char szMsgBuf2[MAXPACKET];              // main i/o buffer
  46.  
  47. u_char szSendPkt[MAXPACKET];           // output transfer buffer
  48. char szString[512];                    // temp string area
  49. char szViewer[128]="view";
  50. char szMailAddress[128];
  51. char szDlgPrompt[220]="input:";         // used by input dialog as prompt
  52. char szDlgEdit[220]="";                 // used by input dialog for output
  53. char szUserID[80]="";                  // used by host dialog for userid
  54. char szPassWord[80]="\0";              // used by host dialog for password
  55. char szGateUserID[80]="";              // used by host dialog for gate userid
  56. char szGatePassWord[80]="\0";          // used by host dialog for gate password
  57. char szGateHost[80]="";                // gateway host name/addr to connect to
  58. char szRemoteHost[80]="";              // remote host name/addr to connect to
  59. char szAppName[20];                    // this programs name "ws_ftp"
  60. char szTmpFile[144];    // used for directory listings
  61. char szTmp1File[144];  // used for remote file displays
  62. char szIniFile[]="WS_FTP.INI";        // INI file name
  63.  
  64. char szFormName[10]="non-print";       // ** not used in this version
  65. char szModeName[10]="stream";          // ** not used in this version
  66. char szStructName[10]="file";          // ** not used in this version
  67. char szTypeName[10]="ASCII";           // ** not used in this version
  68.  
  69. char fType=TYPE_I;                     // file transfer type
  70. char cType=TYPE_A;                     // current transfer type
  71. char cForm=FORM_N;                     // format (not used???)
  72. char cMode=MODE_S;                     // mode (not used???)
  73.  
  74. // lgk new variables for totalbytes transfered
  75. long totalbytestransfered;
  76. time_t totaltimefortransfer;
  77. int totalfilestransfered;
  78. int totaldirscreated;
  79. BOOLEAN mirrorinprogress;
  80.  
  81.  
  82. GLOBALHANDLE hGMem[100];               // memory for debug window display
  83.  
  84. HCURSOR hStdCursor,hWaitCursor;        // cursors
  85.  
  86. HWND hInst;                            // handle of instance
  87. HWND hWndMain;                         // handle of main window
  88. // child window handles
  89. // lgk new handles for dir sel boxes
  90. HWND hLdirBox, hRdirBox, hBtnAbort;
  91. HWND hLbxLDir,hLbxLFiles,hLbxRDir,hLbxRFiles;
  92. HWND hBtnLCWD,hBtnLMKD,hBtnLRMD,hBtnLDisplay,hBtnLREN,hBtnLDEL;
  93. HWND hBtnRCWD,hBtnRMKD,hBtnRRMD,hBtnRDisplay,hBtnRREN,hBtnRDEL;
  94. HWND hBtnLtoR,hBtnRtoL;
  95. HWND hBtnConnect,hBtnClose,hBtnLong,hBtnOption,hBtnAbout,hBtnExit;
  96. HWND hTxtLDir,hTxtRHost,hTxtRDir,hTxtStatus,hTxtLBytes,hTxtRBytes;
  97. HWND hRBascii,hRBbinary,hRBl8,   hTxtStatus1;
  98. HWND hScroll;
  99.  
  100. int bConnected=0;          // connected flag
  101. int bCmdInProgress=0;      // command in progress flag
  102. int bSendPort=1;           // use PORT commands (must be 1!!!)
  103. int use_gateway=1;       // go through firewall
  104.  
  105. int  nWndx;                // the x axis multiplier
  106. int  nWndy;                // the y axis multiplier
  107.  
  108. // options
  109. int bBell=2;               // completion bell (not used in this version)
  110. int bCRstrip=2;            // crlf conversion (not used in this version)
  111. int bDoGlob=2;             // globbing (not used in this version)
  112. int bHash=2;               // show hash (not used in this version)
  113. int bInteractive=0;        // prompting (not used in this version)
  114. int bMCase=2;              // case conversion (not used in this version)
  115. int bRecvUniq=0;           // unique name on receive (not used in this ver)
  116. int bStorUniq=2;           // unique name on transmit (not used in this ver)
  117. int bVerbose=0;            // maximum verbosity (turns extra debug msgs on)
  118.  
  119. int iCode;                 // return code from last command(..)
  120.  
  121. int ptrhGMem=0;
  122.  
  123. volatile SOCKET ctrl_socket = INVALID_SOCKET;   // control channel socket
  124. volatile SOCKET data_socket = INVALID_SOCKET;   // data channel socket
  125. volatile SOCKET listen_socket = INVALID_SOCKET; // data listen socket
  126.  
  127. struct sockaddr saDestAddr;     
  128. struct sockaddr_in saSockAddr;         // endpoint address
  129. struct sockaddr_in saSockAddr1;        // used when bSendPort==0
  130. struct sockaddr_in saCtrlAddr;
  131.  
  132. WORD sVPos;                            // scroll pos for debug window
  133.  
  134. WSADATA WSAData;                       // windows sockets dll information
  135.  
  136.  
  137.