tldm-universe/Ardent/UV/gcidir/include/MFILE.h

187 lines
5.5 KiB
C
Raw Normal View History

2024-09-09 21:51:08 +00:00
#ifndef h_MFILE
#define h_MFILE
/******************************************************************************
*
* Definition of UniVerse "Multi-File" descriptor
*
* Module %M% Version %I% Date %H%
*
* (c) Copyright 1998 Ardent Software Inc. - All Rights Reserved
* This is unpublished proprietary source code of Ardent Software Inc.
* The copyright notice above does not evidence any actual or intented
* publication of such source code.
*
*******************************************************************************
*
* Maintenence log - insert most recent change descriptions at top
*
* Date.... GTAR# WHO Description.........................................
* 01/25/99 24374 RGA Infrastructure for large file lseek.
* 10/14/98 23801 SAP Change copyrights.
* 04/30/97 19665 JWT/FTW/JSM Add partial Advanced PICK READU constraints.
* 09/26/96 19334 AGM undef access before redefining it
* 05/24/95 16489 FRA Port to IBM RS6000
* 04/28/95 16313 SJM NT signal changes
* 05/01/95 16244 GMM taken out SY_STAT_H. taken out stat/fstat redefs.
* 05/03/95 16466 FRA Port to AViiONX86
* 03/21/95 16189 AGM NT only: Include SY_STAT_H before re-defining 'stat'
* and change the redefinition of stat to stat(x,y)
* 02/21/95 16008 FRA Port DG I/O optimizations (FiiRESTORM II)
* 03/01/94 13167 JWT Integrate Pyramid O_SYNC change
* 08/20/93 11392 TMC add if !defined(__STDC__) for pyramips build
* 03/26/92 8348 LPC Add mkdbstamp to multi-file descriptor
* 09/16/91 8207 TMC changed netfopen and netfdopen to be type FILE *
* 08/10/91 8207 TMC Many changes for uvnet checked in
* 07/10/90 7266 TMC Port for new Encore C compiler
* 10/03/89 6351 FAI Port to IBMrios.
* 09/06/89 6121 JSM Added structures for saving READU locks
* 06/20/89 6077 GPS Replace system(2) calls by network calls for TCPIP
* 03/03/89 5751 JWT Implement onsite tunable parameters
* 07/25/88 - - Maintenence log purged at 5.2.1, see release 5.1.10.
*
*****************************************************************************/
#if COMPUTER == IBMrios
#include FCNTL_H
#endif
#define _READ 0x0001
#define _WRITE 0x0002
#define _BUFFER 0x0004
#define _CREATE 0x0008
#define _NDELAY 0x0010
#define _EXCL 0x0020
#define _ANY 0x0040
#define _HUPCL 0x0080
#define _APPEND 0x0100
#define _KOEXEC 0x0200
#define _TRUNC 0x0400
struct multi_file /* Must match Dfile struct */
{ /* Must match Dfile struct */
char openc, /* Must match Dfile struct */
mode; /* Must match Dfile struct */
int fp,filenum; /* Must match Dfile struct */
FILE *fptr; /* Must match Dfile struct */
char *name; /* Must match Dfile struct */
short AC,netflg,netid,netfdesc; /* Must match Dfile struct */
long tell; /* Must match Dfile struct */
int mkdbstamp; /* Must match Dfile struct */
int sync_on; /* Must match Dfile struct */
int EBWSsave; /* Must match Dfile struct */
int lginter; /* Must match Dfile struct */
}; /* Must match Dfile struct */
struct ULchn
{ int filenum;
int exelevel;
uv_ino_t inode;
STRING id;
struct ULchn *nid;
};
struct IDchn
{ STRING id;
struct IDchn *next;
};
struct FLchn
{ char *fname;
struct IDchn *idlst;
struct FLchn *next;
};
EXTERN MFILE **MF;
EXTERN int MFILES;
EXTERN void MFclose(),MFadd(),MFdel();
EXTERN int MFopen(),MFfree(),MFcheck();
EXTERN int Mpipe(),Mopen();
EXTERN FILE *Mfopen();
EXTERN int DBsopen(),DBswrite(),DBsweof(),DBswblk(),DBsseek(),DBsflush();
EXTERN int DBsflush();
EXTERN STRING DBsread(),DBsrblk(),DBsstatus();
#define UVLSEEKDISP netlseekdisp
/* Define sytem calls(2) for network operations. */
#ifndef NONETCALLS
#if NETwork == TCPIP
#if !defined(__STDC__)
EXTERN int netaccess(),netclose(),netuv_fstat(),netopen(),netread();
EXTERN long netlseek();
EXTERN int netuv_stat(),netfile(),netwrite();
EXTERN UVOFFT netlseekdisp();
EXTERN UVOFFT netlseekbig(int fileid,UVOFFT offset,int whence);
#ifdef FASTIO
EXTERN int netpread(),netpwrite();
#endif
EXTERN int netferror(),netfeof(),netfileno(),netfgetc();
EXTERN int netfread(),netfflush(),netfclose(),netfwrite(),netfputc();
EXTERN int netftell(),netrewind(),netfseek();
EXTERN FILE *netfdopen(),*netfopen();
EXTERN void netclearerr();
#endif
#ifdef access
#undef access
#endif
#define access(x,y) netaccess(x,y)
#define close(x) netclose(x)
#define lseek netlseek
#define open netopen
#define read(x,y,z) netread(x,y,z)
#define write(x,y,z) netwrite(x,y,z)
#ifdef FASTIO
#define pread(w,x,y,z) netpread(w,x,y,z)
#define pwrite(w,x,y,z) netpwrite(w,x,y,z)
#endif
#define tstat(x) netfile(x)
#define fopen(x,y) netfopen(x,y)
#define fdopen(x,y) netfdopen(x,y)
#define fseek(x,y,z) netfseek(x,y,z)
#define rewind(x) netrewind(x)
#define ftell(x) netftell(x)
#ifdef putc
#undef putc
#endif
#define putc(x,y) netfputc(x,y)
#define fputc(x,y) netfputc(x,y)
#define fwrite(w,x,y,z) netfwrite(w,x,y,z)
#define fclose(x) netfclose(x)
#define fflush(x) netfflush(x)
#define fread(w,x,y,z) netfread(w,x,y,z)
#ifdef getc
#undef getc
#endif
/* on NT fgetc gets macro'd to another function, so we have to undef it */
#ifdef fgetc
#undef fgetc
#endif
#define getc(x) netfgetc(x)
#define fgetc(x) netfgetc(x)
#ifdef fileno
#undef fileno
#endif
#define fileno(x) netfileno(x)
#ifdef feof
#undef feof
#endif
#define feof(x) netfeof(x)
#ifdef ferror
#undef ferror
#endif
#define ferror(x) netferror(x)
#ifdef clearerr
#undef clearerr
#endif
#define clearerr(x) netclearerr(x)
#endif
#endif
#endif /* end of MFILE.h */