Merge branch 'master' of git://littledan.onigirihouse.com/git/littledan

db4
Slava Pestov 2008-02-01 18:31:13 -06:00
commit 0cd8eb8745
8 changed files with 19 additions and 15 deletions

View File

@ -3,7 +3,7 @@
USING: cryptlib cryptlib.libcl kernel alien sequences continuations USING: cryptlib cryptlib.libcl kernel alien sequences continuations
byte-arrays namespaces io.buffers math generic io strings byte-arrays namespaces io.buffers math generic io strings
io.streams.lines io.streams.plain io.streams.duplex combinators io.streams.lines io.streams.plain io.streams.duplex combinators
alien.c-types ; alien.c-types continuations ;
IN: cryptlib.streams IN: cryptlib.streams
@ -154,4 +154,4 @@ M: crypt-stream dispose ( stream -- )
dispose dispose
end end
; ;

View File

@ -4,7 +4,7 @@
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: io kernel namespaces prettyprint quotations USING: io kernel namespaces prettyprint quotations
sequences strings words xml.writer xml.entities compiler.units effects ; sequences strings words xml.entities compiler.units effects ;
IN: html.elements IN: html.elements

View File

@ -3,7 +3,7 @@
USING: generic assocs help http io io.styles io.files continuations USING: generic assocs help http io io.styles io.files continuations
io.streams.string kernel math math.parser namespaces io.streams.string kernel math math.parser namespaces
quotations assocs sequences strings words html.elements quotations assocs sequences strings words html.elements
xml.writer xml.entities sbufs ; xml.entities sbufs continuations ;
IN: html IN: html
GENERIC: browser-link-href ( presented -- href ) GENERIC: browser-link-href ( presented -- href )

View File

@ -1,7 +1,7 @@
! Copyright (C) 2003, 2007 Slava Pestov. ! Copyright (C) 2003, 2007 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: hashtables io kernel math namespaces math.parser assocs USING: hashtables io kernel math namespaces math.parser assocs
sequences strings splitting ; sequences strings splitting ascii ;
IN: http IN: http
: header-line ( line -- ) : header-line ( line -- )
@ -20,7 +20,7 @@ IN: http
dup letter? dup letter?
over LETTER? or over LETTER? or
over digit? or over digit? or
swap "/_-?." member? or ; foldable swap "/_-." member? or ; foldable
: url-encode ( str -- str ) : url-encode ( str -- str )
[ [

View File

@ -7,7 +7,7 @@ sequences io.sniffer.backend ;
QUALIFIED: unix QUALIFIED: unix
IN: io.sniffer.bsd IN: io.sniffer.bsd
M: unix-io destruct-handle ( obj -- ) close drop ; M: unix-io destruct-handle ( obj -- ) unix:close drop ;
C-UNION: ifreq_props "sockaddr-in" "short" "int" "caddr_t" ; C-UNION: ifreq_props "sockaddr-in" "short" "int" "caddr_t" ;
C-STRUCT: ifreq { { "char" 16 } "name" } { "ifreq_props" "props" } ; C-STRUCT: ifreq { { "char" 16 } "name" } { "ifreq_props" "props" } ;

View File

@ -1,6 +1,8 @@
USING: combinators io io.files io.streams.duplex continuations <<<<<<< HEAD:extra/tar/tar.factor
io.streams.string kernel math math.parser USING: combinators io io.files io.streams.duplex
namespaces pack prettyprint sequences strings system hexdump ; io.streams.string kernel math math.parser continuations
namespaces pack prettyprint sequences strings system ;
USING: hexdump tools.interpreter ;
IN: tar IN: tar
: zero-checksum 256 ; : zero-checksum 256 ;

View File

@ -1,6 +1,6 @@
USING: calendar furnace furnace.validator io.files kernel USING: calendar furnace furnace.validator io.files kernel
namespaces sequences http.server.responders html math math.parser rss namespaces sequences http.server.responders html math.parser rss
xml.writer xmode.code2html ; xml.writer xmode.code2html math ;
IN: webapps.pastebin IN: webapps.pastebin
TUPLE: pastebin pastes ; TUPLE: pastebin pastes ;

View File

@ -12,15 +12,17 @@ SYMBOL: width
: (split-chunk) ( words -- ) : (split-chunk) ( words -- )
-1 over [ length + 1+ dup width get > ] find drop nip -1 over [ length + 1+ dup width get > ] find drop nip
[ cut-slice swap , (split-chunk) ] [ , ] if* ; [ 1 max cut-slice swap , (split-chunk) ] [ , ] if* ;
: split-chunk ( words -- lines ) : split-chunk ( words -- lines )
[ (split-chunk) ] { } make ; [ (split-chunk) ] { } make ;
: join-spaces ( words-seqs -- lines )
[ [ " " join ] map ] map concat ;
: broken-lines ( string width -- lines ) : broken-lines ( string width -- lines )
width [ width [
line-chunks line-chunks [ split-chunk ] map join-spaces
[ split-chunk [ " " join ] map ] map concat
] with-variable ; ] with-variable ;
: line-break ( string width -- newstring ) : line-break ( string width -- newstring )