/************************************************************************
*                       - INFOFLEX System -
* This source code is CONFIDENTIAL and PROPRIETARY to CUSTOMWARE COMPUTING,
* INC. (CWC). The information contained herein may not be used, copied or
* disclosed in whole or in part except as permitted by written agreement
* signed by an officer of CWC.
*
* COPYRIGHT (c) 1986 CUSTOMWARE COMPUTING, INC., BURLINGAME, CALIFORNIA.
* ALL RIGHTS RESERVED.
*************************************************************************/

#ifndef FXISAM_H    /* avoid multiple include problems */
#define FXISAM_H

#include "sqtypes.h"

#ifdef NETISAM
#	include "netisam.h"

#	define MAXLEYLEN  MAXKEYSIZE
#	undef ISTRANS
/*
#	define isflush 	issync 
*/
#else
#ifdef CISAM
#	include "isport.h"		/* porting details */
#	undef MAXKEYLEN
#	include "cisam.h"

	double ldfltnull();
	double lddblnull();

#	define ISWAIT	     0x0400	/* wait for record lock */

	/* audit trail mode parameters */
#	define AUDSETNAME  0  /* set new audit trail name  */
#	define AUDGETNAME  1  /* get audit trail name    */
#	define AUDSTART  2  /* start audit trail     */
#	define AUDSTOP    3  /* stop audit trail     */
#	define AUDINFO    4  /* audit trail running ?  */

#	define DCOMPRESS 002    /* duplicate compression  */
#	define LCOMPRESS 004    /* leading compression    */
#	define TCOMPRESS 010    /* trailing compression    */

#	define ENOLOK    115    /* can't create lock file */

#	define islink(f)   f

	extern char *isversnumber;  /* C-ISAM version number  */
	extern char *iscopyright;  /* RDS copyright    */
	extern char *isserial;    /* C-ISAM software serial number */
	extern int  issingleuser;  /* set for single user access  */

	/*  error message usage:
	 *  if (iserrno >= 100 && iserrno < is_nerr)
	 *      printf("ISAM error %d: %s\n", iserrno, is_errlist[iserrno-100]);
	 */
	extern int  is_nerr;    /* highest C-ISAM error code  */
	extern char *is_errlist[];  /* C-ISAM error messages  */
#else
#ifdef DISAM6
#       define ISINTERNAL 1   /* so DISAM variables not declared again */
#	include "iswrap.h"
#	define MAXKEYLEN ISMAXKEY
#else
#	include "disam.h"
#endif
#endif
#endif

#ifdef ISDOSMSC
#undef ISTRANS   /* clv 11/29/96 */
#endif

#define USERCOLL(x)  ((x))

#define COLLATE1  0x10
#define COLLATE2  0x20
#define COLLATE3  0x30
#define COLLATE4  0x40
#define COLLATE5  0x50
#define COLLATE6  0x60
#define COLLATE7  0x70

#define ISSHARELOCK  0x1000	/* share lock access mode */

#ifndef DISAM6
#define ELOGREAD  118    /* cannot read log rec  */
#define EBADLOG   119    /* bad log record  */
#define ELOGOPEN  120    /* cannot open log file  */
#define ELOGWRIT  121    /* cannot write log rec */
#define ENOTRANS  122    /* no transaction  */
#define ENOSHMEM  123    /* no shared memory  */
#define ENOBEGIN  124    /* no begin work yet  */
#define EBADROWID 126    /* bad record number  */

#define IO_IDX    0x01    /* index file  */
#define IO_DAT    0x02    /* data file  */
#define IO_AUD    0x03    /* audit file  */
#define IO_LOK    0x04    /* lock file  */
#define IO_SEM    0x05    /* semaphore file */

struct audhead
    {
    char au_type[2];    /* audit record type aa,dd,rr,ww*/
    char au_time[4];    /* audit date-time    */
    char au_procid[2];    /* process id number    */
    char au_userid[2];    /* user id number    */
    char au_recnum[4];    /* record number    */
    };
#define AUDHEADSIZE  14    /* num of bytes in audit header  */
#endif	/* ! DISAM6 */

/* DBGU   #if defined(CISAM3) || DISAM3 || DISAM4 */
#if defined(DISAM3) || defined(DISAM4) || defined(DISAM6)
     /* DISAM Version 4 and earlier did not have the ability to close a
      *     table file descriptor without removing any exclusive lock
      *     on the table set up by the same process.
      */
#    define EXCLLOCKBUG
#endif

#endif
