/*static char *SCCSID = "@(#)pdfile.h   6.7 92/02/24";*/
/***    PDFILE.H - Program Dump File Function Prototypes
 *
 *      SCCSID = @(#)pdfile.h   6.7 92/08/31
 *
 *      THIS IS AN OS/2 VERSION 2.x SPECIFIC FILE
 *
 *       Copyright (c) IBM Corporation 1992
 *
 *       All Rights Reserved
 *
 *****************************************************************************
 *  Change                                                               Chg *
 *  Activity      Date    BY   Reason                                    Num *
 *  --------      ----    ---  -------                                   --- *
 *  B......     ../../..  ARJ  ....................................      ... *
 *****************************************************************************
 */

/*** Time support from BSEDOS.H
 *
 */
typedef struct _DATETIME {    /* date */
    UCHAR   hours;
    UCHAR   minutes;
    UCHAR   seconds;
    UCHAR   hundredths;
    UCHAR   day;
    UCHAR   month;
    USHORT  year;
    SHORT   timezone;
    UCHAR   weekday;
} DATETIME;

/** END  **/

/*** DosSetFilePtr() file position codes from BSEDOS.H
 *
 */

#define FILE_BEGIN      0x0000  /* Move relative to beginning of file */
#define FILE_CURRENT    0x0001  /* Move relative to current fptr position */
#define FILE_END        0x0002  /* Move relative to end of file */

/*** DosOpen support from BSEDOS.H
 *
 */
#define FILE_EXISTED                0x0001
#define OPEN_ACTION_OPEN_IF_EXISTS  0x0001  /* ---- ---- ---- 0001 */
#define OPEN_ACTION_CREATE_IF_NEW   0x0010  /* ---- ---- 0001 ---- */
#define OPEN_SHARE_DENYNONE         0x0040  /* ---- ---- -100 ---- */
#define OPEN_ACCESS_READWRITE       0x0002  /* ---- ---- ---- -010 */
#define OPEN_FLAGS_WRITE_THROUGH    0x4000  /* -1-- ---- ---- ---- */

/** END  **/

#define  PDUMPFILENAMELENGTH  20
#define  DUMPNAME             "PDUMP"
#define  HDRNAME              "PDUMPHDR"
#define  MAXFILENUMBER        100                     /* can be 1000 */
#define  WRITESIZE            65535

/* Macros */
#define  GetFilePtr(handle, pos)     PDSeek((handle), 0L, FILE_CURRENT, (pos))

/*      Program Dump File Function Prototypes */

extern USHORT pascal PDOpen(PSZ, PHFILE, PULONG, ULONG,
                            ULONG, ULONG, ULONG, PVOID);
extern USHORT pascal PLDClose(HFILE);
extern USHORT pascal PDWrite(HFILE, PVOID, ULONG);
extern USHORT pascal PDRead(HFILE, PVOID, ULONG);
extern USHORT pascal PDSeek(HFILE, LONG, ULONG, PULONG);
extern USHORT pascal PDDel(PSZ);
extern void          PLDGetDateTime(DATETIME *);
extern void   pascal PLDGetVerString(unsigned char **, ULONG *);
extern ULONG  pascal PLDEnterCritSec();
extern ULONG  pascal PLDExitCritSec();
extern void          MakeSuffix(UCHAR *, LONG);
extern ULONG         OpenDump(HFILE *, char *);
extern ULONG         BfWrite(HFILE, UCHAR *, ULONG);
extern ULONG         WriteWithTableEntry(HFILE, HFILE, UCHAR *, ULONG);
extern ULONG         CopyDumpHdr(HFILE, HFILE);
