Sage-ST ä

Multsage

Documentation

CloseAllSystems CloseRelation CloseRelationDirect CloseSystem
CloseSystemDirect CloseSystemNumber CurrentSystemNumber DeleteRecord
DuplicateBlock EnableRecordLocking ExclusiveLocked ExclusiveReadLockRelation
ExclusiveUnlockRelation ExclusiveWriteLockRelation FindRecord FindRecordA
FindRecordC FindRecordF FindRecordI FindRecordN
FindRecordR FindRecordU GenerateUniqueKey GetBlock
GetBlockSize GetKeyPosition GetMaxUsers GetRecordLocking
GetRecordPreemptTime GetRelationPreemptTime GetUserID OpenRelation
OpenRelationDirect OpenSystem OpenSystemDirect PutBlock
ReWriteRecord ReadLockRecord ReadLockRelation ReadRecord
ReadRecordA ReadRecordC ReadRecordF ReadRecordI
ReadRecordN ReadRecordP ReadRecordR ReadRecordU
RecordIsWriteLocked RecordLockPending ReduceLongUserID RelationIsOpen
RelationIsOpenDirect RelationOpenForModify SetMaxUsers SetRecordPreemptTime
SetRelationPreemptTime SetToSystemNumber SetUserID SystemIsOpen
TotalRecords TotalRecordsDirect TruncateBlock UnlockRecord
UnlockRelation WriteLockRecord WriteLockRelation WriteRecord




  PROCEDURE CloseAllSystems;




  PROCEDURE CloseSystem;




  PROCEDURE CloseSystemNumber
             (CONST systemNumber : ModSys.INT32);




  PROCEDURE CloseRelation
             (CONST Relation : ARRAY OF CHAR);




  PROCEDURE CurrentSystemNumber
             () : ModSys.INT32;




  PROCEDURE DeleteRecord
             (CONST Relation : ARRAY OF CHAR);




  PROCEDURE DuplicateBlock
             (CONST Relation : ARRAY OF CHAR;
              CONST Field    : ARRAY OF CHAR);




  PROCEDURE EnableRecordLocking
             (CONST state : BOOLEAN);

  (**
      EnableRecordLocking - Set the record locking state.


      If "State" is TRUE then all record locking procedures are
      enabled, otherwise they are disabled.

      Setting "State" to TRUE provides the maximum protection in
      a multi-user environment.  The performance of the system is
      degraded in this mode.

      Setting "State" to FALSE provides the minimum protection in
      a multi-user environment.  The performance of the system is
      at its maximum in this mode.  In most cases, this mode is used
      where the programmer will control the multi-user aspects of
      the system using the semaphore mechanisms provided herein.

      By default the system is set with "State" as TRUE;

      CALLING SEQUENCE -

        EnableRecordLocking (State);

      ENTRY -

        State : BOOLEAN
          The desired state for system record locking.

      EXIT -

        None
          N/A
  *)




  PROCEDURE ExclusiveReadLockRelation
             (CONST RelationName : ARRAY OF CHAR;
              CONST LockTimeOut  : CARDINAL);

  (**
      ExclusiveReadLockRelation - Read lock an entire relation.


      The relation "RelationName" is read locked.  This will prohibit
      any other user from reading, rewriting or writing any records in
      the relation.

      The procedure will try for "LockTimeOut" seconds to lock the
      relation.  If it times out a sage error will be set.  If "LockTimeOut"
      is 0 it will wait forever.

      The difference between this procedure and "ReadLockRelation" is
      that this procedure cannot be preempted and hence runs faster.

      CALLING SEQUENCE -

        ExclusiveReadLockRelation (RelationName, LockTimeOut, PreemptTimeOut);

      ENTRY -

        RelationName : ARRAY OF CHAR
          The name of the relation to be locked.

        LockTimeOut : CARDINAL
          The time in seconds to try to lock.

      EXIT -

        Sage error is set if "RelationName" is invalid or the relation
          "RelationName" is already locked.
  *)




  PROCEDURE ExclusiveUnlockRelation
             (CONST RelationName : ARRAY OF CHAR);

  (**
      ExclusiveUnlockRelation - Unlock an entire relation.


      The relation "RelationName" is unlocked.

      CALLING SEQUENCE -

        ExclusiveUnlockRelation (RelationName);

      ENTRY -

        RelationName : ARRAY OF CHAR
          The name of the relation to lock.

      EXIT -

        Sage error is set if "RelationName" is invalid, the relation
          "RelationName" is not locked, or the lock timed out.
  *)




  PROCEDURE ExclusiveWriteLockRelation
             (CONST RelationName : ARRAY OF CHAR;
              CONST LockTimeOut  : CARDINAL);

  (**
      ExclusiveWriteLockRelation - Write lock an entire relation.


      The relation "RelationName" is write locked.  This will prohibit
      any other user from rewriting or writing any records in the relation.

      The procedure will try for "LockTimeOut" seconds to lock the
      relation.  If it times out a sage error will be set.  If "LockTimeOut"
      is 0 it will wait forever.

      The difference between this procedure and "WriteLockRelation" is
      that this procedure cannot be preempted and hence runs faster.

      CALLING SEQUENCE -

        ExclusiveWriteLockRelation (RelationName, LockTimeOut,
                                    PreemptTimeOut);

      ENTRY -

        RelationName : ARRAY OF CHAR
          The name of the relation to be locked.

        LockTimeOut : CARDINAL
          The time in seconds to try to lock.

      EXIT -

        Sage error is set if "RelationName" is invalid or the relation
          "RelationName" is already locked.
  *)




  PROCEDURE RecordLockPending
             (CONST RelationName : ARRAY OF CHAR) : BOOLEAN;

  (**
      RecordLockPending - A record lock has been requested for next Read.
  *)




  PROCEDURE ExclusiveLocked
             (CONST RelationName : ARRAY OF CHAR) : BOOLEAN;

  (**
      ExclusiveLocked - Determine if you have an exclusive rel. lock.
  *)




  PROCEDURE FindRecord
             (CONST Relation  : ARRAY OF CHAR;
              CONST Field     : ARRAY OF CHAR;
              CONST Operation : Sage.SageOperations);




  PROCEDURE FindRecordA
             (CONST Relation  : ARRAY OF CHAR;
              CONST Field     : ARRAY OF CHAR;
              CONST Operation : Sage.SageOperations;
              CONST Alpha     : ARRAY OF CHAR);




  PROCEDURE FindRecordC
             (CONST Relation  : ARRAY OF CHAR;
              CONST Field     : ARRAY OF CHAR;
              CONST Operation : Sage.SageOperations;
              CONST CardVal   : CARDINAL);




  PROCEDURE FindRecordF
             (CONST Relation  : ARRAY OF CHAR;
              CONST Field     : ARRAY OF CHAR;
              CONST Operation : Sage.SageOperations;
              CONST RealVal   : REAL);




  PROCEDURE FindRecordI
             (CONST Relation  : ARRAY OF CHAR;
              CONST Field     : ARRAY OF CHAR;
              CONST Operation : Sage.SageOperations;
              CONST IntVal    : INTEGER);




  PROCEDURE FindRecordN
             (CONST Relation : ARRAY OF CHAR;
              CONST Field    : ARRAY OF CHAR;
              CONST Number   : ModSys.INT32);




  PROCEDURE FindRecordR
             (CONST Relation1 : ARRAY OF CHAR;
              CONST Field1    : ARRAY OF CHAR;
              CONST Operation : Sage.SageOperations;
              CONST Relation2 : ARRAY OF CHAR;
              CONST Field2    : ARRAY OF CHAR);




  PROCEDURE FindRecordU
             (CONST Relation  : ARRAY OF CHAR;
              CONST Field     : ARRAY OF CHAR;
              CONST Operation : Sage.SageOperations;
              CONST Value     : ARRAY OF UCHAR);




  PROCEDURE GenerateUniqueKey
             (CONST Relation : ARRAY OF CHAR;
              CONST Field    : ARRAY OF CHAR;
              VAR   keyNum   : ModSys.INT32);




  PROCEDURE GetBlock
             (CONST Relation  : ARRAY OF CHAR;
              CONST Field     : ARRAY OF CHAR;
              CONST Buff      : SYSTEM.ADDRESS;
              VAR   nBytes    : CARDINAL;
              VAR   firstByte : ModSys.INT32);




  PROCEDURE GetBlockSize
             (CONST Relation : ARRAY OF CHAR;
              CONST Field    : ARRAY OF CHAR;
              VAR   size     : ModSys.INT32);




  PROCEDURE GetKeyPosition
             (CONST Relation : ARRAY OF CHAR;
              CONST Field    : ARRAY OF CHAR;
              VAR   Position : ModSys.INT32);




  PROCEDURE GetRecordPreemptTime
             () : CARDINAL;

  (**
      GetRecordPreemptTime - Get default record preempt time.


      The current value of the system default record preempt time
      is returned.

      CALLING SEQUENCE -

        Seconds := GetRecordPreemptTime ();

      ENTRY -

        None
          N/A

      EXIT -

        Seconds : CARDINAL
          The current value of the system record preempt time.
  *)




  PROCEDURE GetRelationPreemptTime
             () : CARDINAL;

  (**
      GetRelationPreemptTime - Get default relation preempt time.


      The current value of the system default relation preempt time
      is returned.

      CALLING SEQUENCE -

        Seconds := GetRelationPreemptTime ();

      ENTRY -

        None
          N/A

      EXIT -

        Seconds : CARDINAL
          The current value of the system relation preempt time.
  *)




  PROCEDURE GetUserID
             (VAR   CurrentUserID : ARRAY OF CHAR);

  (**
      GetUserID - Get the User ID.


      The current value of the UserID is gotten.

      CALLING SEQUENCE -

        GetUserID (CurrentUserID);

      ENTRY -

        None
          N/A

      EXIT -

        CurrentUserID : ARRAY OF CHAR
          A three character array.
  *)




  PROCEDURE SystemIsOpen
             (CONST Dictionary : ARRAY OF CHAR) : BOOLEAN;




  PROCEDURE OpenSystem
             (CONST Dictionary : ARRAY OF CHAR;
              CONST MaxForms   : CARDINAL;
              CONST MaxScreens : CARDINAL;
              CONST BufferSize : CARDINAL);




  PROCEDURE OpenRelation
             (CONST Relation : ARRAY OF CHAR;
              CONST Modify   : BOOLEAN);




  PROCEDURE PutBlock
             (CONST Relation  : ARRAY OF CHAR;
              CONST Field     : ARRAY OF CHAR;
              CONST Buff      : SYSTEM.ADDRESS;
              CONST nBytes    : CARDINAL;
              VAR   firstByte : ModSys.INT32);




  PROCEDURE ReadLockRecord
             (CONST RelationName   : ARRAY OF CHAR;
              CONST LockTimeOut    : CARDINAL;
              CONST PreemptTimeOut : CARDINAL);

  (**
      ReadLockRecord - Cause next record read to be read locked.


      The next record read from relation "RelationName", in any form
      (i.e. ReadRecord, ReadRecordP, etc.), will be read locked.
      This will prohibit any other user from reading or rewriting the
      next record read.  To unlock the record either "ReWrite", "Delete"
      or "UnlockRecord" the record.

      When the read operation is attempted it will try for "LockTimeOut"
      seconds to read with lock.  If it times out a sage error will be
      set.  If "LockTimeOut" is 0 it will wait forever.

      The record lock that occurs as a result of the next read will be
      un-preemptable for either "PreemptTimeOut" seconds or
      "SysRecordPreemptTimeOut" seconds, whichever is shorter.

      CALLING SEQUENCE -

        ReadLockRecord (RelationName, LockTimeOut, PreemptTimeOut);

      ENTRY -

        RelationName : ARRAY OF CHAR
          The name of the relation whose record is to be locked.

        LockTimeOut : CARDINAL
          The time in seconds to try to read with lock.

        PreemptTimeOut : CARDINAL
          The time in seconds to not allow lock preempting.

      EXIT -

        Sage error is set if "RelationName" is invalid or the relation
          "RelationName" has a record locked.
  *)




  PROCEDURE ReadLockRelation
             (CONST RelationName   : ARRAY OF CHAR;
              CONST LockTimeOut    : CARDINAL;
              CONST PreemptTimeOut : CARDINAL);

  (**
      ReadLockRelation - Read lock an entire relation.


      The relation "RelationName" is read locked.  This will prohibit
      any other user from reading, rewriting or writing any records in
      the relation.

      The procedure will try for "LockTimeOut" seconds to lock the
      relation.  If it times out a sage error will be set. If "LockTimeOut"
      is 0 it will wait forever.

      The relation lock will be un-preemptable for either "PreemptTimeOut"
      seconds or "SysRelationPreemptTimeOut" seconds, whichever
      is shorter.

      CALLING SEQUENCE -

        ReadLockRelation (RelationName, LockTimeOut, PreemptTimeOut);

      ENTRY -

        RelationName : ARRAY OF CHAR
          The name of the relation to be locked.

        LockTimeOut : CARDINAL
          The time in seconds to try to lock.

        PreemptTimeOut : CARDINAL
          The time in seconds to not allow lock preempting.

      EXIT -

        Sage error is set if "RelationName" is invalid or the relation
          "RelationName" is already locked.
  *)




  PROCEDURE ReadRecord
             (CONST Relation  : ARRAY OF CHAR;
              CONST Field     : ARRAY OF CHAR;
              CONST Operation : Sage.SageOperations);




  PROCEDURE ReadRecordA
             (CONST Relation  : ARRAY OF CHAR;
              CONST Field     : ARRAY OF CHAR;
              CONST Operation : Sage.SageOperations;
              CONST Alpha     : ARRAY OF CHAR);




  PROCEDURE ReadRecordC
             (CONST Relation  : ARRAY OF CHAR;
              CONST Field     : ARRAY OF CHAR;
              CONST Operation : Sage.SageOperations;
              CONST CardVal   : CARDINAL);




  PROCEDURE ReadRecordF
             (CONST Relation  : ARRAY OF CHAR;
              CONST Field     : ARRAY OF CHAR;
              CONST Operation : Sage.SageOperations;
              CONST RealVal   : REAL);




  PROCEDURE ReadRecordI
             (CONST Relation  : ARRAY OF CHAR;
              CONST Field     : ARRAY OF CHAR;
              CONST Operation : Sage.SageOperations;
              CONST IntVal    : INTEGER);




  PROCEDURE ReadRecordN
             (CONST Relation : ARRAY OF CHAR;
              CONST Field    : ARRAY OF CHAR;
              CONST Number   : ModSys.INT32);




  PROCEDURE ReadRecordP
             (CONST Relation : ARRAY OF CHAR;
              CONST Field    : ARRAY OF CHAR;
              CONST Number   : ModSys.INT32);




  PROCEDURE ReadRecordR
             (CONST Relation1 : ARRAY OF CHAR;
              CONST Field1    : ARRAY OF CHAR;
              CONST Operation : Sage.SageOperations;
              CONST Relation2 : ARRAY OF CHAR;
              CONST Field2    : ARRAY OF CHAR);




  PROCEDURE ReadRecordU
             (CONST Relation  : ARRAY OF CHAR;
              CONST Field     : ARRAY OF CHAR;
              CONST Operation : Sage.SageOperations;
              CONST Value     : ARRAY OF UCHAR);




  PROCEDURE RelationIsOpen
             (CONST Relation : ARRAY OF CHAR) : BOOLEAN;

  (**
      RelationIsOpen - Check to see if relation is open.

      (Refer to the documentation for the same procedure in the Sage package).
  *)




  PROCEDURE RelationOpenForModify
             (CONST Relation : ARRAY OF CHAR) : BOOLEAN;

  (**
      RelationOpenForModify - Check to see if relation is opened for modify.

      (Refer to the documentation for the same procedure in the Sage package).
  *)




  PROCEDURE ReWriteRecord
             (CONST Relation : ARRAY OF CHAR);




  PROCEDURE RecordIsWriteLocked
             (CONST Relation : ARRAY OF CHAR) : BOOLEAN;

  (**
      RecordIsWriteLocked - The record has a write lock.

      This function returns a true if a write permission lock is
      currently in place.  This could be if :
      1.  A record write lock was requested on a record and has not
            been preempted.
      2.  An exclusive read or write lock is in force for the relation.
      3.  Locking has been turned off
  *)




  PROCEDURE SetRecordPreemptTime
             (CONST Seconds : CARDINAL);

  (**
      SetRecordPreemptTime - Set default record preempt time.


      The system default record preempt time is set to "Seconds".

      This value sets the upper limit on the preempt time for
      record locks.

      CALLING SEQUENCE -

        SetRecordPreemptTime (Seconds);

      ENTRY -

        Seconds : CARDINAL
          The number of seconds to set the record preempt time
          limit to.

      EXIT -

        None
          N/A
  *)




  PROCEDURE SetRelationPreemptTime
             (CONST Seconds : CARDINAL);

  (**
      SetRelationPreemptTime - Set default relation preempt time.


      The system default relation preempt time is set to "Seconds".

      This value sets the upper limit on the preempt time for
      relation locks.

      CALLING SEQUENCE -

        SetRelationPreemptTime (Seconds);

      ENTRY -

        Seconds : CARDINAL
          The number of seconds to set the relation preempt time
          limit to.

      EXIT -

        None
          N/A
  *)




  PROCEDURE SetToSystemNumber
             (CONST systemNumber : ModSys.INT32);




  PROCEDURE SetUserID
             (CONST NewUserID : ARRAY OF CHAR);

  (**
      SetUserID - Set the User ID.


      The current value of the UserID is set.

      CALLING SEQUENCE -

        SetUserID (NewUserID);

      ENTRY -

        NewUserID : ARRAY OF CHAR
          A three character array.

      EXIT -

        None
  *)




  PROCEDURE TotalRecords
             (CONST relName : ARRAY OF CHAR) : ModSys.INT32;




  PROCEDURE TruncateBlock
             (CONST Relation  : ARRAY OF CHAR;
              CONST Field     : ARRAY OF CHAR;
              VAR   firstByte : ModSys.INT32);




  PROCEDURE UnlockRecord
             (CONST RelationName : ARRAY OF CHAR);

  (**
      UnlockRecord - Unlock a pending record lock.


      If the relation "RelationName" has a record locked then the record is
      unlocked.  No data base update is associated with this operation.

      CALLING SEQUENCE -

        UnlockRecord (RelationName);

      ENTRY -

        RelationName : ARRAY OF CHAR
          The name of the relation whose record is to be unlocked.

      EXIT -

        Sage error is set if "RelationName" is invalid, the relation
          "RelationName" has no record locked, or the record lock timed
          out.
  *)




  PROCEDURE UnlockRelation
             (CONST RelationName : ARRAY OF CHAR);

  (**
      UnlockRelation - Unlock an entire relation.


      The relation "RelationName" is unlocked.

      CALLING SEQUENCE -

        UnlockRelation (RelationName);

      ENTRY -

        RelationName : ARRAY OF CHAR
          The name of the relation to lock.

      EXIT -

        Sage error is set if "RelationName" is invalid, the relation
          "RelationName" is not locked, or the lock timed out.
  *)




  PROCEDURE WriteLockRecord
             (CONST RelationName   : ARRAY OF CHAR;
              CONST LockTimeOut    : CARDINAL;
              CONST PreemptTimeOut : CARDINAL);

  (**
      WriteLockRecord - Cause next record read to be write locked.


      The next record read from relation "RelationName", in any form
      (i.e. ReadRecord, ReadRecordP, etc.), will be write locked.
      This will prohibit any other user from rewriting the
      next record read.  To unlock the record either "ReWrite", "Delete"
      or "UnlockRecord" the record.

      When the read operation is attempted it will try for "LockTimeOut"
      seconds to read with lock.  If it times out a sage error will
      be set. If "LockTimeOut" is 0 it will wait forever.

      The record lock that occurs as a result of the next read will be
      un-preemptable for either "PreemptTimeOut" seconds or
      "SysRecordPreemptTimeOut" seconds, whichever is shorter.

      CALLING SEQUENCE -

        WriteLockRecord (RelationName, LockTimeOut, PreemptTimeOut);

      ENTRY -

        RelationName : ARRAY OF CHAR
          The name of the relation whose record is to be locked.

        LockTimeOut : CARDINAL
          The time in seconds to try to read with lock.

        PreemptTimeOut : CARDINAL
          The time in seconds to not allow lock preempting.

      EXIT -

        Sage error is set if "RelationName" is invalid or the relation
          "RelationName" has a record locked.
  *)




  PROCEDURE WriteLockRelation
             (CONST RelationName   : ARRAY OF CHAR;
              CONST LockTimeOut    : CARDINAL;
              CONST PreemptTimeOut : CARDINAL);

  (**
      WriteLockRelation - Write lock an entire relation.


      The relation "RelationName" is write locked.  This will prohibit
      any other user from rewriting or writing any records in the relation.

      The procedure will try for "LockTimeOut" seconds to lock the
      relation.  If it times out a sage error will be set.  If "LockTimeOut"
      is 0 it will wait forever.

      The relation lock will be un-preemptable for either "PreemptTimeOut"
      seconds or "SysRelationPreemptTimeOut" seconds, whichever
      is shorter.

      CALLING SEQUENCE -

        WriteLockRelation (RelationName, LockTimeOut, PreemptTimeOut);

      ENTRY -

        RelationName : ARRAY OF CHAR
          The name of the relation to be locked.

        LockTimeOut : CARDINAL
          The time in seconds to try to lock.

        PreemptTimeOut : CARDINAL
          The time in seconds to not allow lock preempting.

      EXIT -

        Sage error is set if "RelationName" is invalid or the relation
          "RelationName" is already locked.
  *)




  PROCEDURE WriteRecord
             (CONST Relation : ARRAY OF CHAR);




  PROCEDURE GetRecordLocking
             (VAR   lockingEnabled : BOOLEAN);




  PROCEDURE ReduceLongUserID
             (CONST longUserID     : ARRAY OF CHAR;
              VAR   acceptedUserID : ARRAY OF CHAR);

  (**
      ReduceLongUserID - Reduce a long user ID to an acceptable unique 3 char. one.
  *)




  PROCEDURE GetMaxUsers
             (VAR   maximumUsers : CARDINAL);




  PROCEDURE SetMaxUsers
             (CONST maximumUsers : CARDINAL);




  PROCEDURE OpenSystemDirect
             (CONST Dictionary : ARRAY OF CHAR;
              CONST MaxForms   : CARDINAL;
              CONST MaxScreens : CARDINAL;
              CONST BufferSize : CARDINAL) : ModSys.INT32;




  PROCEDURE CloseSystemDirect
             (CONST systemNumber : ModSys.INT32);




  PROCEDURE OpenRelationDirect
             (CONST systemNumber   : CARDINAL;
              CONST relationNumber : CARDINAL;
              CONST Modify         : BOOLEAN);




  PROCEDURE CloseRelationDirect
             (CONST systemNumber   : CARDINAL;
              CONST relationNumber : CARDINAL);




  PROCEDURE TotalRecordsDirect
             (CONST systemNumber   : CARDINAL;
              CONST relationNumber : CARDINAL) : ModSys.INT32;




  PROCEDURE RelationIsOpenDirect
             (CONST systemNumber   : CARDINAL;
              CONST relationNumber : CARDINAL) : BOOLEAN;




Send mail to   warren.merrill@inl.gov with questions or comments about this web site.
Copyright © 1989-2006 Battelle Energy Alliance