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
RevLine 
[49]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
[902]9 Copyright (c) 2001, 2008 Steven H. Levine
[49]10
[145]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
[165]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
[170]22 28 May 05 SHL Drop local functions
[205]23 06 Jun 05 SHL Use QWL_USER
[246]24 11 Aug 05 SHL Renames
[419]25 29 May 06 SHL Rework EditArchiverDefinition
[294]26 16 Jun 06 SHL ARC_TYPE: support non-string signatures
[311]27 26 Jun 06 SHL ARC_TYPE: support preserving comments
[320]28 28 Jun 06 SHL DIRCNRDATA: drop unused
29 05 Jul 06 SHL Support Hide not selected
[337]30 13 Jul 06 SHL Add Runtime_Error
31 22 Jul 06 SHL Add memory.c functions
[365]32 26 Jul 06 SHL Add strips.c functions
[381]33 26 Jul 06 SHL Add more error.c functions
[399]34 29 Jul 06 SHL Add xfgets, xfgets_bstripcr
[520]35 22 Oct 06 GKY Add NDFS32 support
36 03 Nov 06 SHL Renames
[549]37 17 Jan 07 SHL Resize extractdir
[552]38 17 Feb 07 GKY Add more file system types
[557]39 17 Feb 07 GKY Add SelectDriveIcon to streamline update.c
[570]40 18 Mar 07 GKY Add MM import typedefines for fix for files misindentified as multimedia
[593]41 30 Mar 07 GKY Defined golbals for removing GetPString for window class names
[618]42 06 Apr 07 GKY Work around PM DragInfo and DrgFreeDISH limits NumItemsToUnhilite & DeleteDragitemStrHandles
[603]43 06 Apr 07 GKY Add some error checking in drag/drop
[618]44 19 Apr 07 SHL Rework DeleteDragitemStrHandles to be FreeDragInfoData
45 19 Apr 07 SHL Add DbgMsg. Sync with AcceptOneDrop GetOneDrop mods.
[627]46 21 Apr 07 GKY Find FM2Utils by path or utils directory eliminate fAddUtils global
[636]47 23 Apr 07 SHL Add Win_Error_NoMsgBox
[672]48 12 May 07 SHL Add ulItemsToUnHilite to DIRCNRDATA, pass to Unhilite as arg
[689]49 05 Jun 07 SHL Update for OpenWatcom
[688]50 10 Jun 07 GKY Add CheckPmDrgLimit including IsFm2Window as part of work around PM drag limit
[696]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
[737]53 22 Jul 07 GKY Update CNRITEM to optimize RAM usage
54 23 Jul 07 SHL More CNRITEM updates (ticket#24)
[751]55 01 Aug 07 SHL More CNRITEM and ARCITEM updates (ticket#24)
[787]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
[789]60 19 Aug 07 SHL Move FILESTOGET_MIN/MAX here
61 19 Aug 07 SHL Update SaveDirCnrState return
[835]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
[856]64 04 Nov 07 GKY Add pszFmtFileSize to CNRITEM to display large file sizes
[860]65 10 Nov 07 GKY Add ThousandSeparator variable for file sizes NLS tseparator.
[872]66 22 Nov 07 GKY Use CopyPresParams in CheckMenu to fix presparam inconsistencies in menus
[888]67 17 Dec 07 GKY Add variables for using WPURLDEFAULTSETTINGS as the fall back for ftphttprun
[895]68 29 Dec 07 GKY Add remove_first_occurence_of_character
[896]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
[902]71 04 Jan 08 SHL Allow standalone usage
[907]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
[917]77 10 Jan 08 SHL Add UM_FIRSTTIME
[924]78 12 Jan 08 SHL Localize SpecialSelect to comp.c
[953]79 14 Feb 08 SHL Refactor CfgDlgProc to notebook.h
[985]80 29 Feb 08 GKY Refactor global command line variables to notebook.h
[1029]81 22 Jun 08 GKY Changed some variable types to fix compiler warnings
[1065]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.
[1075]85 16 JUL 08 GKY Use TMP directory for temp files
[1082]86 19 Jul 08 GKY Replace save_dir2(dir) with pFM2SaveDirectory and use MakeTempName; Remove LISTTEMPROOT
[1197]87 xx Sep 08 JBS Ticket 187 (Refactor fm2dll.h): All function declarations moved to other include files.
[49]88
89***********************************************************************/
90
[902]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
[907]103#define INCL_LONGLONG // 05 Jan 08 SHL fixme to be gone eventually
[902]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
[907]118#if !defined(INCL_LONGLONG)
119#error INCL_LONGLONG required
120#endif
[902]121#endif // OS2_INCLUDED
122
[689]123#if defined(__IBMC__)
[165]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
[689]130#endif
[165]131
[907]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
[989]134#include "command.h" // 01 Mar 08 GKY fixme to be gone when LINKCMDS refs gone
[907]135
[2]136#ifdef DEFINE_GLOBALS
[551]137#pragma data_seg(GLOBAL1)
[2]138#endif
139
140#define PP_MAX PP_MENUDISABLEBGNDCOLORINDEX
141#define PP_MAXBUF 384
142
143#ifndef MM_PORTHOLEINIT
[551]144#define MM_PORTHOLEINIT 0x01fb
[2]145#endif
146#ifndef MS_POPUP
[551]147#define MS_POPUP 0x00000010L
[2]148#endif
149#ifndef CCS_MINIICONS
[551]150#define CCS_MINIICONS 0x0800
[2]151#endif
152#ifndef CRA_SOURCE
[551]153#define CRA_SOURCE 0x00004000
[2]154#endif
155#ifndef CV_EXACTMATCH
[551]156#define CV_EXACTMATCH 0x10000000
[2]157#endif
158#ifndef CBN_SETFOCUS
[551]159#define CBN_SETFOCUS 20
[2]160#endif
161#ifndef CBN_KILLFOCUS
[551]162#define CBN_KILLFOCUS 21
[2]163#endif
164#ifndef CN_VERIFYEDIT
[551]165#define CN_VERIFYEDIT 134
[2]166#endif
167#ifndef CN_PICKUP
[551]168#define CN_PICKUP 135
[2]169#endif
170#ifndef CN_DROPNOTIFY
[551]171#define CN_DROPNOTIFY 136
[2]172#endif
173#ifndef CN_GRIDRESIZED
[551]174#define CN_GRIDRESIZED 137
[2]175#endif
176#ifndef BKS_MERLINSTYLE
[551]177#define BKS_MERLINSTYLE 0x0800
[2]178#endif
[697]179
180// PMBITMAP_INCLUDED - IBM Toolkit
181// INCL_GPIBITMAPS - OpenWatcom Toolkit
182#if !defined(PMBITMAP_INCLUDED) && !defined(INCL_GPIBITMAPS)
[551]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;
[2]192#endif
193
[311]194#define LINES_PER_ARCSIG 21 // Lines in each archiver.bb2 definition
[2]195#define CON_COLS 6
[672]196#define INSTDATA(h) WinQueryWindowPtr((h),QWL_USER)
[551]197#define DIR_SPLITBAR_OFFSET 18 * 12 /* Pixel offset of details splitbar */
198#define CONTAINER_COLUMNS 13 /* Number of columns in details view */
[2]199#define RGBFROMPARTS(r,g,b) (((r) * 65536) + ((g) * 256) + (b))
[751]200
201#define EXTRA_RECORD_BYTES (sizeof(CNRITEM) - sizeof(MINIRECORDCORE))
[2]202#define EXTRA_ARCRECORD_BYTES (sizeof(ARCITEM) - sizeof(MINIRECORDCORE))
[751]203
[2]204#define ALLATTRS (FILE_NORMAL | FILE_DIRECTORY | FILE_ARCHIVED |\
[636]205 FILE_HIDDEN | FILE_READONLY | FILE_SYSTEM)
[1082]206//#define LISTTEMPROOT "$FM2LI$T"
[2]207
[917]208#include "fm3dll2.h"
[2]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)
[246]274#define UM_BUILDDRIVEBAR (WM_USER + 64)
[2]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)
[320]283#define UM_HIDENOTSELECTED (WM_USER + 73)
[917]284#define UM_FIRSTTIME (WM_USER + 74)
[2]285
[551]286typedef struct
287{
[2]288 USHORT size;
289 USHORT dummy;
[551]290 CHAR szCurrentPath1[CCHMAXPATH];
291 CHAR szCurrentPath2[CCHMAXPATH];
292}
293WALK2;
[2]294
[551]295typedef struct LINKDIRS
296{
297 CHAR *path;
[2]298 struct LINKDIRS *next;
[551]299}
300LINKDIRS;
[2]301
[551]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;
[2]314
[551]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;
[2]324
[551]325typedef struct
326{
[2]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;
[551]335}
336MOVEIT;
[2]337
[551]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;
[2]349
[551]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;
[2]359 LISTINFO *li;
[551]360}
361WORKER;
[2]362
[551]363typedef struct
364{
[2]365 USHORT size;
[1029]366 ULONG flags;
367 ULONG cmd;
[2]368 USHORT dummy;
[551]369 CHAR *prompt;
[2]370 CHAR **list;
[551]371}
372CHECKLIST;
[2]373
[551]374typedef struct
375{
[2]376 ULONG flags;
377 CHAR *commandline;
[551]378 CHAR path[CCHMAXPATH];
379 CHAR environment[1001];
380 CHAR tempprompt[128];
381 CHAR title[80];
382 BOOL dropped;
383}
384EXECARGS;
[2]385
386#pragma pack(1)
387
[769]388// Compare directory flags
389#define CNRITEM_SMALLER 0x00010000 // file exists in both containers and this one is smaller
[2]390#define CNRITEM_LARGER 0x00020000
391#define CNRITEM_NEWER 0x00040000
392#define CNRITEM_OLDER 0x00080000
[769]393#define CNRITEM_EXISTS 0x00100000 // file exists in both containers
[2]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
[551]403typedef struct _ARCITEM
404{ // ARCHIVE CONTAINER RECORD STRUCTURE
405 MINIRECORDCORE rc; // Base information
406 HWND hwndCnr; /* Container holding this record */
[751]407 PSZ pszFileName; // Points to full path name or NullStr
[739]408 PSZ pszDisplayName; // Points to displayable part of path name - used by CFA_STRING
[551]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
[841]413 ULONGLONG cbFile; // File's original size
414 ULONGLONG cbComp; // File's compressed size
[551]415 ULONG flags;
416}
417ARCITEM, *PARCITEM;
[2]418
419#pragma pack()
420
[551]421typedef struct
422{
423 USHORT size;
[2]424 ARC_TYPE *info;
[551]425 CHAR *arcname;
426 CHAR masks[257];
427 CHAR command[257];
428 CHAR extractdir[CCHMAXPATH];
429 INT ret;
430}
431EXTRDATA;
[2]432
[551]433#define COPY 0
434#define MOVE 1
435#define WPSCOPY 2
436#define WPSMOVE 4
437
[2]438/* systemf.c */
[1189]439// #if defined(__IBMC__)
440// /* fsopen.c */
441// FILE *_fsopen(CHAR * filename, CHAR * mode, INT sharemode, ...);
442// #endif
[1164]443
[337]444//=====================================================================
445
[2]446
[789]447#define FILESTOGET_MIN 256
448#define FILESTOGET_MAX 4096
449
[551]450
[2]451#ifdef INCL_MMIOOS2
452#pragma pack(4)
453/* definitions for MMPM/2 imports */
[551]454typedef DWORD(APIENTRY MMIOIDENTIFYFILE) (PSZ, PMMIOINFO, PMMFORMATINFO,
455 PFOURCC, DWORD, DWORD);
[2]456typedef MMIOIDENTIFYFILE *PMMIOIDENTIFYFILE;
[570]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;
[551]463
[2]464#pragma pack()
465#endif
466
[917]467
[2]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))
[902]475
476#endif // FM3DLL_H
Note: See TracBrowser for help on using the repository browser.