perms.sa


Generated by gen_html_sa_files from ICSI. Contact gomes@icsi.berkeley.edu for details
 
------------------------->  GNU Sather - sourcefile  <-------------------------
-- Copyright (C) 2000 by K Hopper, University of Waikato, New Zealand        --
-- This file is part of the GNU Sather library. It is free software; you may --
-- redistribute  and/or modify it under the terms of the GNU Library General --
-- Public  License (LGPL)  as published  by the  Free  Software  Foundation; --
-- either version 2 of the license, or (at your option) any later version.   --
-- This  library  is distributed  in the  hope that it will  be  useful, but --
-- WITHOUT ANY WARRANTY without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See Doc/LGPL for more details.       --
-- The license text is also available from:  Free Software Foundation, Inc., --
-- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA                     --
-------------->  Please email comments to <bug-sather@gnu.org>  <--------------


immutable class PERMISSIONS < $ENUMS{PERMISSIONS}

immutable class PERMISSIONS < $ENUMS{PERMISSIONS} is -- This is an enumeration class which describes the different -- kinds of files -- NOT kinds of contents (see FILE_TYPES). -- Version 1.2 Apr 97. Copyright K Hopper,U of Waikato -- Development History -- ------------------- -- Date Who By Detail -- ---- ------ ------ -- 10 Jun 96 kh Original -- 19 Feb 97 kh Additions for string/char portability. -- 10 Apr 97 kh Modified for INT to CARD, etc include ENUM{PERMISSIONS} ; private const val_count : CARD := 10 ; -- The next routines provide the enumeration itself. World_Execute : SAME is return enum(1) end ; World_Write : SAME is return enum(2) end ; World_Read : SAME is return enum(3) end ; Group_Execute : SAME is return enum(4) end ; Group_Write : SAME is return enum(5) end ; Group_Read : SAME is return enum(6) end ; Owner_Execute : SAME is return enum(7) end ; Owner_Write : SAME is return enum(8) end ; Owner_Read : SAME is return enum(9) end ; Sticky : SAME is return enum(10) end ; end ; -- PERMISSIONS

immutable class ACCESS_SET < $ENUM_SET{ACCESS_SET,PERMISSIONS}

immutable class ACCESS_SET < $ENUM_SET{ACCESS_SET,PERMISSIONS} is -- This enumeration provides for operations on sets of file access -- permissions. All the usual set operations are available. This -- implementation defines constants for owner, group/project, world/public, -- unrestricted access, every one. The applicability of any of these -- depends on the underlying run-time environment (operating system or file -- system, etc). -- Version 1.1 Mar 00. Copyright K Hopper, U of Waikato -- Development History -- ------------------- -- Date Who By Detail -- ---- ------ ------ -- 10 Apr 97 kh Original -- 24 Mar 00 kh Renaming from BIT_SET to ENUM_SET include ENUM_SET{ACCESS_SET,PERMISSIONS} ; const owner : SAME := empty + PERMISSIONS::Owner_Execute + PERMISSIONS::Owner_Write + PERMISSIONS::Owner_Read ; const group : SAME := empty + PERMISSIONS::Group_Execute + PERMISSIONS::Group_Write + PERMISSIONS::Group_Read ; const world : SAME := empty + PERMISSIONS::World_Execute + PERMISSIONS::World_Write + PERMISSIONS::World_Read ; const unrestricted : SAME := empty + owner + group + world ; const owner_mask : SAME := group + world + PERMISSIONS::Sticky ; const group_mask : SAME := owner + world + PERMISSIONS::Sticky ; const world_mask : SAME := group + owner + PERMISSIONS::Sticky ; const every : SAME := full ; end ; -- ACCESS_SET

immutable class FILE_KINDS < $ENUMS{FILE_KINDS}

immutable class FILE_KINDS < $ENUMS{FILE_KINDS} is -- This is an enumeration class which describes the different -- kinds of files -- NOT kinds of contents (see FILE_TYPES). -- Version 1.2 Apr 97. Copyright K Hopper,U of Waikato -- Development History -- ------------------- -- Date Who By Detail -- ---- ------ ------ -- 10 Jun 96 kh Original -- 19 Feb 97 kh Additions for string/char portability. -- 10 Apr 97 kh Modified for INT to CARD, etc include ENUM{FILE_KINDS} ; private const val_count : CARD := 15 ; -- The next routines provide the enumeration 'values'. Pipe : SAME is return enum(1) end ; Char_Device : SAME is return enum(2) end ; private Unused_3 : SAME is return enum(3) end ; Directory : SAME is return enum(4) end ; Xenix_Special : SAME is return enum(5) end ; Block_Device : SAME is return enum(6) end ; private Unused_7 : SAME is return enum(7) end ; Normal : SAME is return enum(8) end ; private Unused_9 : SAME is return enum(9) end ; Link_Only : SAME is return enum(10) end ; Network_Device : SAME is return enum(11) end ; Socket : SAME is return enum(12) end ; Door : SAME is return enum(13) end ; Hidden : SAME is return enum(14) end ; System_Special : SAME is return enum(15) end ; end ; -- FILE_KINDS