source: trunk/dll/fm3dll.h@ 1211

Last change on this file since 1211 was 1208, checked in by John Small, 17 years ago

Ticket 187: Move data declarations/definitions out of fm3dll.h

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 14.8 KB
Line 
1
2/***********************************************************************
3
4 $Id: fm3dll.h 1208 2008-09-13 06:50:20Z jbs $
5
6 Common definitions
7
8 Copyright (c) 1993-98 M. Kimes
9 Copyright (c) 2001, 2008 Steven H. Levine
10
11 12 Feb 03 SHL Add CBLIST_TO_EASIZE
12 11 Jun 03 SHL Add JFS and FAT32 support
13 06 Jan 04 SHL Drop hundfmt
14 01 Aug 04 SHL Optimze strippers
15 01 Aug 04 SHL Drop avv local functions
16 23 May 05 SHL Split datamin to datamin.h
17 24 May 05 SHL Rework Win_Error usage
18 25 May 05 SHL Require VAC 3.65
19 25 May 05 SHL Rename comnam to szCommonName
20 25 May 05 SHL Rework for FillInRecordFromFFB
21 25 May 05 SHL Add CommaFmtULL CommaFmtUL
22 28 May 05 SHL Drop local functions
23 06 Jun 05 SHL Use QWL_USER
24 11 Aug 05 SHL Renames
25 29 May 06 SHL Rework EditArchiverDefinition
26 16 Jun 06 SHL ARC_TYPE: support non-string signatures
27 26 Jun 06 SHL ARC_TYPE: support preserving comments
28 28 Jun 06 SHL DIRCNRDATA: drop unused
29 05 Jul 06 SHL Support Hide not selected
30 13 Jul 06 SHL Add Runtime_Error
31 22 Jul 06 SHL Add memory.c functions
32 26 Jul 06 SHL Add strips.c functions
33 26 Jul 06 SHL Add more error.c functions
34 29 Jul 06 SHL Add xfgets, xfgets_bstripcr
35 22 Oct 06 GKY Add NDFS32 support
36 03 Nov 06 SHL Renames
37 17 Jan 07 SHL Resize extractdir
38 17 Feb 07 GKY Add more file system types
39 17 Feb 07 GKY Add SelectDriveIcon to streamline update.c
40 18 Mar 07 GKY Add MM import typedefines for fix for files misindentified as multimedia
41 30 Mar 07 GKY Defined golbals for removing GetPString for window class names
42 06 Apr 07 GKY Work around PM DragInfo and DrgFreeDISH limits NumItemsToUnhilite & DeleteDragitemStrHandles
43 06 Apr 07 GKY Add some error checking in drag/drop
44 19 Apr 07 SHL Rework DeleteDragitemStrHandles to be FreeDragInfoData
45 19 Apr 07 SHL Add DbgMsg. Sync with AcceptOneDrop GetOneDrop mods.
46 21 Apr 07 GKY Find FM2Utils by path or utils directory eliminate fAddUtils global
47 23 Apr 07 SHL Add Win_Error_NoMsgBox
48 12 May 07 SHL Add ulItemsToUnHilite to DIRCNRDATA, pass to Unhilite as arg
49 05 Jun 07 SHL Update for OpenWatcom
50 10 Jun 07 GKY Add CheckPmDrgLimit including IsFm2Window as part of work around PM drag limit
51 16 Jun 07 GKY Add CheckPmDrgLimit including IsFm2Window as part of work around PM drag limit
52 16 Jun 07 SHL Update more for OpenWatcom
53 22 Jul 07 GKY Update CNRITEM to optimize RAM usage
54 23 Jul 07 SHL More CNRITEM updates (ticket#24)
55 01 Aug 07 SHL More CNRITEM and ARCITEM updates (ticket#24)
56 14 Aug 07 SHL Add GetMSecTimer
57 14 Aug 07 SHL Delete obsoletes
58 16 Aug 07 SHL Update for ticket# 109 - status update
59 18 Aug 07 SHL Update for ticket# 31 - states length
60 19 Aug 07 SHL Move FILESTOGET_MIN/MAX here
61 19 Aug 07 SHL Update SaveDirCnrState return
62 21 Aug 07 GKY Make Subject column in dircnr sizable and movable from the right to the left pane
63 01 Sep 07 GKY Add xDosSetPathInfo to fix case where FS3 buffer crosses 64k boundary
64 04 Nov 07 GKY Add pszFmtFileSize to CNRITEM to display large file sizes
65 10 Nov 07 GKY Add ThousandSeparator variable for file sizes NLS tseparator.
66 22 Nov 07 GKY Use CopyPresParams in CheckMenu to fix presparam inconsistencies in menus
67 17 Dec 07 GKY Add variables for using WPURLDEFAULTSETTINGS as the fall back for ftphttprun
68 29 Dec 07 GKY Add remove_first_occurence_of_character
69 30 Dec 07 GKY Change TestDates to TestFDates can compare by filename or FDATE/FTIME data
70 30 Dec 07 GKY Add TestCDates to compare CNRITEMs by CDATE/CTIME data
71 04 Jan 08 SHL Allow standalone usage
72 05 Jan 08 SHL Move comp.c definitions to comp.h
73 05 Jan 08 SHL Move dircnr.c definitions to dircnr.h
74 05 Jan 08 SHL Move makelist.c definitions to makelist.h
75 05 Jan 08 SHL Move error.c definitions to errutil.h
76 05 Jan 08 SHL Move string.c definitions to strutil.h
77 10 Jan 08 SHL Add UM_FIRSTTIME
78 12 Jan 08 SHL Localize SpecialSelect to comp.c
79 14 Feb 08 SHL Refactor CfgDlgProc to notebook.h
80 29 Feb 08 GKY Refactor global command line variables to notebook.h
81 22 Jun 08 GKY Changed some variable types to fix compiler warnings
82 11 Jul 08 JBS Ticket 230: Simplified code and eliminated some local variables by incorporating
83 all the details view settings (both the global variables and those in the
84 DIRCNRDATA struct) into a new struct: DETAILS_SETTINGS.
85 16 JUL 08 GKY Use TMP directory for temp files
86 19 Jul 08 GKY Replace save_dir2(dir) with pFM2SaveDirectory and use MakeTempName; Remove LISTTEMPROOT
87 xx Sep 08 JBS Ticket 187 (Refactor fm2dll.h): All function declarations moved to other include files.
88
89***********************************************************************/
90
91#if !defined(FM3DLL_H)
92
93#define FM3DLL_H
94
95#include <stdio.h> // FILE
96#include <time.h> // time_t
97
98#if !defined(OS2_INCLUDED)
99#define INCL_WINSTDDRAG
100#define INCL_WINSTDCNR
101#define INCL_WINPROGRAMLIST
102#define INCL_WINHELP
103#define INCL_LONGLONG // 05 Jan 08 SHL fixme to be gone eventually
104#include <os2.h>
105#else
106#if !defined(INCL_WINSTDDRAG)
107#error INCL_WINSTDDRAG required
108#endif
109#if !defined(INCL_WINSTDCNR)
110#error INCL_WINSTDCNR required
111#endif
112#if !defined(INCL_WINPROGRAMLIST)
113#error INCL_WINPROGRAMLIST required
114#endif
115#if !defined(INCL_WINHELP)
116#error INCL_WINHELP required
117#endif
118#if !defined(INCL_LONGLONG)
119#error INCL_LONGLONG required
120#endif
121#endif // OS2_INCLUDED
122
123#if defined(__IBMC__)
124#if __IBMC__ != 430
125#error VAC365 required for long long support
126#endif
127#if !defined(_LONG_LONG)
128#error Long long support not enabled
129#endif
130#endif
131
132#include "dircnrs.h" // 05 Jan 08 SHL fixme to be gone when DIRCNRDATA refs gone
133#include "makelist.h" // 05 Jan 08 SHL fixme to be gone when LISTINFO refs gone
134#include "command.h" // 01 Mar 08 GKY fixme to be gone when LINKCMDS refs gone
135
136#ifdef DEFINE_GLOBALS
137#pragma data_seg(GLOBAL1)
138#endif
139
140#define PP_MAX PP_MENUDISABLEBGNDCOLORINDEX
141#define PP_MAXBUF 384
142
143#ifndef MM_PORTHOLEINIT
144#define MM_PORTHOLEINIT 0x01fb
145#endif
146#ifndef MS_POPUP
147#define MS_POPUP 0x00000010L
148#endif
149#ifndef CCS_MINIICONS
150#define CCS_MINIICONS 0x0800
151#endif
152#ifndef CRA_SOURCE
153#define CRA_SOURCE 0x00004000
154#endif
155#ifndef CV_EXACTMATCH
156#define CV_EXACTMATCH 0x10000000
157#endif
158#ifndef CBN_SETFOCUS
159#define CBN_SETFOCUS 20
160#endif
161#ifndef CBN_KILLFOCUS
162#define CBN_KILLFOCUS 21
163#endif
164#ifndef CN_VERIFYEDIT
165#define CN_VERIFYEDIT 134
166#endif
167#ifndef CN_PICKUP
168#define CN_PICKUP 135
169#endif
170#ifndef CN_DROPNOTIFY
171#define CN_DROPNOTIFY 136
172#endif
173#ifndef CN_GRIDRESIZED
174#define CN_GRIDRESIZED 137
175#endif
176#ifndef BKS_MERLINSTYLE
177#define BKS_MERLINSTYLE 0x0800
178#endif
179
180// PMBITMAP_INCLUDED - IBM Toolkit
181// INCL_GPIBITMAPS - OpenWatcom Toolkit
182#if !defined(PMBITMAP_INCLUDED) && !defined(INCL_GPIBITMAPS)
183typedef struct _RGB2 /* rgb2 */
184{
185 BYTE bBlue; /* Blue component of the color definition */
186 BYTE bGreen; /* Green component of the color definition */
187 BYTE bRed; /* Red component of the color definition */
188 BYTE fcOptions; /* Reserved, must be zero */
189}
190RGB2;
191typedef RGB2 *PRGB2;
192#endif
193
194#define LINES_PER_ARCSIG 21 // Lines in each archiver.bb2 definition
195#define CON_COLS 6
196#define INSTDATA(h) WinQueryWindowPtr((h),QWL_USER)
197#define DIR_SPLITBAR_OFFSET 18 * 12 /* Pixel offset of details splitbar */
198#define CONTAINER_COLUMNS 13 /* Number of columns in details view */
199#define RGBFROMPARTS(r,g,b) (((r) * 65536) + ((g) * 256) + (b))
200
201#define EXTRA_RECORD_BYTES (sizeof(CNRITEM) - sizeof(MINIRECORDCORE))
202#define EXTRA_ARCRECORD_BYTES (sizeof(ARCITEM) - sizeof(MINIRECORDCORE))
203
204#define ALLATTRS (FILE_NORMAL | FILE_DIRECTORY | FILE_ARCHIVED |\
205 FILE_HIDDEN | FILE_READONLY | FILE_SYSTEM)
206//#define LISTTEMPROOT "$FM2LI$T"
207
208#include "fm3dll2.h"
209
210#define UM_PAINT (WM_USER)
211#define UM_SETUP (WM_USER + 1)
212#define UM_RESCAN (WM_USER + 2)
213#define UM_INITIALSIZE (WM_USER + 3)
214#define UM_CONTROL (WM_USER + 4)
215#define UM_COMMAND (WM_USER + 5)
216#define UM_SIZE (WM_USER + 6)
217#define UM_FOCUSME (WM_USER + 7)
218#define UM_FIXEDITNAME (WM_USER + 8)
219#define UM_UPDATERECORD (WM_USER + 9)
220#define UM_SETDIR (WM_USER + 10)
221#define UM_CONTAINER_FILLED (WM_USER + 11)
222#define UM_STRETCH (WM_USER + 12)
223#define UM_LOADFILE (WM_USER + 13)
224#define UM_MOUSEMOVE (WM_USER + 14)
225#define UM_ENTER (WM_USER + 15)
226#define UM_CLOSE (WM_USER + 16)
227#define UM_ACTION (WM_USER + 17)
228#define UM_MASSACTION (WM_USER + 18)
229#define UM_UPDATERECORDLIST (WM_USER + 19)
230#define UM_FILESMENU (WM_USER + 20)
231#define UM_SELECT (WM_USER + 21)
232#define UM_VIEWSMENU (WM_USER + 22)
233#define UM_CONTAINERHWND (WM_USER + 23)
234#define UM_OPENWINDOWFORME (WM_USER + 24)
235#define UM_FOLDUP (WM_USER + 25)
236#define UM_INITMENU (WM_USER + 26)
237#define UM_COMPARE (WM_USER + 27)
238#define UM_EXPAND (WM_USER + 28)
239#define UM_REPLACEFOCUS (WM_USER + 29)
240#define UM_UNDO (WM_USER + 30)
241#define UM_RENDER (WM_USER + 31)
242#define UM_BUTTON2DOWN (WM_USER + 32)
243#define UM_BUTTON2UP (WM_USER + 33)
244#define UM_COLLECTFROMFILE (WM_USER + 34)
245#define UM_TIMER (WM_USER + 35)
246#define UM_HELPON (WM_USER + 36)
247#define UM_SETUP2 (WM_USER + 37)
248#define UM_SETUP3 (WM_USER + 38)
249#define UM_CONTEXTMENU (WM_USER + 39)
250#define UM_FILLUSERLIST (WM_USER + 40)
251#define UM_CONTAINERDIR (WM_USER + 41)
252#define UM_SETUP4 (WM_USER + 42)
253#define UM_FILLSETUPLIST (WM_USER + 43)
254#define UM_ARRANGEICONS (WM_USER + 44)
255#define UM_SETUP5 (WM_USER + 45)
256#define UM_NOTIFY (WM_USER + 46)
257#define UM_INSERTRECORD (WM_USER + 47)
258#define UM_ADDTOMENU (WM_USER + 48)
259#define UM_COLLECT (WM_USER + 49)
260#define UM_RESTOREDC (WM_USER + 50)
261#define UM_MINIMIZE (WM_USER + 51)
262#define UM_MAXIMIZE (WM_USER + 52)
263#define UM_BUTTON1MOTIONSTART (WM_USER + 53)
264#define UM_SETUP6 (WM_USER + 54)
265#define UM_FILLBUTTONLIST (WM_USER + 55)
266#define UM_SETUSERLISTNAME (WM_USER + 56)
267#define UM_FILTER (WM_USER + 57)
268#define UM_SORTRECORD (WM_USER + 58)
269#define UM_SIZE2 (WM_USER + 59)
270#define UM_RESTORE (WM_USER + 60)
271#define UM_TOPDIR (WM_USER + 61)
272#define UM_SHOWME (WM_USER + 62)
273#define UM_RESCAN2 (WM_USER + 63)
274#define UM_BUILDDRIVEBAR (WM_USER + 64)
275#define UM_THREADUSE (WM_USER + 65)
276#define UM_DRIVECMD (WM_USER + 66)
277#define UM_ADVISEFOCUS (WM_USER + 67)
278#define UM_FIXCNRMLE (WM_USER + 68)
279#define UM_FLESH (WM_USER + 69)
280#define UM_FILLCMDLIST (WM_USER + 70)
281#define UM_CLICKED (WM_USER + 71)
282#define UM_CLICKED3 (WM_USER + 72)
283#define UM_HIDENOTSELECTED (WM_USER + 73)
284#define UM_FIRSTTIME (WM_USER + 74)
285
286typedef struct
287{
288 USHORT size;
289 USHORT dummy;
290 CHAR szCurrentPath1[CCHMAXPATH];
291 CHAR szCurrentPath2[CCHMAXPATH];
292}
293WALK2;
294
295typedef struct LINKDIRS
296{
297 CHAR *path;
298 struct LINKDIRS *next;
299}
300LINKDIRS;
301
302typedef struct
303{
304 USHORT size;
305 USHORT numcolors;
306 USHORT flags;
307 USHORT currentcolor;
308 ULONG prompt;
309 long *colors;
310 ULONG descriptions;
311 long *origs;
312}
313COLORS;
314
315typedef struct
316{
317 CHAR *title; /* title of dialog */
318 CHAR *prompt; /* prompt to user */
319 CHAR *ret; /* buffer out, default in */
320 CHAR *help; /* help text */
321 INT inputlen; /* max len of ret */
322}
323STRINGINPARMS;
324
325typedef struct
326{
327 CHAR *source;
328 CHAR target[CCHMAXPATH];
329 BOOL rename;
330 BOOL skip;
331 BOOL dontask;
332 BOOL overold;
333 BOOL overnew;
334 BOOL overwrite;
335}
336MOVEIT;
337
338typedef struct HOLDFEA
339{
340 PFEA2 pfea;
341 CHAR *name;
342 CHAR *value;
343 BYTE fEA;
344 BYTE cbName;
345 USHORT cbValue;
346 struct HOLDFEA *next;
347}
348HOLDFEA;
349
350typedef struct
351{
352 USHORT size;
353 USHORT dummy;
354 CHAR directory[CCHMAXPATH];
355 HWND hwndParent;
356 HWND hwndFrame;
357 HWND hwndClient;
358 HWND hwndCnr;
359 LISTINFO *li;
360}
361WORKER;
362
363typedef struct
364{
365 USHORT size;
366 ULONG flags;
367 ULONG cmd;
368 USHORT dummy;
369 CHAR *prompt;
370 CHAR **list;
371}
372CHECKLIST;
373
374typedef struct
375{
376 ULONG flags;
377 CHAR *commandline;
378 CHAR path[CCHMAXPATH];
379 CHAR environment[1001];
380 CHAR tempprompt[128];
381 CHAR title[80];
382 BOOL dropped;
383}
384EXECARGS;
385
386#pragma pack(1)
387
388// Compare directory flags
389#define CNRITEM_SMALLER 0x00010000 // file exists in both containers and this one is smaller
390#define CNRITEM_LARGER 0x00020000
391#define CNRITEM_NEWER 0x00040000
392#define CNRITEM_OLDER 0x00080000
393#define CNRITEM_EXISTS 0x00100000 // file exists in both containers
394
395#define RECFLAGS_ENV 0x00000001
396#define RECFLAGS_NODRAG 0x00000002
397#define RECFLAGS_NODROP 0x00000004
398#define RECFLAGS_UNDERENV 0x00000008
399
400#define ARCFLAGS_REALDIR 0x00000001
401#define ARCFLAGS_PSEUDODIR 0x00000002
402
403typedef struct _ARCITEM
404{ // ARCHIVE CONTAINER RECORD STRUCTURE
405 MINIRECORDCORE rc; // Base information
406 HWND hwndCnr; /* Container holding this record */
407 PSZ pszFileName; // Points to full path name or NullStr
408 PSZ pszDisplayName; // Points to displayable part of path name - used by CFA_STRING
409 CHAR szDate[40]; // File's assembled date
410 PSZ pszDate; // Pointer to date
411 CDATE date; // if we know date format
412 CTIME time; // if we know time format
413 ULONGLONG cbFile; // File's original size
414 ULONGLONG cbComp; // File's compressed size
415 ULONG flags;
416}
417ARCITEM, *PARCITEM;
418
419#pragma pack()
420
421typedef struct
422{
423 USHORT size;
424 ARC_TYPE *info;
425 CHAR *arcname;
426 CHAR masks[257];
427 CHAR command[257];
428 CHAR extractdir[CCHMAXPATH];
429 INT ret;
430}
431EXTRDATA;
432
433#define COPY 0
434#define MOVE 1
435#define WPSCOPY 2
436#define WPSMOVE 4
437
438/* systemf.c */
439// #if defined(__IBMC__)
440// /* fsopen.c */
441// FILE *_fsopen(CHAR * filename, CHAR * mode, INT sharemode, ...);
442// #endif
443
444//=====================================================================
445
446
447#define FILESTOGET_MIN 256
448#define FILESTOGET_MAX 4096
449
450
451#ifdef INCL_MMIOOS2
452#pragma pack(4)
453/* definitions for MMPM/2 imports */
454typedef DWORD(APIENTRY MMIOIDENTIFYFILE) (PSZ, PMMIOINFO, PMMFORMATINFO,
455 PFOURCC, DWORD, DWORD);
456typedef MMIOIDENTIFYFILE *PMMIOIDENTIFYFILE;
457typedef DWORD(APIENTRY MMIOOPEN)( PSZ, PMMIOINFO, DWORD);
458typedef MMIOOPEN *PMMIOOPEN;
459typedef WORD (APIENTRY MMIOGETINFO)( HMMIO, PMMIOINFO, WORD);
460typedef MMIOGETINFO *PMMIOGETINFO;
461typedef WORD (APIENTRY MMIOCLOSE)( HMMIO, WORD);
462typedef MMIOCLOSE *PMMIOCLOSE;
463
464#pragma pack()
465#endif
466
467
468#define priority_idle() DosSetPriority(PRTYS_THREAD,PRTYC_IDLETIME,30L,0L)
469#define priority_normal() DosSetPriority(PRTYS_THREAD,PRTYC_REGULAR,0L,0L)
470#define priority_tweaked() DosSetPriority(PRTYS_THREAD,PRTYC_REGULAR,1L,0L)
471#define priority_bumped() DosSetPriority(PRTYS_THREAD,PRTYC_REGULAR,3L,0L)
472#define priority_critical() DosSetPriority(PRTYS_THREAD,PRTYC_FOREGROUNDSERVER,2L,0L)
473#define priority_max() DosSetPriority(PRTYS_THREAD,PRTYC_FOREGROUNDSERVER,31L,0L)
474#define SysVal(value) WinQuerySysValue(HWND_DESKTOP, (value))
475
476#endif // FM3DLL_H
Note: See TracBrowser for help on using the repository browser.