From: Jean-Claude Wippler Date: Fri, 4 Nov 2005 21:59:54 +0000 (+0000) Subject: mkclvfs changes X-Git-Tag: vfs-1-4~67 X-Git-Url: https://privyetmir.co.uk/gitweb.cgi?a=commitdiff_plain;h=cdd5e3f384ed17860cd3f41b444cc6a519036b74;p=tclvfs mkclvfs changes --- diff --git a/ChangeLog b/ChangeLog index 14833ea..f893ca7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2005-11-04 Jean-Claude Wippler + + * library/mkclvfs.tcl: some more thrill api mods + * pkgIndex.tcl.in, library/pkgIndex.tcl: bumped to 1.2 + 2005-11-01 Jean-Claude Wippler * library/mkclvfs.tcl: renamed vlerq package to thrill diff --git a/library/mkclvfs.tcl b/library/mkclvfs.tcl index 0523271..9c898b0 100644 --- a/library/mkclvfs.tcl +++ b/library/mkclvfs.tcl @@ -4,8 +4,9 @@ # 1.0 initial release # 1.1 view size renamed to count, vlerq package renamed to thrill +# 1.2 replace view calls by vget (simpler and slightly faster) -package provide vfs::mkcl 1.1 +package provide vfs::mkcl 1.2 package require vfs package require thrill @@ -22,9 +23,9 @@ namespace eval vfs::mkcl { # public proc Mount {mkfile local args} { set db mkclvfs[incr v::seq] - set v::rootv($db) [view [vopen $mkfile] get 0 dirs] - set v::dname($db) [view $v::rootv($db) getcol 0] - set v::prows($db) [view $v::rootv($db) getcol 1] + set v::rootv($db) [vget [vopen $mkfile] 0 dirs] + set v::dname($db) [vget $v::rootv($db) * 0] + set v::prows($db) [vget $v::rootv($db) * 1] ::vfs::filesystem mount $local [list ::vfs::mkcl::handler $db] ::vfs::RegisterMount $local [list ::vfs::mkcl::Unmount $db] return $db @@ -61,21 +62,21 @@ namespace eval vfs::mkcl { } if {$parent != $r} { if {$remain == 1} { - set files [view $dirs get $parent 2] - set i [lsearch -exact [view $files getcol 0] $e] + set files [vget $dirs $parent 2] + set i [lsearch -exact [vget $files * 0] $e] if {$i >= 0} { - # evaluating this 4-item result returns the info about one file - return [list view $files get $i] + # evaluating this 3-item result returns the info about one file + return [list vget $files $i] } } fail ENOENT } } - # evaluating this 5-item result returns the files subview - return [list view $dirs get $parent 2] + # evaluating this 4-item result returns the files subview + return [list vget $dirs $parent 2] } proc isDir {tag} { - return [expr {[llength $tag] == 5}] + return [expr {[llength $tag] == 4}] } # methods proc matchindirectory {db path actual pattern type} { @@ -87,11 +88,11 @@ namespace eval vfs::mkcl { if {[isDir $tag]} { # collect file names if {$type & 16} { - set c [eval [linsert $tag end | getcol 0]] + set c [eval [linsert $tag end * 0]] } # collect directory names if {$type & 4} { - foreach r [lsearch -exact -int -all $v::prows($db) [lindex $tag 3]] { + foreach r [lsearch -exact -int -all $v::prows($db) [lindex $tag 2]] { lappend c [lindex $v::dname($db) $r] } } @@ -141,8 +142,8 @@ namespace eval vfs::mkcl { set s 0 set d 0 set c "" - incr l [eval [linsert $tag end | count]] - incr l [llength [lsearch -exact -int -all $v::prows($db) [lindex $tag 3]]] + incr l [eval [linsert $tag end #]] + incr l [llength [lsearch -exact -int -all $v::prows($db) [lindex $tag 2]]] } else { set t file foreach {n s d c} [eval $tag] break diff --git a/library/pkgIndex.tcl b/library/pkgIndex.tcl index 2dbeed4..47b5e79 100644 --- a/library/pkgIndex.tcl +++ b/library/pkgIndex.tcl @@ -56,7 +56,7 @@ package ifneeded zipvfs 1.0 [list source [file join $dir zipvfs.tcl]] package ifneeded vfs::ftp 1.0 [list source [file join $dir ftpvfs.tcl]] package ifneeded vfs::http 0.5 [list source [file join $dir httpvfs.tcl]] package ifneeded vfs::mk4 1.10 [list source [file join $dir mk4vfs.tcl]] -package ifneeded vfs::mkcl 1.1 [list source [file join $dir mkclvfs.tcl]] +package ifneeded vfs::mkcl 1.2 [list source [file join $dir mkclvfs.tcl]] package ifneeded vfs::ns 0.5 [list source [file join $dir tclprocvfs.tcl]] package ifneeded vfs::tar 0.9 [list source [file join $dir tarvfs.tcl]] package ifneeded vfs::test 1.0 [list source [file join $dir testvfs.tcl]] diff --git a/pkgIndex.tcl.in b/pkgIndex.tcl.in index 427cb8b..0e30a94 100644 --- a/pkgIndex.tcl.in +++ b/pkgIndex.tcl.in @@ -40,7 +40,7 @@ package ifneeded zipvfs 1.0 [list source [file join $dir zipvfs.tcl]] package ifneeded vfs::ftp 1.0 [list source [file join $dir ftpvfs.tcl]] package ifneeded vfs::http 0.5 [list source [file join $dir httpvfs.tcl]] package ifneeded vfs::mk4 1.10 [list source [file join $dir mk4vfs.tcl]] -package ifneeded vfs::mkcl 1.1 [list source [file join $dir mkclvfs.tcl]] +package ifneeded vfs::mkcl 1.2 [list source [file join $dir mkclvfs.tcl]] package ifneeded vfs::ns 0.5 [list source [file join $dir tclprocvfs.tcl]] package ifneeded vfs::tar 0.9 [list source [file join $dir tarvfs.tcl]] package ifneeded vfs::test 1.0 [list source [file join $dir testvfs.tcl]]