home *** CD-ROM | disk | FTP | other *** search
/ The Best Internet Programs / BESTINTERNET.bin / internet / winftp / winftp.h < prev    next >
C/C++ Source or Header  |  1994-01-06  |  14KB  |  458 lines

  1. /*
  2.   MODULE: WINFTP.H   (main program header file)
  3. */
  4.  
  5. #include <windows.h>
  6. #include <windowsx.h>
  7. #include <stdlib.h>
  8. #include "resource.h"
  9.  
  10. // **** Dialog box names
  11. // #define DLG_ABOUT                 510
  12. // #define DLG_HOST                  520
  13. // #define DLG_INPUT                 530
  14. // #define DLG_STATUS                540
  15.  
  16. // **** debug window menu definitions
  17. // may be used by other functions!
  18.  
  19. // under COMMAND popup menu
  20. #define CMD_CONNECT                 1010
  21. #define CMD_CLOSE                   1020
  22.  
  23. #define CMD_CWD                     1040
  24. #define CMD_DELE                    1050
  25. #define CMD_HELP                    1060
  26. #define CMD_LIST                    1070
  27. #define CMD_MKD                     1080
  28. #define CMD_NLST                    1090
  29. #define CMD_PWD                     1100
  30. #define CMD_QUOTE                   1110
  31. #define CMD_RETR                    1120
  32. #define CMD_RMD                     1130
  33. #define CMD_STATUS                  1140
  34. #define CMD_STOR                    1150
  35.  
  36. #define CMD_TYPE_I                  1170
  37. #define CMD_TYPE_A                  1180
  38.  
  39. #define CMD_SHFLAGS                 1200
  40.  
  41. // under OPTIONS popup menu
  42. #define OPT_SETVIEWER               1410
  43.  
  44. #define IDM_ABOUT                   1500
  45. #define IDM_EXIT                    1600
  46. #define IDM_DROPFILES               1610
  47.  
  48. // **** main window child window identifiers
  49. // TXT = static text windows
  50. // LST = list boxes
  51. // BTN = push buttons
  52. // RB  = radio buttons
  53.  
  54. // local side child windows
  55.  
  56. #define LST_DELFILES                2095
  57.  
  58. #define EDT_LFILETYPE               2105
  59. #define TXT_LDIRECTORY              2110
  60. #define LST_LDIRS                   2120
  61. #define LST_LDIRLST                 2125
  62. #define LST_LFILES                  2130
  63. #define BTN_LCHANGE                 2140
  64. #define BTN_LMKDIR                  2150
  65. #define BTN_LRMDIR                  2160
  66. #define BTN_LREFRESH                2175
  67. #define BTN_LHISTORY                2185
  68. #define BTN_LDISPLAY                2170
  69. #define BTN_LRENAME                 2180
  70. #define BTN_LDELETE                 2190
  71.  
  72. // remote side child windows
  73. #define TXT_HOSTNAME                2200
  74.  
  75. #define EDT_RFILETYPE               2205
  76. #define TXT_RDIRECTORY              2210
  77. #define LST_RDIRS                   2220
  78. #define LST_RDIRLST                 2225
  79. #define LST_RFILES                  2230
  80. #define BTN_RCHANGE                 2240
  81. #define BTN_RMKDIR                  2250
  82. #define BTN_RRMDIR                  2260
  83. #define BTN_RREFRESH                2275
  84. #define BTN_RHISTORY                2285
  85. #define BTN_RDISPLAY                2270
  86. #define BTN_RRENAME                 2280
  87. #define BTN_RDELETE                 2290
  88.  
  89. // transfer buttons
  90. #define BTN_LOCAL_TO_REMOTE         2310
  91. #define BTN_REMOTE_TO_LOCAL         2320
  92.  
  93. // configuration buttons
  94. #define RB_ASCII                    2410
  95. #define RB_BINARY                   2411
  96. #define RB_L8                       2412
  97.  
  98. // information text windows
  99. #define TXT_STATUS                  2510
  100. #define TXT_RBYTES                  2520
  101. #define TXT_LBYTES                  2530
  102.  
  103. // control buttons
  104. #define BTN_CONNECT                 2610
  105. #define BTN_CLOSE                   2620
  106. #define BTN_LONG                    2630
  107. #define BTN_ABORT                   2635
  108. #define BTN_OPTION                  2640
  109. #define BTN_ABOUT                   2645
  110. #define BTN_EXIT                    2650
  111.  
  112. // input dialog controls
  113. #define DLG_PROMPT                  3010
  114. #define DLG_EDIT                    3020
  115.  
  116. // **** connect dialog box controls
  117. #define DLG_EDT_HOST                4010
  118. #define DLG_EDT_USERID              4020
  119. #define DLG_EDT_PASSWD              4030
  120. #define DLG_HOST_TIMEOUT            4040
  121.  
  122. // **** status dlg identifiers
  123. #define CKB_BELL                    5010
  124. #define CKB_CRSTRIP                 5020
  125. #define CKB_GLOBBING                5030
  126. #define CKB_HASH                    5040
  127. #define CKB_PROMPT                  5050
  128. #define CKB_INTERACTIVE             5060
  129. #define CKB_MCASE                   5070
  130. #define CKB_PORT_CMDS               5080
  131. #define CKB_RECV_UNIQUE             5090
  132. #define CKB_STOR_UNIQUE             5100
  133. #define CKB_VERBOSE                 5110
  134. #define CKB_AUTOSTART               5120
  135. #define BTN_OPTIONS                 5130
  136. #define DLG_MAILADDR                5250
  137.  
  138. #define RB_SHOWCHECKS 8100
  139.  
  140. // **** misc definitions
  141. #define TYPE_I 'I'
  142. #define TYPE_A 'A'
  143. #define TYPE_E 'E'
  144. #define TYPE_L 'L'
  145.  
  146. #define FORM_N 'N'
  147. #define FORM_T 'T'
  148. #define FORM_C 'C'
  149.  
  150. #define MODE_S 'S'
  151. #define MODE_B 'B'
  152. #define MODE_C 'C'
  153.  
  154. #define DBUGWNDCLASS "WSDBUGWNDCLASS"
  155.  
  156. struct win_info 
  157. {
  158.   HWND hWnd;
  159.   int nLineHeight;
  160.   int nScreenRows;
  161.   int nMemPtr;
  162.   int nVpos;
  163.   LPSTR lpDebugMsg;
  164.   LPSTR lpMem[100];
  165. };
  166.  
  167. typedef struct HostConfig
  168. {
  169.   char szConfig[80];
  170.   char szHostName[80];
  171. } HOSTCONFIG, * LPHOSTCONFIG;
  172.  
  173. typedef struct HostInfo
  174. {
  175.   char szConfig[80];
  176.   char szHostName[80];
  177.   char szUserID[80];
  178.   char szPassword[80];
  179.   char szInitDir[80];
  180.   char szScript[80];
  181.   int  nType;
  182.   BOOL bSaveDir;
  183.   BOOL bFireWall;
  184.   UINT nTimeOut;
  185. } HOSTINFO, * LPHOSTINFO;
  186.  
  187. typedef struct 
  188. {
  189.   char szViewer[80];
  190.   char szDir[80];
  191.   char szExt[10];
  192.   char nTyp;
  193. } VIEWERCFG, *LPVIEWERCFG;
  194.  
  195. // **** function prototypes
  196.  
  197. // in ws_child.c
  198. int CreateSubWindows (HWND,HWND);
  199. int GetLocalDirForWnd (HWND);
  200. int GetRemoteDirForWnd(HWND);
  201. int ReadProcessHelp (HWND, SOCKET);
  202. int DoMainPaint (HWND hWnd);
  203. int GetButtonStatus (int);
  204. int GetButtonMsgStatus (int);
  205. int SetButtonStatus (int, int);
  206. int FindButtonClicked (int, int);
  207. int DoPaintButton (HWND, int, int);
  208. int GetButtonID (int);
  209. int SetStatus (HWND, LPSTR);
  210. int ScrollStatus (HWND, int);
  211. int UnsetStatusLines();
  212. int GetChildWindowID (LPARAM);
  213. int GetMaxStatusLines();
  214.  
  215. BOOL SetButtonEnabledStatus (int, BOOL);
  216. BOOL GetButtonEnabledStatus (int);
  217.  
  218. void ShowOurFlags (void);
  219. void CreateButtonPens (void);
  220. void DeleteButtonPens (void);
  221. void BoxIt (HDC, int, int, int, int, BOOL);
  222.  
  223. LPSTR FindName (LPSTR);
  224. LPSTR GetStatusLine (int nLine);
  225.  
  226. // in ws_con.c
  227. int getreply (SOCKET, LPSTR, BOOL);
  228. int command (SOCKET socket, char *fmt,...);
  229. int DoSTAT (SOCKET);
  230. int DoCHMOD (SOCKET,LPSTR,LPSTR);
  231. int DoCWD (SOCKET,LPSTR);
  232. int DoSystemCommand (SOCKET);
  233. int DoDirList (SOCKET,LPSTR);
  234. int DoDELE (SOCKET,LPSTR);
  235. int DoDisconnect (SOCKET);
  236. int DoMKD (SOCKET,LPSTR);
  237. int DoPWD (SOCKET);
  238. int DoQUOTE (SOCKET,LPSTR);
  239. int DoRMD (SOCKET,LPSTR);
  240. int DoDirList (SOCKET,LPSTR);
  241. int SendFile (SOCKET,LPSTR,LPSTR,char);
  242. int RetrieveFile (SOCKET,LPSTR,LPSTR,char);
  243. int SendPacket (SOCKET,LPSTR);
  244. int ForcePacket (SOCKET,LPSTR);
  245. int ReadDisplayLine (SOCKET);
  246. int ReadLine (SOCKET);
  247. int SendMass (SOCKET,LPSTR filename,BOOL);
  248. int ReadMass (SOCKET,LPSTR filename,BOOL);
  249. int ForceCommand (SOCKET s, LPSTR lpCmd, ...);
  250. char *onoff (BOOL);
  251. SOCKET DoClose (SOCKET sockfd);
  252. SOCKET DoConnect (LPSTR);
  253. SOCKET GetFTPListenSocket (SOCKET sockfd);
  254.  
  255. // in ws_ip.c
  256. SOCKET connectsock (char *host,char *service,char *protocol);
  257. SOCKET connectTCP (char *host,char *service);
  258. SOCKET connectUDP (char *host,char *service);
  259. int sendstr (SOCKET sockfd,LPSTR ptr,int nbytes, int *lpCode);
  260.  
  261. // in ws_debug.c
  262. int CreateDebugWindow (HWND hMainWnd,HWND hInst);
  263. LRESULT CALLBACK DebugWndProc (HWND hWnd, UINT Message, WPARAM wParam, LPARAM lParam);
  264. void SetDebugWindowText (LPSTR);
  265.  
  266. // in ws_error.c
  267. LPSTR ReturnWSError(UINT Err,LPSTR lpszBuf);
  268. void ReportWSError(LPSTR lpszMsg,UINT Err);
  269.  
  270. // in ws_main.c
  271.  
  272. LRESULT CALLBACK WndProc (HWND, UINT, WPARAM, LPARAM);
  273. BOOL CALLBACK WS_AboutMsgProc (HWND, UINT, WPARAM, LPARAM);
  274. BOOL CALLBACK WS_HostMsgProc (HWND, UINT, WPARAM, LPARAM);
  275. BOOL CALLBACK WS_InputMsgProc (HWND, UINT, WPARAM, LPARAM);
  276. BOOL CALLBACK WS_DeleteProc (HWND, UINT, WPARAM, LPARAM);
  277. BOOL CALLBACK WS_StatMsgProc (HWND, UINT, WPARAM, LPARAM);
  278. BOOL CALLBACK WS_FireWallSetupProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam);
  279.  
  280. int SubProcessAsync (HWND, UINT, WPARAM, LPARAM);
  281. int InitIns