minor tweaks to make these modules load with load-everything

db4
Doug Coleman 2008-01-14 11:42:21 -10:00
parent 04b4832454
commit 097dad070a
34 changed files with 101 additions and 86 deletions

View File

@ -1,6 +1,6 @@
! Copyright (C) 2007 Chris Double. ! Copyright (C) 2007 Chris Double.
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: help.syntax help.markup channels ; USING: help.syntax help.markup ;
IN: channels IN: channels
HELP: <channel> HELP: <channel>

View File

@ -1,6 +1,6 @@
! Copyright (C) 2007 Chris Double. ! Copyright (C) 2007 Chris Double.
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: help.syntax help.markup channels channels.remote concurrency.distributed ; USING: help.syntax help.markup channels concurrency.distributed ;
IN: channels.remote IN: channels.remote
HELP: <remote-channel> HELP: <remote-channel>

View File

@ -0,0 +1,3 @@
USING: io.backend ;
HOOK: sniff-channel io-backend ( -- channel )

View File

@ -2,8 +2,9 @@
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
! !
! Wrap a sniffer in a channel ! Wrap a sniffer in a channel
USING: kernel channels channels.sniffer concurrency io USING: kernel channels channels.sniffer.backend concurrency io
io.sniffer io.sniffer.bsd io.unix.backend ; io.sniffer.backend io.sniffer.bsd io.unix.backend ;
IN: channels.sniffer.bsd
M: unix-io sniff-channel ( -- channel ) M: unix-io sniff-channel ( -- channel )
"/dev/bpf0" "en1" <sniffer-spec> <sniffer> <channel> [ "/dev/bpf0" "en1" <sniffer-spec> <sniffer> <channel> [

View File

@ -3,11 +3,9 @@
! !
! Wrap a sniffer in a channel ! Wrap a sniffer in a channel
USING: kernel channels concurrency io io.backend USING: kernel channels concurrency io io.backend
io.sniffer system vocabs.loader ; io.sniffer io.sniffer.backend system vocabs.loader ;
: (sniff-channel) ( stream channel -- ) : (sniff-channel) ( stream channel -- )
4096 pick stream-read-partial over to (sniff-channel) ; 4096 pick stream-read-partial over to (sniff-channel) ;
HOOK: sniff-channel io-backend ( -- channel )
bsd? [ "channels.sniffer.bsd" require ] when bsd? [ "channels.sniffer.bsd" require ] when

View File

@ -1,5 +1,6 @@
! Copyright (C) 2005 Chris Double, 2007 Clemens Hofreither. ! Copyright (C) 2005 Chris Double, 2007 Clemens Hofreither.
USING: help.markup help.syntax coroutines ; USING: help.markup help.syntax ;
IN: coroutines
HELP: cocreate HELP: cocreate
{ $values { "quot" "a quotation with stack effect ( value -- )" } { "co" "a coroutine" } } { $values { "quot" "a quotation with stack effect ( value -- )" } { "co" "a coroutine" } }

View File

@ -12,14 +12,11 @@ USING: alien kernel system combinators alien.syntax ;
IN: cryptlib.libcl IN: cryptlib.libcl
: load-libcl ( -- ) << "libcl" {
"libcl" {
{ [ win32? ] [ "cl32.dll" "stdcall" ] } { [ win32? ] [ "cl32.dll" "stdcall" ] }
{ [ macosx? ] [ "libcl.dylib" "cdecl" ] } { [ macosx? ] [ "libcl.dylib" "cdecl" ] }
{ [ unix? ] [ "libcl.so" "cdecl" ] } { [ unix? ] [ "libcl.so" "cdecl" ] }
} cond add-library ; parsing } cond add-library >>
load-libcl
! =============================================== ! ===============================================
! Machine-dependant types ! Machine-dependant types

View File

@ -1,5 +1,6 @@
USING: help.markup help.syntax kernel math sequences quotations USING: help.markup help.syntax kernel math sequences quotations
crypto.common crypto.md5 ; crypto.common ;
IN: crypto.md5
HELP: stream>md5 HELP: stream>md5
{ $values { "stream" "a stream" } { "byte-array" "md5 hash" } } { $values { "stream" "a stream" } { "byte-array" "md5 hash" } }

View File

@ -0,0 +1,14 @@
IN: hardware-info.backend
SYMBOL: os
HOOK: cpus os ( -- n )
HOOK: memory-load os ( -- n )
HOOK: physical-mem os ( -- n )
HOOK: available-mem os ( -- n )
HOOK: total-page-file os ( -- n )
HOOK: available-page-file os ( -- n )
HOOK: total-virtual-mem os ( -- n )
HOOK: available-virtual-mem os ( -- n )
HOOK: available-virtual-extended-mem os ( -- n )

View File

@ -1,26 +1,15 @@
USING: alien.syntax math prettyprint system combinators USING: alien.syntax kernel math prettyprint system
vocabs.loader ; combinators vocabs.loader hardware-info.backend ;
IN: hardware-info IN: hardware-info
SYMBOL: os
HOOK: cpus os ( -- n )
HOOK: memory-load os ( -- n )
HOOK: physical-mem os ( -- n )
HOOK: available-mem os ( -- n )
HOOK: total-page-file os ( -- n )
HOOK: available-page-file os ( -- n )
HOOK: total-virtual-mem os ( -- n )
HOOK: available-virtual-mem os ( -- n )
HOOK: available-virtual-extended-mem os ( -- n )
: kb. ( x -- ) 10 2^ /f . ; : kb. ( x -- ) 10 2^ /f . ;
: megs. ( x -- ) 20 2^ /f . ; : megs. ( x -- ) 20 2^ /f . ;
: gigs. ( x -- ) 30 2^ /f . ; : gigs. ( x -- ) 30 2^ /f . ;
{ << {
{ [ windows? ] [ "hardware-info.windows" ] } { [ windows? ] [ "hardware-info.windows" ] }
{ [ linux? ] [ "hardware-info.linux" ] } { [ linux? ] [ "hardware-info.linux" ] }
{ [ macosx? ] [ "hardware-info.macosx" ] } { [ macosx? ] [ "hardware-info.macosx" ] }
} cond require { [ t ] [ f ] }
} cond [ require ] when* >>

View File

@ -1,5 +1,5 @@
USING: alien alien.c-types alien.syntax byte-arrays kernel USING: alien alien.c-types alien.syntax byte-arrays kernel
namespaces sequences unix hardware-info ; namespaces sequences unix hardware-info.backend ;
IN: hardware-info.macosx IN: hardware-info.macosx
TUPLE: macosx ; TUPLE: macosx ;

View File

@ -1,5 +1,6 @@
USING: alien.c-types hardware-info hardware-info.windows USING: alien.c-types hardware-info hardware-info.windows
kernel math namespaces windows windows.kernel32 ; kernel math namespaces windows windows.kernel32
hardware-info.backend ;
IN: hardware-info.windows.ce IN: hardware-info.windows.ce
T{ wince } os set-global T{ wince } os set-global
@ -29,5 +30,3 @@ M: wince total-virtual-mem ( -- n )
M: wince available-virtual-mem ( -- n ) M: wince available-virtual-mem ( -- n )
memory-status MEMORYSTATUS-dwAvailVirtual ; memory-status MEMORYSTATUS-dwAvailVirtual ;

View File

@ -1,5 +1,5 @@
USING: alien alien.c-types hardware-info hardware-info.windows USING: alien alien.c-types hardware-info hardware-info.windows
kernel libc math namespaces kernel libc math namespaces hardware-info.backend
windows windows.advapi32 windows.kernel32 ; windows windows.advapi32 windows.kernel32 ;
IN: hardware-info.windows.nt IN: hardware-info.windows.nt

View File

@ -1,6 +1,6 @@
USING: alien alien.c-types kernel libc math namespaces USING: alien alien.c-types kernel libc math namespaces
windows windows.kernel32 windows.advapi32 hardware-info windows windows.kernel32 windows.advapi32
words combinators vocabs.loader ; words combinators vocabs.loader hardware-info.backend ;
IN: hardware-info.windows IN: hardware-info.windows
TUPLE: wince ; TUPLE: wince ;
@ -70,7 +70,8 @@ M: windows cpus ( -- n )
: system-windows-directory ( -- str ) : system-windows-directory ( -- str )
\ GetSystemWindowsDirectory get-directory ; \ GetSystemWindowsDirectory get-directory ;
{ << {
{ [ wince? ] [ "hardware-info.windows.ce" ] } { [ wince? ] [ "hardware-info.windows.ce" ] }
{ [ winnt? ] [ "hardware-info.windows.nt" ] } { [ winnt? ] [ "hardware-info.windows.nt" ] }
} cond require { [ t ] [ f ] }
} cond [ require ] when* >>

View File

@ -2,7 +2,6 @@ USING: assocs circular combinators continuations hashtables
hashtables.private io kernel math hashtables.private io kernel math
namespaces prettyprint quotations sequences splitting namespaces prettyprint quotations sequences splitting
state-parser strings ; state-parser strings ;
USING: html.parser ;
IN: html.parser.utils IN: html.parser.utils
: string-parse-end? : string-parse-end?

View File

@ -1,6 +1,7 @@
! Copyright (C) 2007 Chris Double. ! Copyright (C) 2007 Chris Double.
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: help.markup help.syntax http.basic-authentication crypto.sha2 ; USING: help.markup help.syntax crypto.sha2 ;
IN: http.basic-authentication
HELP: realms HELP: realms
{ $description { $description

View File

@ -1,6 +1,7 @@
! Coyright (C) 2007 Adam Wendt ! Coyright (C) 2007 Adam Wendt
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: id3 help.syntax help.markup ; USING: help.syntax help.markup ;
IN: id3
ARTICLE: "id3-tags" "ID3 Tags" ARTICLE: "id3-tags" "ID3 Tags"
"The " { $vocab-link "id3" } " vocabulary is used to read ID3 tags from MP3 audio streams." "The " { $vocab-link "id3" } " vocabulary is used to read ID3 tags from MP3 audio streams."

View File

@ -1,4 +1,5 @@
USING: inverse help.syntax help.markup ; USING: help.syntax help.markup ;
IN: inverse
HELP: [undo] HELP: [undo]
{ $values { "quot" "a quotation" } { "undo" "the inverse of the quotation" } } { $values { "quot" "a quotation" } { "undo" "the inverse of the quotation" } }

View File

@ -63,7 +63,9 @@ UNION: explicit-inverse normal-inverse math-inverse pop-inverse ;
{ {
{ [ dup word? not over symbol? or ] [ , ] } { [ dup word? not over symbol? or ] [ , ] }
{ [ dup explicit-inverse? ] [ , ] } { [ dup explicit-inverse? ] [ , ] }
{ [ dup compound? over { if dispatch } member? not and ] ! { [ dup compound? over { if dispatch } member? not and ]
! [ word-def [ inline-word ] each ] }
{ [ dup word? over { if dispatch } member? not and ]
[ word-def [ inline-word ] each ] } [ word-def [ inline-word ] each ] }
{ [ drop t ] [ "Quotation is not invertible" throw ] } { [ drop t ] [ "Quotation is not invertible" throw ] }
} cond ; } cond ;

View File

@ -0,0 +1,6 @@
USING: io.backend kernel system vocabs.loader ;
IN: io.sniffer.backend
SYMBOL: sniffer-type
TUPLE: sniffer ;
HOOK: <sniffer> io-backend ( obj -- sniffer )

View File

@ -1,9 +1,9 @@
! Copyright (C) 2007 Elie Chaftari, Doug Coleman. ! Copyright (C) 2007 Elie Chaftari, Doug Coleman.
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: alien.c-types alien.syntax destructors hexdump io USING: alien.c-types alien.syntax destructors hexdump io
io.buffers io.nonblocking io.sniffer io.sockets io.streams.lines io.buffers io.nonblocking io.sockets io.streams.lines
io.unix.backend io.unix.files kernel libc locals math qualified io.unix.backend io.unix.files kernel libc locals math qualified
sequences ; sequences io.sniffer.backend ;
QUALIFIED: unix QUALIFIED: unix
IN: io.sniffer.bsd IN: io.sniffer.bsd

View File

@ -0,0 +1,17 @@
USING: byte-arrays combinators io io.backend
io.sockets.headers io.sniffer.backend kernel
prettyprint sequences ;
IN: io.sniffer.filter.backend
HOOK: sniffer-loop io-backend ( stream -- )
HOOK: packet. io-backend ( string -- )
: (packet.) ( string -- )
dup 14 head >byte-array
"--Ethernet Header--" print
dup etherneth.
dup etherneth-type {
! HEX: 800 [ ] ! IP
! HEX: 806 [ ] ! ARP
[ "Unknown type: " write .h ]
} case 2drop ;

View File

@ -1,7 +1,8 @@
USING: alien.c-types hexdump io io.backend io.sockets.headers USING: alien.c-types hexdump io io.backend io.sockets.headers
io.sockets.headers.bsd kernel io.sniffer io.sniffer.bsd io.sockets.headers.bsd kernel io.sniffer io.sniffer.bsd
io.sniffer.filter io.streams.string io.unix.backend math io.streams.string io.unix.backend math
sequences system byte-arrays ; sequences system byte-arrays io.sniffer.filter.backend
io.sniffer.filter.backend io.sniffer.backend ;
IN: io.sniffer.filter.bsd IN: io.sniffer.filter.bsd
! http://www.iana.org/assignments/ethernet-numbers ! http://www.iana.org/assignments/ethernet-numbers

View File

@ -1,19 +1,8 @@
USING: alien.c-types byte-arrays combinators hexdump io USING: alien.c-types byte-arrays combinators hexdump io
io.backend io.streams.string io.sockets.headers kernel math io.backend io.streams.string io.sockets.headers kernel math
prettyprint io.sniffer sequences system vocabs.loader ; prettyprint io.sniffer sequences system vocabs.loader
io.sniffer.filter.backend ;
IN: io.sniffer.filter IN: io.sniffer.filter
HOOK: sniffer-loop io-backend ( stream -- )
HOOK: packet. io-backend ( string -- )
: (packet.) ( string -- )
dup 14 head >byte-array
"--Ethernet Header--" print
dup etherneth.
dup etherneth-type {
! HEX: 800 [ ] ! IP
! HEX: 806 [ ] ! ARP
[ "Unknown type: " write .h ]
} case 2drop ;
bsd? [ "io.sniffer.filter.bsd" require ] when bsd? [ "io.sniffer.filter.bsd" require ] when

View File

@ -1,10 +1,4 @@
USING: io.backend kernel system vocabs.loader ; USING: io.backend kernel system vocabs.loader ;
IN: io.sniffer IN: io.sniffer
SYMBOL: sniffer-type
TUPLE: sniffer ;
HOOK: <sniffer> io-backend ( obj -- sniffer )
bsd? [ "io.sniffer.bsd" require ] when bsd? [ "io.sniffer.bsd" require ] when

View File

@ -1,4 +1,4 @@
USING: kernel opengl arrays sequences jamshred jamshred.tunnel USING: kernel opengl arrays sequences jamshred.tunnel
jamshred.player math.vectors ; jamshred.player math.vectors ;
IN: jamshred.game IN: jamshred.game

View File

@ -1,4 +1,4 @@
USING: colors jamshred.game jamshred.oint jamshred.tunnel kernel USING: colors jamshred.oint jamshred.tunnel kernel
math math.constants sequences ; math math.constants sequences ;
IN: jamshred.player IN: jamshred.player

View File

@ -1,6 +1,7 @@
! Copyright (C) 2006 Chris Double. ! Copyright (C) 2006 Chris Double.
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: help.markup help.syntax json.reader ; USING: help.markup help.syntax ;
IN: json.reader
HELP: json> "( string -- object )" HELP: json> "( string -- object )"
{ $values { "string" "a string in JSON format" } { "object" "yhe object deserialized from the JSON string" } } { $values { "string" "a string in JSON format" } { "object" "yhe object deserialized from the JSON string" } }

View File

@ -1,6 +1,7 @@
! Copyright (C) 2006 Chris Double. ! Copyright (C) 2006 Chris Double.
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: help.markup help.syntax json.writer ; USING: help.markup help.syntax ;
IN: json.writer
HELP: >json "( obj -- string )" HELP: >json "( obj -- string )"
{ $values { "obj" "an object" } { "string" "the object converted to JSON format" } } { $values { "obj" "an object" } { "string" "the object converted to JSON format" } }

View File

@ -13,7 +13,7 @@ GENERIC: json-print ( obj -- )
[ json-print ] string-out ; [ json-print ] string-out ;
M: f json-print ( f -- ) M: f json-print ( f -- )
"false" write ; drop "false" write ;
M: string json-print ( obj -- ) M: string json-print ( obj -- )
CHAR: " write1 "\"" split "\\\"" join CHAR: \r swap remove "\n" split "\\r\\n" join write CHAR: " write1 ; CHAR: " write1 "\"" split "\\\"" join CHAR: \r swap remove "\n" split "\\r\\n" join write CHAR: " write1 ;

View File

@ -5,7 +5,7 @@ USING: kernel parser namespaces io prettyprint math arrays sequences
IN: lisp.listener IN: lisp.listener
: parse-stdio ( -- quot/f ) stdio get parse-interactive ; : parse-stdio ( -- quot/f ) stdio get read-quot ;
: stuff? ( -- ? ) datastack length 0 > ; : stuff? ( -- ? ) datastack length 0 > ;

View File

@ -4,14 +4,11 @@
USING: alien alien.c-types alien.syntax combinators kernel math system ; USING: alien alien.c-types alien.syntax combinators kernel math system ;
IN: mad IN: mad
: load-mad-library ( -- ) << "mad" {
"mad" {
{ [ macosx? ] [ "libmad.0.dylib" ] } { [ macosx? ] [ "libmad.0.dylib" ] }
{ [ unix? ] [ "libmad.so" ] } { [ unix? ] [ "libmad.so" ] }
{ [ windows? ] [ "mad.dll" ] } { [ windows? ] [ "mad.dll" ] }
} cond "cdecl" add-library ; parsing } cond "cdecl" add-library >>
load-mad-library
LIBRARY: mad LIBRARY: mad

View File

@ -1,7 +1,7 @@
! Copyright (C) 2006 Chris Double. ! Copyright (C) 2006 Chris Double.
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: help.syntax help.markup parser-combinators USING: help.syntax help.markup parser-combinators ;
parser-combinators.simple ; IN: parser-combinators.simple
HELP: 'digit' HELP: 'digit'
{ $values { $values

View File

@ -1,4 +1,5 @@
USING: xml-rpc help.syntax help.markup ; USING: help.syntax help.markup ;
IN: xml-rpc
HELP: send-rpc HELP: send-rpc
{ $values { "rpc" "an RPC data type" } { "xml" "an XML document" } } { $values { "rpc" "an RPC data type" } { "xml" "an XML document" } }