source: trunk/dll/fm3dll.h@ 1188

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

Ticket 187: Draft 1: Functions only

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 28.6 KB
Line 
1
2/***********************************************************************
3
4 $Id: fm3dll.h 1164 2008-09-05 21:44:14Z 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
88***********************************************************************/
89
90#if !defined(FM3DLL_H)
91
92#define FM3DLL_H
93
94#include <stdio.h> // FILE
95#include <time.h> // time_t
96
97#if !defined(OS2_INCLUDED)
98#define INCL_WINSTDDRAG
99#define INCL_WINSTDCNR
100#define INCL_WINPROGRAMLIST
101#define INCL_WINHELP
102#define INCL_LONGLONG // 05 Jan 08 SHL fixme to be gone eventually
103#include <os2.h>
104#else
105#if !defined(INCL_WINSTDDRAG)
106#error INCL_WINSTDDRAG required
107#endif
108#if !defined(INCL_WINSTDCNR)
109#error INCL_WINSTDCNR required
110#endif
111#if !defined(INCL_WINPROGRAMLIST)
112#error INCL_WINPROGRAMLIST required
113#endif
114#if !defined(INCL_WINHELP)
115#error INCL_WINHELP required
116#endif
117#if !defined(INCL_LONGLONG)
118#error INCL_LONGLONG required
119#endif
120#endif // OS2_INCLUDED
121
122#if defined(__IBMC__)
123#if __IBMC__ != 430
124#error VAC365 required for long long support
125#endif
126#if !defined(_LONG_LONG)
127#error Long long support not enabled
128#endif
129#endif
130
131#include "dircnrs.h" // 05 Jan 08 SHL fixme to be gone when DIRCNRDATA refs gone
132#include "makelist.h" // 05 Jan 08 SHL fixme to be gone when LISTINFO refs gone
133#include "command.h" // 01 Mar 08 GKY fixme to be gone when LINKCMDS refs gone
134
135#ifdef DEFINE_GLOBALS
136#pragma data_seg(GLOBAL1)
137#endif
138
139#define PP_MAX PP_MENUDISABLEBGNDCOLORINDEX
140#define PP_MAXBUF 384
141
142#ifndef MM_PORTHOLEINIT
143#define MM_PORTHOLEINIT 0x01fb
144#endif
145#ifndef MS_POPUP
146#define MS_POPUP 0x00000010L
147#endif
148#ifndef CCS_MINIICONS
149#define CCS_MINIICONS 0x0800
150#endif
151#ifndef CRA_SOURCE
152#define CRA_SOURCE 0x00004000
153#endif
154#ifndef CV_EXACTMATCH
155#define CV_EXACTMATCH 0x10000000
156#endif
157#ifndef CBN_SETFOCUS
158#define CBN_SETFOCUS 20
159#endif
160#ifndef CBN_KILLFOCUS
161#define CBN_KILLFOCUS 21
162#endif
163#ifndef CN_VERIFYEDIT
164#define CN_VERIFYEDIT 134
165#endif
166#ifndef CN_PICKUP
167#define CN_PICKUP 135
168#endif
169#ifndef CN_DROPNOTIFY
170#define CN_DROPNOTIFY 136
171#endif
172#ifndef CN_GRIDRESIZED
173#define CN_GRIDRESIZED 137
174#endif
175#ifndef BKS_MERLINSTYLE
176#define BKS_MERLINSTYLE 0x0800
177#endif
178
179// PMBITMAP_INCLUDED - IBM Toolkit
180// INCL_GPIBITMAPS - OpenWatcom Toolkit
181#if !defined(PMBITMAP_INCLUDED) && !defined(INCL_GPIBITMAPS)
182typedef struct _RGB2 /* rgb2 */
183{
184 BYTE bBlue; /* Blue component of the color definition */
185 BYTE bGreen; /* Green component of the color definition */
186 BYTE bRed; /* Red component of the color definition */
187 BYTE fcOptions; /* Reserved, must be zero */
188}
189RGB2;
190typedef RGB2 *PRGB2;
191#endif
192
193#define LINES_PER_ARCSIG 21 // Lines in each archiver.bb2 definition
194#define CON_COLS 6
195#define INSTDATA(h) WinQueryWindowPtr((h),QWL_USER)
196#define DIR_SPLITBAR_OFFSET 18 * 12 /* Pixel offset of details splitbar */
197#define CONTAINER_COLUMNS 13 /* Number of columns in details view */
198#define RGBFROMPARTS(r,g,b) (((r) * 65536) + ((g) * 256) + (b))
199
200#define EXTRA_RECORD_BYTES (sizeof(CNRITEM) - sizeof(MINIRECORDCORE))
201#define EXTRA_ARCRECORD_BYTES (sizeof(ARCITEM) - sizeof(MINIRECORDCORE))
202
203#define ALLATTRS (FILE_NORMAL | FILE_DIRECTORY | FILE_ARCHIVED |\
204 FILE_HIDDEN | FILE_READONLY | FILE_SYSTEM)
205//#define LISTTEMPROOT "$FM2LI$T"
206
207#include "fm3dll2.h"
208
209#define UM_PAINT (WM_USER)
210#define UM_SETUP (WM_USER + 1)
211#define UM_RESCAN (WM_USER + 2)
212#define UM_INITIALSIZE (WM_USER + 3)
213#define UM_CONTROL (WM_USER + 4)
214#define UM_COMMAND (WM_USER + 5)
215#define UM_SIZE (WM_USER + 6)
216#define UM_FOCUSME (WM_USER + 7)
217#define UM_FIXEDITNAME (WM_USER + 8)
218#define UM_UPDATERECORD (WM_USER + 9)
219#define UM_SETDIR (WM_USER + 10)
220#define UM_CONTAINER_FILLED (WM_USER + 11)
221#define UM_STRETCH (WM_USER + 12)
222#define UM_LOADFILE (WM_USER + 13)
223#define UM_MOUSEMOVE (WM_USER + 14)
224#define UM_ENTER (WM_USER + 15)
225#define UM_CLOSE (WM_USER + 16)
226#define UM_ACTION (WM_USER + 17)
227#define UM_MASSACTION (WM_USER + 18)
228#define UM_UPDATERECORDLIST (WM_USER + 19)
229#define UM_FILESMENU (WM_USER + 20)
230#define UM_SELECT (WM_USER + 21)
231#define UM_VIEWSMENU (WM_USER + 22)
232#define UM_CONTAINERHWND (WM_USER + 23)
233#define UM_OPENWINDOWFORME (WM_USER + 24)
234#define UM_FOLDUP (WM_USER + 25)
235#define UM_INITMENU (WM_USER + 26)
236#define UM_COMPARE (WM_USER + 27)
237#define UM_EXPAND (WM_USER + 28)
238#define UM_REPLACEFOCUS (WM_USER + 29)
239#define UM_UNDO (WM_USER + 30)
240#define UM_RENDER (WM_USER + 31)
241#define UM_BUTTON2DOWN (WM_USER + 32)
242#define UM_BUTTON2UP (WM_USER + 33)
243#define UM_COLLECTFROMFILE (WM_USER + 34)
244#define UM_TIMER (WM_USER + 35)
245#define UM_HELPON (WM_USER + 36)
246#define UM_SETUP2 (WM_USER + 37)
247#define UM_SETUP3 (WM_USER + 38)
248#define UM_CONTEXTMENU (WM_USER + 39)
249#define UM_FILLUSERLIST (WM_USER + 40)
250#define UM_CONTAINERDIR (WM_USER + 41)
251#define UM_SETUP4 (WM_USER + 42)
252#define UM_FILLSETUPLIST (WM_USER + 43)
253#define UM_ARRANGEICONS (WM_USER + 44)
254#define UM_SETUP5 (WM_USER + 45)
255#define UM_NOTIFY (WM_USER + 46)
256#define UM_INSERTRECORD (WM_USER + 47)
257#define UM_ADDTOMENU (WM_USER + 48)
258#define UM_COLLECT (WM_USER + 49)
259#define UM_RESTOREDC (WM_USER + 50)
260#define UM_MINIMIZE (WM_USER + 51)
261#define UM_MAXIMIZE (WM_USER + 52)
262#define UM_BUTTON1MOTIONSTART (WM_USER + 53)
263#define UM_SETUP6 (WM_USER + 54)
264#define UM_FILLBUTTONLIST (WM_USER + 55)
265#define UM_SETUSERLISTNAME (WM_USER + 56)
266#define UM_FILTER (WM_USER + 57)
267#define UM_SORTRECORD (WM_USER + 58)
268#define UM_SIZE2 (WM_USER + 59)
269#define UM_RESTORE (WM_USER + 60)
270#define UM_TOPDIR (WM_USER + 61)
271#define UM_SHOWME (WM_USER + 62)
272#define UM_RESCAN2 (WM_USER + 63)
273#define UM_BUILDDRIVEBAR (WM_USER + 64)
274#define UM_THREADUSE (WM_USER + 65)
275#define UM_DRIVECMD (WM_USER + 66)
276#define UM_ADVISEFOCUS (WM_USER + 67)
277#define UM_FIXCNRMLE (WM_USER + 68)
278#define UM_FLESH (WM_USER + 69)
279#define UM_FILLCMDLIST (WM_USER + 70)
280#define UM_CLICKED (WM_USER + 71)
281#define UM_CLICKED3 (WM_USER + 72)
282#define UM_HIDENOTSELECTED (WM_USER + 73)
283#define UM_FIRSTTIME (WM_USER + 74)
284
285typedef struct
286{
287 USHORT size;
288 USHORT dummy;
289 CHAR szCurrentPath1[CCHMAXPATH];
290 CHAR szCurrentPath2[CCHMAXPATH];
291}
292WALK2;
293
294typedef struct LINKDIRS
295{
296 CHAR *path;
297 struct LINKDIRS *next;
298}
299LINKDIRS;
300
301typedef struct
302{
303 USHORT size;
304 USHORT numcolors;
305 USHORT flags;
306 USHORT currentcolor;
307 ULONG prompt;
308 long *colors;
309 ULONG descriptions;
310 long *origs;
311}
312COLORS;
313
314typedef struct
315{
316 CHAR *title; /* title of dialog */
317 CHAR *prompt; /* prompt to user */
318 CHAR *ret; /* buffer out, default in */
319 CHAR *help; /* help text */
320 INT inputlen; /* max len of ret */
321}
322STRINGINPARMS;
323
324typedef struct
325{
326 CHAR *source;
327 CHAR target[CCHMAXPATH];
328 BOOL rename;
329 BOOL skip;
330 BOOL dontask;
331 BOOL overold;
332 BOOL overnew;
333 BOOL overwrite;
334}
335MOVEIT;
336
337typedef struct HOLDFEA
338{
339 PFEA2 pfea;
340 CHAR *name;
341 CHAR *value;
342 BYTE fEA;
343 BYTE cbName;
344 USHORT cbValue;
345 struct HOLDFEA *next;
346}
347HOLDFEA;
348
349typedef struct
350{
351 USHORT size;
352 USHORT dummy;
353 CHAR directory[CCHMAXPATH];
354 HWND hwndParent;
355 HWND hwndFrame;
356 HWND hwndClient;
357 HWND hwndCnr;
358 LISTINFO *li;
359}
360WORKER;
361
362typedef struct
363{
364 USHORT size;
365 ULONG flags;
366 ULONG cmd;
367 USHORT dummy;
368 CHAR *prompt;
369 CHAR **list;
370}
371CHECKLIST;
372
373typedef struct
374{
375 ULONG flags;
376 CHAR *commandline;
377 CHAR path[CCHMAXPATH];
378 CHAR environment[1001];
379 CHAR tempprompt[128];
380 CHAR title[80];
381 BOOL dropped;
382}
383EXECARGS;
384
385#pragma pack(1)
386
387// Compare directory flags
388#define CNRITEM_SMALLER 0x00010000 // file exists in both containers and this one is smaller
389#define CNRITEM_LARGER 0x00020000
390#define CNRITEM_NEWER 0x00040000
391#define CNRITEM_OLDER 0x00080000
392#define CNRITEM_EXISTS 0x00100000 // file exists in both containers
393
394#define RECFLAGS_ENV 0x00000001
395#define RECFLAGS_NODRAG 0x00000002
396#define RECFLAGS_NODROP 0x00000004
397#define RECFLAGS_UNDERENV 0x00000008
398
399#define ARCFLAGS_REALDIR 0x00000001
400#define ARCFLAGS_PSEUDODIR 0x00000002
401
402typedef struct _ARCITEM
403{ // ARCHIVE CONTAINER RECORD STRUCTURE
404 MINIRECORDCORE rc; // Base information
405 HWND hwndCnr; /* Container holding this record */
406 PSZ pszFileName; // Points to full path name or NullStr
407 PSZ pszDisplayName; // Points to displayable part of path name - used by CFA_STRING
408 CHAR szDate[40]; // File's assembled date
409 PSZ pszDate; // Pointer to date
410 CDATE date; // if we know date format
411 CTIME time; // if we know time format
412 ULONGLONG cbFile; // File's original size
413 ULONGLONG cbComp; // File's compressed size
414 ULONG flags;
415}
416ARCITEM, *PARCITEM;
417
418#pragma pack()
419
420typedef struct
421{
422 USHORT size;
423 ARC_TYPE *info;
424 CHAR *arcname;
425 CHAR masks[257];
426 CHAR command[257];
427 CHAR extractdir[CCHMAXPATH];
428 INT ret;
429}
430EXTRDATA;
431
432/* strips.c */
433void strip_lead_char(char *pszStripChars, char *pszSrc);
434void strip_trail_char(char *pszStripChars, char *pszSrc);
435#define lstrip(s) strip_lead_char(" \t",(s))
436#define rstrip(s) strip_trail_char(" \t",(s))
437#define stripcr(s) strip_trail_char("\r\n",(s))
438// Strip leading and trailing white
439#define bstrip(s) (strip_lead_char(" \t",(s)),strip_trail_char(" \t",(s)))
440// Strip leading and trailing white and trail cr/nl
441#define bstripcr(s) (strip_lead_char(" \t",(s)),strip_trail_char("\r\n \t",(s)))
442
443/* init.c */
444BOOL InitFM3DLL(HAB hab, int argc, char **argv);
445
446/* valid.c */
447INT CheckDrive(CHAR Drive, CHAR * FileSystem, ULONG * type);
448BOOL IsRoot(CHAR * filename);
449INT IsFile(CHAR * filename);
450BOOL IsFullName(CHAR * filename);
451CHAR *MakeValidDir(CHAR * path);
452CHAR *assign_ignores(CHAR * s);
453BOOL needs_quoting(CHAR * f);
454BOOL TestBinary(CHAR * filename);
455BOOL ParentIsDesktop(HWND hwnd, HWND hwndParent);
456char *IsVowel(char a);
457char *RootName(char *filename);
458APIRET MakeFullName(char *filename);
459
460/* misc.c */
461BOOL IsFm2Window(HWND hwnd, BOOL chkTid);
462VOID SetShiftState(VOID);
463void DrawTargetEmphasis(HWND hwnd, BOOL on);
464VOID PaintRecessedWindow(HWND hwnd, HPS hps, BOOL outtie, BOOL dbl);
465VOID SetupCommandMenu(HWND hwndMenu, HWND hwndCnr);
466PMINIRECORDCORE CurrentRecord(HWND hwndCnr);
467BOOL PostMsg(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
468VOID PortholeInit(HWND hwndNew, MPARAM mp1, MPARAM mp2);
469HWND CheckMenu(HWND hwnd, HWND * hwndMenu, USHORT id);
470char *GetCmdSpec(BOOL dos);
471void Broadcast(HAB hab, HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
472void SetupWinList(HWND hwndMenu, HWND hwndTop, HWND hwndFrame);
473INT CheckDriveSpaceAvail(CHAR *pTargetPath, ULONGLONG ullSpaceNeeded,
474 ULONGLONG ullFreeSpaceWhenComplete);
475
476/* mainwnd.c */
477VOID GetNextWindowPos(HWND hwndClient, PSWP pswp, ULONG * ulCntR,
478 ULONG * ulNumMinChildrenR);
479VOID TileChildren(HWND hwndClient, BOOL absolute);
480
481#ifdef INCL_GPI
482VOID SetPresParams(HWND hwnd, RGB2 * back, RGB2 * fore, RGB2 * border,
483 CHAR * font);
484#endif
485VOID CopyPresParams(HWND target, HWND source);
486VOID PresParamChanged(HWND hwnd, CHAR * keyroot, MPARAM mp1, MPARAM mp2);
487VOID RestorePresParams(HWND hwnd, CHAR * keyroot);
488
489/* dirs.c */
490APIRET save_dir2(CHAR * curdir);
491APIRET save_dir(CHAR * curdir);
492
493/* delims.c */
494char *skip_delim(char *a, register char *delim);
495char *to_delim(char *a, register char *delim);
496
497/* copyf.c */
498APIRET docopyf(INT type, CHAR * oldname, CHAR * newname, ...);
499char *MakeTempName(char *buffer, char *temproot, int type);
500
501#define COPY 0
502#define MOVE 1
503#define WPSCOPY 2
504#define WPSMOVE 4
505INT unlinkf(CHAR * string, ...);
506INT wipeallf(CHAR * string, ...);
507CHAR *TruncName(CHAR * oldname, CHAR * buffer);
508CHAR *GetLongName(CHAR * oldname, CHAR * buffer);
509
510/* mkdir.c */
511APIRET SetDir(HWND hwndClient, HWND hwnd, CHAR * dir, INT flags);
512BOOL PMMkDir(HWND hwnd, CHAR * filename, BOOL copy);
513void SetTargetDir(HWND hwnd, BOOL justshow);
514
515/* srchpath.c */
516CHAR *first_path(CHAR * path, CHAR * ret);
517CHAR *searchapath(CHAR * path, CHAR * filename);
518CHAR *searchpath(CHAR * filename);
519
520/* literal.c */
521UINT literal(PSZ pszBuf);
522BOOL wildcard(const PSZ pszBuf, const PSZ pszWildCard,
523 const BOOL fNotFileSpec);
524
525/* stristr.c */
526CHAR *stristr(const CHAR * t, const CHAR * s);
527CHAR *strnistr(register CHAR * t, CHAR * s, LONG len);
528CHAR *strnstr(register CHAR * t, CHAR * s, LONG len);
529CHAR *findstring(CHAR * findthis, ULONG lenthis, CHAR * findin,
530 ULONG lenin, BOOL insensitive);
531
532/* systemf.c */
533INT ExecOnList(HWND hwnd, CHAR * command, INT flags, CHAR * tpath,
534 CHAR ** list, CHAR * prompt, PCSZ pszCallingFile, UINT uiLineNumber);
535INT runemf2(INT type, HWND hwnd, PCSZ pszCallingFile, UINT uiLineNumber,
536 CHAR * directory, CHAR * environment,
537 CHAR * formatstring, ...);
538
539#define RUNTYPE_MASK 0xf
540#define SYNCHRONOUS 1
541#define ASYNCHRONOUS 2
542#define DETACHED 3
543#define SEPARATE 4
544#define SEPARATEKEEP 5
545#define WINDOWED 16
546#define MAXIMIZED 32
547#define MINIMIZED 64
548#define FULLSCREEN 128
549#define INVISIBLE 256
550#define BACKGROUND 512
551#define WAIT 1024
552#define PROMPT 2048
553#define KEEP 4096
554#define ONCE 8192
555#define DIEAFTER 16384
556#define SEAMLESS 32768
557#define CHILD 65536
558
559/* chklist.c */
560VOID PosOverOkay(HWND hwnd);
561BOOL PopupMenu(HWND hwndParent, HWND hwndOwner, HWND hwndMenu);
562
563/* eas.c */
564HOLDFEA *GetFileEAs(CHAR * filename, BOOL ishandle, BOOL silentfail);
565MRESULT EXPENTRY DisplayEAsProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
566
567/* subj.c */
568INT Subject(HWND hwnd, CHAR * filename);
569
570/* getnames.c */
571BOOL insert_filename(HWND hwnd, CHAR * filename, INT loadit, BOOL newok);
572BOOL export_filename(HWND hwnd, CHAR * filename, INT overwrite);
573
574/* input.c */
575MRESULT EXPENTRY InputDlgProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
576
577/* select.c */
578VOID UnHilite(HWND hwndCnr, BOOL all, CHAR *** list, ULONG ulItemsToUnHilite);
579VOID Deselect(HWND hwndCnr);
580VOID MarkAll(HWND hwndCnr, BOOL quitit, BOOL target, BOOL source);
581VOID SetMask(CHAR * str, MASK * mask);
582
583/* viewer.c */
584HWND StartMLEEditor(HWND hwnd, INT flags, CHAR * filename, HWND hwndRestore);
585
586/* fonts.c */
587FATTRS *SetMLEFont(HWND hwndMLE, FATTRS * fattrs, ULONG flags);
588
589/* saveclip.c */
590CHAR **ListFromClipboard(HWND hwnd);
591CHAR **ListFromClipboardHab(HAB hab);
592
593/* filter.c */
594INT APIENTRY Filter(PMINIRECORDCORE rmini, PVOID arg);
595MRESULT EXPENTRY PickMaskDlgProc(HWND hwnd, ULONG msg, MPARAM mp1,
596 MPARAM mp2);
597
598/* archive.c */
599MRESULT EXPENTRY ArchiveDlgProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
600MRESULT EXPENTRY SBoxDlgProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
601
602/* walkem.c */
603MRESULT EXPENTRY WalkAllDlgProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
604
605/*draglist.c */
606HWND DoFileDrag(HWND hwndCnr, HWND hwndObj, PCNRDRAGINIT pcd, CHAR * arcfile,
607 CHAR * directory, BOOL moveok);
608
609/* droplist.c */
610void DropHelp(MPARAM mp1, MPARAM mp2, HWND hwnd, char *text);
611BOOL AcceptOneDrop(HWND hwnd, MPARAM mp1, MPARAM mp2);
612BOOL GetOneDrop(HWND hwnd, MPARAM mp1, MPARAM mp2, char *buffer, ULONG buflen);
613LISTINFO *DoFileDrop(HWND hwndCnr, CHAR * directory, BOOL arcfilesok,
614 MPARAM mp1, MPARAM mp2);
615VOID FreeDragInfoData (HWND hwnd, PDRAGINFO pDInfo);
616BOOL CheckPmDrgLimit(PDRAGINFO pDInfo);
617
618/* shadow.c */
619VOID OpenObject(CHAR * filename, CHAR * type, HWND hwnd);
620
621/* findrec.c */
622PCNRITEM FindCnrRecord(HWND hwndCnr, CHAR * filename, PCNRITEM pciParent,
623 BOOL partial, BOOL partmatch, BOOL noenv);
624
625#if defined(__IBMC__)
626/* fsopen.c */
627FILE *_fsopen(CHAR * filename, CHAR * mode, INT sharemode, ...);
628#endif
629
630/* collect.c */
631HWND StartCollector(HWND hwndParent, INT flags);
632
633/* undel.c */
634MRESULT EXPENTRY UndeleteDlgProc(HWND hwnd, ULONG msg, MPARAM mp1,
635 MPARAM mp2);
636
637/* killproc.c */
638CHAR *GetDosPgmName(PID pid, CHAR * string);
639
640/* notify.c */
641HWND Notify(char *text);
642
643/* commafmt.c */
644size_t commafmt(PSZ pszBuf, UINT cBufSize, LONG lNumber);
645size_t CommaFmtUL(char *pszBuf, UINT cBufSize, ULONG ullNumber,
646 CHAR chPreferred);
647size_t CommaFmtULL(char *pszBuf, UINT cBufSize, ULONGLONG ullNumber,
648 CHAR chPreferred);
649
650/* autoview.c */
651MRESULT EXPENTRY AttrListDlgProc(HWND hwnd, ULONG msg, MPARAM mp1,
652 MPARAM mp2);
653
654/* newview.c */
655HWND StartViewer(HWND hwndParent, USHORT flags, CHAR * filename,
656 HWND hwndRestore);
657
658/* defview.c */
659VOID DefaultViewKeys(HWND hwnd, HWND hwndFrame, HWND hwndParent,
660 SWP * swp, CHAR * filename);
661
662/* common.c */
663MRESULT EXPENTRY CommonTextProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
664MRESULT EXPENTRY CommonTextButton(HWND hwnd, ULONG msg, MPARAM mp1,
665 MPARAM mp2);
666HWND OpenDirCnr(HWND hwnd, HWND hwndParent, HWND hwndRestore,
667 BOOL noautotile, char *directory);
668VOID IncrThreadUsage(VOID);
669VOID DecrThreadUsage(VOID);
670
671/* wrappers.c */
672APIRET xDosFindFirst(PSZ pszFileSpec,
673 PHDIR phdir,
674 ULONG flAttribute,
675 PVOID pfindbuf,
676 ULONG cbBuf,
677 PULONG pcFileNames,
678 ULONG ulInfoLevel);
679APIRET xDosFindNext(HDIR hDir,
680 PVOID pfindbuf,
681 ULONG cbfindbuf,
682 PULONG pcFilenames,
683 ULONG ulInfoLevel); // 06 Oct 07 SHL Added
684APIRET xDosSetPathInfo(PSZ pszPathName,
685 ULONG ulInfoLevel,
686 PVOID pInfoBuf,
687 ULONG cbInfoBuf,
688 ULONG flOptions);
689PSZ xfgets(PSZ pszBuf, size_t cMaxBytes, FILE * fp, PCSZ pszSrcFile,
690 UINT uiLineNumber);
691PSZ xfgets_bstripcr(PSZ pszBuf, size_t cMaxBytes, FILE * fp, PCSZ pszSrcFile,
692 UINT uiLineNumber);
693FILE *xfopen(PCSZ pszFileName, PCSZ pszMode, PCSZ pszSrcFile,
694 UINT uiLineNumber);
695FILE *xfsopen(PCSZ pszFileName, PCSZ pszMode, INT fSharemode, PCSZ pszSrcFile,
696 UINT uiLineNumber);
697VOID xfree(PVOID pv, PCSZ pszSrcFile, UINT uiLineNumber);
698PVOID xmalloc(size_t cBytes, PCSZ pszSrcFile, UINT uiLineNumber);
699PVOID xmallocz(size_t cBytes, PCSZ pszSrcFile, UINT uiLineNumber);
700PVOID xrealloc(PVOID pvIn, size_t cBytes, PCSZ pszSrcFile, UINT uiLineNumber);
701PVOID xstrdup(PCSZ pszIn, PCSZ pszSrcFile, UINT uiLineNumber);
702
703//=====================================================================
704
705#ifdef DEFINE_GLOBALS
706#define DATADEF
707#else
708#define DATADEF extern
709#endif
710
711DATADEF ARC_TYPE *arcsighead;
712DATADEF BOOL arcsigsloaded;
713DATADEF BOOL arcsigsmodified;
714DATADEF UINT arcsigs_header_lines; // Header comments line count in archiver.bb2
715DATADEF UINT arcsigs_trailer_line_num; // Trailer comments start line number (1..n)
716
717DATADEF USHORT nodes, shiftstate;
718DATADEF HEV CompactSem;
719DATADEF HWND hwndMain, hwndTree, hwndStatus, hwndStatus2, hwndTrash,
720 hwndButtonlist, hwndDrivelist, hwndStatelist, hwndUserlist,
721 hwndAutoview, hwndAttr, hwndDate, hwndName, hwndBack,
722 hwndLED, hwndLEDHdr, hwndAutoMLE, hwndCmdlist;
723DATADEF HBITMAP hbmLEDon, hbmLEDoff;
724DATADEF CHAR ArcTempRoot[CCHMAXPATH], ThousandsSeparator[2], *pTmpDir, *pFM2SaveDirectory;
725DATADEF HPOINTER hptrArrow, hptrBusy, hptrLast, hptrDir, hptrFile, hptrRemote,
726 hptrFloppy, hptrDrive, hptrRemovable, hptrCDROM,hptrVirtual,hptrRamdisk,
727 hptrFinger, hptrApp, hptrDunno, hptrSystem, hptrHidden,
728 hptrReadonly, hptrNS, hptrZipstrm, hptrArc, hptrArt, hptrEW,
729 hptrCommon, hptrEnv;
730DATADEF PFNWP PFNWPCnr, PFNWPFrame, PFNWPButton, PFNWPStatic, PFNWPMLE;
731DATADEF BOOL fLoadSubject, fLoadLongnames, fForceUpper, fForceLower,
732 fSyncUpdates, fAutoTile, fDontMoveMouse, loadedudirs,
733 fUnHilite, fWorkPlace, fConfirmDelete, fToolbar,
734 fToolsChanged, MenuInvisible, fFreeTree, fFollowTree,
735 fNoIconsFiles, fNoIconsDirs, fVerify, fDCOpens,
736 fLinkSetsIcon, fSaveState, fTextTools, fCopyDefault,
737 fToolTitles, fLogFile, fRealIdle, fNoSaveState, fUseQSysState,
738 fSplitStatus, fArcStuffVisible, fUseMCI, fAmAV2,
739 fNoTreeGap, fDummy, fVTreeOpensWPS, fUseQProcStat,
740 fStartMinimized, fStartMaximized, fRemoteBug, fReminimize,
741 fDragndropDlg, fMinOnOpen, fUserComboBox,
742 fQuickArcFind, fNoRemovableScan, fAutoView, fDataMin,
743 fDataToFore, fDataShowDrives, fDataInclRemote,
744 fExternalArcboxes, fExternalViewer, fExternalCollector,
745 fExternalINIs, fDefaultDeletePerm, fIniExisted, fUseNewViewer,
746 fTileBackwards, fFolderAfterExtract, fUserListSwitches,
747 fGuessType, fAutoAddDirs, fUdirsChanged, fSelectedAlways,
748 fToolbarHelp, fComments, fMoreButtons, fNoSearch, fOtherHelp,
749 fKeepCmdLine, fAmClosing, fSeparateParms, fTopDir,
750 fLookInDir, fSwitchTree, fSwitchTreeOnFocus, fDrivebar,
751 fSwitchTreeExpand, fCollapseFirst, fFilesInTree, fNoDead,
752 fThreadNotes, fOkayMinimize, fRunning, fDullMin, fBlueLED,
753 fViewChild, fShowEnv, fLeaveTree, fNoFoldMenu,
754 fCustomFileDlg, fSaveMiniCmds, fSaveBigCmds, fNoTileUpdate,
755 fFM2Deletes, fAutoAddAllDirs, fConfirmTarget, fChangeTarget,
756 fFirstTime, fShowTarget, fNoFinger, fDrivebarHelp, fCheckMM,
757 fNoLargeFileSupport, fNoMailtoMailRun,
758 fHttpRunWPSDefault, fFtpRunWPSDefault, fLibPathStrictMailRun,
759 fLibPathStrictHttpRun, fLibPathStrictFtpRun, fCancelAction, fTrashCan;
760DATADEF DETAILS_SETTINGS dsDirCnrDefault;
761DATADEF PID mypid;
762DATADEF INT driveflags[26], driveserial[26];
763DATADEF ULONG NoBrokenNotify, fwsAnimate, OS2ver[2], DriveLines;
764DATADEF HINI fmprof;
765DATADEF HELPINIT hini;
766DATADEF HWND hwndHelp, LastDir, AboutBox, DirMenu, FileMenu, TreeMenu,
767 ArcMenu, DirCnrMenu, TreeCnrMenu, ArcCnrMenu,
768 CollectorCnrMenu, CollectorFileMenu, CollectorDirMenu,
769 Collector, MainPopupMenu, DataHwnd, AutoMenu, hwndBubble,
770 hwndToolback, MainObjectHwnd, hwndMainMenu;
771
772#ifdef DEFINE_GLOBALS
773#pragma data_seg(GLOBAL2)
774#endif
775
776DATADEF CHAR *FM3Str, *FM2Str, *NullStr, *Default, *Settings,
777 *DRM_OS2FILE, *DRM_FM2ARCMEMBER, *DRF_FM2ARCHIVE,
778 *DRMDRFLIST, *DRMDRFOS2FILE, *DRMDRFFM2ARC,
779 *DRM_FM2INIRECORD, *DRF_FM2INI, *SUBJECT, *LONGNAME,
780 *HPFS, *JFS, *CDFS, *FAT32, *HPFS386, *NDFS32, *CBSIFS, *ISOFS, *RAMFS, *NTFS,
781 *WPProgram, *FM3Folder, *FM3Tools;
782DATADEF RGB2 RGBGREY, RGBBLACK;
783DATADEF CHAR archiverbb2[CCHMAXPATH], StopPrinting, profile[CCHMAXPATH], extractpath[CCHMAXPATH],
784 lastextractpath[CCHMAXPATH];
785DATADEF CHAR appname[12], realappname[12];
786DATADEF CHAR lasttoolbar[CCHMAXPATH], HomePath[CCHMAXPATH],
787 SwapperDat[CCHMAXPATH], printer[CCHMAXPATH], szDefArc[CCHMAXPATH];
788DATADEF HMODULE FM3DllHandle, FM3ModHandle;
789DATADEF CHAR *quicktool[50];
790DATADEF BOOL qtloaded;
791DATADEF INT sortFlags, TreesortFlags, CollectorsortFlags;
792DATADEF INT butxsize, butysize;
793DATADEF FILE *LogFileHandle;
794
795#define FILESTOGET_MIN 256
796#define FILESTOGET_MAX 4096
797
798DATADEF ULONG ulCnrType, FilesToGet, AutoviewHeight, TreeWidth, FM3UL;
799DATADEF ULONGLONG ullTmpSpaceNeeded, ullDATFileSpaceNeeded;
800DATADEF long prnwidth, prnlength, prntmargin, prnbmargin, prnlmargin,
801 prnrmargin, prnspacing, prntabspaces;
802DATADEF BOOL prnpagenums, prnformat, prnformfeedbefore, prnformfeedafter,
803 prnalt;
804DATADEF LINKDIRS *udirhead, *ldirhead;
805DATADEF LINKCMDS *cmdhead, *cmdtail;
806DATADEF BOOL cmdloaded;
807DATADEF CHAR *WC_OBJECTWINDOW, *WC_BUBBLE, *WC_TOOLBUTTONS, *WC_DRIVEBUTTONS, *WC_DIRCONTAINER,
808 *WC_DIRSTATUS, *WC_TREECONTAINER, *WC_TREEOPENBUTTON, *WC_TREESTATUS, *WC_MAINWND,
809 *WC_MAINWND2, *WC_AUTOVIEW, *WC_LED, *WC_COLLECTOR, *WC_COLSTATUS, *WC_STATUS, *WC_TOOLBACK,
810 *WC_DRIVEBACK, *WC_ARCCONTAINER, *WC_ARCSTATUS, *WC_MLEEDITOR, *WC_INIEDITOR, *WC_SEEALL,
811 *WC_NEWVIEW, *WC_SEESTATUS, *WC_VIEWSTATUS, *WC_ERRORWND, *WC_MINITIME, *WC_DATABAR;
812
813#ifdef DEFINE_GLOBALS
814#pragma data_seg(GLOBAL3)
815#endif
816
817DATADEF BOOL fWantFirstTimeInit;
818DATADEF LONG standardcolors[16];
819
820#ifdef INCL_MMIOOS2
821#pragma pack(4)
822/* definitions for MMPM/2 imports */
823typedef DWORD(APIENTRY MMIOIDENTIFYFILE) (PSZ, PMMIOINFO, PMMFORMATINFO,
824 PFOURCC, DWORD, DWORD);
825typedef MMIOIDENTIFYFILE *PMMIOIDENTIFYFILE;
826typedef DWORD(APIENTRY MMIOOPEN)( PSZ, PMMIOINFO, DWORD);
827typedef MMIOOPEN *PMMIOOPEN;
828typedef WORD (APIENTRY MMIOGETINFO)( HMMIO, PMMIOINFO, WORD);
829typedef MMIOGETINFO *PMMIOGETINFO;
830typedef WORD (APIENTRY MMIOCLOSE)( HMMIO, WORD);
831typedef MMIOCLOSE *PMMIOCLOSE;
832
833#pragma pack()
834#endif
835
836#ifdef DEFINE_GLOBALS
837#pragma data_seg(GLOBAL4)
838#endif
839
840DATADEF HSWITCH switches[499];
841DATADEF ULONG numswitches;
842
843#define priority_idle() DosSetPriority(PRTYS_THREAD,PRTYC_IDLETIME,30L,0L)
844#define priority_normal() DosSetPriority(PRTYS_THREAD,PRTYC_REGULAR,0L,0L)
845#define priority_tweaked() DosSetPriority(PRTYS_THREAD,PRTYC_REGULAR,1L,0L)
846#define priority_bumped() DosSetPriority(PRTYS_THREAD,PRTYC_REGULAR,3L,0L)
847#define priority_critical() DosSetPriority(PRTYS_THREAD,PRTYC_FOREGROUNDSERVER,2L,0L)
848#define priority_max() DosSetPriority(PRTYS_THREAD,PRTYC_FOREGROUNDSERVER,31L,0L)
849#define SysVal(value) WinQuerySysValue(HWND_DESKTOP, (value))
850
851#endif // FM3DLL_H
Note: See TracBrowser for help on using the repository browser.