struct mytimeval tv;
};
-#define ArchiveFormat7Zip '7z '
-#define ArchiveFormatRAR 'rar '
-#define ArchiveFormatZIP 'zip '
-#define ArchiveFormatLHA 'lha '
-#define ArchiveFormatLZX 'lzx '
-#define ArchiveFormatPLAIN '----'
-#define ArchiveFormatDIR 'DIR '
-#define ArchiveFormatAA 'aa ' // method only
-#define ArchiveFormatADF 'DOS '
-#define ArchiveFormatRDB 'RDSK'
-#define ArchiveFormatMBR 'MBR '
-#define ArchiveFormatFAT 'FAT '
-#define ArchiveFormatTAR 'tar '
+#define MCC(a,b,c,d) (((a)<<24) | ((b)<<16) | ((c)<<8) | (d))
+
+#define ArchiveFormat7Zip MCC('7', 'z', ' ', ' ')
+#define ArchiveFormatRAR MCC('r', 'a', 'r', ' ')
+#define ArchiveFormatZIP MCC('z', 'i', 'p', ' ')
+#define ArchiveFormatLHA MCC('l', 'h', 'a', ' ')
+#define ArchiveFormatLZX MCC('l', 'z', 'x', ' ')
+#define ArchiveFormatPLAIN MCC('-', '-', '-', '-')
+#define ArchiveFormatDIR MCC('D', 'I', 'R', ' ')
+#define ArchiveFormatAA MCC('a', 'a', ' ', ' ') // method only
+#define ArchiveFormatADF MCC('D', 'O', 'S', ' ')
+#define ArchiveFormatRDB MCC('R', 'D', 'S', 'K')
+#define ArchiveFormatMBR MCC('M', 'B', 'R', ' ')
+#define ArchiveFormatFAT MCC('F', 'A', 'T', ' ')
+#define ArchiveFormatTAR MCC('t', 'a', 'r', ' ')
#define PEEK_BYTES 1024
#define FILE_PEEK 1
#define unpack_log write_log
#undef unpack_log
-#define unpack_log
+#define unpack_log(fmt, ...)
static time_t fromdostime (uae_u32 dd)
static const int secs_per_day = 24 * 60 * 60;
static const int diff = (8 * 365 + 2) * (24 * 60 * 60);
static const int diff2 = (-8 * 365 - 2) * (24 * 60 * 60);
+
static time_t put_time (long days, long mins, long ticks)
{
time_t t;
struct zvolume *zv = zn->volume;
struct adfhandle *adf = (struct adfhandle*)zv->handle;
TCHAR name2[MAX_DPATH];
- int bs = adf->blocksize;
int block;
uae_u8 *p, *s;
struct zarchive_info zai;
goto fail;
adf->dostype = gl (adf, 0);
- if ((adf->dostype & 0xffffff00) == 'DOS\0') {
+ if ((adf->dostype & 0xffffff00) == MCC('D', 'O', 'S', '\0')) {
int bs = adf->blocksize;
int res;
name[0] = 0;
recurseadf (&zv->root, adf->rootblock, name);
- } else if ((adf->dostype & 0xffffff00) == 'SFS\0') {
+ } else if ((adf->dostype & 0xffffff00) == MCC('S', 'F', 'S', '\0')) {
uae_u16 version, sfs2;
adf->rootblock = gl (adf, 104);
if (!adf_read_block (adf, adf->rootblock))
break;
- if (gl (adf, 0) != 'OBJC')
+ if (gl (adf, 0) != MCC('O', 'B', 'J', 'C'))
break;
if (sfs_checksum (adf->block, adf->blocksize, sfs2))
break;
adf->rootblock = gl (adf, 40);
if (!adf_read_block (adf, adf->rootblock))
break;
- if (gl (adf, 0) != 'OBJC')
+ if (gl (adf, 0) != MCC('O', 'B', 'J', 'C'))
break;
if (sfs_checksum (adf->block, adf->blocksize, sfs2))
break;
if (!z)
return NULL;
- if ((adf->dostype & 0xffffff00) == 'DOS\0') {
+ if ((adf->dostype & 0xffffff00) == MCC('D', 'O', 'S', '\0')) {
ffs = adf->dostype & 1;
root = zn->offset;
break;
root = gl (adf, bs - 2 * 4);
}
- } else if ((adf->dostype & 0xffffff00) == 'SFS\0') {
+ } else if ((adf->dostype & 0xffffff00) == MCC('S', 'F', 'S', '\0')) {
struct sfsblock *sfsblocks;
int sfsblockcnt, sfsmaxblockcnt, i;
zfile_fseek (z, 0, SEEK_SET);
p = buf;
zfile_fread (buf, 1, 512, z);
- zai.name = _T("rdb_dump.dat");
+ zai.name = my_strdup(_T("rdb_dump.dat"));
bs = rl (p + 16);
zai.size = rl (p + 140) * bs;
zai.comment = NULL;
return fat;
}
-static void fatdirectory (struct zfile *z, struct zvolume *zv, TCHAR *name, int startblock, int entries, int sectorspercluster, int fatstart, int dataregion, int fatbits)
+static void fatdirectory (struct zfile *z, struct zvolume *zv, const TCHAR *name, int startblock, int entries, int sectorspercluster, int fatstart, int dataregion, int fatbits)
{
struct zarchive_info zai;
struct znode *znnew;