Commit 74442268 authored by bernd's avatar bernd

get file command

parent 5b0f8b9a
......@@ -177,9 +177,6 @@ event: ->throw dup DoError throw ;
: sha-3-256 ( addr u -- ) sha-3 pad $20 85type ;
: sha-3-512 ( addr u -- ) sha-3 pad $40 85type ;
: arg-loop { xt -- }
begin next-arg dup while xt execute repeat 2drop ;
: sha-3-256s ( -- )
[: 2dup sha-3-256 space type cr ;] arg-loop ;
......
......@@ -169,7 +169,7 @@ get-current net2o-cmds definitions
: server ( -- )
\G usage: n2o server
get-me init-server server-loop ;
get-me init-server announce-me server-loop ;
\ chat mode
......@@ -205,6 +205,19 @@ get-current net2o-cmds definitions
['] rec:word 1 set-recognizers included
nr> set-recognizers nr> set-order ;
\ file copy
: get ( -- )
\G usage: get @user <file1> .. <filen>
\G get: get files into current directory
get-me init-client
?@nextarg IF
$A $E 2swap nick-connect ." connected" cr
net2o-code expect-reply
[: 2dup 2dup '/' -scan nip /string n2o:copy ;] arg-loop
end-code|
c:disconnect THEN ;
synonym bye bye
set-current
......
......@@ -571,8 +571,6 @@ forth-local-words:
forth-local-indent-words:
(
(("net2o:" "+net2o:") (0 . 2) (0 . 2) non-immediate)
(("[:") (0 . 1) (0 . 1) immediate)
((";]") (-1 . 0) (0 . -1) immediate)
(("event:") (0 . 2) (0 . 2) non-immediate)
)
End:
......
......@@ -46,6 +46,9 @@ cmd-args
THEN ;
[THEN]
: -scan ( addr u char -- addr u' ) >r
BEGIN dup WHILE 1- 2dup + c@ r@ = UNTIL 1+ THEN rdrop ;
\ logic memory modifiers
: or! ( x addr -- ) >r r@ @ or r> ! ;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment