--| --|Item: Ada PCTE Binding --|$Revision: 0.2 $ --|$State: Prototype $ --| --|The Version Description Document (VDD) included with this release provides --|detailed information regarding the condition of the software. The "User --|Feedback" section of the VDD describes how to obtain additional information. --| --|Distribution Statement "A", per DoD Directive 5230.24 --|Authorized for public release; distribution is unlimited. --| --|Copyright (c) 1992, Paramax Systems Corporation, Reston, Virginia --|Copyright is assigned to the U.S. Government, upon delivery thereto, --|in accordance with the DFAR Special Works Clause. --| --|Developed by: Paramax Systems Corporation, --| --|This software, developed under the Software Technology for Adaptable, --|Reliable Systems (STARS) program, is approved for release under --|Distribution "A" of the Scientific and Technical Information Program --|Classification Scheme (DoD Directive 5230.24) unless otherwise indicated. --|Sponsored by the U.S. Defense Advanced Research Projects Agency (DARPA) --|under contract F19628-88-D-0031, the STARS program is supported by the --|military services, SEI, and MITRE, with the U.S. Air Force as the executive --|contracting agent. --| --|Permission to use, copy, modify, and comment on this software and its --|documentation for purposes stated under Distribution "A" and without fee --|is hereby granted, provided that this notice appears in each whole or --|partial copy. This software retains Contractor indemnification to --|the Government regarding copyrights pursuant to the above referenced --|STARS contract. The Government disclaims all responsibility against --|liability, including costs and expenses for violation of proprietary --|rights, or copyrights arising out of the creation or use of this --|software. --| --|In addition, the Government, Paramax, and its subcontractors disclaim all --|warranties with regard to this software, including all implied warranties --|of merchantability and fitness, and in no event shall the Government, --|Paramax, or its subcontractor(s) be liable for any special, indirect or --|consequential damages or any damages whatsoever resulting from the loss of --|use, data, or profits, whether in action of contract, negligence or other --|tortious action, arising in connection with the use or performance of this --|software. --| --|$Log $ --| -- Version Information -- ^^^^^^^^^^^^^^^^^^^ -- -- PCTE - Ada Language Interface. -- Version: 0.2. -- Release Date: November 30, 1992. -- Compiled under SUN OS 4.1.2 using SunAda 1.0 -- -- -- General Information -- ^^^^^^^^^^^^^^^^^^^ -- -- This is an alpha release of the Paramax STARS Ada binding to Emeraude's -- PCTE 1.5 using the ECMA PCTE Ada binding specifications. The binding -- is incomplete in this release. See the Version Description Document -- provided with this alpha release for information on which interfaces -- have been implemented. It is expected that future releases will -- expand the number of interfaces implemented. The interfaces defined -- herein are subject to change. -- -- For further information, contact the authors: -- -- -- Robert Smith -- Paramax Systems Corp. -- Valley Forge Labs -- 70 E. Swedesford Road -- Paoli, PA. 19301 -- smith@prc.unisys.com (current) -- smith@vfl.paramax.com (future) -- +1 215 648-2402 -- -- Michael Horton -- Paramax Systems Corp. -- Valley Forge Labs -- 70 E. Swedesford Road -- Paoli, PA. 19301 -- horton@prc.unisys.com (current) -- horton@vfl.paramax.com (future) -- +1 215 648-2527 -- -- with system; with pcte; package pcte_1_5_int is -- OMS related data types and operations -- size limits, from oms.h: SDSNAMESIZE : constant := 32; -- maximum size of the name of an SDS KEYSIZE : constant := 32; -- maximum size of a key DEFNAMESIZE : constant := 32; -- maximum size of a local definition name TYPENAMESIZE : constant := 64; -- maximum length of a definition name -- ['-' ] LINKSIZE : constant := 96; -- maximum length of a link name STRATTRSIZE : constant := 32000; -- size limit of a string attribute ANNOTSIZE : constant := 32000; -- size limit of a type annotation -- access mode constants R_PERM : constant integer := 4; W_PERM : constant integer := 2; X_PERM : constant integer := 1; O_EXIST : constant integer := 0; function obj_access ( path : in system.address; amode : in integer) return integer; pragma INTERFACE (C, obj_access); pragma INTERFACE_NAME (obj_access, "_access"); -- flag values for open and fcntl from fcntl.h O_RDONLY : constant integer := 0; O_WRONLY : constant integer := 1; O_RDWR : constant integer := 2; O_CREAT : constant integer := 256; -- 00400 O_TRUNC : constant integer := 512; -- 01000 O_EXCL : constant integer := 1024; -- 02000 O_NDELAY : constant integer := 4; O_APPEND : constant integer := 8; O_SYNC : constant integer := 16; -- flag values for fcntl F_DUPFD : constant integer := 0; F_GETFD : constant integer := 1; F_SETFD : constant integer := 2; F_GETFL : constant integer := 3; F_SETFL : constant integer := 4; -- domains needed by sdsscan, from scan.h: -- domains defined for an object type SUBTYPES_OF : constant integer := 8#0110#; DESCENDANTS_OF : constant integer := 8#0111#; PARENTS_OF : constant integer := 8#0112#; ANCESTORS_OF : constant integer := 8#0113#; ATTRIBUTE_TYPES_APPLIED_TO : constant integer := 8#0120#; ATTRIBUTE_TYPES_OF : constant integer := 8#0121#; LINK_TYPES_APPLIED_TO : constant integer := 8#0130#; LINK_TYPES_WITH_ORIGIN : constant integer := 8#0131#; LINK_TYPES_EXTENDED_TO : constant integer := 8#0132#; LINK_TYPES_WITH_DESTINATION : constant integer := 8#0133#; -- domains defined for an attribute type OBJECT_TYPES_WITH_APPLIED_ATTRIBUTE : constant integer := 8#0210#; OBJECT_TYPES_WITH_ATTRIBUTE : constant integer := 8#0211#; LINK_TYPES_WITH_KEY_ATTRIBUTE : constant integer := 8#0230#; LINK_TYPES_WITH_NON_KEY_ATTRIBUTE : constant integer := 8#0231#; -- domains defined for a link type OBJECT_TYPES_WITH_APPLIED_LINK : constant integer := 8#0310#; ORIGIN_OBJECT_TYPES_OF : constant integer := 8#0311#; OBJECT_TYPES_IN_DESTINATION_SET_OF : constant integer := 8#0312#; DESTINATION_OBJECT_TYPES_OF : constant integer := 8#0313#; KEY_ATTRIBUTE_TYPES_OF : constant integer := 8#0320#; NON_KEY_ATTRIBUTE_TYPES_OF : constant integer := 8#0321#; D_SUBTYPE : constant integer := SUBTYPES_OF; D_LINK_OF : constant integer := OBJECT_TYPES_WITH_APPLIED_LINK; D_OBJATTR_OF : constant integer := OBJECT_TYPES_WITH_APPLIED_ATTRIBUTE; D_LINK_SET : constant integer := LINK_TYPES_APPLIED_TO; D_DEST_SET : constant integer := OBJECT_TYPES_IN_DESTINATION_SET_OF; D_DEST_OF : constant integer := LINK_TYPES_EXTENDED_TO; D_LINKATTR_OF : constant integer := 0237; -- The domain of scanning is the union of domains -- defined by LINK_TYPES_WITH_KEY_ATTRIBUTE and -- LINK_TYPES_WITH_NON_KEY_ATTRIBUTE D_ATTR_SET : constant integer := 0727; -- The domain of scanning is the union of domains -- defined by ATTRIBUTE_TYPES_APPLIED_TO, -- KEY_ATTRIBUTE_TYPES_OF and -- NON_KEY_ATTRIBUTE_TYPES_OF function open ( path : in system.address; oflag : in integer; mode : in integer := 0) -- defaults to blocked io return integer; pragma INTERFACE (C, open); function read ( fildes : in integer; buf : in system.address; nbytes : in integer) return integer; pragma INTERFACE (C, read); function close ( fildes : in integer) return integer; pragma INTERFACE (C, close); function write ( fildes : in integer; buf : in system.address; nbytes : in natural) return integer; pragma INTERFACE (C, write); type whence is new integer; type off_t is new integer; -- may be very machine dependent SEEK_SET : constant whence := 0; SEEK_CUR : constant whence := 1; SEEK_END : constant whence := 2; function lseek ( fildes : in integer; offset : in off_t; start_pos : in whence) return integer; pragma INTERFACE (C, lseek); type short is range - 2 ** 15 .. (2 ** 15) - 1; for short'size use 16; type u_short is range 0 .. (2 ** 16) - 1; for u_short'size use 16; type long is new integer; -- system/compiler dependent 32 bits subtype objnum_t is long; subtype ivol_t is short; subtype device_t is short; subtype time_t is long; type defid is record d_kind : u_short; d_typid : long; end record; for defid use record at mod 2; d_kind at 0 range 0 .. 15; -- note the 2 bytes of filler between d_kind and d_typid: d_typid at 4 range 0 .. 31; end record; for defid'SIZE use 64; -- masks for d_kind: DEFKIND : constant := 8#000003#; -- definition kind O_OBJ : constant := 8#000001#; -- object type O_ATTR : constant := 8#000002#; -- attribute type O_LINK : constant := 8#000003#; -- link type PSYSDEF : constant := 8#000004#; -- protected predefined type BASETYPE : constant := 8#0170000#; -- ancestor predefined type T_OBJECT : constant := 8#040000#; -- sys-object T_FILE : constant := 8#0100000#; -- sys-file T_PIPE : constant := 8#010000#; -- sys-pipe T_BDEV : constant := 8#060000#; -- sys-bdev T_CDEV : constant := 8#020000#; -- sys-cdev T_MSGQ : constant := 8#050000#; -- sys-msgq V_TYPE : constant := 8#070000#; -- value type of attribute V_STRING : constant := 8#010000#; -- string V_INT : constant := 8#020000#; -- integer V_BOOLEAN: constant := 8#030000#; -- boolean V_DATE : constant := 8#040000#; -- date CATEG : constant := 8#070000#; -- link category COMP : constant := 8#010000#; -- composition REF : constant := 8#020000#; -- reference IMP : constant := 8#030000#; -- implicit SREV : constant := 8#040000#; -- system implicit reverse R_CATEG : constant := 8#007000#; -- reverse link category R_COMP : constant := 8#001000#; -- composition R_REF : constant := 8#002000#; -- reference R_IMP : constant := 8#003000#; -- implicit R_SREV : constant := 8#004000#; -- system implicit reverse STABLE : constant := 8#000100#; -- stability required R_STABLE : constant := 8#000200#; -- stability of inverse MANY : constant := 8#000010#; -- arity "many type defid_array is array (positive range <>) of defid; -- pragma PACK (defid_array); type obj_stat_rec is record -- status of an object o_defid : defid; -- definition ID o_mode : u_short; -- attribute mode o_ino : objnum_t; -- ino o_ivol : ivol_t; -- ivol o_rdev : device_t; -- dev o_uid : u_short; -- owner o_gid : u_short; -- group o_size : off_t; -- size o_atime : time_t; -- adate o_mtime : time_t; -- mdate o_ctime : time_t; -- cdate o_nlink : short; -- nlink o_nclink : short; -- nclink o_nrlink : short; -- nrlink o_nslink : short; -- nslink o_ncomp : short; -- ncomp o_rep : short; -- rep end record; type linkstat is record -- status of a link, from linkstat.h l_key : string (1 .. KEYSIZE); l_def : defid; -- def ID of its link type l_ivol : ivol_t; -- volume ID of the destination l_ino : objnum_t; -- object ID of the destination end record; for linkstat use record at mod 2; l_key at 0 range 0 .. 8 * KEYSIZE - 1; l_def at KEYSIZE range 0 .. 63; l_ivol at KEYSIZE + 8 range 0 .. 15; -- note the 2 bytes of filler between l_ivol and l_ino: l_ino at KEYSIZE + 12 range 0 .. 31; end record; for linkstat'SIZE use 128 + 8 * KEYSIZE; type linkstat_array is array (positive range <>) of linkstat; pragma PACK (linkstat_array); subtype pid_t is long; function getobjfstat ( fildes : in standard.integer; buf : in system.address) return standard.integer; pragma INTERFACE (C, getobjfstat); function crobj ( origin : in system.address; link : in system.address; o_type : in system.address; mode : in standard.integer ) return standard.integer; pragma INTERFACE (C, crobj); function crobjr ( origin : in system.address; link : in system.address; o_type : in system.address; mode : in standard.integer; rev : in system.address ) return standard.integer; pragma INTERFACE (C, crobjr); function crobjv ( origin : in system.address; link : in system.address; o_type : in system.address; mode : in standard.integer; rev : in system.address; path : in system.address ) return standard.integer; pragma INTERFACE (C, crobjv); function dllink ( origin : in system.address; link : in system.address ) return standard.integer; pragma INTERFACE (C, dllink); function getschema ( list_size: in standard.integer; sdsnames : in system.address ) return standard.integer; pragma INTERFACE (C, getschema); function setschema (sdsnames : in system.address) return standard.integer; pragma INTERFACE (C, setschema); function start ( path : in system.address; argv : in system.address; envp : in system.address; dynp : in system.address) return pid_t; pragma INTERFACE (C, start); function wait (stat_loc : in system.address) return standard.integer; pragma INTERFACE (C, wait); function waitp ( pid : in pid_t; stat_loc : in system.address) return standard.integer; pragma INTERFACE (C, waitp); function gettype ( path : in system.address; -- addr of c_string naming path to object typid : in system.address -- addr of defid ) return standard.integer; pragma INTERFACE (C, gettype); function getattr ( path : in system.address; -- addr of c_string naming path to object attr : in system.address; -- addr of c_string naming attribute size : in standard.integer; -- max length of expected string value + 1 value : in system.address -- addr of buffer into which to store value ) return standard.integer; pragma INTERFACE (C, getattr); function getlattr ( path : in system.address; -- addr of c_string naming path to object l : in system.address; -- addr of c_string naming link from object attr : in system.address; -- addr of c_string naming attribute size : in standard.integer; -- max length of expected string value + 1 value : in system.address -- addr of buffer in which to store value ) return standard.integer; pragma INTERFACE (C, getlattr); function getrevlink ( origin : in system.address; -- addr of c_string naming path to object l : in system.address; -- addr of c_string naming link from object rev : in system.address -- addr of buffer into which to store revlink ) return standard.integer; pragma INTERFACE (C, getrevlink); function linkname ( o_defid : in system.address; -- addr of defid lstat : in system.address; -- addr of linkstat shortform : in standard.integer; -- "true" = 1, "false" = 0; l : in system.address -- addr of 96 byte buffer into which -- to store the linkname ) return standard.integer; pragma INTERFACE (C, linkname); function getlinkstat ( origin : in system.address; -- addr of c_string naming path to object l : in system.address; -- addr of c_string naming link from object buf : in system.address -- addr of buffer in which to store linkstat ) return standard.integer; pragma INTERFACE (C, getlinkstat); function lslinks ( origin : in system.address; -- addr of c_string naming path to object ltype : in system.address; -- optional addr of c_string naming -- link type current : in system.address; -- optional addr of linkstat nb : in standard.integer; -- 'LENGTH of list parameter list : in system.address -- addr of linkstat_array ) return standard.integer; pragma INTERFACE (C, lslinks); function sdsdefid ( sdsname : in system.address; -- optional addr of c_string naming sds typename : in system.address; -- addr of c_string containing local name def_id : in system.address -- addr of object's defid to be looked up ) return standard.integer; pragma INTERFACE (C, sdsdefid); function sdsdefname ( sdsname : in system.address; -- optional addr of c_string naming sds def_id : in system.address; -- addr of object's defid to be looked up defname : in system.address; -- addr of buffer into which to store name size : in standard.integer -- 'LENGTH of defname parameter ) return standard.integer; pragma INTERFACE (C, sdsdefname); function sdslinkdef ( sdsname : in system.address; -- optional addr of c_string naming sds linkid : in system.address; -- addr of link's defid to be looked up keyattrs : in system.address; -- addr of defid_array keyno : in standard.integer; -- 'LENGTH of keyattrs parameter r_linkid : in system.address -- addr of buffer into which to store -- the defid of the reverse link ) return standard.integer; pragma INTERFACE (C, sdslinkdef); function sdsscan ( sdsname : in system.address; -- optional addr of c_string naming sds domain : in standard.integer; -- number of domain to be scanned def : in system.address; -- addr of object's defid to be scanned current : in system.address; -- optional addr of current defid list : in system.address; -- addr of defid_array nb : in standard.integer -- 'LENGTH of list parameter ) return standard.integer; pragma INTERFACE (C, sdsscan); end pcte_1_5_int;