2 /*---------------------------------------------------------
4 /*- RESTORE Utility include file RT1.H
6 /*---------------------------------------------------------*/
8 /****************************************************************************/
9 /* This file contains equates for structure definitions used in RESTORE */
11 /****************************************************************************/
13 /***************************************************************************/
14 /* dheadnew - structure of disk header in CONTROL.xxx, */
15 /* used for new format only */
16 /***************************************************************************/
17 struct disk_header_new
19 BYTE dhlength; /* length, in byte , of disk header*/
20 BYTE id[8]; /* identifies disk as a backup */
21 BYTE sequence; /* backup diskette sequence num */
23 BYTE command[128]; /* save area for command line */
25 BYTE lastdisk; /* 0ffh if last targert 0 otherwise*/
29 /***************************************************************************/
30 /* dirblk - structure of directory blocks in CONTROL.xxx, */
31 /* used for new format only */
32 /***************************************************************************/
35 BYTE dblength; /* length, in bytes, of dir block */
37 /* ascii path of this directory, */
38 /* drive letter omitted */
39 WORD numentry; /* num of filenames currently in list*/
40 DWORD nextdb; /* offset of next directory block */
41 }; /* =0xffff if last dir block */
44 /***************************************************************************/
45 /* fheadnew - structure of file header in CONTROL.xxx, */
46 /* used for new format only */
47 /***************************************************************************/
48 #define EXT_ATTR_FLAG 4 /*;AN000;3*/
50 struct file_header_new
52 BYTE fhlength; /* Length, in bytes, of file header */
53 BYTE fname[12]; /* ASCII file name (from directory)*/
54 BYTE flag; /* bit 0=1 if last part of file */
55 /* bit 1=1 if it is backed up successfully */
56 /* ;AN000;3 bit 2=1 if Extended Attributes are backed up (New for DOS4.00) */
57 DWORD flength; /* Total length of the file (from directory) */
58 WORD fsequenc; /* Sequence #, for files that span */
59 DWORD offset; /* Offset in BACKUP.xxx where this segment begins */
60 DWORD partsize; /* Length of part of file on current target */
61 WORD attrib; /* File attribute (from directory) */
62 WORD ftime; /* Time when file was last Revised (from directory)*/
63 WORD fdate; /* Date when file was last Revised (from directory)*/
64 DWORD FH_EA_offset; /*;AN000;3 Offset in BACKUP.xxx where extended attrib begin */
67 /*----------------------------------*/
68 /*- EXTENDED OPEN PARAMETER LIST -*/
69 /*----------------------------------*/
70 #define EXTATTBUFLEN 4086 /*;AN000;3*/
71 struct parm_list /*;AN000;3*/
73 DWORD ext_attr_addr; /*;AN000;3*/
74 WORD num_additional; /*;AN000;3*/
86 /**************************************************************************/
87 /* Fheadold - structure of file header, used for old format only. */
88 /* There are 128 bytes totally in file header of the old */
89 /* format backup disk. Only the first 85 bytes contains */
90 /* meaningful information. */
91 /* This is the structure attached to the beginning of every */
92 /* file backed up with DOS 2.0 through 3.2 inclusive. */
93 /**************************************************************************/
94 struct file_header_old
96 BYTE headflg; /* 0FFh is last sequence of file, 00h if not last*/
97 BYTE disknum[2]; /* file sequence number */
98 BYTE fill1[2]; /* not used */
99 BYTE wherefrom [78]; /* asciiz path and name without drive letter*/
100 unsigned pathlen; /* length of previous field, not used in this program*/
101 char garbage[50]; /* Filler */
107 /***************************************************************************/
108 /* dheadold - structure of disk informtion, used by old format only. */
109 /* There are 128 bytes totally in disk header of the old */
110 /* format backup disk. Only the first 7 bytes contains */
111 /* meaningful information. */
112 /* This is the BACKUPID.@@@ file */
113 /***************************************************************************/
115 struct disk_header_old
117 BYTE diskflag; /* 0FFh if last disk, 00h if not last disk. */
118 /* initialize it to 0FFh when BACKUP.@@@ is created,*/
119 /* and zero it out when the disk is full */
120 BYTE disknum[2]; /* Sequence number of the disk. Least significant*/
122 BYTE diskyear[2]; /* Year, LSB first. */
123 BYTE diskday; /* Month (1 byte) and day (1 byte). */
124 BYTE diskmonth; /* Month (1 byte) and day (1 byte). */
128 /***************************************************************************/
129 /* timedate- structure of buffer to hold time and date data */
130 /***************************************************************************/
132 unsigned int earlier_hour;
133 unsigned int earlier_minute;
134 unsigned int earlier_second;
135 unsigned int later_hour;
136 unsigned int later_minute;
137 unsigned int later_second;
138 unsigned int before_year;
139 unsigned int before_month;
140 unsigned int before_day;
141 unsigned int after_year;
142 unsigned int after_month;
143 unsigned int after_day;
145 /***************************************************************************/
146 /* fsinfo - structure of buffer returned from dosqsinfo */
147 /***************************************************************************/
148 struct fsinfo { /* file system information */
149 unsigned long file_system_id; /* file system ID 4 */
150 unsigned long sectors_per_alloc_unit; /* sectors per allocation unit 4 */
151 unsigned long number_of_alloc_unit; /* number of allocation unit 4 */
152 unsigned long available_alloc_unit; /* available allocatuib unit 4 */
153 unsigned bytes_per_sector; /* number of bytes per sectors 2 */
154 }; /* total byte size = 18 */
156 #define FSINFO_BYTES sizeof(struct fsinfo) /* total # of bytes for BPB */
158 /***************************************************************************/
159 /* internat - structure of buffer returned from get country information */
160 /***************************************************************************/
162 unsigned country_code; /* country code */
163 unsigned code_page; /* country code page */
164 unsigned dtformat; /* time date format */
165 /* 0-usa 1-eur 2-jap */
166 BYTE currency_sym, /* Currency Symbol 5 bytes */
170 BYTE r4; /* null terminated */
171 BYTE thous_sep, /* Thousands separator 2 bytes */
172 r5; /* null terminated */
173 BYTE decimal_sep, /* Decimal separator 2 bytes */
174 r6; /* null terminated */
175 BYTE datesep, /* Date separator 2 bytes */
176 r7; /* null terminated */
177 BYTE timesep, /* Time separator 2 bytes */
178 r8; /* null terminated */
179 BYTE bit_field; /* Bit values */
180 /* Bit 0 = 0 if currency symbol first */
181 /* = 1 if currency symbol last */
182 /* Bit 1= 0 if No space after currency symbol*/
183 /* = 1 if space after currency symbol */
184 BYTE currency_cents; /* Number of places after currency dec point*/
185 BYTE tformat; /* 1 if 24 hour time, 0 if 12 hour time */
186 unsigned long map_call; /* Address of case mapping call (DWORD) */
187 /* in real mode compatibility API */
188 BYTE data_sep, /* Data list separator character */
189 r9; /* null terminated */
190 unsigned ra[ 5 ]; /* reserved */
194 /***************************************************************************/
195 /* Finfo - structure of file information, used for both old format and */
196 /* new format. It contains the information which is common */
197 /* between new and old. */
198 /***************************************************************************/
201 BYTE fname[MAXFSPEC+1]; /* ASCII, filename and file extension.*/
202 BYTE path[MAXPATH+1]; /* ASCII, file path, always started with \ */
203 /* and not end with \ */
204 BYTE fflag; /* last disk in case of file expanded */
205 /* bit 0 = 1 if last part of file */
206 /* In old format file header, its 0ffh if last. */
207 /* The old format has to be converted into bit0=1.*/
208 unsigned dnum; /* sequence number of the file. For file that span */
209 unsigned attrib; /* file attribute */
210 unsigned ftime; /* time when the file was created */
211 unsigned fdate; /* date when the file was created */
212 unsigned long partsize; /* part size of the file */
213 unsigned long offset; /* offset of the file in backup.xxx */
214 BYTE curdir[MAXPATH]; /* current directory of the destination disk.*/
215 /* The current directory usually is maintained to be*/
216 /* the directory that reside the file to be restored*/
217 DWORD ea_offset; /*;AN000;3 Offset in BACKUP.xxx where extended attrib begin */
220 /****************************************************************************/
221 /* dfinfo - destination file information, if the destination file */
222 /* is exist. Structure of file information, used for both old */
223 /* format and new format. It contains the information which is*/
224 /* common between new and old. */
225 /****************************************************************************/
227 BYTE fname[12]; /* ASCII, filename and file extension.*/
228 BYTE path[64]; /* ASCII, file path, always started with \ and */
230 BYTE fflag; /* last disk in case of file expanded */
231 /* bit 0 = 1 if last part of file */
232 /* In old format file header, its 0ffh if last. */
233 /* The old format has to be converted into bit0=1.*/
234 unsigned short dnum; /* sequence number of the file. For file that span */
235 unsigned attrib; /* file attribute */
236 unsigned ftime; /* time when the file was created */
237 unsigned fdate; /* date when the file was created */
238 BYTE *curdir; /* current directory of the destination disk. */
239 /* The current directory usually is maintained to be */
240 /* the directory that reside the file to be restored */
243 /***************************************************************************/
244 /* dinfo - structure of disk information, used for both old format and */
245 /* new format. It contains the information which is common */
246 /* between new and old. */
247 /***************************************************************************/
249 BYTE dflag; /* last backup disk or not */
250 /* Its 0ffh if last. 00h otherwise */
251 BYTE disknum; /* sequence number of the file. For file that span */
253 struct subst_list /*;AN000;6 */
255 BYTE sl_size1; /* Size of List */ /*;AN000;6 */
256 BYTE zero1; /* Reserved */ /*;AN000;6 */
257 char far *value1; /* Time, date, or ptr to data item*/ /*;AN000;6 */
258 BYTE one; /* n of %n */ /*;AN000;6 */
259 BYTE flags1; /* Data Type flags */ /*;AN000;6 */
260 BYTE max_width1; /* Maximum FIELD width */ /*;AN000;6 */
261 BYTE min_width1; /* Minimum FIELD width */ /*;AN000;6 */
262 BYTE pad_char1; /* Character for pad FIELD */ /*;AN000;6 */
264 BYTE sl_size2; /* Size of List */ /*;AN000;6 */
265 BYTE zero2; /* Reserved */ /*;AN000;6 */
266 char far *value2; /* Time; date; or ptr to data item*/ /*;AN000;6 */
267 BYTE two; /* n of %n */ /*;AN000;6 */
268 BYTE flags2; /* Data Type flags */ /*;AN000;6 */
269 BYTE max_width2; /* Maximum FIELD width */ /*;AN000;6 */
270 BYTE min_width2; /* Minimum FIELD width */ /*;AN000;6 */
271 BYTE pad_char2; /* Character for pad FIELD */ /*;AN000;6 */