Sage-ST ä

Cfglib

Documentation

Global Declarations (Constants, Types, Variables)
ChangeUserInfo ChangeUserPassword ConvertCFGToCurrent
GetDFLPath GetLogPath GetPath GetRelationPath
ReleaseForeignUserPasswords ResetCFGRelationPath ResetDFLPath ResetLogPath
ResetPath ReturnUserID ReturnUserInfo ReturnUserPWData
ReturnUserProcesses SetForeignUserPasswords SetUserPasswords TotalProcesses
TotalUsers





  CONST
    TypeLen6_1 = 30;
    TypeLen6_2 = 257;

  TYPE
    TokenType = ARRAY [0 .. 7] OF CHAR;




  PROCEDURE GetPath
             (CONST dflFile : ARRAY OF CHAR;
              CONST keyName : ARRAY OF CHAR;
              VAR   Path    : ARRAY OF CHAR);

  (**
      GetPath - Get a special path from the configuration file.


      This procedure returns a path associated with a special key as
      defined in the configuration file (.CFG) if it exists.

      CALLING SEQUENCE -

        GetPath (dflFile, keyName, path)

      ENTRY -

        dflFile : ARRAY OF CHAR
          The name of the .DFL file of concern.

        keyName : ARRAY OF CHAR
          The name which identifies the required path.

      EXIT -

        path : ARRAY OF CHAR
          The path associated with the given key name.
  *)




  PROCEDURE ResetPath
             (CONST dflFile : ARRAY OF CHAR;
              CONST keyName : ARRAY OF CHAR;
              CONST Path    : ARRAY OF CHAR;
              VAR   Error   : BOOLEAN);

  (**
      ResetPath - Reset a special path for a configuration key.


      This procedure resets a path associated with a special key as
      defined in the configuration file (.CFG) if it exists.

      CALLING SEQUENCE -

        ResetPath (dflFile, keyName, path, error)

      ENTRY -

        dflFile : ARRAY OF CHAR
          The name of the .DFL file of concern.

        keyName : ARRAY OF CHAR
          The name which identifies the required path.

        path : ARRAY OF CHAR
          The path to reset.

      EXIT -

        error : BOOLEAN
          The result of the modification TRUE=Success, FALSE=No Success
  *)




  PROCEDURE GetRelationPath
             (CONST dflFile      : ARRAY OF CHAR;
              CONST RelationName : ARRAY OF CHAR;
              VAR   Path         : ARRAY OF CHAR);

  (**
      GetRelationPath - Get a relation path from the configuration file.


      This procedure returns a path associated with a relation as
      defined in the configuration file (.CFG) if it exists.

      CALLING SEQUENCE -

        GetRelationPath (dflFile, relationName, path)

      ENTRY -

        dflFile : ARRAY OF CHAR
          The name of the .DFL file of concern.

        relationName : ARRAY OF CHAR
          The relation name which identifies the required path.

      EXIT -

        path : ARRAY OF CHAR
          The path associated with the given relation name.
  *)




  PROCEDURE ResetCFGRelationPath
             (CONST dflFile      : ARRAY OF CHAR;
              CONST RelationName : ARRAY OF CHAR;
              CONST Path         : ARRAY OF CHAR;
              VAR   Error        : BOOLEAN);

  (**
      ResetCFGRelationPath - Reset a saved relation path to the configuration file.


      This procedure resets the path associated with the specified
      relation as defined in the configuration file (.CFG) if it exists.

      CALLING SEQUENCE -

        ResetCFGRelationPath (dflFile, relationName, path, error)

      ENTRY -

        dflFile : ARRAY OF CHAR
          The name of the .DFL file of concern.

        relationName : ARRAY OF CHAR
          The relation name which identifies the required path.

        path : ARRAY OF CHAR
          The new path.

      EXIT -

        error : BOOLEAN
          The result of the modification TRUE=Success, FALSE=No Success
  *)




  PROCEDURE GetDFLPath
             (CONST dflFile : ARRAY OF CHAR;
              VAR   Path    : ARRAY OF CHAR);

  (**
      GetDFLPath - Get a dfl path from the configuration file.


      This procedure returns a path associated with a dfl as
      defined in the configuration file (.CFG) if it exists.

      CALLING SEQUENCE -

        GetDFLPath (dflFile, path)

      ENTRY -

        dflFile : ARRAY OF CHAR
          The name of the .dfl file of concern.

      EXIT -

        path : ARRAY OF CHAR
          The path associated with the given .dfl name.
  *)




  PROCEDURE ResetDFLPath
             (CONST dflFile : ARRAY OF CHAR;
              CONST Path    : ARRAY OF CHAR;
              VAR   Error   : BOOLEAN);

  (**
      ResetDFLPath - Reset the DFL path found in the configuration file.


      This procedure resets the dfl path found in the configuration
      defined in the configuration file (.CFG) if it exists.

      CALLING SEQUENCE -

        ResetDFLPath (dflFile, path, error)

      ENTRY -

        dflFile : ARRAY OF CHAR
          The name of the .dfl file of concern.

        path : ARRAY OF CHAR
          The new dfl path.

      EXIT -

        error : BOOLEAN
          The result of the modification TRUE=Success, FALSE=No Success
  *)




  PROCEDURE GetLogPath
             (CONST dflFile : ARRAY OF CHAR;
              VAR   Path    : ARRAY OF CHAR);

  (**
      GetLogPath - Get a Log path from the configuration file.


      This procedure returns a path associated with a Log as
      defined in the configuration file (.CFG) if it exists.

      CALLING SEQUENCE -

        GetLogPath (dflFile, path)

      ENTRY -

        dflFile : ARRAY OF CHAR
          The name of the .dfl file of concern.

      EXIT -

        path : ARRAY OF CHAR
          The path associated with the given Log name.
  *)




  PROCEDURE ResetLogPath
             (CONST dflFile : ARRAY OF CHAR;
              CONST Path    : ARRAY OF CHAR;
              VAR   Error   : BOOLEAN);

  (**
      ResetLOGPath - Reset the log file path found in the configuration file.


      This procedure resets the log file path found in the configuration
      defined in the configuration file (.CFG) if it exists.

      CALLING SEQUENCE -

        ResetLogPath (dflFile, path, error)

      ENTRY -

        dflFile : ARRAY OF CHAR
          The name of the .dfl file of concern.

        path : ARRAY OF CHAR
          The new log file path

      EXIT -

        error : BOOLEAN
          The result of the modification TRUE=Success, FALSE=No Success
  *)




  PROCEDURE TotalUsers
             (CONST dflFile : ARRAY OF CHAR) : CARDINAL;

  (**
      TotalUsers - Return the total users in the security system.


      This procedure returns the total number of users stored in
      the security system.

      CALLING SEQUENCE -

        n := TotalUsers (dflFile);

      ENTRY -

        dflFile : ARRAY OF CHAR
          The name of the database file (if a suffix is not given,
          then ".DFL" is appended).

      EXIT -

        n : CARDINAL
          The total number of users referenced in the configuration.
  *)




  PROCEDURE ReturnUserID
             (CONST dflFile : ARRAY OF CHAR;
              CONST userNum : CARDINAL;
              VAR   userID  : ARRAY OF CHAR);

  (**
      ReturnUserID - Return the user ID for a specified user number.


      This procedure returns the user ID for a given user number.
  *)




  PROCEDURE ReturnUserInfo
             (CONST dflFile   : ARRAY OF CHAR;
              CONST userID    : ARRAY OF CHAR;
              VAR   lastName  : ARRAY OF CHAR;
              VAR   firstName : ARRAY OF CHAR;
              VAR   middleI   : CHAR;
              VAR   logging   : CHAR;
              VAR   phone     : ARRAY OF CHAR;
              VAR   org       : ARRAY OF CHAR;
              VAR   address1  : ARRAY OF CHAR;
              VAR   address2  : ARRAY OF CHAR;
              VAR   city      : ARRAY OF CHAR;
              VAR   state     : ARRAY OF CHAR;
              VAR   country   : ARRAY OF CHAR;
              VAR   zip       : ARRAY OF CHAR;
              VAR   Des       : ARRAY OF CHAR);

  (**
      ReturnUserInfo - Return information about the given user.


      This procedure returns the basic user information
      for the specified user.
  *)




  PROCEDURE ChangeUserInfo
             (CONST dflFile   : ARRAY OF CHAR;
              CONST userID    : ARRAY OF CHAR;
              CONST lastName  : ARRAY OF CHAR;
              CONST firstName : ARRAY OF CHAR;
              CONST middleI   : CHAR;
              CONST phone     : ARRAY OF CHAR;
              CONST org       : ARRAY OF CHAR;
              CONST address1  : ARRAY OF CHAR;
              CONST address2  : ARRAY OF CHAR;
              CONST city      : ARRAY OF CHAR;
              CONST state     : ARRAY OF CHAR;
              CONST country   : ARRAY OF CHAR;
              CONST zip       : ARRAY OF CHAR;
              VAR   good      : BOOLEAN);

  (**
      ChangeUserInfo - Change user information.


      This procedure allows changing of selected user information
      items.  Other items such as the description and passwords
      are not changed by this procedure.  The current user information
      may be acquired using "CFGLib.ReturnUserInfo".
  *)




  PROCEDURE ChangeUserPassword
             (CONST dflFile : ARRAY OF CHAR;
              CONST userID  : ARRAY OF CHAR;
              CONST oldPW   : ARRAY OF CHAR;
              CONST NewPW   : ARRAY OF CHAR;
              VAR   good    : BOOLEAN);

  (**
      ChangeUserPassword - Change a current user password.


      This procedure changes the selected current user password
      from the previous value to the new value.  A user may have
      more than one password.  This procedure only changes the
      one specified.  The new password should not be blank.
  *)




  PROCEDURE SetUserPasswords
             (CONST dflFile      : ARRAY OF CHAR;
              CONST userID       : ARRAY OF CHAR;
              CONST userPassword : ARRAY OF CHAR);

  (**
      SetUserPasswords - Submit passwords to the system.


      This procedure submits passwords to SAGE based on the given
      user ID and password.  The associated system passwords are
      set which allows the user permissions of data base access
      as restricted by the normal SAGE password security system.
  *)




  PROCEDURE SetForeignUserPasswords
             (CONST dflFile      : ARRAY OF CHAR;
              CONST userID       : ARRAY OF CHAR;
              CONST userPassword : ARRAY OF CHAR);

  (**
      SetForeignUserPasswords - Submit passwords to the system for external DFL's.


      This procedure submits passwords to SAGE based on the given
      user ID and password.  The associated system passwords are
      set which allows the user permissions of data base access
      as restricted by the normal SAGE password security system
      implemented in libraries such as "SageDyn".  Each time this
      is called, the previously established foreign passwords are
      released.
  *)




  PROCEDURE ReleaseForeignUserPasswords;

  (**
      ReleaseForeignUserPasswords - Release internal list of foreign pw's.


      This procedure releases the list of passwords which were previously
      set by a call to "SetForeignUserPasswords.
  *)




  PROCEDURE ReturnUserPWData
             (CONST dflFile      : ARRAY OF CHAR;
              CONST userID       : ARRAY OF CHAR;
              CONST userPassword : ARRAY OF CHAR;
              VAR   accessMode   : CARDINAL;
              VAR   workAreaPath : ARRAY OF CHAR);

  (**
      ReturnUserPWData - Return information associated with the user PW.


      This procedure returns information associated with the
      given user and password for the specified data base.

      CALLING SEQUENCE -

        ReturnUserPWData (dflFile, userID, userPassword, accessMode,
                          workAreaPath, totalProcesses)

      ENTRY -

        dflFile : ARRAY OF CHAR
          Name of data base dictionary file.  If given without
          a suffix, then ".DFL" is appended.

        userID : ARRAY OF CHAR
          User ID of the user.

        userPassword : ARRAY OF CHAR
          Password for the specified user.

      EXIT -

        accessMode : CARDINAL
          The access mode associated with this password.  These
          may be determined by the program, but are commonly
          defined as follows -

          0 - Single user normal access.
          1 - Single user with File.DenyNone set for the sharing mode
          2 - Copy required relation files to local space.  Single
              user access to those relations.
          3 - MultSage access with exclusive locks
          4 - Try for an exclusive lock.  If unavailable, use normal
              MultSage access
          5 - Normal MultSage access

        workAreaPath : ARRAY OF CHAR
          Path for the required local work area.  This area may be
          used for local file space if "accessMode" is set to 2.

        totalProcesses : CARDINAL
          The total number of processes associated with the given
          db name, user, and password.  The actual process may
          be retrieved using "CFGLib.ReturnUserProcesses".
          This is the same number as returned from
          "CFGLib.TotalProcesses".
  *)




  PROCEDURE TotalProcesses
             (CONST dflFile      : ARRAY OF CHAR;
              CONST userID       : ARRAY OF CHAR;
              CONST userPassword : ARRAY OF CHAR) : CARDINAL;

  (**
      TotalProcesses - Return the total processes available for the user.


      This procedure returns the total number of passwords assigned
      to the given user under the specified password.  The names of
      these processes may be retrieved using
      "CFGLib.ReturnUserProcesses".
  *)




  PROCEDURE ReturnUserProcesses
             (CONST dflFile       : ARRAY OF CHAR;
              CONST userID        : ARRAY OF CHAR;
              CONST userPassword  : ARRAY OF CHAR;
              VAR   processes     : ARRAY OF TokenType;
              CONST maxProcesses  : CARDINAL;
              VAR   totalReturned : CARDINAL);

  (**
      ReturnUserProcesses - Return the processes for the user.


      This procedure returns the processes assigned to the given
      user and associated given user password.  It will return
      no more than the 'maxProcesses' specified in the argument
      list.  To determine the total number of processes available
      under the given user and password conditions, the
      "CFGLib.TotalProcesses" procedure may be used.
  *)




  PROCEDURE ConvertCFGToCurrent
             (CONST dflFile   : ARRAY OF CHAR;
              VAR   CFGFound  : BOOLEAN;
              VAR   Converted : BOOLEAN);

  (**
      ReturnUserProcesses - Return the processes for the user.


      This procedure converts the .CFG file of the given .DFL to
      the latest format if possible.  If the file is found the
      CFGFound param is set appropriately whether the file gets
      converted or not.  The Converted parameter will give the
      result of the attempt to convert.

      CALLING SEQUENCE -

        ConvertCFGToCurrent (dflFile, CFGFound, Converted)

      ENTRY -

        dflFile : ARRAY OF CHAR
          Name of data base dictionary file.  If given without a suffix,
          then ".DFL" is appended.

      EXIT -

        CFGFound : BOOLEAN
          TRUE - The .CFG file was located whether conversion was successful
                 or not.
          FALSE - The .CFG file was NOT located whether conversion was successful
                  or not.

        Converted : BOOLEAN
          TRUE - The .CFG file was converted to the current format.
          FALSE - The .CFG file was NOT converted to the current format.
  *)




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