/*static char *SCCSID = "@(#)ldefs.h	6.2 91/10/20";*/
#include <os2def.h>
#include <bse.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <malloc.h>
#include <comsub.h>
#include <direct.h>
#include <defs.h>
#include <gdata.h>
#include <pr_com.h>
#include <basemid.h>
/*
 * Definitions for function return values.
 */

#define READ_OK		0	/* successful read */
#define END_OF_FILE	1	/* end of file reached */
#define CANT_READ	2	/* can't read a sector at all */
#define READ_RETRY	3	/* successfully read after retrying */
#define NOT_FOUND	4	/* no such file */
#define CANT_WRITE	5	/* disk full or other such error */

/*
 * Definitions for exit codes
 */

#define SUCCESS_CODE	0	/* no error occurred */
#define ARG_ERROR	1	/* error in arguments */
#define OPEN_ERROR	2	/* error opening disk */
#define INSF_MEM_ERROR	3	/* insufficient memory */
#define READ_ERROR	4	/* error reading disk */
#define WRITE_ERROR	5	/* error writing disk */

#define MAX_ERROR_CODE	6	/* minimum invalid error code */

#define ERROR_CODE	4	/* errorlevel code for an error occurring */

/*
 * Size of chunks to copy the file in, in sectors.  Default is 64 sectors
 * or 32K.
 */

#define CHUNKSIZE (32768L / (ULONG)(SECSIZE))

/*
 * Definitions for flags in EA records.
 */
#define FF_BIGD		0x01		/* if set, EA's data is out-of-band */
#define FF_DAT		0x02		/* if set, EA's data is a b+tree */

/*
 * Definitions for IDs of all messages produced by RECOVER.  These IDs
 * are only valid for Pinball messages;	 they do not match messages in
 * OSO001.MSG (the system message file).
 */

#define REC_ARGUMENT_ERROR_STR	MSG_HPFS_RECOVER_PARM_ERROR	/* Invalid parameter */
#define REC_OPEN_ERROR_STR	MSG_HPFS_RECOV_FILE_NOT_FOUND	/* File not found */
#define REC_UNKNOWN_ERROR_STR	MSG_HPFS_RECOV_UNKNOWN_ERROR	/* Unknown error code %d */
#define REC_INSF_MEM_ERROR_STR	MSG_HPFS_RECOV_NOT_ENOUGH_MEM	/* Insufficient memory */
#define REC_READ_ERROR_STR	660	/* NULL MESSAGE Error reading disk */
#define REC_WRITE_ERROR_STR	MSG_HPFS_RECOV_NOWRITE_DATA	/* Error writing disk */
#define REC_USAGE_STR		MSG_HPFS_SYNTAX_HELP		/* Usage: RECOVER filename */
#define REC_TEMP_FILES_STR	MSG_HPFS_RECOV_NOTEMP_CREATE	/* Too many files named FILEnnnn.REC */
#define REC_TRUNC_EA_STR	MSG_HPFS_RECOV_EA_NOREAD	/* Hard error in EAs, EA stream trunc. */
#define REC_GOOD_BYTES_STR	MSG_HPFS_RECOV_FILE_BYTES	/* nnnnnnnn bytes recovered */
#define REC_RETRY_BYTES_STR	MSG_HPFS_RECOV_BAD_BYTES_RECOV	/* nnnnnnnn bytes rec'd after retrying */
#define REC_LOST_BYTES_STR	MSG_HPFS_RECOV_FILEBYTES_NOREC	/* nnnnnnnn bytes unrecoverable */
#define REC_CANT_SAVE_BAD_STR	MSG_HPFS_RECOV_DISK_INUSE	/* Disk in use, can't save bad blocks */
#define REC_CANT_DELETE_STR	MSG_HPFS_RECOV_FILE_NODELETE	/* Can't delete old file */
#define REC_CANT_RENAME_STR	MSG_HPFS_RECOV_NOCREATE_NEWFILE /* Can't rename new file to old */
#define REC_OS_ERROR_STR	MSG_HPFS_RECOV_SYSTEM_ERROR	/* Unexpected OS error (?????) */
#define REC_PRESS_ENTER_STR	MSG_HPFS_RECOV_FILE		/* Press Enter to begin recovery */
