! Copyright (C) 2007 Chris Double.
! See http://factorcode.org/license.txt for BSD license.
-USING: help.syntax help.markup channels ;
+USING: help.syntax help.markup ;
IN: channels
HELP: <channel>
! Copyright (C) 2007 Chris Double.
! 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
HELP: <remote-channel>
{ $snippet "\"myhost.com\" 9001 <node> \"ID123456\" <remote-channel>\n\"hello\" over to" }
;
-ABOUT: { "remote-channels" "remote-channels" }
\ No newline at end of file
+ABOUT: { "remote-channels" "remote-channels" }
--- /dev/null
+USING: io.backend ;
+
+HOOK: sniff-channel io-backend ( -- channel )
! See http://factorcode.org/license.txt for BSD license.
!
! Wrap a sniffer in a channel
-USING: kernel channels channels.sniffer concurrency io
-io.sniffer io.sniffer.bsd io.unix.backend ;
+USING: kernel channels channels.sniffer.backend concurrency io
+io.sniffer.backend io.sniffer.bsd io.unix.backend ;
+IN: channels.sniffer.bsd
M: unix-io sniff-channel ( -- channel )
"/dev/bpf0" "en1" <sniffer-spec> <sniffer> <channel> [
!
! Wrap a sniffer in a channel
USING: kernel channels concurrency io io.backend
-io.sniffer system vocabs.loader ;
+io.sniffer io.sniffer.backend system vocabs.loader ;
: (sniff-channel) ( stream channel -- )
4096 pick stream-read-partial over to (sniff-channel) ;
-HOOK: sniff-channel io-backend ( -- channel )
-
bsd? [ "channels.sniffer.bsd" require ] when
! Copyright (C) 2005 Chris Double, 2007 Clemens Hofreither.
-USING: help.markup help.syntax coroutines ;
+USING: help.markup help.syntax ;
+IN: coroutines
HELP: cocreate
{ $values { "quot" "a quotation with stack effect ( value -- )" } { "co" "a coroutine" } }
HELP: current-coro
{ $description "Variable which contains the currently executing coroutine, or " { $link f } " if none is executing. User code should treat this variable as read-only." }
{ $see-also cocreate coresume coyield }
-;
\ No newline at end of file
+;
IN: cryptlib.libcl
-: load-libcl ( -- )
- "libcl" {
+<< "libcl" {
{ [ win32? ] [ "cl32.dll" "stdcall" ] }
{ [ macosx? ] [ "libcl.dylib" "cdecl" ] }
{ [ unix? ] [ "libcl.so" "cdecl" ] }
- } cond add-library ; parsing
-
-load-libcl
+ } cond add-library >>
! ===============================================
! Machine-dependant types
USING: help.markup help.syntax kernel math sequences quotations
-crypto.common crypto.md5 ;
+crypto.common ;
+IN: crypto.md5
HELP: stream>md5
{ $values { "stream" "a stream" } { "byte-array" "md5 hash" } }
--- /dev/null
+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 )
+
-USING: alien.syntax math prettyprint system combinators
-vocabs.loader ;
+USING: alien.syntax kernel math prettyprint system
+combinators vocabs.loader hardware-info.backend ;
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 . ;
: megs. ( x -- ) 20 2^ /f . ;
: gigs. ( x -- ) 30 2^ /f . ;
-{
+<< {
{ [ windows? ] [ "hardware-info.windows" ] }
{ [ linux? ] [ "hardware-info.linux" ] }
{ [ macosx? ] [ "hardware-info.macosx" ] }
-} cond require
+ { [ t ] [ f ] }
+} cond [ require ] when* >>
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
TUPLE: macosx ;
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
T{ wince } os set-global
M: wince available-virtual-mem ( -- n )
memory-status MEMORYSTATUS-dwAvailVirtual ;
-
-
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 ;
IN: hardware-info.windows.nt
USING: alien alien.c-types kernel libc math namespaces
-windows windows.kernel32 windows.advapi32 hardware-info
-words combinators vocabs.loader ;
+windows windows.kernel32 windows.advapi32
+words combinators vocabs.loader hardware-info.backend ;
IN: hardware-info.windows
TUPLE: wince ;
: system-windows-directory ( -- str )
\ GetSystemWindowsDirectory get-directory ;
-{
+<< {
{ [ wince? ] [ "hardware-info.windows.ce" ] }
{ [ winnt? ] [ "hardware-info.windows.nt" ] }
-} cond require
+ { [ t ] [ f ] }
+} cond [ require ] when* >>
hashtables.private io kernel math
namespaces prettyprint quotations sequences splitting
state-parser strings ;
-USING: html.parser ;
IN: html.parser.utils
: string-parse-end?
! Copyright (C) 2007 Chris Double.
! 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
{ $description
"it is best to use Basic Authentication with SSL." ;
IN: http.basic-authentication
-ABOUT: { "http-authentication" "basic-authentication" }
\ No newline at end of file
+ABOUT: { "http-authentication" "basic-authentication" }
! Coyright (C) 2007 Adam Wendt
! 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"
"The " { $vocab-link "id3" } " vocabulary is used to read ID3 tags from MP3 audio streams."
-USING: inverse help.syntax help.markup ;
+USING: help.syntax help.markup ;
+IN: inverse
HELP: [undo]
{ $values { "quot" "a quotation" } { "undo" "the inverse of the quotation" } }
{
{ [ dup word? not over symbol? or ] [ , ] }
{ [ 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 ] }
{ [ drop t ] [ "Quotation is not invertible" throw ] }
} cond ;
--- /dev/null
+USING: io.backend kernel system vocabs.loader ;
+IN: io.sniffer.backend
+
+SYMBOL: sniffer-type
+TUPLE: sniffer ;
+HOOK: <sniffer> io-backend ( obj -- sniffer )
! Copyright (C) 2007 Elie Chaftari, Doug Coleman.
! See http://factorcode.org/license.txt for BSD license.
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
-sequences ;
+sequences io.sniffer.backend ;
QUALIFIED: unix
IN: io.sniffer.bsd
--- /dev/null
+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 ;
USING: alien.c-types hexdump io io.backend io.sockets.headers
io.sockets.headers.bsd kernel io.sniffer io.sniffer.bsd
-io.sniffer.filter io.streams.string io.unix.backend math
-sequences system byte-arrays ;
+io.streams.string io.unix.backend math
+sequences system byte-arrays io.sniffer.filter.backend
+io.sniffer.filter.backend io.sniffer.backend ;
IN: io.sniffer.filter.bsd
! http://www.iana.org/assignments/ethernet-numbers
USING: alien.c-types byte-arrays combinators hexdump io
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
-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
USING: io.backend kernel system vocabs.loader ;
IN: io.sniffer
-SYMBOL: sniffer-type
-
-TUPLE: sniffer ;
-
-HOOK: <sniffer> io-backend ( obj -- sniffer )
-
bsd? [ "io.sniffer.bsd" require ] when
-USING: kernel opengl arrays sequences jamshred jamshred.tunnel
+USING: kernel opengl arrays sequences jamshred.tunnel
jamshred.player math.vectors ;
IN: jamshred.game
-USING: colors jamshred.game jamshred.oint jamshred.tunnel kernel
+USING: colors jamshred.oint jamshred.tunnel kernel
math math.constants sequences ;
IN: jamshred.player
! Copyright (C) 2006 Chris Double.
! 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 )"
{ $values { "string" "a string in JSON format" } { "object" "yhe object deserialized from the JSON string" } }
-{ $description "Deserializes the JSON formatted string into a Factor object. JSON objects are converted to Factor hashtables. All other JSON objects convert to their obvious Factor equivalents." } ;
\ No newline at end of file
+{ $description "Deserializes the JSON formatted string into a Factor object. JSON objects are converted to Factor hashtables. All other JSON objects convert to their obvious Factor equivalents." } ;
! Copyright (C) 2006 Chris Double.
! 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 )"
{ $values { "obj" "an object" } { "string" "the object converted to JSON format" } }
[ json-print ] string-out ;
M: f json-print ( f -- )
- "false" write ;
+ drop "false" write ;
M: string json-print ( obj -- )
CHAR: " write1 "\"" split "\\\"" join CHAR: \r swap remove "\n" split "\\r\\n" join write CHAR: " write1 ;
IN: lisp.listener
-: parse-stdio ( -- quot/f ) stdio get parse-interactive ;
+: parse-stdio ( -- quot/f ) stdio get read-quot ;
: stuff? ( -- ? ) datastack length 0 > ;
{ "lisp" "lisp.syntax" } add-use
! [ listener-hook get call prompt. lisp-listen ] until-quit
until-quit
-] with-scope ;
\ No newline at end of file
+] with-scope ;
USING: alien alien.c-types alien.syntax combinators kernel math system ;
IN: mad
-: load-mad-library ( -- )
- "mad" {
+<< "mad" {
{ [ macosx? ] [ "libmad.0.dylib" ] }
{ [ unix? ] [ "libmad.so" ] }
{ [ windows? ] [ "mad.dll" ] }
- } cond "cdecl" add-library ; parsing
-
-load-mad-library
+ } cond "cdecl" add-library >>
LIBRARY: mad
! Copyright (C) 2006 Chris Double.
! See http://factorcode.org/license.txt for BSD license.
-USING: help.syntax help.markup parser-combinators
-parser-combinators.simple ;
+USING: help.syntax help.markup parser-combinators ;
+IN: parser-combinators.simple
HELP: 'digit'
{ $values
-USING: xml-rpc help.syntax help.markup ;
+USING: help.syntax help.markup ;
+IN: xml-rpc
HELP: send-rpc
{ $values { "rpc" "an RPC data type" } { "xml" "an XML document" } }