| 1 |  | 
|---|
| 2 | /*********************************************************************** | 
|---|
| 3 |  | 
|---|
| 4 | $Id: dircnrs.h 1891 2020-01-31 02:47:37Z stevenhl $ | 
|---|
| 5 |  | 
|---|
| 6 | dircnrs common definitions | 
|---|
| 7 |  | 
|---|
| 8 | Copyright (c) 1993-1998 M. Kimes | 
|---|
| 9 | Copyright (c) 2001-2020 Steven H. Levine | 
|---|
| 10 |  | 
|---|
| 11 | 05 Jan 08 SHL Move dircnrs.c definitions here | 
|---|
| 12 | 13 Jan 08 GKY Add variables to DIRCNRDATA struct for Subjectwidth/Subjectleft. | 
|---|
| 13 | 11 Jul 08 JBS Ticket 230: Simplified code and eliminated some local variables by incorporating | 
|---|
| 14 | all the details view settings (both the global variables and those in the | 
|---|
| 15 | DIRCNRDATA struct) into a new struct: DETAILS_SETTINGS. | 
|---|
| 16 | 17 Jan 10 GKY Changes to get working with Watcom 1.9 Beta (1/16/10). Mostly cast CHAR CONSTANT * as CHAR *. | 
|---|
| 17 | 20 Sep 15 GKY Add a flag to indicate when a directory needed to be Fleshed and a PCNRITEM | 
|---|
| 18 | previous to try to keep the pci chain intact on renames, delete etc to PCNRITEM | 
|---|
| 19 | 29 Jan 20 SHL Get rid of unused pciPrevious | 
|---|
| 20 |  | 
|---|
| 21 | ***********************************************************************/ | 
|---|
| 22 |  | 
|---|
| 23 | #if !defined(DIRCNRS_H) | 
|---|
| 24 |  | 
|---|
| 25 | #define DIRCNRS_H | 
|---|
| 26 |  | 
|---|
| 27 | #if !defined(OS2_INCLUDED) | 
|---|
| 28 | #define INCL_WINSTDCNR                  // avl.h | 
|---|
| 29 | #define INCL_LONGLONG | 
|---|
| 30 | #include <os2.h> | 
|---|
| 31 | #else | 
|---|
| 32 | #if !defined(INCL_WINSTDCNR) | 
|---|
| 33 | #error INCL_WINSTDCNR required by dircnrs.h | 
|---|
| 34 | #endif | 
|---|
| 35 | #if !defined(INCL_LONGLONG) | 
|---|
| 36 | #error INCL_LONGLONG required | 
|---|
| 37 | #endif | 
|---|
| 38 | #endif | 
|---|
| 39 |  | 
|---|
| 40 | #include "avl.h"                        // ARC_TYPE | 
|---|
| 41 |  | 
|---|
| 42 | #define CBLIST_TO_EASIZE(cb) ((cb) > 4 ? (cb) / 2 : 0)  // FILEFINDBUF4L.cbList to logical EA size | 
|---|
| 43 |  | 
|---|
| 44 | typedef struct _CNRITEM | 
|---|
| 45 | {                               /* CONTAINER RECORD STRUCTURE must be first*/ | 
|---|
| 46 | MINIRECORDCORE rc;            /* Base information */ | 
|---|
| 47 | HWND hwndCnr;                 /* The container holding this record */ | 
|---|
| 48 | PSZ pszFileName;              // Points to buffer holding full pathname or NullStr | 
|---|
| 49 | PSZ pszDisplayName;           // Points to displayable part of path name  - used by CFA_STRING | 
|---|
| 50 | CHAR *pszSubject;             // Points subject buffer or Nullstr - used by fm/2 and by CFA_STRING | 
|---|
| 51 | CHAR *pszDispAttr;            // Points to szDispAttr - required by CFA_STRING | 
|---|
| 52 | CDATE date;                   /* Last write date of file */ | 
|---|
| 53 | CTIME time;                   /* Last write time of file */ | 
|---|
| 54 | CDATE ladate;                 /* Last access date of file */ | 
|---|
| 55 | CTIME latime;                 /* Last access time of file */ | 
|---|
| 56 | CDATE crdate;                 /* Creation date of file */ | 
|---|
| 57 | CTIME crtime;                 /* Creation time of file */ | 
|---|
| 58 | CHAR *pszLongName;            // Points to long name buffer - used by code and by CFA_STRING | 
|---|
| 59 | CHAR *pszFmtFileSize;         // Comma formatted file size for large file support | 
|---|
| 60 | ULONGLONG cbFile;             /* File size */ | 
|---|
| 61 | ULONGLONG easize;             // Size of EAs - dirsize uses this - hack cough | 
|---|
| 62 | ULONG attrFile;               /* Attributes of this file */ | 
|---|
| 63 | ULONG flags; | 
|---|
| 64 | BOOL fleshed; | 
|---|
| 65 | } | 
|---|
| 66 | CNRITEM, *PCNRITEM; | 
|---|
| 67 |  | 
|---|
| 68 | // Compare directory flags | 
|---|
| 69 | #define CNRITEM_SMALLER   0x00010000    // file exists in both containers and this one is smaller | 
|---|
| 70 | #define CNRITEM_LARGER    0x00020000 | 
|---|
| 71 | #define CNRITEM_NEWER     0x00040000 | 
|---|
| 72 | #define CNRITEM_OLDER     0x00080000 | 
|---|
| 73 | #define CNRITEM_EXISTS    0x00100000    // file exists in both containers | 
|---|
| 74 | #define CNRITEM_EASDIFFER 0x00200000    // file EAs are different | 
|---|
| 75 |  | 
|---|
| 76 | #define EXTRA_RECORD_BYTES      (sizeof(CNRITEM) - sizeof(MINIRECORDCORE)) | 
|---|
| 77 |  | 
|---|
| 78 | typedef struct | 
|---|
| 79 | { | 
|---|
| 80 | CHAR szMask[CCHMAXPATH]; | 
|---|
| 81 | CHAR szMaskCopy[CCHMAXPATH]; | 
|---|
| 82 | CHAR *pszMasks[26]; | 
|---|
| 83 | ULONG attrFile; | 
|---|
| 84 | ULONG antiattr; | 
|---|
| 85 | BOOL fNoAttribs; | 
|---|
| 86 | BOOL fShowDirs; | 
|---|
| 87 | BOOL fNoDirs; | 
|---|
| 88 | BOOL fIsTree; | 
|---|
| 89 | BOOL fIsSeeAll; | 
|---|
| 90 | BOOL fFilesIncluded; | 
|---|
| 91 | BOOL fText; | 
|---|
| 92 | CHAR szText[256]; | 
|---|
| 93 | CHAR prompt[80]; | 
|---|
| 94 | } | 
|---|
| 95 | MASK; | 
|---|
| 96 |  | 
|---|
| 97 | typedef struct DETAILS_SETTINGS | 
|---|
| 98 | { | 
|---|
| 99 | BOOL detailsladate, detailslatime, detailscrdate, detailscrtime, | 
|---|
| 100 | detailslongname, detailsea, detailssize, detailssubject, | 
|---|
| 101 | detailslwdate, detailslwtime, detailsattr, detailsicon, | 
|---|
| 102 | fSubjectInLeftPane, fSubjectLengthMax; | 
|---|
| 103 | ULONG SubjectDisplayWidth; | 
|---|
| 104 | } | 
|---|
| 105 | DETAILS_SETTINGS; | 
|---|
| 106 |  | 
|---|
| 107 | typedef struct DIRCNRDATA | 
|---|
| 108 | { | 
|---|
| 109 | USHORT size; | 
|---|
| 110 | USHORT id; | 
|---|
| 111 | INT type; | 
|---|
| 112 | ULONG flWindowAttr; | 
|---|
| 113 | HWND hwndParent; | 
|---|
| 114 | HWND hwndCnr; | 
|---|
| 115 | HWND hwndObject; | 
|---|
| 116 | HWND hwndFrame; | 
|---|
| 117 | HWND hwndClient; | 
|---|
| 118 | HWND hwndLastMenu; | 
|---|
| 119 | HWND hwndExtract; | 
|---|
| 120 | HWND hwndLastDirCnr; | 
|---|
| 121 | HWND hwndRestore; | 
|---|
| 122 | CHAR directory[CCHMAXPATH]; | 
|---|
| 123 | CHAR previous[CCHMAXPATH]; | 
|---|
| 124 | ULONG fg, bg, hifg, hibg, border; | 
|---|
| 125 | PFNWP oldproc; | 
|---|
| 126 | CHAR font[CCHMAXPATH]; | 
|---|
| 127 | MASK mask; | 
|---|
| 128 | ULONGLONG ullTotalBytes; | 
|---|
| 129 | ULONGLONG selectedbytes; | 
|---|
| 130 | ULONG selectedfiles; | 
|---|
| 131 | ULONG totalfiles; | 
|---|
| 132 | BOOL cnremphasized; | 
|---|
| 133 | BOOL dontclose; | 
|---|
| 134 | ARC_TYPE *info; | 
|---|
| 135 | CHAR arcname[CCHMAXPATH]; | 
|---|
| 136 | CHAR command[257]; | 
|---|
| 137 | CHAR stopflag; | 
|---|
| 138 | CHAR workdir[CCHMAXPATH]; | 
|---|
| 139 | CHAR lastfilename[CCHMAXPATH]; | 
|---|
| 140 | BOOL namecanchange; | 
|---|
| 141 | BOOL fmoving; | 
|---|
| 142 | BOOL amextracted; | 
|---|
| 143 | INT lasthelp; | 
|---|
| 144 | INT sortFlags; | 
|---|
| 145 | DETAILS_SETTINGS ds; | 
|---|
| 146 | CHAR **lastselection; | 
|---|
| 147 | USHORT shiftstate; | 
|---|
| 148 | USHORT suspendview; | 
|---|
| 149 | CHAR szCommonName[CCHMAXPATH]; | 
|---|
| 150 | ULONG lasttime; | 
|---|
| 151 | BOOL arcfilled; | 
|---|
| 152 | HMTX filling; | 
|---|
| 153 | BOOL firsttree; | 
|---|
| 154 | ULONG lastattr; | 
|---|
| 155 | ULONG ulItemsToUnHilite; | 
|---|
| 156 | } | 
|---|
| 157 | DIRCNRDATA; | 
|---|
| 158 |  | 
|---|
| 159 | MRESULT EXPENTRY DirClientWndProc(HWND hwnd, ULONG msg, MPARAM mp1, | 
|---|
| 160 | MPARAM mp2); | 
|---|
| 161 | HWND StartDirCnr(HWND hwndParent, CHAR * directory, HWND hwndRestore, | 
|---|
| 162 | ULONG flags); | 
|---|
| 163 | MRESULT EXPENTRY DirTextProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2); | 
|---|
| 164 | MRESULT EXPENTRY DirFolderProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2); | 
|---|
| 165 | MRESULT EXPENTRY DirMaxProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2); | 
|---|
| 166 | MRESULT EXPENTRY DirObjWndProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2); | 
|---|
| 167 |  | 
|---|
| 168 | MRESULT EXPENTRY SearchContainer(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2); | 
|---|
| 169 |  | 
|---|
| 170 | // 05 Jan 08 SHL FIXME for dircnrs.c globals to be here | 
|---|
| 171 |  | 
|---|
| 172 | #ifdef DEFINE_GLOBALS | 
|---|
| 173 | #define DATADEF | 
|---|
| 174 | #pragma data_seg(GLOBAL1) | 
|---|
| 175 | #else | 
|---|
| 176 | #define DATADEF extern | 
|---|
| 177 | #endif | 
|---|
| 178 |  | 
|---|
| 179 | // Data declarations | 
|---|
| 180 | extern HWND DirCnrMenu; | 
|---|
| 181 | extern HWND hwndAttr; | 
|---|
| 182 | extern HWND hwndDate; | 
|---|
| 183 | extern INT sortFlags; | 
|---|
| 184 |  | 
|---|
| 185 | #endif // DIRCNRS_H | 
|---|