|
|
DataMuseum.dkPresents historical artifacts from the history of: Rational R1000/400 |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Rational R1000/400 Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - download
Length: 30720 (0x7800)
Types: Ada Source
Notes: 03_class, FILE, R1k_Segment, e3_tag, package Xlbp_Rm, seg_004f80
└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000
└─⟦5a81ac88f⟧ »Space Info Vol 1«
└─⟦this⟧
with Xlbt_Arithmetic;
use Xlbt_Arithmetic;
with Xlbt_Basic;
use Xlbt_Basic;
with Xlbt_Rm;
use Xlbt_Rm;
with Xlbt_Rm2;
use Xlbt_Rm2;
with Xlbt_String;
use Xlbt_String;
with Xlbt_Univ_Ptr;
use Xlbt_Univ_Ptr;
package Xlbp_Rm is
------------------------------------------------------------------------------
-- X Library Resource Manager
--
-- Xlbp_Rm - Manager of application/window/object resources
------------------------------------------------------------------------------
-- Copyright 1989 - 1991 by Rational, Santa Clara, California.
-- Copyright 1987 - 1989 by Digital Equipment Corporation, Maynard, Mass.
-- Copyright 1987 - 1989 by Massachusetts Institute of Technology,
-- Cambridge, Massachusetts.
--
-- All Rights Reserved.
--
-- Permission to use, copy, modify, and distribute this software and its
-- documentation for any purpose and without fee is hereby granted,
-- provided that the above copyright notice(s) appear in all copies and that
-- both that copyright notice(s) and this permission notice appear in
-- supporting documentation, and that the names of Digital, MIT, or Rational
-- not be used in advertising or publicity pertaining to distribution of
-- the software without specific, written prior permission.
--
-- Digital, MIT, and Rational disclaim all warranties with regard to this
-- software, including all implied warranties of merchantability and fitness,
-- in no event shall Digital, MIT, or Rational be liable for any special,
-- indirect or consequential damages or any damages whatsoever resulting from
-- loss of use, data or profits, whether in an action of contract, negligence
-- or other tortious action, arising out of or in connection with the use or
-- performance of this software.
------------------------------------------------------------------------------
--\x0c
------------------------------------------------------------------------------
-- Resource Manager Functions - Database Query
------------------------------------------------------------------------------
function X_New_Rm_Database return X_Rm_Database;
------------------------------------------------------------------------------
-- Called to obtain a newly allocated, completely empty database. Free the
-- database after use with Free_X_Rm_Database.
------------------------------------------------------------------------------
procedure X_Rm_Get_Resource (Database : X_Rm_Database;
Names : X_String;
Classes : X_String;
Representation : out X_Rm_Representation;
Value : out X_Rm_Value);
--------------------------------------------------------------------------
-- Database - Specifies the database to use for the lookup.
-- Names - Specifies the fully qualified name of the value; e.g. a.b.c
-- Classes - Specifies the fully qualified class of the value; e.g. A.B.C
-- Representation- Receives the representation of the value
-- Value - Receives the entry from the database or None_X_Rm_Value
--
-- If successful (Value /= None_X_Rm_Value) then Value has received an
-- X_Rm_Value from within the database. Any heap based data returned is shared
-- with the database (and possibly other databases) so do not attempt free the
-- data contained within the value.
--
-- Will raise Constraint_Error if either Names or Classes contains
-- illegal characters.
--------------------------------------------------------------------------
procedure X_Rm_Get_Resource (Database : X_Rm_Database;
Names : X_Rm_Name_Array;
Classes : X_Rm_Class_Array;
Representation : out X_Rm_Representation;
Value : out X_Rm_Value);
--------------------------------------------------------------------------
-- Database - Specifies the database to use for the lookup.
-- Names - Specifies the fully qualified name of the value.
-- Classes - Specifies the fully qualified class of the value.
-- Representation- Receives the representation of the value
-- Value - Receives the entry from the database or None_X_Rm_Value
--
-- If successful (Value /= None_X_Rm_Value) then Value has received an
-- X_Rm_Value from within the database. Any heap based data returned is shared
-- with the database (and possibly other databases) so do not attempt free the
-- data contained within the entry.
--------------------------------------------------------------------------
--\x0c
------------------------------------------------------------------------------
-- Resource Manager Functions - Database Update
------------------------------------------------------------------------------
procedure X_Rm_Put_Resource (Database : in out X_Rm_Database;
Bindings : X_Rm_Binding_Array;
Names : X_Rm_Name_Array;
Representation : X_Rm_Representation;
Value : X_Rm_Value;
Db_Owner : Boolean := True);
procedure X_Rm_Put_Resource (Database : in out X_Rm_Database;
Bindings : X_Rm_Binding_Array;
Classes : X_Rm_Class_Array;
Representation : X_Rm_Representation;
Value : X_Rm_Value;
Db_Owner : Boolean := True);
procedure X_Rm_Put_Resource (Database : in out X_Rm_Database;
Bindings : X_Rm_Binding_Array;
Quarks : X_Rm_Quark_Array;
Representation : X_Rm_Representation;
Value : X_Rm_Value;
Db_Owner : Boolean := True);
--------------------------------------------------------------------------
-- Database - Specifies the database to modify; if None_X_Rm_Database
-- then a new database record will be created.
-- Bindings - Specifies a list of binding types.
-- Names/Classes/Quarks - Specifies the partial name, class, or quark list
-- of the resource.
-- Representation - Specifies the type of the resource.
-- Value - Specifies the value of the resource.
-- Db_Owner - Specifies True if the database is to be responsible for
-- deallocating any heap storage utilized by Value once the
-- last database entry for this Value is overwritten or
-- released.
--
-- Place an X_Rm_Value into the database.
--
-- To "remove" a value from the database simply pass an X_Rm_Value'(Kind =>
-- Is_None) in as Value. The database storage space will not grow if the
-- indicated value was not there to begin with and it will shrink (by a tiny
-- amount) if the value is eliminated by an Is_None assignment.
--
-- If Db_Owner is True (the default) then any heap storage represented by
-- the Value becomes the "property" of the database and it must not be
-- subsequently modified or freed. If several entries in one database (or
-- individual entries in multiple databases) are all to be given entries
-- which will all have the same heap-using Value then either a) none of the
-- database entries should be made with Db_Owner => True (meaning that the
-- application is responsible for releasing the heap storage), or b) only
-- one database entry should have Db_Owner => True and that database must
-- be deallocated last of any databases sharing this value.
--
-- Note that if Value is an Is_X_Universal_Pointer then Db_Owner has no affect
-- if the Free routine within the Value is None_X_Universal_Pointer. A database
-- cannot free a Universal pointer when no Free routine has been provided.
--------------------------------------------------------------------------
procedure X_Rm_Put_String_Resource
(Database : in out X_Rm_Database;
Bindings : X_Rm_Binding_Array;
Names : X_Rm_Name_Array;
Value : X_String);
--------------------------------------------------------------------------
-- Just like X_Rm_Put_Resource above except it is only for installing string
-- values.
------------------------------------------------------------------------------
procedure X_Rm_Put_Resource (Database : in out X_Rm_Database;
Specifier : X_String;
Representation : X_String;
Value : X_Rm_Value;
Db_Owner : Boolean := True);
------------------------------------------------------------------------------
-- Database - Specifies the database to modify; if None_X_Rm_Database
-- then a new database record will be created and returned.
-- Specifier - Specifies the (may be partial) specification of the
-- resource.
-- Representation - Specifies the type of the resource.
-- Value - Specifies the value of the resource.
-- Db_Owner - Specifies True if the database is to be responsible for
-- deallocating any heap storage utilized by Value once the
-- last database entry for this Value is overwritten or
-- released.
--
-- A convenience routine that calls X_Rm_String_To_Representation for the
-- Representation string, calls X_Rm_String_To_Binding_Name_List for the
-- Specifier, and calls X_Rm_Put_Resource above to actually install the
-- resource.
--
-- Constraint_Error will be raised if the Specifier or Representation
-- contain illegal characters.
------------------------------------------------------------------------------
procedure X_Rm_Put_String_Resource (Database : in out X_Rm_Database;
Specifier : X_String;
Value : X_String);
------------------------------------------------------------------------------
-- Just like X_Rm_Put_Resource above except it is only for installing string
-- values.
------------------------------------------------------------------------------
--\x0c
------------------------------------------------------------------------------
-- Resource Manager Functions - Database Multi-Query
------------------------------------------------------------------------------
function X_Rm_Get_Search_List (Database : X_Rm_Database;
Names : X_Rm_Name_Array;
Classes : X_Rm_Class_Array)
return X_Rm_Search_List;
--------------------------------------------------------------------------
-- Database - Specifies the database to search.
-- Names - Specifies a list of resource names.
-- Classes - Specifies a list of class names.
--
-- Takes a list of names and classes and returns a list of database levels
-- and wildcards where a match might occur.
--------------------------------------------------------------------------
procedure X_Rm_Get_Search_Resource
(List : X_Rm_Search_List;
Name : X_Rm_Name;
Class : X_Rm_Class;
Representation : out X_Rm_Representation;
Value : out X_Rm_Value);
--------------------------------------------------------------------------
-- List - Specifies the search list to use.
-- Name - Specifies a name to look up via the list.
-- Class - Specifies a class name to look up via the list.
-- Representation- Receives the representation of the value
-- Value - Receives the entry from the database or None_X_Rm_Value
--
-- If successful (Value /= None_X_Rm_Value) then Value has received an
-- X_Rm_Value from within the database. Any heap based data returned is shared
-- with the database (and possibly other databases) so do not attempt free the
-- data contained within the entry.
--------------------------------------------------------------------------
--\x0c
------------------------------------------------------------------------------
-- Resource Manager Functions - Database Creation and I/O
------------------------------------------------------------------------------
procedure X_Rm_Get_File_Database (Filename : String;
Database : out X_Rm_Database;
Status : out X_Rm_Status);
------------------------------------------------------------------------------
-- Filename - Specifies the name of the file to read.
-- Database - Receives the database read or else None_X_Rm_Database
-- Status - Receives Rm_Successful, Rm_Had_Errors, or Rm_Failed.
--
-- Opens the specified file and attempts to read it and create a new database.
-- The file must contain lines acceptable to X_Rm_Put_Line_Resource.
--
-- Status = Rm_Had_Errors or Rm_Failed means that the returned Database, if
-- any, may have missing or incorrect data entries. The may be the result of
-- bad input data, Storage_Error, or other similar problems. Rm_Failed is
-- used for more serious errors such as memory or I/O errors.
--
-- Note: Files created by X Library implementations other than this one
-- may or may not be usable and files written with this X Library
-- implementation may or may not work properly with other implementation
-- unless the resource values consist only of strings.
--
-- Currently (Sep-1989) this implementation provides a superset of the
-- functionality of the existing C X Library implementation. This means that
-- this routine can read resource files created by other implementations and
-- other implementations can read files created here as long as only string
-- values are involved. Compatibility is a goal and as much compatibility as
-- possible will be maintained in the future.
------------------------------------------------------------------------------
procedure X_Rm_Get_String_Database (Data : X_String;
Database : out X_Rm_Database;
Status : out X_Rm_Status);
------------------------------------------------------------------------------
-- Just like X_Rm_Get_File_database except that it reads a string instead
-- of a file.
------------------------------------------------------------------------------
procedure X_Rm_Add_Resource (Database : in out X_Rm_Database;
Line : X_String;
Status : out X_Rm_Status);
------------------------------------------------------------------------------
-- Database - Specifies the database to modify; if None_X_Rm_Database then a
-- new database record will be created.
-- Line - Specifies the "name:value" string. The name contains any
-- full or partial resource specification and the value of the
-- resource.
-- Status - Receives Rm_Successful, Rm_Had_Errors, or Rm_Failed.
--
-- Called to add one entry to a database.
--
-- Status = Rm_Had_Errors or Rm_Failed means that the result Database, if
-- any, may have missing or incorrect data entries. The may be the result of
-- bad input data, Storage_Error, or other similar problems. Rm_Failed is
-- used for more serious errors such as memory or I/O errors.
--
-- Scans the string for a ':'. The "name" is any portion of the scanned
-- string that is not whitespace; leading and trailing whitespace surrounding
-- the name is dropped.
--
-- The "value" begins with the first non-whitespace character after the colon
-- and continues up to the end of the string or until an embedded Ascii.Lf
-- is found. If the Ascii.Lf is preceded by "\n" then the "\n"&Ascii.Lf
-- will be replaced in the string value by a single Ascii.Lf and the scan
-- continues. The value can have aribtary 8 bit embedded values by use of
-- the "\nnn" notation. These four characters are interpreted as an octal
-- number that must be in the 0..255 range. That value replaces the four
-- characters in the stored value.
------------------------------------------------------------------------------
procedure X_Rm_Put_Line_Resource (Database : in out X_Rm_Database;
Line : X_String;
Status : out X_Rm_Status)
renames X_Rm_Add_Resource;
------------------------------------------------------------------------------
-- A convenient alias for use by programs being converted from C.
------------------------------------------------------------------------------
procedure X_Rm_Put_File_Database (Filename : String;
Database : X_Rm_Database;
Status : out X_Rm_Status);
------------------------------------------------------------------------------
-- Filename - Specifies the name of the file to write.
-- Database - Specifies the database to write.
-- Status - Receives Rm_Successful, Rm_Had_Errors, or Rm_Failed.
--
-- Opens the specified file and writes the contents of the database in a
-- form acceptable to X_Rm_Put_Line_Resource.
--
-- Status = Rm_Had_Errors or Rm_Failed means that the new database file, if
-- any, may have missing or incorrect data written to it. These may be the
-- result of bad input data, Storage_Error, or other similar problems.
-- Rm_Failed is used for more serious errors such as memory or I/O errors.
--
-- Note: Files created by this X Library implementation may or may not be
-- readable by other X Library implementations unless the resource values
-- consist only of strings.
--
-- Currently (Sep-1989) this implementation provides a superset of the
-- functionality of the existing C X Library implementation. This means that
-- this routine can read resource files created by other implementations and
-- other implementations can read files created here as long as only string
-- values are involved. Compatibility is a goal and as much compatibility as
-- possible will be maintained in the future.
------------------------------------------------------------------------------
procedure X_Rm_Merge_Databases (Source : in out X_Rm_Database;
Destination : X_Rm_Database;
Status : out X_Rm_Status);
------------------------------------------------------------------------------
-- Source - Specifies the source database.
-- Destination - Specifies the target database.
-- Status - Receives Rm_Successful, Rm_Had_Errors, or Rm_Failed
--
-- Merges the contents of one database into another. The original Source
-- database is destroyed by this operation and the Destination database is
-- modified by it. Values in the original Into database that are replaced by
-- new values of the same name and/or class will cause the old values to be
-- updated.
--
-- Status = Rm_Had_Errors or Rm_Failed means that the returned Database, if
-- any, may have missing or incorrect data entries. This may be the result of
-- bad input data, Storage_Error, or other similar problems. Rm_Failed is
-- used for more serious errors such as memory errors.
--
-- Note: This update will cause the old values to be freed if they are
-- heap-based values and if the values were placed into the database with
-- Db_Owner => True (always the case if X_Rm_Get_@ or X_Rm_Add_@ routines
-- were used to create the database). So beware of dangling pointers.
-- For example, if Destination has a Foo value that is an X_Font_Struct pointer,
-- and if Source replaces Foo with a new X_Font_Struct pointer, then the
-- old X_Font_Struct will be freed. If the application has previously
-- queried the database and has obtained the old value then continued usage
-- of the old value by the application will eventually cause some sort of
-- mysterious failure.
------------------------------------------------------------------------------
procedure Free_X_Rm_Database (Database : in out X_Rm_Database);
------------------------------------------------------------------------------
-- Database - Specifies the database to free
--
-- Free a database and all dependent storage and objects.
------------------------------------------------------------------------------
procedure X_Rm_Destroy_Database (Database : in out X_Rm_Database)
renames Free_X_Rm_Database;
------------------------------------------------------------------------------
-- Support the same name as the C interface.
------------------------------------------------------------------------------
--\x0c
------------------------------------------------------------------------------
-- Resource Manager Functions - Misc.
------------------------------------------------------------------------------
package Univ_X_Rm_Database is
new X_Universal_Pointer_Conversion (X_Rm_Database_Rec,
X_Rm_Database,
Free_X_Rm_Database);
------------------------------------------------------------------------------
-- Package for making/breaking X_Universal_Pointers to databases.
------------------------------------------------------------------------------
procedure X_Get_Default (Display : X_Display;
Program : X_String;
Option : X_String;
Representation : out X_Rm_Representation;
Value : out X_Rm_Value);
------------------------------------------------------------------------------
-- Display - Specifies the display to use.
-- Program - Specifies the program name for the Xlib defaults.
-- The name must be passed in with the program arguments
-- (usually as ArgV[ArgV'First]).
-- Option - Specifies the option name.
-- Representation - Receives the representation of the value;
-- None_X_Rm_Representation if the option is not in the
-- database
-- Value - Receives the value of the option if Type /= None
--
-- Returns the representation and the value for the specified option.
------------------------------------------------------------------------------
procedure X_Rm_Parse_Command
(Database : in out X_Rm_Database;
Options : X_Rm_Option_Desc_Array;
Prefix : X_String;
Arg_C : in out S_Natural;
Arg_V : in out X_String_Pointer_Array;
Status : out X_Rm_Status);
------------------------------------------------------------------------------
-- Database - Specifies the database to use for the parsing.
-- Table - Specifies a table of command line argument data.
-- Prefix - Specifies the application name
-- Arg_C - Specifies the number of argument strings.
-- Arg_V - Specifies the argument strings and returns those not used.
-- Status - Receives Rm_Successful, Rm_Had_Errors, or Rm_Failed
--
-- Parse command line and store argument values into resource database.
-- Allows any unambiguous abbreviation for an option name, but requires
-- that the table be ordered with any options that are prefixes of
-- other options appearing before the longer option name.
------------------------------------------------------------------------------
--\x0c
------------------------------------------------------------------------------
-- Convenient aliases for use by programs being converted from C.
------------------------------------------------------------------------------
procedure X_Rm_Q_Get_Resource (Database : X_Rm_Database;
Names : X_Rm_Name_Array;
Classes : X_Rm_Class_Array;
Representation : out X_Rm_Representation;
Value : out X_Rm_Value)
renames X_Rm_Get_Resource;
------------------------------------------------------------------------------
-- A convenient alias for use by programs being converted from C.
------------------------------------------------------------------------------
procedure X_Rm_Q_Put_String_Resource
(Database : in out X_Rm_Database;
Bindings : X_Rm_Binding_Array;
Names : X_Rm_Name_Array;
Value : X_String)
renames X_Rm_Put_String_Resource;
------------------------------------------------------------------------------
-- A convenient alias for use by programs being converted from C.
------------------------------------------------------------------------------
procedure X_Rm_Q_Put_Resource (Database : in out X_Rm_Database;
Specifier : X_String;
Representation : X_String;
Value : X_Rm_Value;
Db_Owner : Boolean := True)
renames X_Rm_Put_Resource;
------------------------------------------------------------------------------
-- A convenient alias for use by programs being converted from C.
------------------------------------------------------------------------------
function X_Rm_Q_Get_Search_List (Database : X_Rm_Database;
Names : X_Rm_Name_Array;
Classes : X_Rm_Class_Array)
return X_Rm_Search_List
renames X_Rm_Get_Search_List;
------------------------------------------------------------------------------
-- A convenient alias for use by programs being converted from C.
------------------------------------------------------------------------------
procedure X_Rm_Q_Get_Search_Resource
(List : X_Rm_Search_List;
Name : X_Rm_Name;
Class : X_Rm_Class;
Representation : out X_Rm_Representation;
Value : out X_Rm_Value)
renames X_Rm_Get_Search_Resource;
------------------------------------------------------------------------------
-- A convenient alias for use by programs being converted from C.
------------------------------------------------------------------------------
end Xlbp_Rm;
nblk1=1d
nid=0
hdr6=3a
[0x00] rec0=1e rec1=00 rec2=01 rec3=01a
[0x01] rec0=10 rec1=00 rec2=02 rec3=07c
[0x02] rec0=11 rec1=00 rec2=03 rec3=018
[0x03] rec0=11 rec1=00 rec2=04 rec3=052
[0x04] rec0=11 rec1=00 rec2=05 rec3=056
[0x05] rec0=0e rec1=00 rec2=06 rec3=084
[0x06] rec0=0f rec1=00 rec2=07 rec3=018
[0x07] rec0=11 rec1=00 rec2=08 rec3=028
[0x08] rec0=10 rec1=00 rec2=09 rec3=098
[0x09] rec0=10 rec1=00 rec2=0a rec3=09a
[0x0a] rec0=13 rec1=00 rec2=0b rec3=006
[0x0b] rec0=13 rec1=00 rec2=0c rec3=092
[0x0c] rec0=13 rec1=00 rec2=0d rec3=014
[0x0d] rec0=12 rec1=00 rec2=0e rec3=082
[0x0e] rec0=10 rec1=00 rec2=0f rec3=07a
[0x0f] rec0=11 rec1=00 rec2=10 rec3=03e
[0x10] rec0=13 rec1=00 rec2=11 rec3=030
[0x11] rec0=10 rec1=00 rec2=12 rec3=082
[0x12] rec0=13 rec1=00 rec2=13 rec3=060
[0x13] rec0=10 rec1=00 rec2=14 rec3=06e
[0x14] rec0=10 rec1=00 rec2=15 rec3=080
[0x15] rec0=13 rec1=00 rec2=16 rec3=08c
[0x16] rec0=11 rec1=00 rec2=17 rec3=09c
[0x17] rec0=13 rec1=00 rec2=18 rec3=04c
[0x18] rec0=12 rec1=00 rec2=19 rec3=020
[0x19] rec0=11 rec1=00 rec2=1a rec3=016
[0x1a] rec0=10 rec1=00 rec2=1b rec3=068
[0x1b] rec0=11 rec1=00 rec2=1c rec3=082
[0x1c] rec0=04 rec1=00 rec2=1d rec3=000
tail 0x21500963481978320b035 0x42a00088462063203