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