#ifndef __MSSTAT__ #define __MSSTAT__ /* * MSSTAT.H MS-DOS file status structure * * Conceptually similar to the Unix STAT structure, but not compatible at * the field level. This structure contains basically the same information * as the MS-DOS directory entry, but expressed in the host's formats. * For example, pMSFDE->size is little-endian, but msstat.size is in the * host's native format for a long integer. * * See MSFIO.TXT for additional documentation * * Copyright (c) 1991 Shal Farley * Cheshire Engineering Corporation * 650 Sierra Madre Villa Avenue, Suite 201 * Pasadena, California 91107 * (818) 351-5493 * (818) 351-8645 FAX * shal@alumni.caltech.edu * * This software may be used and distributed for any purpose without license or * royalty payments so long as the above copyright notice is preserved. If you * have any comments, bug fixes, improvements, or new programs based upon this * software I'd like to hear from you. */ typedef struct { long size; /* File size (little endian) */ UCHAR *pDEV; /* Reserved */ int di; /* Reserved */ USHORT attrib; /* Reserved */ USHORT time; /* File update (or creation) time */ USHORT date; /* File update (or creation) date */ USHORT cluster; /* Starting cluster number */ char name[MSFILENAME_MAX+1]; /* File name, as a string */ char wname[MSFILENAME_MAX+1]; /* Reserved */ UCHAR stat; /* Entry Status byte */ #define MSS_RONLY (0x01) /* Read-Only file */ #define MSS_HIDDEN (0x02) /* Hidden file */ #define MSS_SYSTEM (0x04) /* System file */ #define MSS_ROOT (0x08) /* Root directory entry w/ volume label */ #define MSS_DIR (0x10) /* Entry containing a subdirectory */ #define MSS_DIRTY (0x20) /* Dirty (aka "archive") */ } MSSTAT; #define SECOND(time) ((time) << 1 & 0x3e) /* Second (from 30ths) */ #define MINUTE(time) ((time) >> 5 & 0x3f) /* Minute */ #define HOUR(time) ((time) >> 11 & 0x1f) /* Hours */ #define DAY(date) ((date) & 0x1f) /* Days */ #define MONTH(date) ((date) >> 5 & 0x0f) /* Months */ #define YEAR(date) (((date) >> 9 & 0x7f) + 80) /* Years */ #endif /* __MSSTAT__ */