/*static char *SCCSID = "@(#)api.h	6.2 92/02/21";*/
/*
 *	API.h - File System API Defintions
 *
 *	This file contains the definitions used by clients of the file
 *	system.
 *
 */

/*
 *	Open Action Codes
 *
 *	---- xxxx Action taken if file exists
 *	---- 0000	fail
 *	---- 0001	open file
 *	---- 0010	replace file
 *	xxxx ---- Action taken if file doesn't exist
 *	0000 ----	fail
 *	0001 ----	create file
 *
 */

#define OAC_FE		0x0f	/* file exists action */
#define OAC_FDE		0xf0	/* file doesn't exist */
#define OAC_FAIL	0x00	/* fail operation */
#define OAC_OF		0x01	/* open file */
#define OAC_RF		0x02	/* replace file */
#define OAC_CF		0x10	/* create file */

/*		___________________________
 *		| hours | minutes | seconds|
 *		| 5 bit |  6 bits | 5 bits+|
 *		|__________________________|
 *		___________________________
 *		| years*|  months |  days  |
 *		| 7 bit |  4 bits | 5 bits |
 *		|__________________________|
 *	(*) years from 1980
 *	(+) 2 seconds units
 */
typedef struct DOSTIME {
    unsigned int seconds2:5;
    unsigned int minutes:6;
    unsigned int hours:5;
} DOSTIME;

typedef DOSTIME far *PDOSTIME;

typedef struct DOSDATE {
    unsigned int days:5;
    unsigned int months:4;
    unsigned int years:7;
} DOSDATE;

typedef DOSDATE far *PDOSDATE;

/*
 *    Filestatus level 1 return and set structure
 */

typedef struct ATTRIBUTES {
	DOSDATE ddCreate;	/* creation date */
	DOSTIME dtCreate;	/* creation time */
	DOSDATE ddAccess;	/* last access date */
	DOSTIME dtAccess;	/* last access time */
	DOSDATE ddMod;		/* modification date */
	DOSTIME dtMod;		/* modification time */
	ULONG	ulFileSize;	/* size of file */
	ULONG	ulAllocSize;	/* space allocated to file */
	USHORT	usFileAttr;	/* file attribute */
} ATTRIBUTES;

typedef ATTRIBUTES far *PATTRIBUTES;


/*
 *    Filestatus level 2 return structure
 */

typedef struct ATTRIBUTES2 {
	DOSDATE ddCreate;	/* creation date */
	DOSTIME dtCreate;	/* creation time */
	DOSDATE ddAccess;	/* last access date */
	DOSTIME dtAccess;	/* last access time */
	DOSDATE ddMod;		/* modification date */
	DOSTIME dtMod;		/* modification time */
	ULONG	ulFileSize;	/* size of file */
	ULONG	ulAllocSize;	/* space allocated to file */
	USHORT	usFileAttr;	/* file attribute */
	ULONG	cbList;		/* len of ea list */
} ATTRIBUTES2;

typedef ATTRIBUTES2 far * PATTRIBUTES2;
