home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Best Internet Programs
/
BESTINTERNET.bin
/
internet
/
winftp
/
winftp.h
< prev
next >
Wrap
C/C++ Source or Header
|
1994-01-06
|
14KB
|
458 lines
/*
MODULE: WINFTP.H (main program header file)
*/
#include <windows.h>
#include <windowsx.h>
#include <stdlib.h>
#include "resource.h"
// **** Dialog box names
// #define DLG_ABOUT 510
// #define DLG_HOST 520
// #define DLG_INPUT 530
// #define DLG_STATUS 540
// **** debug window menu definitions
// may be used by other functions!
// under COMMAND popup menu
#define CMD_CONNECT 1010
#define CMD_CLOSE 1020
#define CMD_CWD 1040
#define CMD_DELE 1050
#define CMD_HELP 1060
#define CMD_LIST 1070
#define CMD_MKD 1080
#define CMD_NLST 1090
#define CMD_PWD 1100
#define CMD_QUOTE 1110
#define CMD_RETR 1120
#define CMD_RMD 1130
#define CMD_STATUS 1140
#define CMD_STOR 1150
#define CMD_TYPE_I 1170
#define CMD_TYPE_A 1180
#define CMD_SHFLAGS 1200
// under OPTIONS popup menu
#define OPT_SETVIEWER 1410
#define IDM_ABOUT 1500
#define IDM_EXIT 1600
#define IDM_DROPFILES 1610
// **** main window child window identifiers
// TXT = static text windows
// LST = list boxes
// BTN = push buttons
// RB = radio buttons
// local side child windows
#define LST_DELFILES 2095
#define EDT_LFILETYPE 2105
#define TXT_LDIRECTORY 2110
#define LST_LDIRS 2120
#define LST_LDIRLST 2125
#define LST_LFILES 2130
#define BTN_LCHANGE 2140
#define BTN_LMKDIR 2150
#define BTN_LRMDIR 2160
#define BTN_LREFRESH 2175
#define BTN_LHISTORY 2185
#define BTN_LDISPLAY 2170
#define BTN_LRENAME 2180
#define BTN_LDELETE 2190
// remote side child windows
#define TXT_HOSTNAME 2200
#define EDT_RFILETYPE 2205
#define TXT_RDIRECTORY 2210
#define LST_RDIRS 2220
#define LST_RDIRLST 2225
#define LST_RFILES 2230
#define BTN_RCHANGE 2240
#define BTN_RMKDIR 2250
#define BTN_RRMDIR 2260
#define BTN_RREFRESH 2275
#define BTN_RHISTORY 2285
#define BTN_RDISPLAY 2270
#define BTN_RRENAME 2280
#define BTN_RDELETE 2290
// transfer buttons
#define BTN_LOCAL_TO_REMOTE 2310
#define BTN_REMOTE_TO_LOCAL 2320
// configuration buttons
#define RB_ASCII 2410
#define RB_BINARY 2411
#define RB_L8 2412
// information text windows
#define TXT_STATUS 2510
#define TXT_RBYTES 2520
#define TXT_LBYTES 2530
// control buttons
#define BTN_CONNECT 2610
#define BTN_CLOSE 2620
#define BTN_LONG 2630
#define BTN_ABORT 2635
#define BTN_OPTION 2640
#define BTN_ABOUT 2645
#define BTN_EXIT 2650
// input dialog controls
#define DLG_PROMPT 3010
#define DLG_EDIT 3020
// **** connect dialog box controls
#define DLG_EDT_HOST 4010
#define DLG_EDT_USERID 4020
#define DLG_EDT_PASSWD 4030
#define DLG_HOST_TIMEOUT 4040
// **** status dlg identifiers
#define CKB_BELL 5010
#define CKB_CRSTRIP 5020
#define CKB_GLOBBING 5030
#define CKB_HASH 5040
#define CKB_PROMPT 5050
#define CKB_INTERACTIVE 5060
#define CKB_MCASE 5070
#define CKB_PORT_CMDS 5080
#define CKB_RECV_UNIQUE 5090
#define CKB_STOR_UNIQUE 5100
#define CKB_VERBOSE 5110
#define CKB_AUTOSTART 5120
#define BTN_OPTIONS 5130
#define DLG_MAILADDR 5250
#define RB_SHOWCHECKS 8100
// **** misc definitions
#define TYPE_I 'I'
#define TYPE_A 'A'
#define TYPE_E 'E'
#define TYPE_L 'L'
#define FORM_N 'N'
#define FORM_T 'T'
#define FORM_C 'C'
#define MODE_S 'S'
#define MODE_B 'B'
#define MODE_C 'C'
#define DBUGWNDCLASS "WSDBUGWNDCLASS"
struct win_info
{
HWND hWnd;
int nLineHeight;
int nScreenRows;
int nMemPtr;
int nVpos;
LPSTR lpDebugMsg;
LPSTR lpMem[100];
};
typedef struct HostConfig
{
char szConfig[80];
char szHostName[80];
} HOSTCONFIG, * LPHOSTCONFIG;
typedef struct HostInfo
{
char szConfig[80];
char szHostName[80];
char szUserID[80];
char szPassword[80];
char szInitDir[80];
char szScript[80];
int nType;
BOOL bSaveDir;
BOOL bFireWall;
UINT nTimeOut;
} HOSTINFO, * LPHOSTINFO;
typedef struct
{
char szViewer[80];
char szDir[80];
char szExt[10];
char nTyp;
} VIEWERCFG, *LPVIEWERCFG;
// **** function prototypes
// in ws_child.c
int CreateSubWindows (HWND,HWND);
int GetLocalDirForWnd (HWND);
int GetRemoteDirForWnd(HWND);
int ReadProcessHelp (HWND, SOCKET);
int DoMainPaint (HWND hWnd);
int GetButtonStatus (int);
int GetButtonMsgStatus (int);
int SetButtonStatus (int, int);
int FindButtonClicked (int, int);
int DoPaintButton (HWND, int, int);
int GetButtonID (int);
int SetStatus (HWND, LPSTR);
int ScrollStatus (HWND, int);
int UnsetStatusLines();
int GetChildWindowID (LPARAM);
int GetMaxStatusLines();
BOOL SetButtonEnabledStatus (int, BOOL);
BOOL GetButtonEnabledStatus (int);
void ShowOurFlags (void);
void CreateButtonPens (void);
void DeleteButtonPens (void);
void BoxIt (HDC, int, int, int, int, BOOL);
LPSTR FindName (LPSTR);
LPSTR GetStatusLine (int nLine);
// in ws_con.c
int getreply (SOCKET, LPSTR, BOOL);
int command (SOCKET socket, char *fmt,...);
int DoSTAT (SOCKET);
int DoCHMOD (SOCKET,LPSTR,LPSTR);
int DoCWD (SOCKET,LPSTR);
int DoSystemCommand (SOCKET);
int DoDirList (SOCKET,LPSTR);
int DoDELE (SOCKET,LPSTR);
int DoDisconnect (SOCKET);
int DoMKD (SOCKET,LPSTR);
int DoPWD (SOCKET);
int DoQUOTE (SOCKET,LPSTR);
int DoRMD (SOCKET,LPSTR);
int DoDirList (SOCKET,LPSTR);
int SendFile (SOCKET,LPSTR,LPSTR,char);
int RetrieveFile (SOCKET,LPSTR,LPSTR,char);
int SendPacket (SOCKET,LPSTR);
int ForcePacket (SOCKET,LPSTR);
int ReadDisplayLine (SOCKET);
int ReadLine (SOCKET);
int SendMass (SOCKET,LPSTR filename,BOOL);
int ReadMass (SOCKET,LPSTR filename,BOOL);
int ForceCommand (SOCKET s, LPSTR lpCmd, ...);
char *onoff (BOOL);
SOCKET DoClose (SOCKET sockfd);
SOCKET DoConnect (LPSTR);
SOCKET GetFTPListenSocket (SOCKET sockfd);
// in ws_ip.c
SOCKET connectsock (char *host,char *service,char *protocol);
SOCKET connectTCP (char *host,char *service);
SOCKET connectUDP (char *host,char *service);
int sendstr (SOCKET sockfd,LPSTR ptr,int nbytes, int *lpCode);
// in ws_debug.c
int CreateDebugWindow (HWND hMainWnd,HWND hInst);
LRESULT CALLBACK DebugWndProc (HWND hWnd, UINT Message, WPARAM wParam, LPARAM lParam);
void SetDebugWindowText (LPSTR);
// in ws_error.c
LPSTR ReturnWSError(UINT Err,LPSTR lpszBuf);
void ReportWSError(LPSTR lpszMsg,UINT Err);
// in ws_main.c
LRESULT CALLBACK WndProc (HWND, UINT, WPARAM, LPARAM);
BOOL CALLBACK WS_AboutMsgProc (HWND, UINT, WPARAM, LPARAM);
BOOL CALLBACK WS_HostMsgProc (HWND, UINT, WPARAM, LPARAM);
BOOL CALLBACK WS_InputMsgProc (HWND, UINT, WPARAM, LPARAM);
BOOL CALLBACK WS_DeleteProc (HWND, UINT, WPARAM, LPARAM);
BOOL CALLBACK WS_StatMsgProc (HWND, UINT, WPARAM, LPARAM);
BOOL CALLBACK WS_FireWallSetupProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam);
int SubProcessAsync (HWND, UINT, WPARAM, LPARAM);
int InitIns