Code:
/* filesys - header information file system interface */
/* $Id: filesys.h,v 1.97.4.4.2.3 2003/02/04 16:51:47 mark Exp $ */
#ifndef ACU_FSI_FILESYS_H
#define ACU_FSI_FILESYS_H
/*
** LargeFileOff_t should be "long" or "off64_t" for UNIX systems, and
** "__int64" for Windows.
*/
#ifndef LargeFileOff_t
#ifdef WIN32
/* Win32 API */
#define LargeFileOff_t __int64
#else /* WIN32 */
/* UNIX API */
#ifdef HAVE_LARGE_FILE_API
#define LargeFileOff_t off64_t
#else /* HAVE_LARGE_FILE_API */
#define LargeFileOff_t long
#endif /* HAVE_LARGE_FILE_API */
#endif /* WIN32 */
#endif /* LargeFileOff_t */
/* Define PROTOTYPE if your compiler understands ANSI-style prototypes */
#ifndef P_
#ifdef PROTOTYPE
#define P_(x) x
#else /* PROTOTYPE */
#define P_(x) ()
#endif /* PROTOTYPE */
#endif /* P_ */
/* Allow "region locks" (ie, record locks that are applied to the */
/* entire record) by setting WANT_REGION_LOCKS to "1". Region locks */
/* improve performance in cases where very many locks are applied in a */
/* file at once (because adjacent record locks will collapse into a */
/* single lock region in the Unix lock manager). */
#define WANT_REGION_LOCKS 0
#if WANT_REGION_LOCKS
#ifdef O_UNIX
#ifndef ENFORCED_LOCKS
#define REGION_LOCKS_OK
#endif /* ENFORCED_LOCKS */
#endif /* O_UNIX */
#endif /* WANT_REGION_LOCKS */
typedef struct _i_abilities {
unsigned has_previous : 1;
unsigned alternate_collate : 1;
} I_ABILITIES;
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#ifdef INTERNAL_USE
typedef struct _i_file *IFilePtr;
typedef struct _r_file *RFilePtr;
typedef struct _s_file *SFilePtr;
#ifndef ACU_GENERIC_PROC_DEFINED
/* generic proc for registering functions */
typedef int (*GenericProc)();
#define ACU_GENERIC_PROC_DEFINED
#endif /* ACU_GENERIC_PROC_DEFINED */
typedef int (*FSIInitProc) P_((int, int *));
typedef void (*FSIExitProc) P_((void));
typedef int (*FSIMakeProc) P_((char *, char *, char *, char *, char *, char *));
typedef IFilePtr (*FSIOpenProc) P_((char *, int, char *));
typedef int (*FSICloseProc) P_((IFilePtr));
typedef unsigned (*FSIReadProc) P_((IFilePtr, char *, int));
typedef unsigned (*FSINextProc) P_((IFilePtr, char *));
typedef unsigned (*FSIPreviousProc) P_((IFilePtr, char *));
typedef int (*FSIStartProc) P_((IFilePtr, char *, int, int, int));
typedef int (*FSIWriteProc) P_((IFilePtr, char *, unsigned));
typedef int (*FSIRewriteProc) P_((IFilePtr, char *, unsigned));
typedef int (*FSIDeleteProc) P_((IFilePtr, char *));
typedef int (*FSIUnlockProc) P_((IFilePtr));
typedef int (*FSIInfoProc) P_((IFilePtr, int, char *));
typedef void (*FSISyncProc) P_((int));
typedef int (*FSIRemoveProc) P_((char *));
typedef int (*FSIRenameProc) P_((char *, char *));
typedef int (*FSIVersionProc) P_((char *, char *, char *, int, long *));
typedef void (*FSIAbilitiesProc) P_((I_ABILITIES *));
typedef int (*FSIExecuteProc) P_((char *, char *));
typedef int (*FSICopyProc) P_((char *, char *));
typedef int (*FSIBeginProc) P_((void));
typedef int (*FSICommitProc) P_((int));
typedef int (*FSIRollbackProc) P_((int));
typedef int (*FSIRecoverProc) P_((void));
typedef GenericProc (*FSIRegisterProc) P_((char *, GenericProc));
typedef void (*FSIInitConfigProc) P_((void));
typedef int (*FSI_RInitProc) P_((void));
typedef void (*FSI_RExitProc) P_((void));
typedef int (*FSI_RMakeProc) P_((char *, char *, long));
typedef RFilePtr (*FSI_ROpenProc) P_((char *, int, unsigned,
unsigned, long));
typedef int (*FSI_RUnlockProc) P_((RFilePtr));
typedef int (*FSI_RCloseProc) P_((RFilePtr));
typedef unsigned (*FSI_RReadProc) P_((RFilePtr, char *, long));
typedef unsigned (*FSI_RNextProc) P_((RFilePtr, char *));
typedef unsigned (*FSI_RPreviousProc) P_((RFilePtr, char *));
typedef int (*FSI_RStartProc) P_((RFilePtr, long, int));
typedef int (*FSI_RWriteProc) P_((RFilePtr, char *, unsigned,
long));
typedef int (*FSI_RDeleteProc) P_((RFilePtr, long));
typedef int (*FSI_RRewriteProc) P_((RFilePtr, char *, unsigned,
long));
typedef int (*FSI_RRemoveProc) P_((char *));
typedef int (*FSI_RRenameProc) P_((char *, char *));
typedef int (*FSI_RCopyProc) P_((char *, char *));
typedef int (*FSI_RInfoProc) P_((RFilePtr, int, char *));
typedef int (*FSI_SMakeProc) P_((char *, char *));
typedef SFilePtr (*FSI_SOpenProc) P_((char *, int, unsigned, int,
unsigned, int, char *, int));
typedef int (*FSI_SCloseProc) P_((SFilePtr, int));
typedef int (*FSI_SReadProc) P_((SFilePtr, char *));
typedef int (*FSI_SWriteProc) P_((SFilePtr, char *, unsigned, int));
typedef int (*FSI_SRewriteProc) P_((SFilePtr, char *, unsigned));
typedef int (*FSI_SRemoveProc) P_((char *));
typedef int (*FSI_SRenameProc) P_((char *, char *));
typedef int (*FSI_SCopyProc) P_((char *, char *));
typedef LargeFileOff_t (*FSI_SSeekProc) P_((SFilePtr, LargeFileOff_t, int));
typedef int (*FSI_SInfoProc) P_((SFilePtr, int, char *));
typedef struct _i_dispatch {
/* Indexed file functions */
FSIInitProc p_init;
FSIExitProc p_exit;
FSIMakeProc p_make;
FSIOpenProc p_open;
FSICloseProc p_close;
FSIReadProc p_read;
FSINextProc p_next;
FSIPreviousProc p_previous;
FSIStartProc p_start;
FSIWriteProc p_write;
FSIRewriteProc p_rewrite;
FSIDeleteProc p_delete;
FSIUnlockProc p_unlock;
FSIInfoProc p_info;
FSISyncProc p_sync;
FSIRemoveProc p_remove;
FSIRenameProc p_rename;
FSIVersionProc p_version;
FSIAbilitiesProc p_abilities;
FSIExecuteProc p_execute;
FSICopyProc p_copy;
FSIBeginProc p_begin;
FSICommitProc p_commit;
FSIRollbackProc p_rollback;
FSIRecoverProc p_recover;
/* Setup functions */
FSIRegisterProc p_register;
FSIInitConfigProc p_init_cfg;
/* Relative file functions */
FSI_RInitProc pr_init;
FSI_RExitProc pr_exit;
FSI_RMakeProc pr_make;
FSI_ROpenProc pr_open;
FSI_RUnlockProc pr_unlock;
FSI_RCloseProc pr_close;
FSI_RReadProc pr_read;
FSI_RNextProc pr_next;
FSI_RPreviousProc pr_previous;
FSI_RStartProc pr_start;
FSI_RWriteProc pr_write;
FSI_RDeleteProc pr_delete;
FSI_RRewriteProc pr_rewrite;
FSI_RRemoveProc pr_remove;
FSI_RRenameProc pr_rename;
FSI_RCopyProc pr_copy;
FSI_RInfoProc pr_info;
/* Sequential file functions */
FSI_SMakeProc ps_make;
FSI_SOpenProc ps_open;
FSI_SCloseProc ps_close;
FSI_SReadProc ps_read;
FSI_SWriteProc ps_write;
FSI_SRewriteProc ps_rewrite;
FSI_SRemoveProc ps_remove;
FSI_SRenameProc ps_rename;
FSI_SCopyProc ps_copy;
FSI_SSeekProc ps_seek;
FSI_SInfoProc ps_info;
} I_DISPATCH;
typedef int (*FSI_IGetDispatchTableProc) P_((I_DISPATCH **));
#else /* INTERNAL_USE */
struct _AcuFile_ {
long notused;
};
typedef struct _AcuFile_ *IFilePtr;
typedef struct _AcuFile_ *RFilePtr;
typedef struct _AcuFile_ *SFilePtr;
#endif /* INTERNAL_USE */