home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DP Tool Club 15
/
CD_ASCQ_15_070894.iso
/
vrac
/
wsftp2.zip
/
WS_GLOB.C
< prev
next >
Wrap
C/C++ Source or Header
|
1994-06-03
|
6KB
|
126 lines
/***************************************************************************
Windows Sockets Client Application Support Module
Written by:
John A. Junod Internet: <junodj@gordon-emh2.army.mil>
267 Hillwood Street <zj8549@trotter.usma.edu>
Martinez, GA 30907 Compuserve: 72321,366
This program executable and all source code is released into the public
domain. It would be nice (but is not required) to give me a little
credit for any use of this code.
THE INFORMATION AND CODE PROVIDED IS PROVIDED AS IS WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. IN NO EVENT SHALL JOHN A. JUNOD BE LIABLE FOR ANY DAMAGES
WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS
OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF JOHN A. JUNOD HAS BEEN
ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
Contains all global variables.
*****************************************************************************/
#define IS_GLOBAL_C /* prevent externs from being read in ws_glob.h */
#include "ws_glob.h"
#include "ws_ftp.h"
#ifndef MAXPACKET
#define MAXPACKET 4096
#endif
BOOL bAutoStart=TRUE; // automatically prompt for connect
BOOL bAborted=FALSE; // set by timeout routine
u_int uiTimeOut=120; // 120 second timeout
char szMsgBuf[MAXPACKET]; // main i/o buffer
// lgk need a new szmsgbuf since one is already being used during downloads and conflicts
// with local commands
char szMsgBuf2[MAXPACKET]; // main i/o buffer
u_char szSendPkt[MAXPACKET]; // output transfer buffer
char szString[512]; // temp string area
char szViewer[128]="view";
char szMailAddress[128];
char szDlgPrompt[220]="input:"; // used by input dialog as prompt
char szDlgEdit[220]=""; // used by input dialog for output
char szUserID[80]=""; // used by host dialog for userid
char szPassWord[80]="\0"; // used by host dialog for password
char szGateUserID[80]=""; // used by host dialog for gate userid
char szGatePassWord[80]="\0"; // used by host dialog for gate password
char szGateHost[80]=""; // gateway host name/addr to connect to
char szRemoteHost[80]=""; // remote host name/addr to connect to
char szAppName[20]; // this programs name "ws_ftp"
char szTmpFile[144]; // used for directory listings
char szTmp1File[144]; // used for remote file displays
char szIniFile[]="WS_FTP.INI"; // INI file name
char szFormName[10]="non-print"; // ** not used in this version
char szModeName[10]="stream"; // ** not used in this version
char szStructName[10]="file"; // ** not used in this version
char szTypeName[10]="ASCII"; // ** not used in this version
char fType=TYPE_I; // file transfer type
char cType=TYPE_A; // current transfer type
char cForm=FORM_N; // format (not used???)
char cMode=MODE_S; // mode (not used???)
GLOBALHANDLE hGMem[100]; // memory for debug window display
HCURSOR hStdCursor,hWaitCursor; // cursors
HWND hInst; // handle of instance
HWND hWndMain; // handle of main window
// child window handles
// lgk new handles for dir sel boxes
HWND hLdirBox, hRdirBox, hBtnAbort;
HWND hLbxLDir,hLbxLFiles,hLbxRDir,hLbxRFiles;
HWND hBtnLCWD,hBtnLMKD,hBtnLRMD,hBtnLDisplay,hBtnLREN,hBtnLDEL;
HWND hBtnRCWD,hBtnRMKD,hBtnRRMD,hBtnRDisplay,hBtnRREN,hBtnRDEL;
HWND hBtnLtoR,hBtnRtoL;
HWND hBtnConnect,hBtnClose,hBtnLong,hBtnOption,hBtnAbout,hBtnExit;
HWND hTxtLDir,hTxtRHost,hTxtRDir,hTxtStatus,hTxtLBytes,hTxtRBytes;
HWND hRBascii,hRBbinary,hRBl8, hTxtStatus1;
HWND hScroll;
int bConnected=0; // connected flag
int bCmdInProgress=0; // command in progress flag
int bSendPort=1; // use PORT commands (must be 1!!!)
int use_gateway=1; // go through firewall
int nWndx; // the x axis multiplier
int nWndy; // the y axis multiplier
// options
int bBell=2; // completion bell (not used in this version)
int bCRstrip=2; // crlf conversion (not used in this version)
int bDoGlob=2; // globbing (not used in this version)
int bHash=2; // show hash (not used in this version)
int bInteractive=0; // prompting (not used in this version)
int bMCase=2; // case conversion (not used in this version)
int bRecvUniq=0; // unique name on receive (not used in this ver)
int bStorUniq=2; // unique name on transmit (not used in this ver)
int bVerbose=0; // maximum verbosity (turns extra debug msgs on)
int iCode; // return code from last command(..)
int ptrhGMem=0;
volatile SOCKET ctrl_socket = INVALID_SOCKET; // control channel socket
volatile SOCKET data_socket = INVALID_SOCKET; // data channel socket
volatile SOCKET listen_socket = INVALID_SOCKET; // data listen socket
struct sockaddr saDestAddr;
struct sockaddr_in saSockAddr; // endpoint address
struct sockaddr_in saSockAddr1; // used when bSendPort==0
struct sockaddr_in saCtrlAddr;
WORD sVPos; // scroll pos for debug window
WSADATA WSAData; // windows sockets dll information