DIRECTORY AlpineEnvironment USING [LockOption], AlpTransaction USING [Handle], DBCommon, Rope USING [ROPE]; DBFile: CEDAR DEFINITIONS = BEGIN ROPE: TYPE = Rope.ROPE; AlpTrans: TYPE = AlpTransaction.Handle; VersionOptions: TYPE = DBCommon.VersionOptions; OpenFileHandle: TYPE = DBCommon.OpenFileHandle; CreateTransaction: PROC [server: ROPE] RETURNS [t: AlpTrans]; FinishTransaction: PROC [t: AlpTrans, abort: BOOL, continue: BOOL]; PagesFromBytes: PROC [bytes: INT] RETURNS [pages: CARDINAL]; BytesFromPages: PUBLIC PROC [pages: CARDINAL] RETURNS [bytes: INT]; OpenFile: PROC [t: AlpTrans, file: ROPE, version: VersionOptions, discardFileContents: BOOL, nPagesInitial: INT, lock: AlpineEnvironment.LockOption, readOnly: BOOL] RETURNS [f: OpenFileHandle, createdFile: BOOL]; Close: PROC [f: OpenFileHandle]; ReadFilePage: PROC [f: OpenFileHandle, p: CARDINAL, corePage: LONG POINTER]; WriteFilePage: PROC [f: OpenFileHandle, p: CARDINAL, corePage: LONG POINTER]; GetSize: PROC [f: OpenFileHandle] RETURNS [nPages: CARDINAL]; SetSize: PROC [f: OpenFileHandle, nPages: CARDINAL]; END. pFile DBFile.mesa Copyright c 1985 by Xerox Corporation. All rights reserved. Last edited by: MBrown on February 7, 1983 12:10 pm Cattell on May 10, 1984 6:24:44 pm PDT Willie-Sue on April 25, 1985 12:34:09 pm PST Last Edited by: Wert, July 26, 1984 4:33:53 pm PDT Donahue, November 13, 1985 11:20:46 am PST Widom, August 15, 1985 10:37:19 am PDT Transactions Creates a new transaction on the given server, and returns it. If NOT abort AND continue, then t continues as a valid transaction, all open files remain open, etc, but all updates are committed. Files Creates an "open file" f, that is used to access file "file" under transaction "t". If version = NewFileOnly or None, will create file of nPagesInitial pages if necessary. (The full path name must contain enough information, and must be consistent with transaction t). If discardFileContents, then the contents of the open file are undefined (and performance may be considerably better). Reads page p of file f into corePage. The page size is given by DBCommon.WordsPerPage. Writes corePage onto page p of file f. Raises ERROR if the user who opened f does not have write access to f. The page size is given by DBCommon.WordsPerPage. Returns the size of the file (in pages). If the length of the file is not multiple of 512 bytes, ERROR Fatal[IllegalFileLength] is raised. Sets the size (number of pages) of the file. ΚF˜šœ™J™<—šœ™Jšœ#™#Jšœ&™&Jšœ,™,Jšœ2™2Icode™*J™&—˜šΟk ˜ Jšœœ˜%Jšœœ ˜J˜ Jšœœœ˜J˜——Jšœœ œ˜!˜Jšœœœ˜Jšœ œ˜'Jšœœ˜/Jšœœ˜/Ihead1šœ ™ šΟnœœ œœ˜CJšœ>™>J˜—šžœœœ œ˜CJšœƒ™ƒ—Lšœ™J˜Jš žœœ œœ œ˜