removed <filebr>, <filebw>, renamed <filecr> to <file-reader>, <filecw> to <file-writer>
parent
d29cd15f74
commit
12eceb5b44
|
@ -47,13 +47,11 @@
|
||||||
- nicer way to combine two paths
|
- nicer way to combine two paths
|
||||||
- add a socket timeout
|
- add a socket timeout
|
||||||
- rename f* words to stream-*
|
- rename f* words to stream-*
|
||||||
- <file[bc][rw]> is badly named -- <file-reader>, <file-writer>
|
|
||||||
|
|
||||||
+ kernel:
|
+ kernel:
|
||||||
|
|
||||||
- ppc register decls
|
- ppc register decls
|
||||||
- cat, reverse-cat primitives
|
- cat, reverse-cat primitives
|
||||||
- first-class hashtables
|
|
||||||
|
|
||||||
+ misc:
|
+ misc:
|
||||||
|
|
||||||
|
@ -63,6 +61,7 @@
|
||||||
- browser responder for word links in HTTPd
|
- browser responder for word links in HTTPd
|
||||||
- worddef props
|
- worddef props
|
||||||
- prettyprint: when unparse called due to recursion, write a link
|
- prettyprint: when unparse called due to recursion, write a link
|
||||||
|
- vectors: ensure its ok with bignum indices
|
||||||
|
|
||||||
+ httpd:
|
+ httpd:
|
||||||
|
|
||||||
|
|
|
@ -352,16 +352,15 @@ M: hashtable ' ( hashtable -- pointer )
|
||||||
] ifte ;
|
] ifte ;
|
||||||
|
|
||||||
: write-image ( image file -- )
|
: write-image ( image file -- )
|
||||||
<filebw> [ [ write-word ] vector-each ] with-stream ;
|
<file-writer> [ [ write-word ] vector-each ] with-stream ;
|
||||||
|
|
||||||
: with-minimal-image ( quot -- image )
|
: with-minimal-image ( quot -- image )
|
||||||
[
|
[
|
||||||
300000 <vector> image set
|
300000 <vector> image set
|
||||||
521 <hashtable> "objects" set
|
<namespace> "objects" set
|
||||||
! Note that this is a vector that we can side-effect,
|
! Note that this is a vector that we can side-effect,
|
||||||
! since ; ends up using this variable from nested
|
! since ; ends up using this variable from nested
|
||||||
! parser namespaces.
|
! parser namespaces.
|
||||||
1000 <vector> "word-fixups" set
|
|
||||||
call
|
call
|
||||||
image get
|
image get
|
||||||
] with-scope ;
|
] with-scope ;
|
||||||
|
|
|
@ -106,7 +106,7 @@ IN: hashtables
|
||||||
|
|
||||||
: grow-hash ( hash -- )
|
: grow-hash ( hash -- )
|
||||||
#! A good way to earn a living.
|
#! A good way to earn a living.
|
||||||
dup hash-size 3 * 2 /i <array> swap set-hash-array ;
|
dup hash-size 2 * <array> swap set-hash-array ;
|
||||||
|
|
||||||
: (hash>alist) ( alist n hash -- alist )
|
: (hash>alist) ( alist n hash -- alist )
|
||||||
2dup bucket-count >= [
|
2dup bucket-count >= [
|
||||||
|
|
|
@ -54,7 +54,7 @@ USE: unparser
|
||||||
over file-length file-response "method" get "head" = [
|
over file-length file-response "method" get "head" = [
|
||||||
drop
|
drop
|
||||||
] [
|
] [
|
||||||
<filebr> stdio get fcopy
|
<file-reader> stdio get fcopy
|
||||||
] ifte ;
|
] ifte ;
|
||||||
|
|
||||||
: serve-file ( filename -- )
|
: serve-file ( filename -- )
|
||||||
|
|
|
@ -41,7 +41,7 @@ USE: url-encoding
|
||||||
: httpd-log-stream ( -- stream )
|
: httpd-log-stream ( -- stream )
|
||||||
#! Set httpd-log-file to save httpd log to a file.
|
#! Set httpd-log-file to save httpd log to a file.
|
||||||
"httpd-log-file" get dup [
|
"httpd-log-file" get dup [
|
||||||
<filecr>
|
<file-reader>
|
||||||
] [
|
] [
|
||||||
drop stdio get
|
drop stdio get
|
||||||
] ifte ;
|
] ifte ;
|
||||||
|
|
|
@ -51,4 +51,4 @@ USE: unparser
|
||||||
[ stdio get "log" set call ] with-scope ;
|
[ stdio get "log" set call ] with-scope ;
|
||||||
|
|
||||||
: with-log-file ( file quot -- )
|
: with-log-file ( file quot -- )
|
||||||
[ swap <filecr> "log" set call ] with-scope ;
|
[ swap <file-reader> "log" set call ] with-scope ;
|
||||||
|
|
|
@ -64,18 +64,12 @@ M: fd-stream fclose ( -- )
|
||||||
C: fd-stream ( in out -- stream )
|
C: fd-stream ( in out -- stream )
|
||||||
[ "out" set "in" set ] extend ;
|
[ "out" set "in" set ] extend ;
|
||||||
|
|
||||||
: <filecr> ( path -- stream )
|
: <file-reader> ( path -- stream )
|
||||||
t f open-file <fd-stream> ;
|
t f open-file <fd-stream> ;
|
||||||
|
|
||||||
: <filecw> ( path -- stream )
|
: <file-writer> ( path -- stream )
|
||||||
f t open-file <fd-stream> ;
|
f t open-file <fd-stream> ;
|
||||||
|
|
||||||
: <filebr> ( path -- stream )
|
|
||||||
<filecr> ;
|
|
||||||
|
|
||||||
: <filebw> ( path -- stream )
|
|
||||||
<filecw> ;
|
|
||||||
|
|
||||||
: init-stdio ( -- )
|
: init-stdio ( -- )
|
||||||
stdin stdout <fd-stream> <stdio-stream> stdio set ;
|
stdin stdout <fd-stream> <stdio-stream> stdio set ;
|
||||||
|
|
||||||
|
@ -94,4 +88,4 @@ C: fd-stream ( in out -- stream )
|
||||||
"resource-path" get [ "." ] unless* ;
|
"resource-path" get [ "." ] unless* ;
|
||||||
|
|
||||||
: <resource-stream> ( path -- stream )
|
: <resource-stream> ( path -- stream )
|
||||||
resource-path swap cat2 <filecr> ;
|
resource-path swap cat2 <file-reader> ;
|
||||||
|
|
|
@ -75,7 +75,7 @@ USE: strings
|
||||||
[ file-vocabs (parse-stream) ] with-scope ;
|
[ file-vocabs (parse-stream) ] with-scope ;
|
||||||
|
|
||||||
: parse-file ( file -- quot )
|
: parse-file ( file -- quot )
|
||||||
dup <filecr> parse-stream ;
|
dup <file-reader> parse-stream ;
|
||||||
|
|
||||||
: run-file ( file -- )
|
: run-file ( file -- )
|
||||||
#! Run a file. The file is read with the default IN:/USE:
|
#! Run a file. The file is read with the default IN:/USE:
|
||||||
|
@ -83,7 +83,7 @@ USE: strings
|
||||||
parse-file call ;
|
parse-file call ;
|
||||||
|
|
||||||
: (parse-file) ( file -- quot )
|
: (parse-file) ( file -- quot )
|
||||||
dup <filecr> (parse-stream) ;
|
dup <file-reader> (parse-stream) ;
|
||||||
|
|
||||||
: (run-file) ( file -- )
|
: (run-file) ( file -- )
|
||||||
#! Run a file. The file is read with the same IN:/USE: as
|
#! Run a file. The file is read with the same IN:/USE: as
|
||||||
|
|
|
@ -41,7 +41,7 @@ USE: words
|
||||||
[ "~" get "/.jedit/server" cat2 ] unless* ;
|
[ "~" get "/.jedit/server" cat2 ] unless* ;
|
||||||
|
|
||||||
: jedit-server-info ( -- port auth )
|
: jedit-server-info ( -- port auth )
|
||||||
jedit-server-file <filecr> [
|
jedit-server-file <file-reader> [
|
||||||
read drop
|
read drop
|
||||||
read parse-number
|
read parse-number
|
||||||
read parse-number
|
read parse-number
|
||||||
|
|
Loading…
Reference in New Issue