Permalink
Browse files

use zsh-style autoloads in zcache lib

  • Loading branch information...
1 parent 649adb5 commit 89c329047aa8f7f4ea5f818722cd6f0f0d43d716 @rsanders committed Feb 13, 2012
@@ -1,8 +1,5 @@
#!/bin/zsh
-
-
-function zcache {
emulate -L zsh
setopt typeset_silent
unsetopt multibyte
@@ -44,4 +41,3 @@ function zcache {
esac
return
-}
@@ -1,7 +1,6 @@
#!/bin/zsh
-function zcache_configure {
zcache_servers[localhost:11211]=1
zcache_servers[available]=1
-}
+
@@ -1,6 +1,5 @@
#!/bin/zsh
-function zcache_connect {
emulate -L zsh
setopt typeset_silent
@@ -47,4 +46,3 @@ function zcache_connect {
fi
[[ $retval == 0 && -z $fd ]] && return 15
return $retval
-}
@@ -1,6 +1,5 @@
#!/bin/zsh
-function zcache_disconnect {
local fd=$1
if [[ -z $fd ]]; then
@@ -11,4 +10,3 @@ function zcache_disconnect {
[[ $fd == $zcache_vars[last_opened_fd] ]] && unset 'zcache_vars[last_opened_fd]'
ztcp -c $fd
fi
-}
@@ -9,7 +9,6 @@
#
#
-function zcache_misc_command {
emulate -L zsh
setopt typeset_silent
unsetopt multibyte
@@ -79,4 +78,3 @@ function zcache_misc_command {
zctrace "islist=$islist $replyvar=${(P)replyvar}"
return $retval
-}
@@ -1,6 +1,5 @@
#!/bin/zsh
-function zcache_read {
local fd=$1 size=$2 timeout=${3}
local -a args
local remain=$size data="" loopdata="" count=0 total=0 looptimeout
@@ -21,4 +20,3 @@ function zcache_read {
done
REPLY=$data
-}
@@ -28,7 +28,6 @@
# echo "KEYB flags: ${keyb_hash[flags]}
#
-function zcache_retrieval_command {
emulate -L zsh
setopt typeset_silent
unsetopt multibyte
@@ -110,4 +109,3 @@ function zcache_retrieval_command {
REPLY=$firstdata
[[ $retval != 0 ]] && return $retval
[[ ${(P)#replyvar} -gt 0 ]]
-}
@@ -1,9 +1,7 @@
#!/bin/zsh
-function zcache_send {
local fd=$1 data=$2
zctrace "sending data to memcache: $data.."
print -n -r -u $fd -- "$data"
print -n -u $fd -- "\r\n"
-}
@@ -1,6 +1,5 @@
#!/bin/zsh
-function zcache_storage_command {
emulate -L zsh
setopt typeset_silent
unsetopt multibyte
@@ -67,4 +66,3 @@ function zcache_storage_command {
NOT_FOUND) return 11 ;;
*) return 0 ;;
esac
-}
View
@@ -39,7 +39,7 @@ function zcache_setup() {
local _zfile
for _zfile in $libdir/functions/*; do
- autoload -Uk ${_zfile:t}
+ autoload -U ${_zfile:t}
done
# setup in current dir

0 comments on commit 89c3290

Please sign in to comment.