Juniper.mesa
Safe Cedar interface to Juniper transactions and directories, not to Juniper files. For use with FileIO for Juniper file access.
Last edited by:
MBrown on August 26, 1982 2:29 pm
Russ Atkinson on 26-May-81 14:47:23
Warren Teitelman on May 26, 1982 4:41 pm
DIRECTORY
UserPineDefs USING [Transaction],
Rope USING [ROPE];
Juniper: CEDAR DEFINITIONS =
BEGIN
ROPE: TYPE = Rope.ROPE;
1. Types and Errors
Transaction: TYPE = REF TransactionObject;
TransactionObject: TYPE;
This is the safe replacement for UserPineDefs.Transaction.
LFH: TYPE [8];
This is a unique ID for a Juniper file. LFH stands for "long file handle" (includes file UID plus pack ID, machine ID).
Error: ERROR [ec: JuniperErrorType];
JuniperErrorType: TYPE = MACHINE DEPENDENT {transactionReset, notDone, (LAST[CARDINAL]) };
transactionReset means that the transaction has been aborted; notDone means that it has not (but probably should be).
Juniper passes back much more specific information, which is mapped into the two classes above. It is just not possible to define what Juniper calls will raise what signals. Always be prepared to catch Error, or land in the debugger.
2. Starting Pine
StartPine: PROC [];
Call this and let it return before doing ANYTHING else with Pine! Start traps don't work.
InitializePine: PROC [];
Increases Pine share count by 1. When share count becomes 1, some overhead processes are created.
FinalizePine: PROC [];
Decreases Pine share count by 1. When share count becomes 0, some overhead processes are destroyed.
3. Juniper Files
LookupFile: PROC [t: Transaction, name: ROPE] RETURNS [success: BOOLEAN, file: LFH];
Looks for file with given name on machine of transaction t. success = FALSE means that lookup failed. No server name should be specified as part of name.
CreateFile: PROC [t: Transaction, name: ROPE] RETURNS [LFH];
Creates a file with given name on machine of transaction t. No server name should be specified as part of name.
4. Juniper Transactions
BeginTransaction: PROC [server, user, password: ROPENIL] RETURNS [t: Transaction, welcomeText: ROPE];
Returns a valid transaction on the given server, and the welcome text obtained from the server. Server defaults to "Juniper", and user to currently logged-in user (password defaults when user does).
CommitTransaction: PROC [t: Transaction];
Commits t, turns t's write locks into read locks. t remains valid. (Sometimes called "checkpoint".)
AbortTransaction: PROC [t: Transaction];
Aborts t, releases all of t's locks. t becomes invalid.
EndTransaction: PROC [t: Transaction];
Commits t, releases all of t's locks. t becomes invalid.
Escape to Pine (for hardy souls)
TransactionFromUserPineDefsTrans: UNSAFE PROC [u: UserPineDefs.Transaction] RETURNS [t: Transaction];
UserPineDefsTransFromTransaction: UNSAFE PROC [t: Transaction] RETURNS [u: UserPineDefs.Transaction];
END.
Change Log
Created by MBrown on January 27, 1981 1:29 PM
Changed by MBrown on 29-Jan-81 12:07:08
Added AbortTransaction.
Changed by Russ Atkinson on 26-May-81 14:48:11
CedarString -> Rope
Changed by MBrown on 7-Dec-81 9:46:20
Rope.Ref -> ROPE.
Changed by MBrown on August 20, 1982 11:17 am
Added the escapes to Pine, format this file using Tioga nodes.