head 1.16; access; symbols release_4_2:1.16 aix_ok:1.15 Version_2_1:1.12 Version_2:1.8 C_Demo_1:1.4; locks; strict; comment @ * @; 1.16 date 94.06.16.03.23.06; author aoki; state Exp; branches; next 1.15; 1.15 date 91.11.14.19.38.05; author kemnitz; state Exp; branches; next 1.14; 1.14 date 91.04.24.12.13.08; author hong; state Exp; branches; next 1.13; 1.13 date 91.03.10.16.38.35; author hong; state Exp; branches; next 1.12; 1.12 date 91.01.23.12.45.59; author sp; state Exp; branches; next 1.11; 1.11 date 90.10.21.23.33.20; author hong; state Exp; branches; next 1.10; 1.10 date 90.09.18.21.47.03; author hong; state Exp; branches; next 1.9; 1.9 date 90.08.17.08.53.17; author cimarron; state Exp; branches; next 1.8; 1.8 date 90.06.26.23.01.47; author hong; state Version_2; branches; next 1.7; 1.7 date 90.04.02.11.15.21; author hong; state Exp; branches; next 1.6; 1.6 date 89.09.25.11.26.39; author cimarron; state Exp; branches; next 1.5; 1.5 date 89.09.21.19.12.30; author hirohama; state Exp; branches; next 1.4; 1.4 date 89.09.05.17.05.59; author mao; state C_Demo_1; branches; next 1.3; 1.3 date 89.04.12.19.54.01; author dillon; state Exp; branches; next 1.2; 1.2 date 89.03.22.17.32.45; author muir; state Stab; branches; next 1.1; 1.1 date 89.01.17.05.54.02; author cimarron; state Exp; branches; next ; desc @@ 1.16 log @add system #includes for O_ and SEEK_ flags @ text @/* * fd.h -- * Virtual file descriptor definitions. * * calls: * * File {Close, Read, Write, Seek, Tell, Sync} * {File Name Open, Allocate, Free} File * * These are NOT JUST RENAMINGS OF THE UNIX ROUTINES. * use them for all file activity... * * fd = FilePathOpenFile("foo", O_RDONLY); * File fd; * * use AllocateFile if you need a file descriptor in some other context. * it will make sure that there is a file descriptor free * * use FreeFile to let the virtual file descriptor package know that * there is now a free fd (when you are done with it) * * AllocateFile(); * FreeFile(); */ #ifndef FDIncluded /* Include this file only once */ #define FDIncluded 1 /* * Identification: */ #define FD_H "$Header: /faerie/aoki/postgres/src/backend/storage/RCS/fd.h,v 1.15 1991/11/14 19:38:05 kemnitz Exp aoki $" /* * FileOpen uses the standard UNIX open(2) flags. */ #include /* for O_ on most */ #ifndef O_RDONLY #include /* for O_ on the rest */ #endif /* O_RDONLY */ /* * FileSeek uses the standard UNIX lseek(2) flags. */ #include /* for SEEK_ on most */ #ifndef SEEK_SET #include /* for SEEK_ on the rest */ #endif /* SEEK_SET */ #include "tmp/c.h" #include "storage/block.h" typedef String FileName; #define NDISKS 7 /* no. of disks we have */ typedef int File; typedef int FileNumber; typedef int Amount; /* * FileNameOpenFile -- * */ /* VARARGS2 */ extern File FileNameOpenFile ARGS(( FileName fileName, int flags, int mode )); extern int FileNameUnlink ARGS(( FileName fileName )); extern BlockNumber FileGetNumberOfBlocks ARGS(( File file )); /* * FileClose -- * */ extern void FileClose ARGS(( File file )); /* * FileUnlink -- * */ extern void FileUnlink ARGS(( File file )); /* * FileRead -- * */ extern Amount FileRead ARGS(( File file, String buffer, Amount amount )); /* * FileWrite -- * */ extern Amount FileWrite ARGS(( File file, String buffer, Amount amount )); /* UNIX DEPENDENT XXXX 6/21/88 */ /* * FileSeek -- * */ extern long /* XXX FilePosition? */ FileSeek ARGS(( File file, long offset, int whence )); /* * FileTell -- * */ extern long /* XXX FilePosition? */ FileTell ARGS(( File file )); /* * FileSync -- * * fsync (UNIX) */ extern int FileSync ARGS(( File file )); /* * AllocateFile -- * */ extern void AllocateFile ARGS(( void )); /* * AllocateFiles -- * */ extern uint16 AllocateFiles ARGS(( uint16 fileCount )); /* * FreeFile -- * */ extern void FreeFile ARGS(( void )); /* * FreeFiles -- * */ extern void FreeFiles ARGS(( int numberOfFiles )); /* * FileFindName * * return the name of a file (used for debugging...) */ extern char * FileFindName ARGS(( File file )); extern void closeAllVfds ARGS(()); extern void closeOneVfd ARGS(()); #endif /* !defined(FDIncluded) */ @ 1.15 log @protos checkin. @ text @d32 1 a32 1 #define FD_H "$Header: RCS/fd.h,v 1.14 91/04/24 12:13:08 hong Exp Locker: kemnitz $" d34 16 @ 1.14 log @added declarations of two more functions @ text @d32 1 a32 1 #define FD_H "$Header: RCS/fd.h,v 1.13 91/03/10 16:38:35 hong Exp Locker: hong $" d101 1 a101 1 Size amount d113 1 a113 1 Size amount d190 1 a190 1 uint16 numberOfFiles @ 1.13 log @gotten rid of hard limit on # of striped file descriptors @ text @d32 1 a32 1 #define FD_H "$Header: RCS/fd.h,v 1.12 91/01/23 12:45:59 sp Exp Locker: hong $" d204 2 @ 1.12 log @New routine: FileFindName (returns the name of the given file) @ text @d32 1 a32 1 #define FD_H "$Header: RCS/fd.h,v 1.11 90/10/21 23:33:20 hong Exp $" a39 1 #define MAXNOFILES 100 @ 1.11 log @increased NDISKS @ text @d32 1 a32 1 #define FD_H "$Header: RCS/fd.h,v 1.10 90/09/18 21:47:03 hong Exp $" d192 11 @ 1.10 log @cleaned up striping interface @ text @d32 1 a32 1 #define FD_H "$Header: RCS/fd.h,v 1.9 90/08/17 08:53:17 cimarron Exp Locker: hong $" d39 1 a39 1 #define NDISKS 5 /* no. of disks we have */ @ 1.9 log @added pathnames to #include statements @ text @d32 1 a32 1 #define FD_H "$Header: RCS/fd.h,v 1.8 90/06/26 23:01:47 hong Version_2 Locker: cimarron $" d35 1 d39 3 a41 4 #ifdef _xprs_ #define NSTRIPING 5 /* no. of disks hermes has */ typedef struct { int fd[NSTRIPING]; bool is_sys; } File; #else /* _xprs_ */ a42 1 #endif /* _xprs_ */ d52 1 a52 1 FileNumber d59 14 d80 1 a80 1 FileNumber file d90 1 a90 1 FileNumber file d100 1 a100 1 FileNumber file, d112 1 a112 1 FileNumber file, d126 1 a126 1 FileNumber file, d139 1 a139 1 FileNumber file d151 1 a151 1 FileNumber file @ 1.8 log @added a function, FileUnlink() @ text @d32 1 a32 1 #define FD_H "$Header: RCS/fd.h,v 1.7 90/04/02 11:15:21 hong Exp $" d34 1 a34 3 #ifndef C_H #include "c.h" #endif @ 1.7 log @some changes for striping, should not affect non-striping case @ text @d32 1 a32 1 #define FD_H "$Header: RCS/fd.h,v 1.6 89/09/25 11:26:39 cimarron Exp Locker: hong $" d69 10 @ 1.6 log @moved dynamic symbol stuff to syms.h @ text @d32 1 a32 1 #define FD_H "$Header: RCS/fd.h,v 1.5 89/09/21 19:12:30 hirohama Exp $" d40 4 d45 2 d55 1 a55 1 File d69 1 a69 1 File file d79 1 a79 1 File file, d91 1 a91 1 File file, d105 1 a105 1 File file, d118 1 a118 1 File file d130 1 a130 1 File file @ 1.5 log @added ...SYMBOLS declarations miscellaneous cleanup @ text @d32 1 a32 1 #define FD_H "$Header: RCS/fd.h,v 1.4 89/09/05 17:05:59 mao C_Demo_1 Locker: hirohama $" a165 13 #define FD_SYMBOLS \ SymbolDecl(FileNameOpenFile, "_FileNameOpenFile"), \ SymbolDecl(FileClose, "_FileClose"), \ SymbolDecl(FileRead, "_FileRead"), \ SymbolDecl(FileWrite, "_FileWrite"), \ SymbolDecl(FileSeek, "_FileSeek"), \ SymbolDecl(FileTell, "_FileTell"), \ SymbolDecl(FileSync, "_FileSync"), \ SymbolDecl(AllocateFile, "_AllocateFile"), \ SymbolDecl(AllocateFiles, "_AllocateFiles"), \ SymbolDecl(FreeFile, "_FreeFile"), \ SymbolDecl(FreeFiles, "_FreeFiles") @ 1.4 log @Working version of C-only demo @ text @a23 3 * * Identification: * $Header: /usr6/postgres/mao/postgres/src/lib/H/RCS/fd.h,v 1.3 89/04/12 19:54:01 dillon Exp $ d26 1 a26 1 #ifndef FDIncluded /* Include this file only once */ d29 5 d116 12 d167 12 a178 11 /* * FileSync -- * * fsync (UNIX) */ extern int FileSync ARGS(( File file )); @ 1.3 log @c.h @ text @d26 1 a26 1 * $Header: /usr6/postgres/dillon/ptree/src/lib/H/RCS/fd.h,v 1.2 89/03/22 17:32:45 muir Stab $ @ 1.2 log @copyright removal @ text @d26 1 a26 1 * $Header: /usr6/postgres/muir/postgres/src/lib/H/RCS/fd.h,v 1.1 89/01/17 05:54:02 cimarron Exp $ d32 1 d34 1 @ 1.1 log @Initial revision @ text @a0 27 ; /* ; * ; * POSTGRES Data Base Management System ; * ; * Copyright (c) 1988 Regents of the University of California ; * ; * Permission to use, copy, modify, and distribute this software and its ; * documentation for educational, research, and non-profit purposes and ; * without fee is hereby granted, provided that the above copyright ; * notice appear in all copies and that both that copyright notice and ; * this permission notice appear in supporting documentation, and that ; * the name of the University of California not be used in advertising ; * or publicity pertaining to distribution of the software without ; * specific, written prior permission. Permission to incorporate this ; * software into commercial products can be obtained from the Campus ; * Software Office, 295 Evans Hall, University of California, Berkeley, ; * Ca., 94720 provided only that the the requestor give the University ; * of California a free licence to any derived software for educational ; * and research purposes. The University of California makes no ; * representations about the suitability of this software for any ; * purpose. It is provided "as is" without express or implied warranty. ; * ; */ d26 1 a26 1 * $Header: fd.h,v 1.1 88/11/11 16:37:03 postgres Exp $ @