From 98e37c52f1c935548fd8a24db46a860107224d5d Mon Sep 17 00:00:00 2001 From: John Benediktsson Date: Wed, 24 Oct 2012 16:51:07 -0700 Subject: [PATCH] io.files.acls: cleanup. --- extra/io/files/acls/acls.factor | 2 +- extra/io/files/acls/macosx/macosx.factor | 36 ++++++++++++------------ 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/extra/io/files/acls/acls.factor b/extra/io/files/acls/acls.factor index 5a58ca185b..f97c0ee875 100644 --- a/extra/io/files/acls/acls.factor +++ b/extra/io/files/acls/acls.factor @@ -1,7 +1,7 @@ ! Copyright (C) 2010 Doug Coleman. ! See http://factorcode.org/license.txt for BSD license. USING: ; -IN: acls +IN: io.files.acls ! File and directory permissions SYMBOLS: +delete+ +readattr+ +writeattr+ +readextattr+ +writeextattr+ diff --git a/extra/io/files/acls/macosx/macosx.factor b/extra/io/files/acls/macosx/macosx.factor index d0fbf19ebb..a69b16ca7d 100644 --- a/extra/io/files/acls/macosx/macosx.factor +++ b/extra/io/files/acls/macosx/macosx.factor @@ -5,7 +5,7 @@ classes.struct combinators destructors io.backend io.files kernel libc literals locals math.order prettyprint sequences unix unix.ffi unix.groups unix.types unix.users ; QUALIFIED: io -IN: acls.macosx +IN: io.files.acls.macosx [ mbr_uuid_to_string io-error ] keep ] + ! [ uuid_string_t [ mbr_uuid_to_string io-error ] keep ] } case ; : acl-error ( n -- ) -1 = [ (io-error) ] when ; inline @@ -218,7 +218,7 @@ FUNCTION: int mbr_uuid_to_string ( uuid_t uu, char* string ) ; DESTRUCTOR: free-acl : get-acl-entry ( acl_t n -- acl_entry_t ) - acl_entry_t [ acl_get_entry ] keep swap -1 = [ drop f ] when ; + acl_entry_t [ acl_get_entry ] keep swap -1 = [ drop f ] when ; : first-acl-entry ( acl_t -- acl_entry_t ) ACL_FIRST_ENTRY get-acl-entry ; : next-acl-entry ( acl_t -- acl_entry_t ) ACL_NEXT_ENTRY get-acl-entry ; @@ -233,9 +233,9 @@ PRIVATE> path file-acl &free-acl :> acl f :> acl-entry! acl [ - acl first-acl-entry *void* quot call + acl first-acl-entry void* deref quot call [ acl next-acl-entry dup acl-entry! ] - [ acl-entry *void* quot call ] while + [ acl-entry void* deref quot call ] while ] when ] with-destructors ; inline @@ -270,7 +270,7 @@ ERROR: add-permission-failed permission-set permission ; acl_add_perm acl-error ; : acl-entry>permset ( acl_entry_t -- acl_permset ) - acl_permset_t [ acl_get_permset acl-error ] keep ; + acl_permset_t [ acl_get_permset acl-error ] keep ; : filter-strings ( obj strings -- string ) [ [ 1 = ] dip f ? ] 2map sift "," join ; @@ -291,20 +291,20 @@ ERROR: add-permission-failed permission-set permission ; : acl-entry>owner-name ( acl-entry -- string ) [ acl_get_qualifier dup acl-error &free-acl - uid_t -1 [ mbr_uuid_to_id io-error ] 2keep - [ *uint ] bi@ unix-id>string + uid_t -1 int [ mbr_uuid_to_id io-error ] 2keep + [ uint deref ] bi@ unix-id>string ] with-destructors ; : acl-entry>tag-name ( acl-entry -- string ) - acl_tag_t [ acl_get_tag_type acl-error ] keep - *uint acl_tag_t>string ; + acl_tag_t [ acl_get_tag_type acl-error ] keep + uint deref acl_tag_t>string ; : flagset>strings ( flagset -- strings ) acl-flags [ acl_get_flag_np dup acl-error ] with map acl-flag-names filter-strings ; : acl-entry>flagset ( acl-entry -- flagset ) - acl_flagset_t [ acl_get_flagset_np acl-error ] keep ; + acl_flagset_t [ acl_get_flagset_np acl-error ] keep ; : acl-entry>flag-names ( acl-entry -- strings ) acl-entry>flagset flagset>strings ;