Merge branch 'master' of git://factorcode.org/git/factor
commit
bd157e01e1
|
@ -1,18 +1,19 @@
|
||||||
! Copyright (C) 2008 Slava Pestov.
|
! Copyright (C) 2008 Slava Pestov.
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: accessors words quotations kernel effects sequences parser ;
|
USING: accessors words quotations kernel effects sequences
|
||||||
|
parser definitions ;
|
||||||
IN: alias
|
IN: alias
|
||||||
|
|
||||||
PREDICATE: alias < word "alias" word-prop ;
|
PREDICATE: alias < word "alias" word-prop ;
|
||||||
|
|
||||||
|
: define-alias ( new old -- )
|
||||||
|
[ [ 1quotation ] [ stack-effect ] bi define-inline ]
|
||||||
|
[ drop t "alias" set-word-prop ] 2bi ;
|
||||||
|
|
||||||
|
: ALIAS: CREATE-WORD scan-word define-alias ; parsing
|
||||||
|
|
||||||
M: alias reset-word
|
M: alias reset-word
|
||||||
[ call-next-method ] [ f "alias" set-word-prop ] bi ;
|
[ call-next-method ] [ f "alias" set-word-prop ] bi ;
|
||||||
|
|
||||||
M: alias stack-effect
|
M: alias stack-effect
|
||||||
def>> first stack-effect ;
|
def>> first stack-effect ;
|
||||||
|
|
||||||
: define-alias ( new old -- )
|
|
||||||
[ 1quotation define-inline ]
|
|
||||||
[ drop t "alias" set-word-prop ] 2bi ;
|
|
||||||
|
|
||||||
: ALIAS: CREATE-WORD scan-word define-alias ; parsing
|
|
||||||
|
|
|
@ -234,17 +234,16 @@ M: long-long-type box-return ( type -- )
|
||||||
f swap box-parameter ;
|
f swap box-parameter ;
|
||||||
|
|
||||||
: define-deref ( name -- )
|
: define-deref ( name -- )
|
||||||
[ CHAR: * prefix "alien.c-types" create ]
|
[ CHAR: * prefix "alien.c-types" create ] [ c-getter 0 prefix ] bi
|
||||||
[ c-getter 0 prefix ] bi
|
(( c-ptr -- value )) define-inline ;
|
||||||
define-inline ;
|
|
||||||
|
|
||||||
: define-out ( name -- )
|
: define-out ( name -- )
|
||||||
[ "alien.c-types" constructor-word ]
|
[ "alien.c-types" constructor-word ]
|
||||||
[ dup c-setter '[ _ <c-object> [ 0 @ ] keep ] ]
|
[ dup c-setter '[ _ <c-object> [ 0 @ ] keep ] ] bi
|
||||||
bi define-inline ;
|
(( value -- c-ptr )) define-inline ;
|
||||||
|
|
||||||
: c-bool> ( int -- ? )
|
: c-bool> ( int -- ? )
|
||||||
zero? not ;
|
0 = not ; inline
|
||||||
|
|
||||||
: define-primitive-type ( type name -- )
|
: define-primitive-type ( type name -- )
|
||||||
[ typedef ]
|
[ typedef ]
|
||||||
|
|
|
@ -52,8 +52,8 @@ PREDICATE: slot-writer < word "writing" word-prop >boolean ;
|
||||||
[ (>>offset) ] [ type>> heap-size + ] 2bi
|
[ (>>offset) ] [ type>> heap-size + ] 2bi
|
||||||
] reduce ;
|
] reduce ;
|
||||||
|
|
||||||
: define-struct-slot-word ( word quot spec -- )
|
: define-struct-slot-word ( word quot spec effect -- )
|
||||||
offset>> prefix define-inline ;
|
[ offset>> prefix ] dip define-inline ;
|
||||||
|
|
||||||
: define-getter ( type spec -- )
|
: define-getter ( type spec -- )
|
||||||
[ set-reader-props ] keep
|
[ set-reader-props ] keep
|
||||||
|
@ -62,11 +62,13 @@ PREDICATE: slot-writer < word "writing" word-prop >boolean ;
|
||||||
type>>
|
type>>
|
||||||
[ c-getter ] [ c-type-boxer-quot ] bi append
|
[ c-getter ] [ c-type-boxer-quot ] bi append
|
||||||
]
|
]
|
||||||
[ ] tri define-struct-slot-word ;
|
[ ] tri
|
||||||
|
(( c-ptr -- value )) define-struct-slot-word ;
|
||||||
|
|
||||||
: define-setter ( type spec -- )
|
: define-setter ( type spec -- )
|
||||||
[ set-writer-props ] keep
|
[ set-writer-props ] keep
|
||||||
[ writer>> ] [ type>> c-setter ] [ ] tri define-struct-slot-word ;
|
[ writer>> ] [ type>> c-setter ] [ ] tri
|
||||||
|
(( value c-ptr -- )) define-struct-slot-word ;
|
||||||
|
|
||||||
: define-field ( type spec -- )
|
: define-field ( type spec -- )
|
||||||
[ define-getter ] [ define-setter ] 2bi ;
|
[ define-getter ] [ define-setter ] 2bi ;
|
||||||
|
|
|
@ -11,7 +11,7 @@ TUPLE: bit-array
|
||||||
|
|
||||||
<PRIVATE
|
<PRIVATE
|
||||||
|
|
||||||
: n>byte -3 shift ; inline
|
: n>byte ( m -- n ) -3 shift ; inline
|
||||||
|
|
||||||
: byte/bit ( n alien -- byte bit )
|
: byte/bit ( n alien -- byte bit )
|
||||||
over n>byte alien-unsigned-1 swap 7 bitand ; inline
|
over n>byte alien-unsigned-1 swap 7 bitand ; inline
|
||||||
|
@ -19,9 +19,9 @@ TUPLE: bit-array
|
||||||
: set-bit ( ? byte bit -- byte )
|
: set-bit ( ? byte bit -- byte )
|
||||||
2^ rot [ bitor ] [ bitnot bitand ] if ; inline
|
2^ rot [ bitor ] [ bitnot bitand ] if ; inline
|
||||||
|
|
||||||
: bits>cells 31 + -5 shift ; inline
|
: bits>cells ( m -- n ) 31 + -5 shift ; inline
|
||||||
|
|
||||||
: bits>bytes 7 + n>byte ; inline
|
: bits>bytes ( m -- n ) 7 + n>byte ; inline
|
||||||
|
|
||||||
: (set-bits) ( bit-array n -- )
|
: (set-bits) ( bit-array n -- )
|
||||||
[ [ length bits>cells ] keep ] dip swap underlying>>
|
[ [ length bits>cells ] keep ] dip swap underlying>>
|
||||||
|
|
|
@ -66,7 +66,7 @@ M: id equal?
|
||||||
|
|
||||||
SYMBOL: objects
|
SYMBOL: objects
|
||||||
|
|
||||||
: (objects) <id> objects get ; inline
|
: (objects) ( obj -- id assoc ) <id> objects get ; inline
|
||||||
|
|
||||||
: lookup-object ( obj -- n/f ) (objects) at ;
|
: lookup-object ( obj -- n/f ) (objects) at ;
|
||||||
|
|
||||||
|
|
|
@ -211,7 +211,7 @@ M: real +minute ( timestamp n -- timestamp )
|
||||||
M: number +second ( timestamp n -- timestamp )
|
M: number +second ( timestamp n -- timestamp )
|
||||||
[ over second>> + seconds/minutes [ >>second ] dip +minute ] unless-zero ;
|
[ over second>> + seconds/minutes [ >>second ] dip +minute ] unless-zero ;
|
||||||
|
|
||||||
: (time+)
|
: (time+) ( timestamp duration -- timestamp' duration )
|
||||||
[ second>> +second ] keep
|
[ second>> +second ] keep
|
||||||
[ minute>> +minute ] keep
|
[ minute>> +minute ] keep
|
||||||
[ hour>> +hour ] keep
|
[ hour>> +hour ] keep
|
||||||
|
@ -219,7 +219,8 @@ M: number +second ( timestamp n -- timestamp )
|
||||||
[ month>> +month ] keep
|
[ month>> +month ] keep
|
||||||
[ year>> +year ] keep ; inline
|
[ year>> +year ] keep ; inline
|
||||||
|
|
||||||
: +slots [ bi@ + ] curry 2keep ; inline
|
: +slots ( obj1 obj2 quot -- n obj1 obj2 )
|
||||||
|
[ bi@ + ] curry 2keep ; inline
|
||||||
|
|
||||||
PRIVATE>
|
PRIVATE>
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,7 @@ IN: channels.remote
|
||||||
HELP: <remote-channel>
|
HELP: <remote-channel>
|
||||||
{ $values { "node" "a node object" }
|
{ $values { "node" "a node object" }
|
||||||
{ "id" "the id of the published channel on the node" }
|
{ "id" "the id of the published channel on the node" }
|
||||||
|
{ "remote-channel" remote-channel }
|
||||||
}
|
}
|
||||||
{ $description "Create a remote channel that acts as a proxy for a "
|
{ $description "Create a remote channel that acts as a proxy for a "
|
||||||
"channel on another node. The remote node's channel must have been "
|
"channel on another node. The remote node's channel must have been "
|
||||||
|
|
|
@ -4,8 +4,8 @@ USING: help.syntax help.markup ;
|
||||||
HELP: openssl-checksum
|
HELP: openssl-checksum
|
||||||
{ $class-description "The class of checksum algorithms implemented by OpenSSL. The exact set of algorithms supported depends on how the OpenSSL library was compiled; " { $snippet "md5" } " and " { $snippet "sha1" } " should be universally available." } ;
|
{ $class-description "The class of checksum algorithms implemented by OpenSSL. The exact set of algorithms supported depends on how the OpenSSL library was compiled; " { $snippet "md5" } " and " { $snippet "sha1" } " should be universally available." } ;
|
||||||
|
|
||||||
HELP: <openssl-checksum> ( name -- checksum )
|
HELP: <openssl-checksum>
|
||||||
{ $values { "name" "an EVP message digest name" } { "checksum" openssl-checksum } }
|
{ $values { "name" "an EVP message digest name" } { "openssl-checksum" openssl-checksum } }
|
||||||
{ $description "Creates a new OpenSSL checksum object." } ;
|
{ $description "Creates a new OpenSSL checksum object." } ;
|
||||||
|
|
||||||
HELP: openssl-md5
|
HELP: openssl-md5
|
||||||
|
|
|
@ -14,7 +14,7 @@ IN: cocoa.windows
|
||||||
: NSBackingStoreNonretained 1 ; inline
|
: NSBackingStoreNonretained 1 ; inline
|
||||||
: NSBackingStoreBuffered 2 ; inline
|
: NSBackingStoreBuffered 2 ; inline
|
||||||
|
|
||||||
: standard-window-type
|
: standard-window-type ( -- n )
|
||||||
{
|
{
|
||||||
NSTitledWindowMask
|
NSTitledWindowMask
|
||||||
NSClosableWindowMask
|
NSClosableWindowMask
|
||||||
|
|
|
@ -4,8 +4,8 @@ IN: columns
|
||||||
HELP: column
|
HELP: column
|
||||||
{ $class-description "A virtual sequence which presents a fixed column of a matrix represented as a sequence of rows. New instances can be created by calling " { $link <column> } "." } ;
|
{ $class-description "A virtual sequence which presents a fixed column of a matrix represented as a sequence of rows. New instances can be created by calling " { $link <column> } "." } ;
|
||||||
|
|
||||||
HELP: <column> ( seq n -- column )
|
HELP: <column>
|
||||||
{ $values { "seq" sequence } { "n" "a non-negative integer" } { "column" column } }
|
{ $values { "seq" sequence } { "col" "a non-negative integer" } { "column" column } }
|
||||||
{ $description "Outputs a new virtual sequence which presents a fixed column of a matrix represented as a sequence of rows." "The " { $snippet "i" } "th element of a column is the " { $snippet "n" } "th element of the " { $snippet "i" } "th element of " { $snippet "seq" } ". Every element of " { $snippet "seq" } " must be a sequence, and all sequences must have equal length." }
|
{ $description "Outputs a new virtual sequence which presents a fixed column of a matrix represented as a sequence of rows." "The " { $snippet "i" } "th element of a column is the " { $snippet "n" } "th element of the " { $snippet "i" } "th element of " { $snippet "seq" } ". Every element of " { $snippet "seq" } " must be a sequence, and all sequences must have equal length." }
|
||||||
{ $examples
|
{ $examples
|
||||||
{ $example
|
{ $example
|
||||||
|
|
|
@ -68,7 +68,8 @@ IN: compiler.cfg.alias-analysis
|
||||||
! Map vregs -> alias classes
|
! Map vregs -> alias classes
|
||||||
SYMBOL: vregs>acs
|
SYMBOL: vregs>acs
|
||||||
|
|
||||||
: check [ "BUG: static type error detected" throw ] unless* ; inline
|
: check ( obj -- obj )
|
||||||
|
[ "BUG: static type error detected" throw ] unless* ; inline
|
||||||
|
|
||||||
: vreg>ac ( vreg -- ac )
|
: vreg>ac ( vreg -- ac )
|
||||||
#! Only vregs produced by ##allot, ##peek and ##slot can
|
#! Only vregs produced by ##allot, ##peek and ##slot can
|
||||||
|
|
|
@ -5,17 +5,17 @@ sequences classes.tuple cpu.architecture compiler.cfg.registers
|
||||||
compiler.cfg.instructions ;
|
compiler.cfg.instructions ;
|
||||||
IN: compiler.cfg.hats
|
IN: compiler.cfg.hats
|
||||||
|
|
||||||
: i int-regs next-vreg ; inline
|
: i ( -- vreg ) int-regs next-vreg ; inline
|
||||||
: ^^i i dup ; inline
|
: ^^i ( -- vreg vreg ) i dup ; inline
|
||||||
: ^^i1 [ ^^i ] dip ; inline
|
: ^^i1 ( obj -- vreg vreg obj ) [ ^^i ] dip ; inline
|
||||||
: ^^i2 [ ^^i ] 2dip ; inline
|
: ^^i2 ( obj obj -- vreg vreg obj obj ) [ ^^i ] 2dip ; inline
|
||||||
: ^^i3 [ ^^i ] 3dip ; inline
|
: ^^i3 ( obj obj obj -- vreg vreg obj obj obj ) [ ^^i ] 3dip ; inline
|
||||||
|
|
||||||
: d double-float-regs next-vreg ; inline
|
: d ( -- vreg ) double-float-regs next-vreg ; inline
|
||||||
: ^^d d dup ; inline
|
: ^^d ( -- vreg vreg ) d dup ; inline
|
||||||
: ^^d1 [ ^^d ] dip ; inline
|
: ^^d1 ( obj -- vreg vreg obj ) [ ^^d ] dip ; inline
|
||||||
: ^^d2 [ ^^d ] 2dip ; inline
|
: ^^d2 ( obj obj -- vreg vreg obj obj ) [ ^^d ] 2dip ; inline
|
||||||
: ^^d3 [ ^^d ] 3dip ; inline
|
: ^^d3 ( obj obj obj -- vreg vreg obj obj obj ) [ ^^d ] 3dip ; inline
|
||||||
|
|
||||||
: ^^load-literal ( obj -- dst ) ^^i1 ##load-literal ; inline
|
: ^^load-literal ( obj -- dst ) ^^i1 ##load-literal ; inline
|
||||||
: ^^peek ( loc -- dst ) ^^i1 ##peek ; inline
|
: ^^peek ( loc -- dst ) ^^i1 ##peek ; inline
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
! Copyright (C) 2008 Slava Pestov.
|
! Copyright (C) 2008 Slava Pestov.
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: classes.tuple classes.tuple.parser kernel words
|
USING: classes.tuple classes.tuple.parser kernel words
|
||||||
make fry sequences parser ;
|
make fry sequences parser accessors ;
|
||||||
IN: compiler.cfg.instructions.syntax
|
IN: compiler.cfg.instructions.syntax
|
||||||
|
|
||||||
: insn-word ( -- word )
|
: insn-word ( -- word )
|
||||||
|
@ -10,10 +10,13 @@ IN: compiler.cfg.instructions.syntax
|
||||||
#! this one.
|
#! this one.
|
||||||
"insn" "compiler.cfg.instructions" lookup ;
|
"insn" "compiler.cfg.instructions" lookup ;
|
||||||
|
|
||||||
|
: insn-effect ( word -- effect )
|
||||||
|
boa-effect [ but-last ] change-in { } >>out ;
|
||||||
|
|
||||||
: INSN:
|
: INSN:
|
||||||
parse-tuple-definition "regs" suffix
|
parse-tuple-definition "regs" suffix
|
||||||
[ dup tuple eq? [ drop insn-word ] when ] dip
|
[ dup tuple eq? [ drop insn-word ] when ] dip
|
||||||
[ define-tuple-class ]
|
[ define-tuple-class ]
|
||||||
[ 2drop save-location ]
|
[ 2drop save-location ]
|
||||||
[ 2drop dup '[ f _ boa , ] define-inline ]
|
[ 2drop [ ] [ '[ f _ boa , ] ] [ insn-effect ] tri define-inline ]
|
||||||
3tri ; parsing
|
3tri ; parsing
|
||||||
|
|
|
@ -37,7 +37,7 @@ M: insn linearize-insn , drop ;
|
||||||
M: ##branch linearize-insn
|
M: ##branch linearize-insn
|
||||||
drop dup successors>> first emit-branch ;
|
drop dup successors>> first emit-branch ;
|
||||||
|
|
||||||
: (binary-conditional)
|
: (binary-conditional) ( basic-block insn -- basic-block successor1 successor2 src1 src2 cc )
|
||||||
[ dup successors>> first2 ]
|
[ dup successors>> first2 ]
|
||||||
[ [ src1>> ] [ src2>> ] [ cc>> ] tri ] bi* ; inline
|
[ [ src1>> ] [ src2>> ] [ cc>> ] tri ] bi* ; inline
|
||||||
|
|
||||||
|
|
|
@ -95,7 +95,7 @@ M: ##dispatch-label generate-insn label>> %dispatch-label ;
|
||||||
M: ##dispatch generate-insn
|
M: ##dispatch generate-insn
|
||||||
[ src>> register ] [ temp>> register ] [ offset>> ] tri %dispatch ;
|
[ src>> register ] [ temp>> register ] [ offset>> ] tri %dispatch ;
|
||||||
|
|
||||||
: >slot<
|
: >slot< ( insn -- dst obj slot tag )
|
||||||
{
|
{
|
||||||
[ dst>> register ]
|
[ dst>> register ]
|
||||||
[ obj>> register ]
|
[ obj>> register ]
|
||||||
|
@ -109,7 +109,7 @@ M: ##slot generate-insn
|
||||||
M: ##slot-imm generate-insn
|
M: ##slot-imm generate-insn
|
||||||
>slot< %slot-imm ;
|
>slot< %slot-imm ;
|
||||||
|
|
||||||
: >set-slot<
|
: >set-slot< ( insn -- src obj slot tag )
|
||||||
{
|
{
|
||||||
[ src>> register ]
|
[ src>> register ]
|
||||||
[ obj>> register ]
|
[ obj>> register ]
|
||||||
|
@ -209,7 +209,8 @@ M: ##alien-cell generate-insn dst/src %alien-cell ;
|
||||||
M: ##alien-float generate-insn dst/src %alien-float ;
|
M: ##alien-float generate-insn dst/src %alien-float ;
|
||||||
M: ##alien-double generate-insn dst/src %alien-double ;
|
M: ##alien-double generate-insn dst/src %alien-double ;
|
||||||
|
|
||||||
: >alien-setter< [ src>> register ] [ value>> register ] bi ; inline
|
: >alien-setter< ( insn -- src value )
|
||||||
|
[ src>> register ] [ value>> register ] bi ; inline
|
||||||
|
|
||||||
M: ##set-alien-integer-1 generate-insn >alien-setter< %set-alien-integer-1 ;
|
M: ##set-alien-integer-1 generate-insn >alien-setter< %set-alien-integer-1 ;
|
||||||
M: ##set-alien-integer-2 generate-insn >alien-setter< %set-alien-integer-2 ;
|
M: ##set-alien-integer-2 generate-insn >alien-setter< %set-alien-integer-2 ;
|
||||||
|
|
|
@ -28,7 +28,8 @@ PRIVATE>
|
||||||
|
|
||||||
: [future] ( quot -- quot' ) '[ _ curry future ] ; inline
|
: [future] ( quot -- quot' ) '[ _ curry future ] ; inline
|
||||||
|
|
||||||
: future-values dup [ ?future ] change-each ; inline
|
: future-values ( futures -- futures )
|
||||||
|
dup [ ?future ] change-each ; inline
|
||||||
|
|
||||||
PRIVATE>
|
PRIVATE>
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
! Copyright (C) 2008 Slava Pestov.
|
||||||
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
|
USING: parser kernel words ;
|
||||||
|
IN: constants
|
||||||
|
|
||||||
|
: CONSTANT:
|
||||||
|
CREATE scan-object [ ] curry (( -- value ))
|
||||||
|
define-inline ; parsing
|
|
@ -189,21 +189,21 @@ MTSPR: LR 8
|
||||||
MTSPR: CTR 9
|
MTSPR: CTR 9
|
||||||
|
|
||||||
! Pseudo-instructions
|
! Pseudo-instructions
|
||||||
: LI 0 rot ADDI ; inline
|
: LI ( value dst -- ) 0 rot ADDI ; inline
|
||||||
: SUBI neg ADDI ; inline
|
: SUBI ( dst src1 src2 -- ) neg ADDI ; inline
|
||||||
: LIS 0 rot ADDIS ; inline
|
: LIS ( value dst -- ) 0 rot ADDIS ; inline
|
||||||
: SUBIC neg ADDIC ; inline
|
: SUBIC ( dst src1 src2 -- ) neg ADDIC ; inline
|
||||||
: SUBIC. neg ADDIC. ; inline
|
: SUBIC. ( dst src1 src2 -- ) neg ADDIC. ; inline
|
||||||
: NOT dup NOR ; inline
|
: NOT ( dst src -- ) dup NOR ; inline
|
||||||
: NOT. dup NOR. ; inline
|
: NOT. ( dst src -- ) dup NOR. ; inline
|
||||||
: MR dup OR ; inline
|
: MR ( dst src -- ) dup OR ; inline
|
||||||
: MR. dup OR. ; inline
|
: MR. ( dst src -- ) dup OR. ; inline
|
||||||
: (SLWI) 0 31 pick - ; inline
|
: (SLWI) ( d a b -- d a b x y ) 0 31 pick - ; inline
|
||||||
: SLWI ( d a b -- ) (SLWI) RLWINM ;
|
: SLWI ( d a b -- ) (SLWI) RLWINM ;
|
||||||
: SLWI. ( d a b -- ) (SLWI) RLWINM. ;
|
: SLWI. ( d a b -- ) (SLWI) RLWINM. ;
|
||||||
: (SRWI) 32 over - swap 31 ; inline
|
: (SRWI) ( d a b -- d a b x y ) 32 over - swap 31 ; inline
|
||||||
: SRWI ( d a b -- ) (SRWI) RLWINM ;
|
: SRWI ( d a b -- ) (SRWI) RLWINM ;
|
||||||
: SRWI. ( d a b -- ) (SRWI) RLWINM. ;
|
: SRWI. ( d a b -- ) (SRWI) RLWINM. ;
|
||||||
: LOAD32 ( n r -- ) >r w>h/h r> tuck LIS dup rot ORI ;
|
: LOAD32 ( n r -- ) [ w>h/h ] dip tuck LIS dup rot ORI ;
|
||||||
: immediate? ( n -- ? ) HEX: -8000 HEX: 7fff between? ;
|
: immediate? ( n -- ? ) HEX: -8000 HEX: 7fff between? ;
|
||||||
: LOAD ( n r -- ) over immediate? [ LI ] [ LOAD32 ] if ;
|
: LOAD ( n r -- ) over immediate? [ LI ] [ LOAD32 ] if ;
|
||||||
|
|
|
@ -79,8 +79,8 @@ M: label (B) 0 -rot (B) rc-relative-ppc-3 label-fixup ;
|
||||||
|
|
||||||
GENERIC: BC ( a b c -- )
|
GENERIC: BC ( a b c -- )
|
||||||
M: integer BC 0 0 16 b-insn ;
|
M: integer BC 0 0 16 b-insn ;
|
||||||
M: word BC >r 0 BC r> rc-relative-ppc-2 rel-word ;
|
M: word BC [ 0 BC ] dip rc-relative-ppc-2 rel-word ;
|
||||||
M: label BC >r 0 BC r> rc-relative-ppc-2 label-fixup ;
|
M: label BC [ 0 BC ] dip rc-relative-ppc-2 label-fixup ;
|
||||||
|
|
||||||
: CREATE-B ( -- word ) scan "B" prepend create-in ;
|
: CREATE-B ( -- word ) scan "B" prepend create-in ;
|
||||||
|
|
||||||
|
|
|
@ -467,19 +467,21 @@ M: ppc %gc
|
||||||
M: ppc %prologue ( n -- )
|
M: ppc %prologue ( n -- )
|
||||||
0 11 LOAD32 rc-absolute-ppc-2/2 rel-this
|
0 11 LOAD32 rc-absolute-ppc-2/2 rel-this
|
||||||
0 MFLR
|
0 MFLR
|
||||||
1 1 pick neg ADDI
|
{
|
||||||
11 1 pick xt-save STW
|
[ [ 1 1 ] dip neg ADDI ]
|
||||||
dup 11 LI
|
[ [ 11 1 ] dip xt-save STW ]
|
||||||
11 1 pick next-save STW
|
[ 11 LI ]
|
||||||
0 1 rot lr-save + STW ;
|
[ [ 11 1 ] dip next-save STW ]
|
||||||
|
[ [ 0 1 ] dip lr-save + STW ]
|
||||||
|
} cleave ;
|
||||||
|
|
||||||
M: ppc %epilogue ( n -- )
|
M: ppc %epilogue ( n -- )
|
||||||
#! At the end of each word that calls a subroutine, we store
|
#! At the end of each word that calls a subroutine, we store
|
||||||
#! the previous link register value in r0 by popping it off
|
#! the previous link register value in r0 by popping it off
|
||||||
#! the stack, set the link register to the contents of r0,
|
#! the stack, set the link register to the contents of r0,
|
||||||
#! and jump to the link register.
|
#! and jump to the link register.
|
||||||
0 1 pick lr-save + LWZ
|
[ [ 0 1 ] dip lr-save + LWZ ]
|
||||||
1 1 rot ADDI
|
[ [ 1 1 ] dip ADDI ] bi
|
||||||
0 MTLR ;
|
0 MTLR ;
|
||||||
|
|
||||||
:: (%boolean) ( dst temp word -- )
|
:: (%boolean) ( dst temp word -- )
|
||||||
|
@ -541,17 +543,17 @@ GENERIC: STF ( src dst off reg-class -- )
|
||||||
M: single-float-regs STF drop STFS ;
|
M: single-float-regs STF drop STFS ;
|
||||||
M: double-float-regs STF drop STFD ;
|
M: double-float-regs STF drop STFD ;
|
||||||
|
|
||||||
M: float-regs %save-param-reg >r 1 rot local@ r> STF ;
|
M: float-regs %save-param-reg [ 1 rot local@ ] dip STF ;
|
||||||
|
|
||||||
GENERIC: LF ( dst src off reg-class -- )
|
GENERIC: LF ( dst src off reg-class -- )
|
||||||
|
|
||||||
M: single-float-regs LF drop LFS ;
|
M: single-float-regs LF drop LFS ;
|
||||||
M: double-float-regs LF drop LFD ;
|
M: double-float-regs LF drop LFD ;
|
||||||
|
|
||||||
M: float-regs %load-param-reg >r 1 rot local@ r> LF ;
|
M: float-regs %load-param-reg [ 1 rot local@ ] dip LF ;
|
||||||
|
|
||||||
M: stack-params %load-param-reg ( stack reg reg-class -- )
|
M: stack-params %load-param-reg ( stack reg reg-class -- )
|
||||||
drop >r 0 1 rot local@ LWZ 0 1 r> param@ STW ;
|
drop [ 0 1 rot local@ LWZ 0 1 ] dip param@ STW ;
|
||||||
|
|
||||||
: next-param@ ( n -- x ) param@ stack-frame get total-size>> + ;
|
: next-param@ ( n -- x ) param@ stack-frame get total-size>> + ;
|
||||||
|
|
||||||
|
@ -559,8 +561,8 @@ M: stack-params %save-param-reg ( stack reg reg-class -- )
|
||||||
#! Funky. Read the parameter from the caller's stack frame.
|
#! Funky. Read the parameter from the caller's stack frame.
|
||||||
#! This word is used in callbacks
|
#! This word is used in callbacks
|
||||||
drop
|
drop
|
||||||
0 1 rot next-param@ LWZ
|
[ 0 1 ] dip next-param@ LWZ
|
||||||
0 1 rot local@ STW ;
|
[ 0 1 ] dip local@ STW ;
|
||||||
|
|
||||||
M: ppc %prepare-unbox ( -- )
|
M: ppc %prepare-unbox ( -- )
|
||||||
! First parameter is top of stack
|
! First parameter is top of stack
|
||||||
|
@ -580,14 +582,14 @@ M: ppc %unbox-long-long ( n func -- )
|
||||||
f %alien-invoke
|
f %alien-invoke
|
||||||
! Store the return value on the C stack
|
! Store the return value on the C stack
|
||||||
[
|
[
|
||||||
3 1 pick local@ STW
|
[ [ 3 1 ] dip local@ STW ]
|
||||||
4 1 rot cell + local@ STW
|
[ [ 4 1 ] dip cell + local@ STW ] bi
|
||||||
] when* ;
|
] when* ;
|
||||||
|
|
||||||
M: ppc %unbox-large-struct ( n c-type -- )
|
M: ppc %unbox-large-struct ( n c-type -- )
|
||||||
! Value must be in r3
|
! Value must be in r3
|
||||||
! Compute destination address and load struct size
|
! Compute destination address and load struct size
|
||||||
[ 4 1 rot local@ ADDI ] [ heap-size 5 LI ] bi*
|
[ [ 4 1 ] dip local@ ADDI ] [ heap-size 5 LI ] bi*
|
||||||
! Call the function
|
! Call the function
|
||||||
"to_value_struct" f %alien-invoke ;
|
"to_value_struct" f %alien-invoke ;
|
||||||
|
|
||||||
|
@ -595,15 +597,16 @@ M: ppc %box ( n reg-class func -- )
|
||||||
! If the source is a stack location, load it into freg #0.
|
! If the source is a stack location, load it into freg #0.
|
||||||
! If the source is f, then we assume the value is already in
|
! If the source is f, then we assume the value is already in
|
||||||
! freg #0.
|
! freg #0.
|
||||||
>r
|
[ over [ 0 over param-reg swap %load-param-reg ] [ 2drop ] if ] dip
|
||||||
over [ 0 over param-reg swap %load-param-reg ] [ 2drop ] if
|
f %alien-invoke ;
|
||||||
r> f %alien-invoke ;
|
|
||||||
|
|
||||||
M: ppc %box-long-long ( n func -- )
|
M: ppc %box-long-long ( n func -- )
|
||||||
>r [
|
[
|
||||||
3 1 pick local@ LWZ
|
[
|
||||||
4 1 rot cell + local@ LWZ
|
[ [ 3 1 ] dip local@ LWZ ]
|
||||||
] when* r> f %alien-invoke ;
|
[ [ 4 1 ] dip cell + local@ LWZ ] bi
|
||||||
|
] when*
|
||||||
|
] dip f %alien-invoke ;
|
||||||
|
|
||||||
: struct-return@ ( n -- n )
|
: struct-return@ ( n -- n )
|
||||||
[ stack-frame get params>> ] unless* local@ ;
|
[ stack-frame get params>> ] unless* local@ ;
|
||||||
|
@ -616,7 +619,7 @@ M: ppc %prepare-box-struct ( -- )
|
||||||
M: ppc %box-large-struct ( n c-type -- )
|
M: ppc %box-large-struct ( n c-type -- )
|
||||||
! If n = f, then we're boxing a returned struct
|
! If n = f, then we're boxing a returned struct
|
||||||
! Compute destination address and load struct size
|
! Compute destination address and load struct size
|
||||||
[ 3 1 rot struct-return@ ADDI ] [ heap-size 4 LI ] bi*
|
[ [ 3 1 ] dip struct-return@ ADDI ] [ heap-size 4 LI ] bi*
|
||||||
! Call the function
|
! Call the function
|
||||||
"box_value_struct" f %alien-invoke ;
|
"box_value_struct" f %alien-invoke ;
|
||||||
|
|
||||||
|
|
|
@ -37,7 +37,7 @@ M:: x86.64 %dispatch ( src temp offset -- )
|
||||||
|
|
||||||
M: x86.64 param-reg-1 int-regs param-regs first ;
|
M: x86.64 param-reg-1 int-regs param-regs first ;
|
||||||
M: x86.64 param-reg-2 int-regs param-regs second ;
|
M: x86.64 param-reg-2 int-regs param-regs second ;
|
||||||
: param-reg-3 int-regs param-regs third ; inline
|
: param-reg-3 ( -- reg ) int-regs param-regs third ; inline
|
||||||
|
|
||||||
M: int-regs return-reg drop RAX ;
|
M: int-regs return-reg drop RAX ;
|
||||||
M: float-regs return-reg drop XMM0 ;
|
M: float-regs return-reg drop XMM0 ;
|
||||||
|
|
|
@ -79,9 +79,10 @@ big-endian off
|
||||||
! compute quotation location
|
! compute quotation location
|
||||||
temp0 temp1 ADD
|
temp0 temp1 ADD
|
||||||
! load quotation
|
! load quotation
|
||||||
temp0 temp0 array-start-offset [+] MOV
|
arg temp0 array-start-offset [+] MOV
|
||||||
! execute branch
|
! execute branch. the quot must be in arg, since it might
|
||||||
temp0 quot-xt-offset [+] JMP
|
! not be compiled yet
|
||||||
|
arg quot-xt-offset [+] JMP
|
||||||
] rc-absolute-cell rt-immediate 1 rex-length + jit-dispatch jit-define
|
] rc-absolute-cell rt-immediate 1 rex-length + jit-dispatch jit-define
|
||||||
|
|
||||||
: jit->r ( -- )
|
: jit->r ( -- )
|
||||||
|
|
|
@ -12,7 +12,7 @@ SYMBOL: delimiter
|
||||||
|
|
||||||
CHAR: , delimiter set-global
|
CHAR: , delimiter set-global
|
||||||
|
|
||||||
: delimiter> delimiter get ; inline
|
: delimiter> ( -- delimiter ) delimiter get ; inline
|
||||||
|
|
||||||
DEFER: quoted-field ( -- endchar )
|
DEFER: quoted-field ( -- endchar )
|
||||||
|
|
||||||
|
|
|
@ -41,12 +41,15 @@ HELP: +user-assigned-id+
|
||||||
{ $description "The user is responsible for choosing a primary key for tuples inserted with this database type. Keys must be unique or else the database will throw an error. Usually it is better to use a " { $link +db-assigned-id+ } "." } ;
|
{ $description "The user is responsible for choosing a primary key for tuples inserted with this database type. Keys must be unique or else the database will throw an error. Usually it is better to use a " { $link +db-assigned-id+ } "." } ;
|
||||||
|
|
||||||
HELP: <generator-bind>
|
HELP: <generator-bind>
|
||||||
|
{ $values { "slot-name" object } { "key" object } { "generator-singleton" object } { "type" object } { "generator-bind" generator-bind } }
|
||||||
{ $description "" } ;
|
{ $description "" } ;
|
||||||
|
|
||||||
HELP: <literal-bind>
|
HELP: <literal-bind>
|
||||||
|
{ $values { "key" object } { "type" object } { "value" object } { "literal-bind" literal-bind } }
|
||||||
{ $description "" } ;
|
{ $description "" } ;
|
||||||
|
|
||||||
HELP: <low-level-binding>
|
HELP: <low-level-binding>
|
||||||
|
{ $values { "value" object } { "low-level-binding" low-level-binding } }
|
||||||
{ $description "" } ;
|
{ $description "" } ;
|
||||||
|
|
||||||
HELP: BIG-INTEGER
|
HELP: BIG-INTEGER
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
USING: definitions kernel parser words sequences math.parser
|
USING: definitions kernel parser words sequences math.parser
|
||||||
namespaces editors io.launcher windows.shell32 io.files
|
namespaces editors io.launcher windows.shell32 io.files
|
||||||
io.paths.windows strings unicode.case make ;
|
io.directories.search.windows strings unicode.case make ;
|
||||||
IN: editors.editpadlite
|
IN: editors.editpadlite
|
||||||
|
|
||||||
: editpadlite-path ( -- path )
|
: editpadlite-path ( -- path )
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
USING: definitions kernel parser words sequences math.parser
|
USING: definitions kernel parser words sequences math.parser
|
||||||
namespaces editors io.launcher windows.shell32 io.files
|
namespaces editors io.launcher windows.shell32 io.files
|
||||||
io.paths.windows strings unicode.case make ;
|
io.directories.search.windows strings unicode.case make ;
|
||||||
IN: editors.editpadpro
|
IN: editors.editpadpro
|
||||||
|
|
||||||
: editpadpro-path ( -- path )
|
: editpadpro-path ( -- path )
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
USING: editors io.files io.launcher kernel math.parser
|
USING: editors io.files io.launcher kernel math.parser
|
||||||
namespaces sequences windows.shell32 make io.paths.windows ;
|
namespaces sequences windows.shell32 make
|
||||||
|
io.directories.search.windows ;
|
||||||
IN: editors.editplus
|
IN: editors.editplus
|
||||||
|
|
||||||
: editplus-path ( -- path )
|
: editplus-path ( -- path )
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
USING: editors io.files io.launcher kernel math.parser
|
USING: editors io.files io.launcher kernel math.parser
|
||||||
namespaces sequences windows.shell32 make io.paths.windows ;
|
namespaces sequences windows.shell32 make
|
||||||
|
io.directories.search.windows ;
|
||||||
IN: editors.emeditor
|
IN: editors.emeditor
|
||||||
|
|
||||||
: emeditor-path ( -- path )
|
: emeditor-path ( -- path )
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
! Copyright (C) 2008 Kibleur Christophe.
|
! Copyright (C) 2008 Kibleur Christophe.
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: editors io.files io.launcher kernel math.parser
|
USING: editors io.files io.launcher kernel math.parser make
|
||||||
namespaces sequences windows.shell32 io.paths.windows make ;
|
namespaces sequences windows.shell32 io.directories.search.windows ;
|
||||||
IN: editors.etexteditor
|
IN: editors.etexteditor
|
||||||
|
|
||||||
: etexteditor-path ( -- str )
|
: etexteditor-path ( -- str )
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
USING: editors.gvim io.files kernel namespaces sequences
|
USING: editors.gvim io.files kernel namespaces sequences
|
||||||
windows.shell32 io.paths.windows system ;
|
windows.shell32 io.directories.search.windows system
|
||||||
|
io.pathnames ;
|
||||||
IN: editors.gvim.windows
|
IN: editors.gvim.windows
|
||||||
|
|
||||||
M: windows gvim-path
|
M: windows gvim-path
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
USING: editors io.files io.launcher kernel math.parser
|
USING: editors io.files io.launcher kernel math.parser
|
||||||
namespaces sequences windows.shell32 make ;
|
namespaces sequences windows.shell32 make io.pathnames ;
|
||||||
IN: editors.notepad2
|
IN: editors.notepad2
|
||||||
|
|
||||||
: notepad2-path ( -- path )
|
: notepad2-path ( -- path )
|
||||||
\ notepad2-path get-global [
|
\ notepad2-path get-global [
|
||||||
"C:\\Windows\\system32\\notepad.exe"
|
windows-directory "system32\\notepad.exe" append-path
|
||||||
] unless* ;
|
] unless* ;
|
||||||
|
|
||||||
: notepad2 ( file line -- )
|
: notepad2 ( file line -- )
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
USING: editors io.files io.launcher kernel math.parser
|
USING: editors io.files io.launcher kernel math.parser
|
||||||
namespaces sequences io.paths.windows make ;
|
namespaces sequences io.directories.search.windows make ;
|
||||||
IN: editors.notepadpp
|
IN: editors.notepadpp
|
||||||
|
|
||||||
: notepadpp-path ( -- path )
|
: notepadpp-path ( -- path )
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
! Copyright (C) 2007 Clemens F. Hofreither.
|
! Copyright (C) 2007 Clemens F. Hofreither.
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
! clemens.hofreither@gmx.net
|
! clemens.hofreither@gmx.net
|
||||||
USING: io.files io.launcher kernel namespaces io.paths.windows
|
USING: io.files io.launcher kernel namespaces io.directories.search.windows
|
||||||
math math.parser editors sequences make unicode.case ;
|
math math.parser editors sequences make unicode.case ;
|
||||||
IN: editors.scite
|
IN: editors.scite
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
USING: editors io.files io.launcher kernel math.parser
|
USING: editors io.files io.launcher kernel math.parser
|
||||||
namespaces sequences io.paths.windows make ;
|
namespaces sequences io.directories.search.windows make ;
|
||||||
IN: editors.ted-notepad
|
IN: editors.ted-notepad
|
||||||
|
|
||||||
: ted-notepad-path ( -- path )
|
: ted-notepad-path ( -- path )
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
Doug Coleman
|
|
@ -0,0 +1 @@
|
||||||
|
TextPad editor integration
|
|
@ -0,0 +1 @@
|
||||||
|
unportable
|
|
@ -0,0 +1,16 @@
|
||||||
|
USING: editors io.files io.launcher kernel math.parser
|
||||||
|
namespaces sequences make io.directories.search
|
||||||
|
io.directories.search.windows ;
|
||||||
|
IN: editors.textpad
|
||||||
|
|
||||||
|
: textpad-path ( -- path )
|
||||||
|
\ textpad-path get-global [
|
||||||
|
"TextPad 5" t [ "TextPad.exe" tail? ] find-in-program-files
|
||||||
|
] unless* ;
|
||||||
|
|
||||||
|
: textpad ( file line -- )
|
||||||
|
[
|
||||||
|
textpad-path , [ , ] [ number>string "(" ",0)" surround , ] bi*
|
||||||
|
] { } make run-detached drop ;
|
||||||
|
|
||||||
|
[ textpad ] edit-hook set-global
|
|
@ -1,5 +1,5 @@
|
||||||
USING: editors io.files io.launcher kernel math.parser
|
USING: editors io.files io.launcher kernel math.parser
|
||||||
namespaces sequences io.paths.windows make ;
|
namespaces sequences io.directories.search.windows make ;
|
||||||
IN: editors.ultraedit
|
IN: editors.ultraedit
|
||||||
|
|
||||||
: ultraedit-path ( -- path )
|
: ultraedit-path ( -- path )
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
USING: definitions help help.markup help.syntax io io.files editors words ;
|
USING: definitions editors help help.markup help.syntax io io.files
|
||||||
|
io.pathnames words ;
|
||||||
IN: editors.vim
|
IN: editors.vim
|
||||||
|
|
||||||
ARTICLE: { "vim" "vim" } "Vim support"
|
ARTICLE: { "vim" "vim" } "Vim support"
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
USING: editors io.launcher kernel io.paths.windows
|
USING: editors io.launcher kernel io.directories.search.windows
|
||||||
math.parser namespaces sequences io.files arrays ;
|
math.parser namespaces sequences io.files arrays ;
|
||||||
IN: editors.wordpad
|
IN: editors.wordpad
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ sequences ftp io.launcher.unix.parser unicode.case splitting
|
||||||
assocs classes io.servers.connection destructors calendar
|
assocs classes io.servers.connection destructors calendar
|
||||||
io.timeouts io.streams.duplex threads continuations math
|
io.timeouts io.streams.duplex threads continuations math
|
||||||
concurrency.promises byte-arrays io.backend tools.hexdump
|
concurrency.promises byte-arrays io.backend tools.hexdump
|
||||||
tools.files io.streams.string ;
|
tools.files io.streams.string math.bitwise ;
|
||||||
IN: ftp.server
|
IN: ftp.server
|
||||||
|
|
||||||
TUPLE: ftp-client url mode state command-promise user password ;
|
TUPLE: ftp-client url mode state command-promise user password ;
|
||||||
|
@ -49,7 +49,7 @@ C: <ftp-list> ftp-list
|
||||||
[ >>raw ] [ tokenize-command >>tokenized ] bi ;
|
[ >>raw ] [ tokenize-command >>tokenized ] bi ;
|
||||||
|
|
||||||
: (send-response) ( n string separator -- )
|
: (send-response) ( n string separator -- )
|
||||||
rot number>string write write ftp-send ;
|
[ number>string write ] 2dip write ftp-send ;
|
||||||
|
|
||||||
: send-response ( ftp-response -- )
|
: send-response ( ftp-response -- )
|
||||||
[ n>> ] [ strings>> ] bi
|
[ n>> ] [ strings>> ] bi
|
||||||
|
@ -102,7 +102,7 @@ ERROR: type-error type ;
|
||||||
: handle-TYPE ( obj -- )
|
: handle-TYPE ( obj -- )
|
||||||
[
|
[
|
||||||
tokenized>> second parse-type
|
tokenized>> second parse-type
|
||||||
200 "Switching to " rot " mode" 3append server-response
|
[ 200 ] dip "Switching to " " mode" surround server-response
|
||||||
] [
|
] [
|
||||||
2drop "TYPE is binary only" ftp-error
|
2drop "TYPE is binary only" ftp-error
|
||||||
] recover ;
|
] recover ;
|
||||||
|
@ -111,11 +111,11 @@ ERROR: type-error type ;
|
||||||
remote-address get class new 0 >>port binary <server> ;
|
remote-address get class new 0 >>port binary <server> ;
|
||||||
|
|
||||||
: port>bytes ( port -- hi lo )
|
: port>bytes ( port -- hi lo )
|
||||||
[ -8 shift ] keep [ HEX: ff bitand ] bi@ ;
|
[ -8 shift ] keep [ 8 bits ] bi@ ;
|
||||||
|
|
||||||
: handle-PWD ( obj -- )
|
: handle-PWD ( obj -- )
|
||||||
drop
|
drop
|
||||||
257 current-directory get "\"" "\"" surround server-response ;
|
257 current-directory get "\"" dup surround server-response ;
|
||||||
|
|
||||||
: handle-SYST ( obj -- )
|
: handle-SYST ( obj -- )
|
||||||
drop
|
drop
|
||||||
|
@ -155,15 +155,19 @@ M: ftp-list service-command ( stream obj -- )
|
||||||
finish-directory ;
|
finish-directory ;
|
||||||
|
|
||||||
: transfer-outgoing-file ( path -- )
|
: transfer-outgoing-file ( path -- )
|
||||||
150 "Opening BINARY mode data connection for "
|
[
|
||||||
rot
|
150
|
||||||
[ file-name ] [
|
"Opening BINARY mode data connection for "
|
||||||
" " swap file-info size>> number>string
|
] dip
|
||||||
"(" " bytes)." surround append
|
[
|
||||||
] bi 3append server-response ;
|
file-name
|
||||||
|
] [
|
||||||
|
file-info size>> number>string
|
||||||
|
"(" " bytes)." surround
|
||||||
|
] bi " " glue append server-response ;
|
||||||
|
|
||||||
: transfer-incoming-file ( path -- )
|
: transfer-incoming-file ( path -- )
|
||||||
150 "Opening BINARY mode data connection for " rot append
|
[ 150 ] dip "Opening BINARY mode data connection for " prepend
|
||||||
server-response ;
|
server-response ;
|
||||||
|
|
||||||
: finish-file-transfer ( -- )
|
: finish-file-transfer ( -- )
|
||||||
|
@ -209,8 +213,9 @@ M: ftp-put service-command ( stream obj -- )
|
||||||
|
|
||||||
: handle-SIZE ( obj -- )
|
: handle-SIZE ( obj -- )
|
||||||
[
|
[
|
||||||
|
[ 213 ] dip
|
||||||
tokenized>> second file-info size>>
|
tokenized>> second file-info size>>
|
||||||
213 swap number>string server-response
|
number>string server-response
|
||||||
] [
|
] [
|
||||||
2drop
|
2drop
|
||||||
550 "Could not get file size" server-response
|
550 "Could not get file size" server-response
|
||||||
|
@ -228,21 +233,20 @@ M: ftp-put service-command ( stream obj -- )
|
||||||
|
|
||||||
: handle-PASV ( obj -- )
|
: handle-PASV ( obj -- )
|
||||||
drop client get passive >>mode drop
|
drop client get passive >>mode drop
|
||||||
expect-connection
|
221
|
||||||
[
|
expect-connection port>bytes [ number>string ] bi@ "," glue
|
||||||
"Entering Passive Mode (127,0,0,1," %
|
"Entering Passive Mode (127,0,0,1," ")" surround
|
||||||
port>bytes [ number>string ] bi@ "," glue %
|
server-response ;
|
||||||
")" %
|
|
||||||
] "" make 227 swap server-response ;
|
|
||||||
|
|
||||||
: handle-EPSV ( obj -- )
|
: handle-EPSV ( obj -- )
|
||||||
drop
|
drop
|
||||||
client get command-promise>> [
|
client get command-promise>> [
|
||||||
"You already have a passive stream" ftp-error
|
"You already have a passive stream" ftp-error
|
||||||
] [
|
] [
|
||||||
229 "Entering Extended Passive Mode (|||"
|
229
|
||||||
expect-connection number>string
|
expect-connection number>string
|
||||||
"|)" 3append server-response
|
"Entering Extended Passive Mode (|||" "|)" surround
|
||||||
|
server-response
|
||||||
] if ;
|
] if ;
|
||||||
|
|
||||||
! LPRT 6,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,242,186
|
! LPRT 6,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,242,186
|
||||||
|
|
|
@ -10,8 +10,8 @@ HELP: <redirect>
|
||||||
{ $values { "url" url } { "response" response } }
|
{ $values { "url" url } { "response" response } }
|
||||||
{ $description "Creates a response which redirects the client to the given URL." } ;
|
{ $description "Creates a response which redirects the client to the given URL." } ;
|
||||||
|
|
||||||
HELP: <secure-only> ( responder -- responder' )
|
HELP: <secure-only>
|
||||||
{ $values { "responder" "a responder" } { "responder'" "a responder" } }
|
{ $values { "responder" "a responder" } { "secure-only" "a responder" } }
|
||||||
{ $description "Creates a new responder which ensures that the client is connecting via HTTPS before delegating to the underlying responder. If the client is connecting via HTTP, a redirect is sent instead." } ;
|
{ $description "Creates a new responder which ensures that the client is connecting via HTTPS before delegating to the underlying responder. If the client is connecting via HTTP, a redirect is sent instead." } ;
|
||||||
|
|
||||||
HELP: <secure-redirect>
|
HELP: <secure-redirect>
|
||||||
|
|
|
@ -8,7 +8,8 @@ IN: grouping
|
||||||
|
|
||||||
TUPLE: chunking-seq { seq read-only } { n read-only } ;
|
TUPLE: chunking-seq { seq read-only } { n read-only } ;
|
||||||
|
|
||||||
: check-groups dup 0 <= [ "Invalid group count" throw ] when ; inline
|
: check-groups ( n -- n )
|
||||||
|
dup 0 <= [ "Invalid group count" throw ] when ; inline
|
||||||
|
|
||||||
: new-groups ( seq n class -- groups )
|
: new-groups ( seq n class -- groups )
|
||||||
[ check-groups ] dip boa ; inline
|
[ check-groups ] dip boa ; inline
|
||||||
|
|
|
@ -87,7 +87,8 @@ M: heap heap-size ( heap -- n )
|
||||||
|
|
||||||
GENERIC: heap-compare ( pair1 pair2 heap -- ? )
|
GENERIC: heap-compare ( pair1 pair2 heap -- ? )
|
||||||
|
|
||||||
: (heap-compare) drop [ key>> ] compare ; inline
|
: (heap-compare) ( pair1 pair2 heap -- <=> )
|
||||||
|
drop [ key>> ] compare ; inline
|
||||||
|
|
||||||
M: min-heap heap-compare (heap-compare) +gt+ eq? ;
|
M: min-heap heap-compare (heap-compare) +gt+ eq? ;
|
||||||
|
|
||||||
|
|
|
@ -43,9 +43,9 @@ IN: help.lint
|
||||||
|
|
||||||
: check-values ( word element -- )
|
: check-values ( word element -- )
|
||||||
{
|
{
|
||||||
|
[ drop { [ symbol? ] [ macro? ] [ parsing-word? ] } 1|| ]
|
||||||
[ drop "declared-effect" word-prop not ]
|
[ drop "declared-effect" word-prop not ]
|
||||||
[ nip contains-funky-elements? ]
|
[ nip contains-funky-elements? ]
|
||||||
[ drop macro? ]
|
|
||||||
[
|
[
|
||||||
[ effect-values >array ]
|
[ effect-values >array ]
|
||||||
[ extract-values >array ]
|
[ extract-values >array ]
|
||||||
|
@ -59,7 +59,7 @@ IN: help.lint
|
||||||
] each ;
|
] each ;
|
||||||
|
|
||||||
: vocab-exists? ( name -- ? )
|
: vocab-exists? ( name -- ? )
|
||||||
dup vocab swap "all-vocabs" get member? or ;
|
[ vocab ] [ "all-vocabs" get member? ] bi or ;
|
||||||
|
|
||||||
: check-modules ( element -- )
|
: check-modules ( element -- )
|
||||||
\ $vocab-link swap elements [
|
\ $vocab-link swap elements [
|
||||||
|
|
|
@ -4,8 +4,8 @@ html.templates html.templates.chloe.syntax
|
||||||
html.templates.chloe.compiler html.templates.chloe.components
|
html.templates.chloe.compiler html.templates.chloe.components
|
||||||
math xml.data strings quotations namespaces ;
|
math xml.data strings quotations namespaces ;
|
||||||
|
|
||||||
HELP: <chloe> ( path -- template )
|
HELP: <chloe>
|
||||||
{ $values { "path" "a pathname string without the trailing " { $snippet ".xml" } " extension" } { "template" chloe } }
|
{ $values { "path" "a pathname string without the trailing " { $snippet ".xml" } " extension" } { "chloe" chloe } }
|
||||||
{ $description "Creates a new Chloe template object which can be passed to " { $link call-template } "." } ;
|
{ $description "Creates a new Chloe template object which can be passed to " { $link call-template } "." } ;
|
||||||
|
|
||||||
HELP: required-attr
|
HELP: required-attr
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
IN: html.templates.fhtml
|
IN: html.templates.fhtml
|
||||||
USING: help.markup help.syntax ;
|
USING: help.markup help.syntax ;
|
||||||
|
|
||||||
HELP: <fhtml> ( path -- fhtml )
|
HELP: <fhtml>
|
||||||
{ $values { "path" "a pathname string" } { "fhtml" fhtml } }
|
{ $values { "path" "a pathname string" } { "fhtml" fhtml } }
|
||||||
{ $description "Creates an FHTML template descriptor." } ;
|
{ $description "Creates an FHTML template descriptor." } ;
|
||||||
|
|
||||||
|
|
|
@ -4,8 +4,8 @@ IN: http.server
|
||||||
HELP: trivial-responder
|
HELP: trivial-responder
|
||||||
{ $description "The class of trivial responders, which output the same response for every request. New instances are created by calling " { $link <trivial-responder> } "." } ;
|
{ $description "The class of trivial responders, which output the same response for every request. New instances are created by calling " { $link <trivial-responder> } "." } ;
|
||||||
|
|
||||||
HELP: <trivial-responder> ( response -- responder )
|
HELP: <trivial-responder>
|
||||||
{ $values { "response" response } { "responder" trivial-responder } }
|
{ $values { "response" response } { "trivial-responder" trivial-responder } }
|
||||||
{ $description "Creates a new trivial responder which outputs the same response for every request." } ;
|
{ $description "Creates a new trivial responder which outputs the same response for every request." } ;
|
||||||
|
|
||||||
HELP: benchmark?
|
HELP: benchmark?
|
||||||
|
|
|
@ -21,6 +21,9 @@ C: <io-callback> io-callback
|
||||||
[ (make-overlapped) ] dip
|
[ (make-overlapped) ] dip
|
||||||
handle>> ptr>> [ over set-OVERLAPPED-offset ] when* ;
|
handle>> ptr>> [ over set-OVERLAPPED-offset ] when* ;
|
||||||
|
|
||||||
|
M: winnt FileArgs-overlapped ( port -- overlapped )
|
||||||
|
make-overlapped ;
|
||||||
|
|
||||||
: <completion-port> ( handle existing -- handle )
|
: <completion-port> ( handle existing -- handle )
|
||||||
f 1 CreateIoCompletionPort dup win32-error=0/f ;
|
f 1 CreateIoCompletionPort dup win32-error=0/f ;
|
||||||
|
|
||||||
|
|
|
@ -56,4 +56,4 @@ PRIVATE>
|
||||||
: find-in-directories ( directories bfs? quot -- path' )
|
: find-in-directories ( directories bfs? quot -- path' )
|
||||||
'[ _ _ find-file ] attempt-all ; inline
|
'[ _ _ find-file ] attempt-all ; inline
|
||||||
|
|
||||||
os windows? [ "io.paths.windows" require ] when
|
os windows? [ "io.directories.search.windows" require ] when
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
! Copyright (C) 2008 Doug Coleman.
|
! Copyright (C) 2008 Doug Coleman.
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: arrays fry io.pathnames kernel sequences windows.shell32 ;
|
USING: arrays fry io.pathnames kernel sequences windows.shell32
|
||||||
IN: io.paths
|
io.directories.search ;
|
||||||
|
IN: io.directories.search.windows
|
||||||
|
|
||||||
: program-files-directories ( -- array )
|
: program-files-directories ( -- array )
|
||||||
program-files program-files-x86 2array ; inline
|
program-files program-files-x86 2array ; inline
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
unportable
|
|
@ -0,0 +1 @@
|
||||||
|
unportable
|
|
@ -0,0 +1 @@
|
||||||
|
unportable
|
|
@ -11,14 +11,15 @@ M: unix cwd ( -- path )
|
||||||
|
|
||||||
M: unix cd ( path -- ) [ chdir ] unix-system-call drop ;
|
M: unix cd ( path -- ) [ chdir ] unix-system-call drop ;
|
||||||
|
|
||||||
: read-flags O_RDONLY ; inline
|
: read-flags ( -- n ) O_RDONLY ; inline
|
||||||
|
|
||||||
: open-read ( path -- fd ) O_RDONLY file-mode open-file ;
|
: open-read ( path -- fd ) O_RDONLY file-mode open-file ;
|
||||||
|
|
||||||
M: unix (file-reader) ( path -- stream )
|
M: unix (file-reader) ( path -- stream )
|
||||||
open-read <fd> init-fd <input-port> ;
|
open-read <fd> init-fd <input-port> ;
|
||||||
|
|
||||||
: write-flags { O_WRONLY O_CREAT O_TRUNC } flags ; inline
|
: write-flags ( -- n )
|
||||||
|
{ O_WRONLY O_CREAT O_TRUNC } flags ; inline
|
||||||
|
|
||||||
: open-write ( path -- fd )
|
: open-write ( path -- fd )
|
||||||
write-flags file-mode open-file ;
|
write-flags file-mode open-file ;
|
||||||
|
@ -26,7 +27,8 @@ M: unix (file-reader) ( path -- stream )
|
||||||
M: unix (file-writer) ( path -- stream )
|
M: unix (file-writer) ( path -- stream )
|
||||||
open-write <fd> init-fd <output-port> ;
|
open-write <fd> init-fd <output-port> ;
|
||||||
|
|
||||||
: append-flags { O_WRONLY O_APPEND O_CREAT } flags ; inline
|
: append-flags ( -- n )
|
||||||
|
{ O_WRONLY O_APPEND O_CREAT } flags ; inline
|
||||||
|
|
||||||
: open-append ( path -- fd )
|
: open-append ( path -- fd )
|
||||||
[
|
[
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
USING: io.files kernel tools.test io.backend
|
USING: io.files io.pathnames kernel tools.test io.backend
|
||||||
io.files.windows.nt splitting sequences ;
|
io.files.windows.nt splitting sequences ;
|
||||||
IN: io.files.windows.nt.tests
|
IN: io.files.windows.nt.tests
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
USING: continuations destructors io.buffers io.files io.backend
|
USING: continuations destructors io.buffers io.files io.backend
|
||||||
io.timeouts io.ports io.pathnames io.files.private io.backend.windows
|
io.timeouts io.ports io.pathnames io.files.private
|
||||||
io.files.windows io.backend.windows.nt io.encodings.utf16n
|
io.backend.windows io.files.windows io.encodings.utf16n windows
|
||||||
windows windows.kernel32 kernel libc math threads system
|
windows.kernel32 kernel libc math threads system environment
|
||||||
environment alien.c-types alien.arrays alien.strings sequences
|
alien.c-types alien.arrays alien.strings sequences combinators
|
||||||
combinators combinators.short-circuit ascii splitting alien
|
combinators.short-circuit ascii splitting alien strings assocs
|
||||||
strings assocs namespaces make accessors tr ;
|
namespaces make accessors tr ;
|
||||||
IN: io.files.windows.nt
|
IN: io.files.windows.nt
|
||||||
|
|
||||||
M: winnt cwd
|
M: winnt cwd
|
||||||
|
@ -44,9 +44,6 @@ M: winnt normalize-path ( string -- string' )
|
||||||
M: winnt CreateFile-flags ( DWORD -- DWORD )
|
M: winnt CreateFile-flags ( DWORD -- DWORD )
|
||||||
FILE_FLAG_OVERLAPPED bitor ;
|
FILE_FLAG_OVERLAPPED bitor ;
|
||||||
|
|
||||||
M: winnt FileArgs-overlapped ( port -- overlapped )
|
|
||||||
make-overlapped ;
|
|
||||||
|
|
||||||
M: winnt open-append
|
M: winnt open-append
|
||||||
0 ! [ dup file-info size>> ] [ drop 0 ] recover
|
0 ! [ dup file-info size>> ] [ drop 0 ] recover
|
||||||
[ (open-append) ] dip >>ptr ;
|
[ (open-append) ] dip >>ptr ;
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
USING: io.launcher tools.test calendar accessors environment
|
USING: io.launcher tools.test calendar accessors environment
|
||||||
namespaces kernel system arrays io io.files io.encodings.ascii
|
namespaces kernel system arrays io io.files io.encodings.ascii
|
||||||
sequences parser assocs hashtables math continuations eval ;
|
sequences parser assocs hashtables math continuations eval
|
||||||
|
io.files.temp io.directories io.pathnames ;
|
||||||
IN: io.launcher.windows.nt.tests
|
IN: io.launcher.windows.nt.tests
|
||||||
|
|
||||||
[ ] [
|
[ ] [
|
||||||
|
|
|
@ -86,7 +86,7 @@ ARTICLE: "ssl-contexts" "Secure socket contexts"
|
||||||
HELP: secure
|
HELP: secure
|
||||||
{ $class-description "The class of secure socket addresses." } ;
|
{ $class-description "The class of secure socket addresses." } ;
|
||||||
|
|
||||||
HELP: <secure> ( addrspec -- secure )
|
HELP: <secure>
|
||||||
{ $values { "addrspec" "an address specifier" } { "secure" secure } }
|
{ $values { "addrspec" "an address specifier" } { "secure" secure } }
|
||||||
{ $description "Creates a new secure socket address, which can then be passed to " { $link <client> } " or " { $link <server> } "." } ;
|
{ $description "Creates a new secure socket address, which can then be passed to " { $link <client> } " or " { $link <server> } "." } ;
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@ HELP: duplex-stream
|
||||||
{ $class-description "A bidirectional stream wrapping an input and output stream." } ;
|
{ $class-description "A bidirectional stream wrapping an input and output stream." } ;
|
||||||
|
|
||||||
HELP: <duplex-stream>
|
HELP: <duplex-stream>
|
||||||
{ $values { "in" "an input stream" } { "out" "an output stream" } { "stream" " a duplex stream" } }
|
{ $values { "in" "an input stream" } { "out" "an output stream" } { "duplex-stream" duplex-stream } }
|
||||||
{ $description "Creates a duplex stream. Writing to a duplex stream will write to " { $snippet "out" } ", and reading from a duplex stream will read from " { $snippet "in" } ". Closing a duplex stream closes both the input and output streams." } ;
|
{ $description "Creates a duplex stream. Writing to a duplex stream will write to " { $snippet "out" } ", and reading from a duplex stream will read from " { $snippet "in" } ". Closing a duplex stream closes both the input and output streams." } ;
|
||||||
|
|
||||||
HELP: with-stream
|
HELP: with-stream
|
||||||
|
|
|
@ -150,7 +150,7 @@ HELP: input
|
||||||
{ $code "\"2 3 + .\" dup <input> write-object nl" }
|
{ $code "\"2 3 + .\" dup <input> write-object nl" }
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
HELP: <input> ( string -- input )
|
HELP: <input>
|
||||||
{ $values { "string" string } { "input" input } }
|
{ $values { "string" string } { "input" input } }
|
||||||
{ $description "Creates a new " { $link input } "." } ;
|
{ $description "Creates a new " { $link input } "." } ;
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,6 @@
|
||||||
USING: slots.private ;
|
USING: slots.private ;
|
||||||
IN: locals.backend
|
IN: locals.backend
|
||||||
|
|
||||||
: local-value 2 slot ; inline
|
: local-value ( box -- value ) 2 slot ; inline
|
||||||
|
|
||||||
: set-local-value 2 set-slot ; inline
|
: set-local-value ( value box -- ) 2 set-slot ; inline
|
||||||
|
|
|
@ -66,7 +66,10 @@ DEFER: byte-bit-count
|
||||||
\ byte-bit-count
|
\ byte-bit-count
|
||||||
256 [
|
256 [
|
||||||
0 swap [ [ 1+ ] when ] each-bit
|
0 swap [ [ 1+ ] when ] each-bit
|
||||||
] B{ } map-as '[ HEX: ff bitand _ nth-unsafe ] define-inline
|
] B{ } map-as '[ HEX: ff bitand _ nth-unsafe ]
|
||||||
|
(( byte -- table )) define-declared
|
||||||
|
|
||||||
|
\ byte-bit-count make-inline
|
||||||
|
|
||||||
>>
|
>>
|
||||||
|
|
||||||
|
|
|
@ -46,7 +46,8 @@ M: real sqrt
|
||||||
|
|
||||||
GENERIC# ^n 1 ( z w -- z^w )
|
GENERIC# ^n 1 ( z w -- z^w )
|
||||||
|
|
||||||
: (^n) 1 swap [ [ dupd * ] when [ sq ] dip ] each-bit nip ; inline
|
: (^n) ( z w -- z^w )
|
||||||
|
1 swap [ [ dupd * ] when [ sq ] dip ] each-bit nip ; inline
|
||||||
|
|
||||||
M: integer ^n
|
M: integer ^n
|
||||||
[ factor-2s ] dip [ (^n) ] keep rot * shift ;
|
[ factor-2s ] dip [ (^n) ] keep rot * shift ;
|
||||||
|
|
|
@ -11,7 +11,7 @@ HELP: rect
|
||||||
"Rectangles are constructed by calling " { $link <rect> } " and " { $link <extent-rect> } "."
|
"Rectangles are constructed by calling " { $link <rect> } " and " { $link <extent-rect> } "."
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
HELP: <rect> ( loc dim -- rect )
|
HELP: <rect>
|
||||||
{ $values { "loc" "a pair of integers" } { "dim" "a pair of integers" } { "rect" "a new " { $link rect } } }
|
{ $values { "loc" "a pair of integers" } { "dim" "a pair of integers" } { "rect" "a new " { $link rect } } }
|
||||||
{ $description "Creates a new rectangle with the specified top-left location and dimensions." } ;
|
{ $description "Creates a new rectangle with the specified top-left location and dimensions." } ;
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ HELP: rect-bounds
|
||||||
|
|
||||||
{ rect-bounds rect-extent } related-words
|
{ rect-bounds rect-extent } related-words
|
||||||
|
|
||||||
HELP: <extent-rect> ( loc ext -- rect )
|
HELP: <extent-rect>
|
||||||
{ $values { "loc" "a pair of integers" } { "ext" "a pair of integers" } { "rect" "a new " { $link rect } } }
|
{ $values { "loc" "a pair of integers" } { "ext" "a pair of integers" } { "rect" "a new " { $link rect } } }
|
||||||
{ $description "Creates a new rectangle with the specified top-left and bottom-right corner locations." } ;
|
{ $description "Creates a new rectangle with the specified top-left and bottom-right corner locations." } ;
|
||||||
|
|
||||||
|
|
|
@ -93,7 +93,7 @@ $nl
|
||||||
$nl
|
$nl
|
||||||
"Intervals are created by calling " { $link [a,b] } ", " { $link (a,b) } ", " { $link [a,b) } ", " { $link (a,b] } " or " { $link [a,a] } "." } ;
|
"Intervals are created by calling " { $link [a,b] } ", " { $link (a,b) } ", " { $link [a,b) } ", " { $link (a,b] } " or " { $link [a,a] } "." } ;
|
||||||
|
|
||||||
HELP: <interval> ( from to -- interval )
|
HELP: <interval>
|
||||||
{ $values { "from" "a " { $snippet "{ point included? }" } " pair" } { "to" "a " { $snippet "{ point included? }" } " pair" } { "interval" interval } }
|
{ $values { "from" "a " { $snippet "{ point included? }" } " pair" } { "to" "a " { $snippet "{ point included? }" } " pair" } { "interval" interval } }
|
||||||
{ $description "Creates a new interval. Usually it is more convenient to create intervals using one of the following words instead:"
|
{ $description "Creates a new interval. Usually it is more convenient to create intervals using one of the following words instead:"
|
||||||
{ $list
|
{ $list
|
||||||
|
|
|
@ -11,7 +11,7 @@ SYMBOL: full-interval
|
||||||
|
|
||||||
TUPLE: interval { from read-only } { to read-only } ;
|
TUPLE: interval { from read-only } { to read-only } ;
|
||||||
|
|
||||||
: <interval> ( from to -- int )
|
: <interval> ( from to -- interval )
|
||||||
2dup [ first ] bi@ {
|
2dup [ first ] bi@ {
|
||||||
{ [ 2dup > ] [ 2drop 2drop empty-interval ] }
|
{ [ 2dup > ] [ 2drop 2drop empty-interval ] }
|
||||||
{ [ 2dup = ] [
|
{ [ 2dup = ] [
|
||||||
|
|
|
@ -10,7 +10,7 @@ IN: math.quaternions
|
||||||
|
|
||||||
<PRIVATE
|
<PRIVATE
|
||||||
|
|
||||||
: ** conjugate * ; inline
|
: ** ( x y -- z ) conjugate * ; inline
|
||||||
|
|
||||||
: 2q ( u v -- u' u'' v' v'' ) [ first2 ] bi@ ; inline
|
: 2q ( u v -- u' u'' v' v'' ) [ first2 ] bi@ ; inline
|
||||||
|
|
||||||
|
|
|
@ -20,11 +20,11 @@ M: range nth-unsafe ( n range -- obj )
|
||||||
|
|
||||||
INSTANCE: range immutable-sequence
|
INSTANCE: range immutable-sequence
|
||||||
|
|
||||||
: twiddle 2dup > -1 1 ? ; inline
|
: twiddle ( a b -- a b step ) 2dup > -1 1 ? ; inline
|
||||||
|
|
||||||
: (a, dup [ + ] curry 2dip ; inline
|
: (a, ( a b step -- a' b' step ) dup [ + ] curry 2dip ; inline
|
||||||
|
|
||||||
: ,b) dup [ - ] curry dip ; inline
|
: ,b) ( a b step -- a' b' step ) dup [ - ] curry dip ; inline
|
||||||
|
|
||||||
: [a,b] ( a b -- range ) twiddle <range> ; inline
|
: [a,b] ( a b -- range ) twiddle <range> ; inline
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@ $nl
|
||||||
$nl
|
$nl
|
||||||
"Mirrors are created by calling " { $link <mirror> } " or " { $link make-mirror } "." } ;
|
"Mirrors are created by calling " { $link <mirror> } " or " { $link make-mirror } "." } ;
|
||||||
|
|
||||||
HELP: <mirror> ( object -- mirror )
|
HELP: <mirror>
|
||||||
{ $values { "object" object } { "mirror" mirror } }
|
{ $values { "object" object } { "mirror" mirror } }
|
||||||
{ $description "Creates a " { $link mirror } " reflecting an object." }
|
{ $description "Creates a " { $link mirror } " reflecting an object." }
|
||||||
{ $examples
|
{ $examples
|
||||||
|
|
|
@ -22,7 +22,8 @@ PRIVATE>
|
||||||
|
|
||||||
: STRING:
|
: STRING:
|
||||||
CREATE-WORD
|
CREATE-WORD
|
||||||
parse-here 1quotation define-inline ; parsing
|
parse-here 1quotation
|
||||||
|
(( -- string )) define-inline ; parsing
|
||||||
|
|
||||||
<PRIVATE
|
<PRIVATE
|
||||||
: (parse-multiline-string) ( start-index end-text -- end-index )
|
: (parse-multiline-string) ( start-index end-text -- end-index )
|
||||||
|
|
|
@ -12,7 +12,7 @@ TUPLE: nibble-array
|
||||||
|
|
||||||
: nibble BIN: 1111 ; inline
|
: nibble BIN: 1111 ; inline
|
||||||
|
|
||||||
: nibbles>bytes 1 + 2/ ; inline
|
: nibbles>bytes ( m -- n ) 1 + 2/ ; inline
|
||||||
|
|
||||||
: byte/nibble ( n -- shift n' )
|
: byte/nibble ( n -- shift n' )
|
||||||
[ 1 bitand 2 shift ] [ -1 shift ] bi ; inline
|
[ 1 bitand 2 shift ] [ -1 shift ] bi ; inline
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -2,7 +2,8 @@
|
||||||
! Portions copyright (C) 2008 Slava Pestov
|
! Portions copyright (C) 2008 Slava Pestov
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: alien alien.syntax combinators kernel system namespaces
|
USING: alien alien.syntax combinators kernel system namespaces
|
||||||
assocs parser lexer sequences words quotations math.bitwise ;
|
assocs parser lexer sequences words quotations math.bitwise
|
||||||
|
alias constants ;
|
||||||
|
|
||||||
IN: openssl.libssl
|
IN: openssl.libssl
|
||||||
|
|
||||||
|
@ -13,64 +14,64 @@ IN: openssl.libssl
|
||||||
{ [ os unix? ] [ "libssl" "libssl.so" "cdecl" add-library ] }
|
{ [ os unix? ] [ "libssl" "libssl.so" "cdecl" add-library ] }
|
||||||
} cond >>
|
} cond >>
|
||||||
|
|
||||||
: X509_FILETYPE_PEM 1 ; inline
|
CONSTANT: X509_FILETYPE_PEM 1
|
||||||
: X509_FILETYPE_ASN1 2 ; inline
|
CONSTANT: X509_FILETYPE_ASN1 2
|
||||||
: X509_FILETYPE_DEFAULT 3 ; inline
|
CONSTANT: X509_FILETYPE_DEFAULT 3
|
||||||
|
|
||||||
: SSL_FILETYPE_ASN1 X509_FILETYPE_ASN1 ; inline
|
ALIAS: SSL_FILETYPE_ASN1 X509_FILETYPE_ASN1
|
||||||
: SSL_FILETYPE_PEM X509_FILETYPE_PEM ; inline
|
ALIAS: SSL_FILETYPE_PEM X509_FILETYPE_PEM
|
||||||
|
|
||||||
: SSL_CTRL_NEED_TMP_RSA 1 ; inline
|
CONSTANT: SSL_CTRL_NEED_TMP_RSA 1
|
||||||
: SSL_CTRL_SET_TMP_RSA 2 ; inline
|
CONSTANT: SSL_CTRL_SET_TMP_RSA 2
|
||||||
: SSL_CTRL_SET_TMP_DH 3 ; inline
|
CONSTANT: SSL_CTRL_SET_TMP_DH 3
|
||||||
: SSL_CTRL_SET_TMP_RSA_CB 4 ; inline
|
CONSTANT: SSL_CTRL_SET_TMP_RSA_CB 4
|
||||||
: SSL_CTRL_SET_TMP_DH_CB 5 ; inline
|
CONSTANT: SSL_CTRL_SET_TMP_DH_CB 5
|
||||||
|
|
||||||
: SSL_CTRL_GET_SESSION_REUSED 6 ; inline
|
CONSTANT: SSL_CTRL_GET_SESSION_REUSED 6
|
||||||
: SSL_CTRL_GET_CLIENT_CERT_REQUEST 7 ; inline
|
CONSTANT: SSL_CTRL_GET_CLIENT_CERT_REQUEST 7
|
||||||
: SSL_CTRL_GET_NUM_RENEGOTIATIONS 8 ; inline
|
CONSTANT: SSL_CTRL_GET_NUM_RENEGOTIATIONS 8
|
||||||
: SSL_CTRL_CLEAR_NUM_RENEGOTIATIONS 9 ; inline
|
CONSTANT: SSL_CTRL_CLEAR_NUM_RENEGOTIATIONS 9
|
||||||
: SSL_CTRL_GET_TOTAL_RENEGOTIATIONS 10 ; inline
|
CONSTANT: SSL_CTRL_GET_TOTAL_RENEGOTIATIONS 10
|
||||||
: SSL_CTRL_GET_FLAGS 11 ; inline
|
CONSTANT: SSL_CTRL_GET_FLAGS 11
|
||||||
: SSL_CTRL_EXTRA_CHAIN_CERT 12 ; inline
|
CONSTANT: SSL_CTRL_EXTRA_CHAIN_CERT 12
|
||||||
|
|
||||||
: SSL_CTRL_SET_MSG_CALLBACK 13 ; inline
|
CONSTANT: SSL_CTRL_SET_MSG_CALLBACK 13
|
||||||
: SSL_CTRL_SET_MSG_CALLBACK_ARG 14 ; inline
|
CONSTANT: SSL_CTRL_SET_MSG_CALLBACK_ARG 14
|
||||||
|
|
||||||
: SSL_CTRL_SESS_NUMBER 20 ; inline
|
CONSTANT: SSL_CTRL_SESS_NUMBER 20
|
||||||
: SSL_CTRL_SESS_CONNECT 21 ; inline
|
CONSTANT: SSL_CTRL_SESS_CONNECT 21
|
||||||
: SSL_CTRL_SESS_CONNECT_GOOD 22 ; inline
|
CONSTANT: SSL_CTRL_SESS_CONNECT_GOOD 22
|
||||||
: SSL_CTRL_SESS_CONNECT_RENEGOTIATE 23 ; inline
|
CONSTANT: SSL_CTRL_SESS_CONNECT_RENEGOTIATE 23
|
||||||
: SSL_CTRL_SESS_ACCEPT 24 ; inline
|
CONSTANT: SSL_CTRL_SESS_ACCEPT 24
|
||||||
: SSL_CTRL_SESS_ACCEPT_GOOD 25 ; inline
|
CONSTANT: SSL_CTRL_SESS_ACCEPT_GOOD 25
|
||||||
: SSL_CTRL_SESS_ACCEPT_RENEGOTIATE 26 ; inline
|
CONSTANT: SSL_CTRL_SESS_ACCEPT_RENEGOTIATE 26
|
||||||
: SSL_CTRL_SESS_HIT 27 ; inline
|
CONSTANT: SSL_CTRL_SESS_HIT 27
|
||||||
: SSL_CTRL_SESS_CB_HIT 28 ; inline
|
CONSTANT: SSL_CTRL_SESS_CB_HIT 28
|
||||||
: SSL_CTRL_SESS_MISSES 29 ; inline
|
CONSTANT: SSL_CTRL_SESS_MISSES 29
|
||||||
: SSL_CTRL_SESS_TIMEOUTS 30 ; inline
|
CONSTANT: SSL_CTRL_SESS_TIMEOUTS 30
|
||||||
: SSL_CTRL_SESS_CACHE_FULL 31 ; inline
|
CONSTANT: SSL_CTRL_SESS_CACHE_FULL 31
|
||||||
: SSL_CTRL_OPTIONS 32 ; inline
|
CONSTANT: SSL_CTRL_OPTIONS 32
|
||||||
: SSL_CTRL_MODE 33 ; inline
|
CONSTANT: SSL_CTRL_MODE 33
|
||||||
|
|
||||||
: SSL_CTRL_GET_READ_AHEAD 40 ; inline
|
CONSTANT: SSL_CTRL_GET_READ_AHEAD 40
|
||||||
: SSL_CTRL_SET_READ_AHEAD 41 ; inline
|
CONSTANT: SSL_CTRL_SET_READ_AHEAD 41
|
||||||
: SSL_CTRL_SET_SESS_CACHE_SIZE 42 ; inline
|
CONSTANT: SSL_CTRL_SET_SESS_CACHE_SIZE 42
|
||||||
: SSL_CTRL_GET_SESS_CACHE_SIZE 43 ; inline
|
CONSTANT: SSL_CTRL_GET_SESS_CACHE_SIZE 43
|
||||||
: SSL_CTRL_SET_SESS_CACHE_MODE 44 ; inline
|
CONSTANT: SSL_CTRL_SET_SESS_CACHE_MODE 44
|
||||||
: SSL_CTRL_GET_SESS_CACHE_MODE 45 ; inline
|
CONSTANT: SSL_CTRL_GET_SESS_CACHE_MODE 45
|
||||||
|
|
||||||
: SSL_CTRL_GET_MAX_CERT_LIST 50 ; inline
|
CONSTANT: SSL_CTRL_GET_MAX_CERT_LIST 50
|
||||||
: SSL_CTRL_SET_MAX_CERT_LIST 51 ; inline
|
CONSTANT: SSL_CTRL_SET_MAX_CERT_LIST 51
|
||||||
|
|
||||||
: SSL_ERROR_NONE 0 ; inline
|
CONSTANT: SSL_ERROR_NONE 0
|
||||||
: SSL_ERROR_SSL 1 ; inline
|
CONSTANT: SSL_ERROR_SSL 1
|
||||||
: SSL_ERROR_WANT_READ 2 ; inline
|
CONSTANT: SSL_ERROR_WANT_READ 2
|
||||||
: SSL_ERROR_WANT_WRITE 3 ; inline
|
CONSTANT: SSL_ERROR_WANT_WRITE 3
|
||||||
: SSL_ERROR_WANT_X509_LOOKUP 4 ; inline
|
CONSTANT: SSL_ERROR_WANT_X509_LOOKUP 4
|
||||||
: SSL_ERROR_SYSCALL 5 ; inline ! consult errno for details
|
CONSTANT: SSL_ERROR_SYSCALL 5 ! consult errno for details
|
||||||
: SSL_ERROR_ZERO_RETURN 6 ; inline
|
CONSTANT: SSL_ERROR_ZERO_RETURN 6
|
||||||
: SSL_ERROR_WANT_CONNECT 7 ; inline
|
CONSTANT: SSL_ERROR_WANT_CONNECT 7
|
||||||
: SSL_ERROR_WANT_ACCEPT 8 ; inline
|
CONSTANT: SSL_ERROR_WANT_ACCEPT 8
|
||||||
|
|
||||||
! Error messages table
|
! Error messages table
|
||||||
: error-messages ( -- hash )
|
: error-messages ( -- hash )
|
||||||
|
@ -157,8 +158,8 @@ FUNCTION: int SSL_read ( SSL* ssl, void* buf, int num ) ;
|
||||||
|
|
||||||
FUNCTION: int SSL_shutdown ( SSL* ssl ) ;
|
FUNCTION: int SSL_shutdown ( SSL* ssl ) ;
|
||||||
|
|
||||||
: SSL_SENT_SHUTDOWN 1 ;
|
CONSTANT: SSL_SENT_SHUTDOWN 1
|
||||||
: SSL_RECEIVED_SHUTDOWN 2 ;
|
CONSTANT: SSL_RECEIVED_SHUTDOWN 2
|
||||||
|
|
||||||
FUNCTION: int SSL_get_shutdown ( SSL* ssl ) ;
|
FUNCTION: int SSL_get_shutdown ( SSL* ssl ) ;
|
||||||
|
|
||||||
|
@ -172,10 +173,10 @@ FUNCTION: void SSL_SESSION_free ( SSL_SESSION* ses ) ;
|
||||||
|
|
||||||
FUNCTION: int SSL_want ( SSL* ssl ) ;
|
FUNCTION: int SSL_want ( SSL* ssl ) ;
|
||||||
|
|
||||||
: SSL_NOTHING 1 ; inline
|
CONSTANT: SSL_NOTHING 1
|
||||||
: SSL_WRITING 2 ; inline
|
CONSTANT: SSL_WRITING 2
|
||||||
: SSL_READING 3 ; inline
|
CONSTANT: SSL_READING 3
|
||||||
: SSL_X509_LOOKUP 4 ; inline
|
CONSTANT: SSL_X509_LOOKUP 4
|
||||||
|
|
||||||
FUNCTION: long SSL_get_verify_result ( SSL* ssl ) ;
|
FUNCTION: long SSL_get_verify_result ( SSL* ssl ) ;
|
||||||
|
|
||||||
|
@ -199,10 +200,10 @@ FUNCTION: int SSL_CTX_load_verify_locations ( SSL_CTX* ctx, char* CAfile,
|
||||||
|
|
||||||
FUNCTION: int SSL_CTX_set_default_verify_paths ( SSL_CTX* ctx ) ;
|
FUNCTION: int SSL_CTX_set_default_verify_paths ( SSL_CTX* ctx ) ;
|
||||||
|
|
||||||
: SSL_VERIFY_NONE 0 ; inline
|
CONSTANT: SSL_VERIFY_NONE 0
|
||||||
: SSL_VERIFY_PEER 1 ; inline
|
CONSTANT: SSL_VERIFY_PEER 1
|
||||||
: SSL_VERIFY_FAIL_IF_NO_PEER_CERT 2 ; inline
|
CONSTANT: SSL_VERIFY_FAIL_IF_NO_PEER_CERT 2
|
||||||
: SSL_VERIFY_CLIENT_ONCE 4 ; inline
|
CONSTANT: SSL_VERIFY_CLIENT_ONCE 4
|
||||||
|
|
||||||
FUNCTION: void SSL_CTX_set_verify ( SSL_CTX* ctx, int mode, void* callback ) ;
|
FUNCTION: void SSL_CTX_set_verify ( SSL_CTX* ctx, int mode, void* callback ) ;
|
||||||
|
|
||||||
|
@ -242,16 +243,16 @@ FUNCTION: void* BIO_f_ssl ( ) ;
|
||||||
: SSL_CTX_set_session_cache_mode ( ctx mode -- n )
|
: SSL_CTX_set_session_cache_mode ( ctx mode -- n )
|
||||||
[ SSL_CTRL_SET_SESS_CACHE_MODE ] dip f SSL_CTX_ctrl ;
|
[ SSL_CTRL_SET_SESS_CACHE_MODE ] dip f SSL_CTX_ctrl ;
|
||||||
|
|
||||||
: SSL_SESS_CACHE_OFF HEX: 0000 ; inline
|
CONSTANT: SSL_SESS_CACHE_OFF HEX: 0000
|
||||||
: SSL_SESS_CACHE_CLIENT HEX: 0001 ; inline
|
CONSTANT: SSL_SESS_CACHE_CLIENT HEX: 0001
|
||||||
: SSL_SESS_CACHE_SERVER HEX: 0002 ; inline
|
CONSTANT: SSL_SESS_CACHE_SERVER HEX: 0002
|
||||||
|
|
||||||
: SSL_SESS_CACHE_BOTH ( -- n )
|
: SSL_SESS_CACHE_BOTH ( -- n )
|
||||||
{ SSL_SESS_CACHE_CLIENT SSL_SESS_CACHE_SERVER } flags ; inline
|
{ SSL_SESS_CACHE_CLIENT SSL_SESS_CACHE_SERVER } flags ; inline
|
||||||
|
|
||||||
: SSL_SESS_CACHE_NO_AUTO_CLEAR HEX: 0080 ; inline
|
CONSTANT: SSL_SESS_CACHE_NO_AUTO_CLEAR HEX: 0080
|
||||||
: SSL_SESS_CACHE_NO_INTERNAL_LOOKUP HEX: 0100 ; inline
|
CONSTANT: SSL_SESS_CACHE_NO_INTERNAL_LOOKUP HEX: 0100
|
||||||
: SSL_SESS_CACHE_NO_INTERNAL_STORE HEX: 0200 ; inline
|
CONSTANT: SSL_SESS_CACHE_NO_INTERNAL_STORE HEX: 0200
|
||||||
|
|
||||||
: SSL_SESS_CACHE_NO_INTERNAL ( -- n )
|
: SSL_SESS_CACHE_NO_INTERNAL ( -- n )
|
||||||
{ SSL_SESS_CACHE_NO_INTERNAL_LOOKUP SSL_SESS_CACHE_NO_INTERNAL_STORE } flags ; inline
|
{ SSL_SESS_CACHE_NO_INTERNAL_LOOKUP SSL_SESS_CACHE_NO_INTERNAL_STORE } flags ; inline
|
||||||
|
@ -282,8 +283,9 @@ H{ } clone verify-messages set-global
|
||||||
: X509_V_:
|
: X509_V_:
|
||||||
scan "X509_V_" prepend create-in
|
scan "X509_V_" prepend create-in
|
||||||
scan-word
|
scan-word
|
||||||
[ 1quotation define-inline ]
|
[ 1quotation (( -- value )) define-inline ]
|
||||||
[ verify-messages get set-at ] 2bi ; parsing
|
[ verify-messages get set-at ]
|
||||||
|
2bi ; parsing
|
||||||
|
|
||||||
>>
|
>>
|
||||||
|
|
||||||
|
@ -333,4 +335,4 @@ X509_V_: ERR_APPLICATION_VERIFICATION 50
|
||||||
! obj_mac.h
|
! obj_mac.h
|
||||||
! ===============================================
|
! ===============================================
|
||||||
|
|
||||||
: NID_commonName 13 ; inline
|
CONSTANT: NID_commonName 13
|
||||||
|
|
|
@ -22,9 +22,9 @@ M: persistent-vector length count>> ;
|
||||||
|
|
||||||
: node-size 32 ; inline
|
: node-size 32 ; inline
|
||||||
|
|
||||||
: node-mask node-size mod ; inline
|
: node-mask ( m -- n ) node-size mod ; inline
|
||||||
|
|
||||||
: node-shift -5 * shift ; inline
|
: node-shift ( m n -- x ) -5 * shift ; inline
|
||||||
|
|
||||||
: node-nth ( i node -- obj )
|
: node-nth ( i node -- obj )
|
||||||
[ node-mask ] [ children>> ] bi* nth ;
|
[ node-mask ] [ children>> ] bi* nth ;
|
||||||
|
|
|
@ -5,7 +5,7 @@ IN: refs
|
||||||
|
|
||||||
TUPLE: ref assoc key ;
|
TUPLE: ref assoc key ;
|
||||||
|
|
||||||
: >ref< [ key>> ] [ assoc>> ] bi ; inline
|
: >ref< ( ref -- key value ) [ key>> ] [ assoc>> ] bi ; inline
|
||||||
|
|
||||||
: delete-ref ( ref -- ) >ref< delete-at ;
|
: delete-ref ( ref -- ) >ref< delete-at ;
|
||||||
GENERIC: get-ref ( ref -- obj )
|
GENERIC: get-ref ( ref -- obj )
|
||||||
|
|
|
@ -10,6 +10,6 @@ $nl
|
||||||
|
|
||||||
ABOUT: "search-deques"
|
ABOUT: "search-deques"
|
||||||
|
|
||||||
HELP: <search-deque> ( assoc deque -- search-deque )
|
HELP: <search-deque>
|
||||||
{ $values { "assoc" assoc } { "deque" deque } { "search-deque" search-deque } }
|
{ $values { "assoc" assoc } { "deque" deque } { "search-deque" search-deque } }
|
||||||
{ $description "Creates a new " { $link search-deque } "." } ;
|
{ $description "Creates a new " { $link search-deque } "." } ;
|
||||||
|
|
|
@ -3,7 +3,8 @@ IN: sequences.next
|
||||||
|
|
||||||
<PRIVATE
|
<PRIVATE
|
||||||
|
|
||||||
: iterate-seq [ dup length swap ] dip ; inline
|
: iterate-seq ( seq quot -- i seq quot )
|
||||||
|
[ [ length ] keep ] dip ; inline
|
||||||
|
|
||||||
: (map-next) ( i seq quot -- )
|
: (map-next) ( i seq quot -- )
|
||||||
! this uses O(n) more bounds checks than is really necessary
|
! this uses O(n) more bounds checks than is really necessary
|
||||||
|
|
|
@ -25,7 +25,7 @@ HELP: no-auth
|
||||||
HELP: plain-auth
|
HELP: plain-auth
|
||||||
{ $class-description "If the " { $link smtp-auth } " variable is set to this value, plain authentication will be performed, with the username and password stored in the " { $slot "username" } " and " { $slot "password" } " slots of the tuple sent to the server as plain-text." } ;
|
{ $class-description "If the " { $link smtp-auth } " variable is set to this value, plain authentication will be performed, with the username and password stored in the " { $slot "username" } " and " { $slot "password" } " slots of the tuple sent to the server as plain-text." } ;
|
||||||
|
|
||||||
HELP: <plain-auth> ( username password -- plain-auth )
|
HELP: <plain-auth>
|
||||||
{ $values { "username" string } { "password" string } { "plain-auth" plain-auth } }
|
{ $values { "username" string } { "password" string } { "plain-auth" plain-auth } }
|
||||||
{ $description "Creates a new " { $link plain-auth } " instance." } ;
|
{ $description "Creates a new " { $link plain-auth } " instance." } ;
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@ WHERE
|
||||||
|
|
||||||
TUPLE: V { underlying A } { length array-capacity } ;
|
TUPLE: V { underlying A } { length array-capacity } ;
|
||||||
|
|
||||||
: <V> <A> execute 0 V boa ; inline
|
: <V> ( capacity -- vector ) <A> execute 0 V boa ; inline
|
||||||
|
|
||||||
M: V like
|
M: V like
|
||||||
drop dup V instance? [
|
drop dup V instance? [
|
||||||
|
@ -31,7 +31,7 @@ M: A new-resizable drop <V> execute ;
|
||||||
|
|
||||||
M: V equal? over V instance? [ sequence= ] [ 2drop f ] if ;
|
M: V equal? over V instance? [ sequence= ] [ 2drop f ] if ;
|
||||||
|
|
||||||
: >V V new clone-like ; inline
|
: >V ( seq -- vector ) V new clone-like ; inline
|
||||||
|
|
||||||
M: V pprint-delims drop V{ \ } ;
|
M: V pprint-delims drop V{ \ } ;
|
||||||
|
|
||||||
|
|
|
@ -145,7 +145,6 @@ M: object apply-object push-literal ;
|
||||||
|
|
||||||
: effect-required? ( word -- ? )
|
: effect-required? ( word -- ? )
|
||||||
{
|
{
|
||||||
{ [ dup inline? ] [ drop f ] }
|
|
||||||
{ [ dup deferred? ] [ drop f ] }
|
{ [ dup deferred? ] [ drop f ] }
|
||||||
{ [ dup crossref? not ] [ drop f ] }
|
{ [ dup crossref? not ] [ drop f ] }
|
||||||
[ def>> [ word? ] contains? ]
|
[ def>> [ word? ] contains? ]
|
||||||
|
|
|
@ -20,8 +20,9 @@ TYPEDEF: char[592] ud
|
||||||
FUNCTION: void ud_translate_intel ( ud* u ) ;
|
FUNCTION: void ud_translate_intel ( ud* u ) ;
|
||||||
FUNCTION: void ud_translate_att ( ud* u ) ;
|
FUNCTION: void ud_translate_att ( ud* u ) ;
|
||||||
|
|
||||||
: UD_SYN_INTEL &: ud_translate_intel ; inline
|
: UD_SYN_INTEL ( -- addr ) &: ud_translate_intel ; inline
|
||||||
: UD_SYN_ATT &: ud_translate_att ; inline
|
: UD_SYN_ATT ( -- addr ) &: ud_translate_att ; inline
|
||||||
|
|
||||||
: UD_EOI -1 ; inline
|
: UD_EOI -1 ; inline
|
||||||
: UD_INP_CACHE_SZ 32 ; inline
|
: UD_INP_CACHE_SZ 32 ; inline
|
||||||
: UD_VENDOR_AMD 0 ; inline
|
: UD_VENDOR_AMD 0 ; inline
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: accessors calendar.format combinators io.files
|
USING: accessors calendar.format combinators io.files
|
||||||
kernel math.parser sequences splitting system tools.files
|
kernel math.parser sequences splitting system tools.files
|
||||||
generalizations tools.files.private ;
|
generalizations tools.files.private io.files.info ;
|
||||||
IN: tools.files.windows
|
IN: tools.files.windows
|
||||||
|
|
||||||
<PRIVATE
|
<PRIVATE
|
||||||
|
|
|
@ -78,9 +78,9 @@ SYMBOL: dpi
|
||||||
|
|
||||||
72 dpi set-global
|
72 dpi set-global
|
||||||
|
|
||||||
: ft-floor -6 shift ; inline
|
: ft-floor ( m -- n ) -6 shift ; inline
|
||||||
|
|
||||||
: ft-ceil 63 + -64 bitand -6 shift ; inline
|
: ft-ceil ( m -- n ) 63 + -64 bitand -6 shift ; inline
|
||||||
|
|
||||||
: font-units>pixels ( n font -- n )
|
: font-units>pixels ( n font -- n )
|
||||||
face-size face-size-y-scale FT_MulFix ;
|
face-size face-size-y-scale FT_MulFix ;
|
||||||
|
|
|
@ -11,7 +11,7 @@ C: <grid-lines> grid-lines
|
||||||
|
|
||||||
SYMBOL: grid-dim
|
SYMBOL: grid-dim
|
||||||
|
|
||||||
: half-gap grid get gap>> [ 2/ ] map ; inline
|
: half-gap ( -- gap ) grid get gap>> [ 2/ ] map ; inline
|
||||||
|
|
||||||
: grid-line-from/to ( orientation point -- from to )
|
: grid-line-from/to ( orientation point -- from to )
|
||||||
half-gap v-
|
half-gap v-
|
||||||
|
|
|
@ -49,8 +49,8 @@ HELP: <pane-control>
|
||||||
HELP: pane-stream
|
HELP: pane-stream
|
||||||
{ $class-description "Pane streams implement the portion of the " { $link "stream-protocol" } " responsible for output of text, including full support for " { $link "styles" } ". Pane streams also support direct output of gadgets via " { $link write-gadget } " and " { $link print-gadget } ". Pane streams are created by calling " { $link <pane-stream> } "." } ;
|
{ $class-description "Pane streams implement the portion of the " { $link "stream-protocol" } " responsible for output of text, including full support for " { $link "styles" } ". Pane streams also support direct output of gadgets via " { $link write-gadget } " and " { $link print-gadget } ". Pane streams are created by calling " { $link <pane-stream> } "." } ;
|
||||||
|
|
||||||
HELP: <pane-stream> ( pane -- stream )
|
HELP: <pane-stream>
|
||||||
{ $values { "pane" pane } { "stream" "a new " { $link pane-stream } } }
|
{ $values { "pane" pane } { "pane-stream" "a new " { $link pane-stream } } }
|
||||||
{ $description "Creates a new " { $link pane-stream } " for writing to " { $snippet "pane" } "." } ;
|
{ $description "Creates a new " { $link pane-stream } " for writing to " { $snippet "pane" } "." } ;
|
||||||
|
|
||||||
{ with-pane make-pane } related-words
|
{ with-pane make-pane } related-words
|
||||||
|
|
|
@ -1,30 +1,31 @@
|
||||||
! Copyright (C) 2005, 2006 Slava Pestov.
|
! Copyright (C) 2005, 2006 Slava Pestov.
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: alien.syntax combinators system vocabs.loader ;
|
USING: alien.syntax combinators system vocabs.loader alias
|
||||||
|
constants ;
|
||||||
IN: unix
|
IN: unix
|
||||||
|
|
||||||
: MAXPATHLEN 1024 ; inline
|
CONSTANT: MAXPATHLEN 1024
|
||||||
|
|
||||||
: O_RDONLY HEX: 0000 ; inline
|
CONSTANT: O_RDONLY HEX: 0000
|
||||||
: O_WRONLY HEX: 0001 ; inline
|
CONSTANT: O_WRONLY HEX: 0001
|
||||||
: O_RDWR HEX: 0002 ; inline
|
CONSTANT: O_RDWR HEX: 0002
|
||||||
: O_NONBLOCK HEX: 0004 ; inline
|
CONSTANT: O_NONBLOCK HEX: 0004
|
||||||
: O_APPEND HEX: 0008 ; inline
|
CONSTANT: O_APPEND HEX: 0008
|
||||||
: O_CREAT HEX: 0200 ; inline
|
CONSTANT: O_CREAT HEX: 0200
|
||||||
: O_TRUNC HEX: 0400 ; inline
|
CONSTANT: O_TRUNC HEX: 0400
|
||||||
: O_EXCL HEX: 0800 ; inline
|
CONSTANT: O_EXCL HEX: 0800
|
||||||
: O_NOCTTY HEX: 20000 ; inline
|
CONSTANT: O_NOCTTY HEX: 20000
|
||||||
: O_NDELAY O_NONBLOCK ; inline
|
ALIAS: O_NDELAY O_NONBLOCK
|
||||||
|
|
||||||
: SOL_SOCKET HEX: ffff ; inline
|
CONSTANT: SOL_SOCKET HEX: ffff
|
||||||
: SO_REUSEADDR HEX: 4 ; inline
|
CONSTANT: SO_REUSEADDR HEX: 4
|
||||||
: SO_OOBINLINE HEX: 100 ; inline
|
CONSTANT: SO_OOBINLINE HEX: 100
|
||||||
: SO_SNDTIMEO HEX: 1005 ; inline
|
CONSTANT: SO_SNDTIMEO HEX: 1005
|
||||||
: SO_RCVTIMEO HEX: 1006 ; inline
|
CONSTANT: SO_RCVTIMEO HEX: 1006
|
||||||
|
|
||||||
: F_SETFD 2 ; inline
|
CONSTANT: F_SETFD 2
|
||||||
: F_SETFL 4 ; inline
|
CONSTANT: F_SETFL 4
|
||||||
: FD_CLOEXEC 1 ; inline
|
CONSTANT: FD_CLOEXEC 1
|
||||||
|
|
||||||
C-STRUCT: sockaddr-in
|
C-STRUCT: sockaddr-in
|
||||||
{ "uchar" "len" }
|
{ "uchar" "len" }
|
||||||
|
@ -59,29 +60,29 @@ C-STRUCT: passwd
|
||||||
{ "time_t" "pw_expire" }
|
{ "time_t" "pw_expire" }
|
||||||
{ "int" "pw_fields" } ;
|
{ "int" "pw_fields" } ;
|
||||||
|
|
||||||
: max-un-path 104 ; inline
|
CONSTANT: max-un-path 104
|
||||||
|
|
||||||
: SOCK_STREAM 1 ; inline
|
CONSTANT: SOCK_STREAM 1
|
||||||
: SOCK_DGRAM 2 ; inline
|
CONSTANT: SOCK_DGRAM 2
|
||||||
|
|
||||||
: AF_UNSPEC 0 ; inline
|
CONSTANT: AF_UNSPEC 0
|
||||||
: AF_UNIX 1 ; inline
|
CONSTANT: AF_UNIX 1
|
||||||
: AF_INET 2 ; inline
|
CONSTANT: AF_INET 2
|
||||||
: AF_INET6 30 ; inline
|
CONSTANT: AF_INET6 30
|
||||||
|
|
||||||
: PF_UNSPEC AF_UNSPEC ; inline
|
ALIAS: PF_UNSPEC AF_UNSPEC
|
||||||
: PF_UNIX AF_UNIX ; inline
|
ALIAS: PF_UNIX AF_UNIX
|
||||||
: PF_INET AF_INET ; inline
|
ALIAS: PF_INET AF_INET
|
||||||
: PF_INET6 AF_INET6 ; inline
|
ALIAS: PF_INET6 AF_INET6
|
||||||
|
|
||||||
: IPPROTO_TCP 6 ; inline
|
CONSTANT: IPPROTO_TCP 6
|
||||||
: IPPROTO_UDP 17 ; inline
|
CONSTANT: IPPROTO_UDP 17
|
||||||
|
|
||||||
: AI_PASSIVE 1 ; inline
|
CONSTANT: AI_PASSIVE 1
|
||||||
|
|
||||||
: SEEK_SET 0 ; inline
|
CONSTANT: SEEK_SET 0
|
||||||
: SEEK_CUR 1 ; inline
|
CONSTANT: SEEK_CUR 1
|
||||||
: SEEK_END 2 ; inline
|
CONSTANT: SEEK_END 2
|
||||||
|
|
||||||
os {
|
os {
|
||||||
{ macosx [ "unix.bsd.macosx" require ] }
|
{ macosx [ "unix.bsd.macosx" require ] }
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
USING: alien.syntax ;
|
USING: alien.syntax alias constants ;
|
||||||
IN: unix
|
IN: unix
|
||||||
|
|
||||||
: FD_SETSIZE 1024 ;
|
: FD_SETSIZE 1024 ;
|
||||||
|
@ -20,97 +20,97 @@ C-STRUCT: dirent
|
||||||
{ "u_int8_t" "d_namlen" }
|
{ "u_int8_t" "d_namlen" }
|
||||||
{ { "char" 256 } "d_name" } ;
|
{ { "char" 256 } "d_name" } ;
|
||||||
|
|
||||||
: EPERM 1 ; inline
|
CONSTANT: EPERM 1
|
||||||
: ENOENT 2 ; inline
|
CONSTANT: ENOENT 2
|
||||||
: ESRCH 3 ; inline
|
CONSTANT: ESRCH 3
|
||||||
: EINTR 4 ; inline
|
CONSTANT: EINTR 4
|
||||||
: EIO 5 ; inline
|
CONSTANT: EIO 5
|
||||||
: ENXIO 6 ; inline
|
CONSTANT: ENXIO 6
|
||||||
: E2BIG 7 ; inline
|
CONSTANT: E2BIG 7
|
||||||
: ENOEXEC 8 ; inline
|
CONSTANT: ENOEXEC 8
|
||||||
: EBADF 9 ; inline
|
CONSTANT: EBADF 9
|
||||||
: ECHILD 10 ; inline
|
CONSTANT: ECHILD 10
|
||||||
: EDEADLK 11 ; inline
|
CONSTANT: EDEADLK 11
|
||||||
: ENOMEM 12 ; inline
|
CONSTANT: ENOMEM 12
|
||||||
: EACCES 13 ; inline
|
CONSTANT: EACCES 13
|
||||||
: EFAULT 14 ; inline
|
CONSTANT: EFAULT 14
|
||||||
: ENOTBLK 15 ; inline
|
CONSTANT: ENOTBLK 15
|
||||||
: EBUSY 16 ; inline
|
CONSTANT: EBUSY 16
|
||||||
: EEXIST 17 ; inline
|
CONSTANT: EEXIST 17
|
||||||
: EXDEV 18 ; inline
|
CONSTANT: EXDEV 18
|
||||||
: ENODEV 19 ; inline
|
CONSTANT: ENODEV 19
|
||||||
: ENOTDIR 20 ; inline
|
CONSTANT: ENOTDIR 20
|
||||||
: EISDIR 21 ; inline
|
CONSTANT: EISDIR 21
|
||||||
: EINVAL 22 ; inline
|
CONSTANT: EINVAL 22
|
||||||
: ENFILE 23 ; inline
|
CONSTANT: ENFILE 23
|
||||||
: EMFILE 24 ; inline
|
CONSTANT: EMFILE 24
|
||||||
: ENOTTY 25 ; inline
|
CONSTANT: ENOTTY 25
|
||||||
: ETXTBSY 26 ; inline
|
CONSTANT: ETXTBSY 26
|
||||||
: EFBIG 27 ; inline
|
CONSTANT: EFBIG 27
|
||||||
: ENOSPC 28 ; inline
|
CONSTANT: ENOSPC 28
|
||||||
: ESPIPE 29 ; inline
|
CONSTANT: ESPIPE 29
|
||||||
: EROFS 30 ; inline
|
CONSTANT: EROFS 30
|
||||||
: EMLINK 31 ; inline
|
CONSTANT: EMLINK 31
|
||||||
: EPIPE 32 ; inline
|
CONSTANT: EPIPE 32
|
||||||
: EDOM 33 ; inline
|
CONSTANT: EDOM 33
|
||||||
: ERANGE 34 ; inline
|
CONSTANT: ERANGE 34
|
||||||
: EAGAIN 35 ; inline
|
CONSTANT: EAGAIN 35
|
||||||
: EWOULDBLOCK EAGAIN ; inline
|
ALIAS: EWOULDBLOCK EAGAIN
|
||||||
: EINPROGRESS 36 ; inline
|
CONSTANT: EINPROGRESS 36
|
||||||
: EALREADY 37 ; inline
|
CONSTANT: EALREADY 37
|
||||||
: ENOTSOCK 38 ; inline
|
CONSTANT: ENOTSOCK 38
|
||||||
: EDESTADDRREQ 39 ; inline
|
CONSTANT: EDESTADDRREQ 39
|
||||||
: EMSGSIZE 40 ; inline
|
CONSTANT: EMSGSIZE 40
|
||||||
: EPROTOTYPE 41 ; inline
|
CONSTANT: EPROTOTYPE 41
|
||||||
: ENOPROTOOPT 42 ; inline
|
CONSTANT: ENOPROTOOPT 42
|
||||||
: EPROTONOSUPPORT 43 ; inline
|
CONSTANT: EPROTONOSUPPORT 43
|
||||||
: ESOCKTNOSUPPORT 44 ; inline
|
CONSTANT: ESOCKTNOSUPPORT 44
|
||||||
: EOPNOTSUPP 45 ; inline
|
CONSTANT: EOPNOTSUPP 45
|
||||||
: ENOTSUP EOPNOTSUPP ; inline
|
ALIAS: ENOTSUP EOPNOTSUPP
|
||||||
: EPFNOSUPPORT 46 ; inline
|
CONSTANT: EPFNOSUPPORT 46
|
||||||
: EAFNOSUPPORT 47 ; inline
|
CONSTANT: EAFNOSUPPORT 47
|
||||||
: EADDRINUSE 48 ; inline
|
CONSTANT: EADDRINUSE 48
|
||||||
: EADDRNOTAVAIL 49 ; inline
|
CONSTANT: EADDRNOTAVAIL 49
|
||||||
: ENETDOWN 50 ; inline
|
CONSTANT: ENETDOWN 50
|
||||||
: ENETUNREACH 51 ; inline
|
CONSTANT: ENETUNREACH 51
|
||||||
: ENETRESET 52 ; inline
|
CONSTANT: ENETRESET 52
|
||||||
: ECONNABORTED 53 ; inline
|
CONSTANT: ECONNABORTED 53
|
||||||
: ECONNRESET 54 ; inline
|
CONSTANT: ECONNRESET 54
|
||||||
: ENOBUFS 55 ; inline
|
CONSTANT: ENOBUFS 55
|
||||||
: EISCONN 56 ; inline
|
CONSTANT: EISCONN 56
|
||||||
: ENOTCONN 57 ; inline
|
CONSTANT: ENOTCONN 57
|
||||||
: ESHUTDOWN 58 ; inline
|
CONSTANT: ESHUTDOWN 58
|
||||||
: ETOOMANYREFS 59 ; inline
|
CONSTANT: ETOOMANYREFS 59
|
||||||
: ETIMEDOUT 60 ; inline
|
CONSTANT: ETIMEDOUT 60
|
||||||
: ECONNREFUSED 61 ; inline
|
CONSTANT: ECONNREFUSED 61
|
||||||
: ELOOP 62 ; inline
|
CONSTANT: ELOOP 62
|
||||||
: ENAMETOOLONG 63 ; inline
|
CONSTANT: ENAMETOOLONG 63
|
||||||
: EHOSTDOWN 64 ; inline
|
CONSTANT: EHOSTDOWN 64
|
||||||
: EHOSTUNREACH 65 ; inline
|
CONSTANT: EHOSTUNREACH 65
|
||||||
: ENOTEMPTY 66 ; inline
|
CONSTANT: ENOTEMPTY 66
|
||||||
: EPROCLIM 67 ; inline
|
CONSTANT: EPROCLIM 67
|
||||||
: EUSERS 68 ; inline
|
CONSTANT: EUSERS 68
|
||||||
: EDQUOT 69 ; inline
|
CONSTANT: EDQUOT 69
|
||||||
: ESTALE 70 ; inline
|
CONSTANT: ESTALE 70
|
||||||
: EREMOTE 71 ; inline
|
CONSTANT: EREMOTE 71
|
||||||
: EBADRPC 72 ; inline
|
CONSTANT: EBADRPC 72
|
||||||
: ERPCMISMATCH 73 ; inline
|
CONSTANT: ERPCMISMATCH 73
|
||||||
: EPROGUNAVAIL 74 ; inline
|
CONSTANT: EPROGUNAVAIL 74
|
||||||
: EPROGMISMATCH 75 ; inline
|
CONSTANT: EPROGMISMATCH 75
|
||||||
: EPROCUNAVAIL 76 ; inline
|
CONSTANT: EPROCUNAVAIL 76
|
||||||
: ENOLCK 77 ; inline
|
CONSTANT: ENOLCK 77
|
||||||
: ENOSYS 78 ; inline
|
CONSTANT: ENOSYS 78
|
||||||
: EFTYPE 79 ; inline
|
CONSTANT: EFTYPE 79
|
||||||
: EAUTH 80 ; inline
|
CONSTANT: EAUTH 80
|
||||||
: ENEEDAUTH 81 ; inline
|
CONSTANT: ENEEDAUTH 81
|
||||||
: EIDRM 82 ; inline
|
CONSTANT: EIDRM 82
|
||||||
: ENOMSG 83 ; inline
|
CONSTANT: ENOMSG 83
|
||||||
: EOVERFLOW 84 ; inline
|
CONSTANT: EOVERFLOW 84
|
||||||
: ECANCELED 85 ; inline
|
CONSTANT: ECANCELED 85
|
||||||
: EILSEQ 86 ; inline
|
CONSTANT: EILSEQ 86
|
||||||
: ENOATTR 87 ; inline
|
CONSTANT: ENOATTR 87
|
||||||
: EDOOFUS 88 ; inline
|
CONSTANT: EDOOFUS 88
|
||||||
: EBADMSG 89 ; inline
|
CONSTANT: EBADMSG 89
|
||||||
: EMULTIHOP 90 ; inline
|
CONSTANT: EMULTIHOP 90
|
||||||
: ENOLINK 91 ; inline
|
CONSTANT: ENOLINK 91
|
||||||
: EPROTO 92 ; inline
|
CONSTANT: EPROTO 92
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
USING: alien.syntax unix.time ;
|
USING: alien.syntax unix.time alias constants ;
|
||||||
IN: unix
|
IN: unix
|
||||||
|
|
||||||
: FD_SETSIZE 1024 ; inline
|
CONSTANT: FD_SETSIZE 1024
|
||||||
|
|
||||||
C-STRUCT: addrinfo
|
C-STRUCT: addrinfo
|
||||||
{ "int" "flags" }
|
{ "int" "flags" }
|
||||||
|
@ -13,10 +13,10 @@ C-STRUCT: addrinfo
|
||||||
{ "void*" "addr" }
|
{ "void*" "addr" }
|
||||||
{ "addrinfo*" "next" } ;
|
{ "addrinfo*" "next" } ;
|
||||||
|
|
||||||
: _UTX_USERSIZE 256 ; inline
|
CONSTANT: _UTX_USERSIZE 256
|
||||||
: _UTX_LINESIZE 32 ; inline
|
CONSTANT: _UTX_LINESIZE 32
|
||||||
: _UTX_IDSIZE 4 ; inline
|
CONSTANT: _UTX_IDSIZE 4
|
||||||
: _UTX_HOSTSIZE 256 ; inline
|
CONSTANT: _UTX_HOSTSIZE 256
|
||||||
|
|
||||||
C-STRUCT: utmpx
|
C-STRUCT: utmpx
|
||||||
{ { "char" _UTX_USERSIZE } "ut_user" }
|
{ { "char" _UTX_USERSIZE } "ut_user" }
|
||||||
|
@ -28,9 +28,9 @@ C-STRUCT: utmpx
|
||||||
{ { "char" _UTX_HOSTSIZE } "ut_host" }
|
{ { "char" _UTX_HOSTSIZE } "ut_host" }
|
||||||
{ { "uint" 16 } "ut_pad" } ;
|
{ { "uint" 16 } "ut_pad" } ;
|
||||||
|
|
||||||
: __DARWIN_MAXPATHLEN 1024 ; inline
|
CONSTANT: __DARWIN_MAXPATHLEN 1024
|
||||||
: __DARWIN_MAXNAMELEN 255 ; inline
|
CONSTANT: __DARWIN_MAXNAMELEN 255
|
||||||
: __DARWIN_MAXNAMELEN+1 255 ; inline
|
CONSTANT: __DARWIN_MAXNAMELEN+1 255
|
||||||
|
|
||||||
C-STRUCT: dirent
|
C-STRUCT: dirent
|
||||||
{ "ino_t" "d_ino" }
|
{ "ino_t" "d_ino" }
|
||||||
|
@ -39,107 +39,107 @@ C-STRUCT: dirent
|
||||||
{ "__uint8_t" "d_namlen" }
|
{ "__uint8_t" "d_namlen" }
|
||||||
{ { "char" __DARWIN_MAXNAMELEN+1 } "d_name" } ;
|
{ { "char" __DARWIN_MAXNAMELEN+1 } "d_name" } ;
|
||||||
|
|
||||||
: EPERM 1 ; inline
|
CONSTANT: EPERM 1
|
||||||
: ENOENT 2 ; inline
|
CONSTANT: ENOENT 2
|
||||||
: ESRCH 3 ; inline
|
CONSTANT: ESRCH 3
|
||||||
: EINTR 4 ; inline
|
CONSTANT: EINTR 4
|
||||||
: EIO 5 ; inline
|
CONSTANT: EIO 5
|
||||||
: ENXIO 6 ; inline
|
CONSTANT: ENXIO 6
|
||||||
: E2BIG 7 ; inline
|
CONSTANT: E2BIG 7
|
||||||
: ENOEXEC 8 ; inline
|
CONSTANT: ENOEXEC 8
|
||||||
: EBADF 9 ; inline
|
CONSTANT: EBADF 9
|
||||||
: ECHILD 10 ; inline
|
CONSTANT: ECHILD 10
|
||||||
: EDEADLK 11 ; inline
|
CONSTANT: EDEADLK 11
|
||||||
: ENOMEM 12 ; inline
|
CONSTANT: ENOMEM 12
|
||||||
: EACCES 13 ; inline
|
CONSTANT: EACCES 13
|
||||||
: EFAULT 14 ; inline
|
CONSTANT: EFAULT 14
|
||||||
: ENOTBLK 15 ; inline
|
CONSTANT: ENOTBLK 15
|
||||||
: EBUSY 16 ; inline
|
CONSTANT: EBUSY 16
|
||||||
: EEXIST 17 ; inline
|
CONSTANT: EEXIST 17
|
||||||
: EXDEV 18 ; inline
|
CONSTANT: EXDEV 18
|
||||||
: ENODEV 19 ; inline
|
CONSTANT: ENODEV 19
|
||||||
: ENOTDIR 20 ; inline
|
CONSTANT: ENOTDIR 20
|
||||||
: EISDIR 21 ; inline
|
CONSTANT: EISDIR 21
|
||||||
: EINVAL 22 ; inline
|
CONSTANT: EINVAL 22
|
||||||
: ENFILE 23 ; inline
|
CONSTANT: ENFILE 23
|
||||||
: EMFILE 24 ; inline
|
CONSTANT: EMFILE 24
|
||||||
: ENOTTY 25 ; inline
|
CONSTANT: ENOTTY 25
|
||||||
: ETXTBSY 26 ; inline
|
CONSTANT: ETXTBSY 26
|
||||||
: EFBIG 27 ; inline
|
CONSTANT: EFBIG 27
|
||||||
: ENOSPC 28 ; inline
|
CONSTANT: ENOSPC 28
|
||||||
: ESPIPE 29 ; inline
|
CONSTANT: ESPIPE 29
|
||||||
: EROFS 30 ; inline
|
CONSTANT: EROFS 30
|
||||||
: EMLINK 31 ; inline
|
CONSTANT: EMLINK 31
|
||||||
: EPIPE 32 ; inline
|
CONSTANT: EPIPE 32
|
||||||
: EDOM 33 ; inline
|
CONSTANT: EDOM 33
|
||||||
: ERANGE 34 ; inline
|
CONSTANT: ERANGE 34
|
||||||
: EAGAIN 35 ; inline
|
CONSTANT: EAGAIN 35
|
||||||
: EWOULDBLOCK EAGAIN ; inline
|
ALIAS: EWOULDBLOCK EAGAIN
|
||||||
: EINPROGRESS 36 ; inline
|
CONSTANT: EINPROGRESS 36
|
||||||
: EALREADY 37 ; inline
|
CONSTANT: EALREADY 37
|
||||||
: ENOTSOCK 38 ; inline
|
CONSTANT: ENOTSOCK 38
|
||||||
: EDESTADDRREQ 39 ; inline
|
CONSTANT: EDESTADDRREQ 39
|
||||||
: EMSGSIZE 40 ; inline
|
CONSTANT: EMSGSIZE 40
|
||||||
: EPROTOTYPE 41 ; inline
|
CONSTANT: EPROTOTYPE 41
|
||||||
: ENOPROTOOPT 42 ; inline
|
CONSTANT: ENOPROTOOPT 42
|
||||||
: EPROTONOSUPPORT 43 ; inline
|
CONSTANT: EPROTONOSUPPORT 43
|
||||||
: ESOCKTNOSUPPORT 44 ; inline
|
CONSTANT: ESOCKTNOSUPPORT 44
|
||||||
: ENOTSUP 45 ; inline
|
CONSTANT: ENOTSUP 45
|
||||||
: EPFNOSUPPORT 46 ; inline
|
CONSTANT: EPFNOSUPPORT 46
|
||||||
: EAFNOSUPPORT 47 ; inline
|
CONSTANT: EAFNOSUPPORT 47
|
||||||
: EADDRINUSE 48 ; inline
|
CONSTANT: EADDRINUSE 48
|
||||||
: EADDRNOTAVAIL 49 ; inline
|
CONSTANT: EADDRNOTAVAIL 49
|
||||||
: ENETDOWN 50 ; inline
|
CONSTANT: ENETDOWN 50
|
||||||
: ENETUNREACH 51 ; inline
|
CONSTANT: ENETUNREACH 51
|
||||||
: ENETRESET 52 ; inline
|
CONSTANT: ENETRESET 52
|
||||||
: ECONNABORTED 53 ; inline
|
CONSTANT: ECONNABORTED 53
|
||||||
: ECONNRESET 54 ; inline
|
CONSTANT: ECONNRESET 54
|
||||||
: ENOBUFS 55 ; inline
|
CONSTANT: ENOBUFS 55
|
||||||
: EISCONN 56 ; inline
|
CONSTANT: EISCONN 56
|
||||||
: ENOTCONN 57 ; inline
|
CONSTANT: ENOTCONN 57
|
||||||
: ESHUTDOWN 58 ; inline
|
CONSTANT: ESHUTDOWN 58
|
||||||
: ETOOMANYREFS 59 ; inline
|
CONSTANT: ETOOMANYREFS 59
|
||||||
: ETIMEDOUT 60 ; inline
|
CONSTANT: ETIMEDOUT 60
|
||||||
: ECONNREFUSED 61 ; inline
|
CONSTANT: ECONNREFUSED 61
|
||||||
: ELOOP 62 ; inline
|
CONSTANT: ELOOP 62
|
||||||
: ENAMETOOLONG 63 ; inline
|
CONSTANT: ENAMETOOLONG 63
|
||||||
: EHOSTDOWN 64 ; inline
|
CONSTANT: EHOSTDOWN 64
|
||||||
: EHOSTUNREACH 65 ; inline
|
CONSTANT: EHOSTUNREACH 65
|
||||||
: ENOTEMPTY 66 ; inline
|
CONSTANT: ENOTEMPTY 66
|
||||||
: EPROCLIM 67 ; inline
|
CONSTANT: EPROCLIM 67
|
||||||
: EUSERS 68 ; inline
|
CONSTANT: EUSERS 68
|
||||||
: EDQUOT 69 ; inline
|
CONSTANT: EDQUOT 69
|
||||||
: ESTALE 70 ; inline
|
CONSTANT: ESTALE 70
|
||||||
: EREMOTE 71 ; inline
|
CONSTANT: EREMOTE 71
|
||||||
: EBADRPC 72 ; inline
|
CONSTANT: EBADRPC 72
|
||||||
: ERPCMISMATCH 73 ; inline
|
CONSTANT: ERPCMISMATCH 73
|
||||||
: EPROGUNAVAIL 74 ; inline
|
CONSTANT: EPROGUNAVAIL 74
|
||||||
: EPROGMISMATCH 75 ; inline
|
CONSTANT: EPROGMISMATCH 75
|
||||||
: EPROCUNAVAIL 76 ; inline
|
CONSTANT: EPROCUNAVAIL 76
|
||||||
: ENOLCK 77 ; inline
|
CONSTANT: ENOLCK 77
|
||||||
: ENOSYS 78 ; inline
|
CONSTANT: ENOSYS 78
|
||||||
: EFTYPE 79 ; inline
|
CONSTANT: EFTYPE 79
|
||||||
: EAUTH 80 ; inline
|
CONSTANT: EAUTH 80
|
||||||
: ENEEDAUTH 81 ; inline
|
CONSTANT: ENEEDAUTH 81
|
||||||
: EPWROFF 82 ; inline
|
CONSTANT: EPWROFF 82
|
||||||
: EDEVERR 83 ; inline
|
CONSTANT: EDEVERR 83
|
||||||
: EOVERFLOW 84 ; inline
|
CONSTANT: EOVERFLOW 84
|
||||||
: EBADEXEC 85 ; inline
|
CONSTANT: EBADEXEC 85
|
||||||
: EBADARCH 86 ; inline
|
CONSTANT: EBADARCH 86
|
||||||
: ESHLIBVERS 87 ; inline
|
CONSTANT: ESHLIBVERS 87
|
||||||
: EBADMACHO 88 ; inline
|
CONSTANT: EBADMACHO 88
|
||||||
: ECANCELED 89 ; inline
|
CONSTANT: ECANCELED 89
|
||||||
: EIDRM 90 ; inline
|
CONSTANT: EIDRM 90
|
||||||
: ENOMSG 91 ; inline
|
CONSTANT: ENOMSG 91
|
||||||
: EILSEQ 92 ; inline
|
CONSTANT: EILSEQ 92
|
||||||
: ENOATTR 93 ; inline
|
CONSTANT: ENOATTR 93
|
||||||
: EBADMSG 94 ; inline
|
CONSTANT: EBADMSG 94
|
||||||
: EMULTIHOP 95 ; inline
|
CONSTANT: EMULTIHOP 95
|
||||||
: ENODATA 96 ; inline
|
CONSTANT: ENODATA 96
|
||||||
: ENOLINK 97 ; inline
|
CONSTANT: ENOLINK 97
|
||||||
: ENOSR 98 ; inline
|
CONSTANT: ENOSR 98
|
||||||
: ENOSTR 99 ; inline
|
CONSTANT: ENOSTR 99
|
||||||
: EPROTO 100 ; inline
|
CONSTANT: EPROTO 100
|
||||||
: ETIME 101 ; inline
|
CONSTANT: ETIME 101
|
||||||
: EOPNOTSUPP 102 ; inline
|
CONSTANT: EOPNOTSUPP 102
|
||||||
: ENOPOLICY 103 ; inline
|
CONSTANT: ENOPOLICY 103
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
USING: alien.syntax alien.c-types math vocabs.loader ;
|
USING: alien.syntax alien.c-types math vocabs.loader constants alias ;
|
||||||
IN: unix
|
IN: unix
|
||||||
|
|
||||||
: FD_SETSIZE 256 ; inline
|
CONSTANT: FD_SETSIZE 256
|
||||||
|
|
||||||
C-STRUCT: addrinfo
|
C-STRUCT: addrinfo
|
||||||
{ "int" "flags" }
|
{ "int" "flags" }
|
||||||
|
@ -20,111 +20,111 @@ C-STRUCT: dirent
|
||||||
{ "__uint8_t" "d_namlen" }
|
{ "__uint8_t" "d_namlen" }
|
||||||
{ { "char" 256 } "d_name" } ;
|
{ { "char" 256 } "d_name" } ;
|
||||||
|
|
||||||
: EPERM 1 ; inline
|
CONSTANT: EPERM 1
|
||||||
: ENOENT 2 ; inline
|
CONSTANT: ENOENT 2
|
||||||
: ESRCH 3 ; inline
|
CONSTANT: ESRCH 3
|
||||||
: EINTR 4 ; inline
|
CONSTANT: EINTR 4
|
||||||
: EIO 5 ; inline
|
CONSTANT: EIO 5
|
||||||
: ENXIO 6 ; inline
|
CONSTANT: ENXIO 6
|
||||||
: E2BIG 7 ; inline
|
CONSTANT: E2BIG 7
|
||||||
: ENOEXEC 8 ; inline
|
CONSTANT: ENOEXEC 8
|
||||||
: EBADF 9 ; inline
|
CONSTANT: EBADF 9
|
||||||
: ECHILD 10 ; inline
|
CONSTANT: ECHILD 10
|
||||||
: EDEADLK 11 ; inline
|
CONSTANT: EDEADLK 11
|
||||||
: ENOMEM 12 ; inline
|
CONSTANT: ENOMEM 12
|
||||||
: EACCES 13 ; inline
|
CONSTANT: EACCES 13
|
||||||
: EFAULT 14 ; inline
|
CONSTANT: EFAULT 14
|
||||||
: ENOTBLK 15 ; inline
|
CONSTANT: ENOTBLK 15
|
||||||
: EBUSY 16 ; inline
|
CONSTANT: EBUSY 16
|
||||||
: EEXIST 17 ; inline
|
CONSTANT: EEXIST 17
|
||||||
: EXDEV 18 ; inline
|
CONSTANT: EXDEV 18
|
||||||
: ENODEV 19 ; inline
|
CONSTANT: ENODEV 19
|
||||||
: ENOTDIR 20 ; inline
|
CONSTANT: ENOTDIR 20
|
||||||
: EISDIR 21 ; inline
|
CONSTANT: EISDIR 21
|
||||||
: EINVAL 22 ; inline
|
CONSTANT: EINVAL 22
|
||||||
: ENFILE 23 ; inline
|
CONSTANT: ENFILE 23
|
||||||
: EMFILE 24 ; inline
|
CONSTANT: EMFILE 24
|
||||||
: ENOTTY 25 ; inline
|
CONSTANT: ENOTTY 25
|
||||||
: ETXTBSY 26 ; inline
|
CONSTANT: ETXTBSY 26
|
||||||
: EFBIG 27 ; inline
|
CONSTANT: EFBIG 27
|
||||||
: ENOSPC 28 ; inline
|
CONSTANT: ENOSPC 28
|
||||||
: ESPIPE 29 ; inline
|
CONSTANT: ESPIPE 29
|
||||||
: EROFS 30 ; inline
|
CONSTANT: EROFS 30
|
||||||
: EMLINK 31 ; inline
|
CONSTANT: EMLINK 31
|
||||||
: EPIPE 32 ; inline
|
CONSTANT: EPIPE 32
|
||||||
: EDOM 33 ; inline
|
CONSTANT: EDOM 33
|
||||||
: ERANGE 34 ; inline
|
CONSTANT: ERANGE 34
|
||||||
: EAGAIN 35 ; inline
|
CONSTANT: EAGAIN 35
|
||||||
: EWOULDBLOCK EAGAIN ; inline
|
ALIAS: EWOULDBLOCK EAGAIN
|
||||||
: EINPROGRESS 36 ; inline
|
CONSTANT: EINPROGRESS 36
|
||||||
: EALREADY 37 ; inline
|
CONSTANT: EALREADY 37
|
||||||
: ENOTSOCK 38 ; inline
|
CONSTANT: ENOTSOCK 38
|
||||||
: EDESTADDRREQ 39 ; inline
|
CONSTANT: EDESTADDRREQ 39
|
||||||
: EMSGSIZE 40 ; inline
|
CONSTANT: EMSGSIZE 40
|
||||||
: EPROTOTYPE 41 ; inline
|
CONSTANT: EPROTOTYPE 41
|
||||||
: ENOPROTOOPT 42 ; inline
|
CONSTANT: ENOPROTOOPT 42
|
||||||
: EPROTONOSUPPORT 43 ; inline
|
CONSTANT: EPROTONOSUPPORT 43
|
||||||
: ESOCKTNOSUPPORT 44 ; inline
|
CONSTANT: ESOCKTNOSUPPORT 44
|
||||||
: EOPNOTSUPP 45 ; inline
|
CONSTANT: EOPNOTSUPP 45
|
||||||
: EPFNOSUPPORT 46 ; inline
|
CONSTANT: EPFNOSUPPORT 46
|
||||||
: EAFNOSUPPORT 47 ; inline
|
CONSTANT: EAFNOSUPPORT 47
|
||||||
: EADDRINUSE 48 ; inline
|
CONSTANT: EADDRINUSE 48
|
||||||
: EADDRNOTAVAIL 49 ; inline
|
CONSTANT: EADDRNOTAVAIL 49
|
||||||
: ENETDOWN 50 ; inline
|
CONSTANT: ENETDOWN 50
|
||||||
: ENETUNREACH 51 ; inline
|
CONSTANT: ENETUNREACH 51
|
||||||
: ENETRESET 52 ; inline
|
CONSTANT: ENETRESET 52
|
||||||
: ECONNABORTED 53 ; inline
|
CONSTANT: ECONNABORTED 53
|
||||||
: ECONNRESET 54 ; inline
|
CONSTANT: ECONNRESET 54
|
||||||
: ENOBUFS 55 ; inline
|
CONSTANT: ENOBUFS 55
|
||||||
: EISCONN 56 ; inline
|
CONSTANT: EISCONN 56
|
||||||
: ENOTCONN 57 ; inline
|
CONSTANT: ENOTCONN 57
|
||||||
: ESHUTDOWN 58 ; inline
|
CONSTANT: ESHUTDOWN 58
|
||||||
: ETOOMANYREFS 59 ; inline
|
CONSTANT: ETOOMANYREFS 59
|
||||||
: ETIMEDOUT 60 ; inline
|
CONSTANT: ETIMEDOUT 60
|
||||||
: ECONNREFUSED 61 ; inline
|
CONSTANT: ECONNREFUSED 61
|
||||||
: ELOOP 62 ; inline
|
CONSTANT: ELOOP 62
|
||||||
: ENAMETOOLONG 63 ; inline
|
CONSTANT: ENAMETOOLONG 63
|
||||||
: EHOSTDOWN 64 ; inline
|
CONSTANT: EHOSTDOWN 64
|
||||||
: EHOSTUNREACH 65 ; inline
|
CONSTANT: EHOSTUNREACH 65
|
||||||
: ENOTEMPTY 66 ; inline
|
CONSTANT: ENOTEMPTY 66
|
||||||
: EPROCLIM 67 ; inline
|
CONSTANT: EPROCLIM 67
|
||||||
: EUSERS 68 ; inline
|
CONSTANT: EUSERS 68
|
||||||
: EDQUOT 69 ; inline
|
CONSTANT: EDQUOT 69
|
||||||
: ESTALE 70 ; inline
|
CONSTANT: ESTALE 70
|
||||||
: EREMOTE 71 ; inline
|
CONSTANT: EREMOTE 71
|
||||||
: EBADRPC 72 ; inline
|
CONSTANT: EBADRPC 72
|
||||||
: ERPCMISMATCH 73 ; inline
|
CONSTANT: ERPCMISMATCH 73
|
||||||
: EPROGUNAVAIL 74 ; inline
|
CONSTANT: EPROGUNAVAIL 74
|
||||||
: EPROGMISMATCH 75 ; inline
|
CONSTANT: EPROGMISMATCH 75
|
||||||
: EPROCUNAVAIL 76 ; inline
|
CONSTANT: EPROCUNAVAIL 76
|
||||||
: ENOLCK 77 ; inline
|
CONSTANT: ENOLCK 77
|
||||||
: ENOSYS 78 ; inline
|
CONSTANT: ENOSYS 78
|
||||||
: EFTYPE 79 ; inline
|
CONSTANT: EFTYPE 79
|
||||||
: EAUTH 80 ; inline
|
CONSTANT: EAUTH 80
|
||||||
: ENEEDAUTH 81 ; inline
|
CONSTANT: ENEEDAUTH 81
|
||||||
: EIDRM 82 ; inline
|
CONSTANT: EIDRM 82
|
||||||
: ENOMSG 83 ; inline
|
CONSTANT: ENOMSG 83
|
||||||
: EOVERFLOW 84 ; inline
|
CONSTANT: EOVERFLOW 84
|
||||||
: EILSEQ 85 ; inline
|
CONSTANT: EILSEQ 85
|
||||||
: ENOTSUP 86 ; inline
|
CONSTANT: ENOTSUP 86
|
||||||
: ECANCELED 87 ; inline
|
CONSTANT: ECANCELED 87
|
||||||
: EBADMSG 88 ; inline
|
CONSTANT: EBADMSG 88
|
||||||
: ENODATA 89 ; inline
|
CONSTANT: ENODATA 89
|
||||||
: ENOSR 90 ; inline
|
CONSTANT: ENOSR 90
|
||||||
: ENOSTR 91 ; inline
|
CONSTANT: ENOSTR 91
|
||||||
: ETIME 92 ; inline
|
CONSTANT: ETIME 92
|
||||||
: ENOATTR 93 ; inline
|
CONSTANT: ENOATTR 93
|
||||||
: EMULTIHOP 94 ; inline
|
CONSTANT: EMULTIHOP 94
|
||||||
: ENOLINK 95 ; inline
|
CONSTANT: ENOLINK 95
|
||||||
: EPROTO 96 ; inline
|
CONSTANT: EPROTO 96
|
||||||
: ELAST 96 ; inline
|
CONSTANT: ELAST 96
|
||||||
|
|
||||||
TYPEDEF: __uint8_t sa_family_t
|
TYPEDEF: __uint8_t sa_family_t
|
||||||
|
|
||||||
: _UTX_USERSIZE 32 ; inline
|
CONSTANT: _UTX_USERSIZE 32
|
||||||
: _UTX_LINESIZE 32 ; inline
|
CONSTANT: _UTX_LINESIZE 32
|
||||||
: _UTX_IDSIZE 4 ; inline
|
CONSTANT: _UTX_IDSIZE 4
|
||||||
: _UTX_HOSTSIZE 256 ; inline
|
CONSTANT: _UTX_HOSTSIZE 256
|
||||||
|
|
||||||
: _SS_MAXSIZE ( -- n )
|
: _SS_MAXSIZE ( -- n )
|
||||||
128 ; inline
|
128 ; inline
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
USING: alien.syntax ;
|
USING: alien.syntax constants alias ;
|
||||||
IN: unix
|
IN: unix
|
||||||
|
|
||||||
: FD_SETSIZE 1024 ; inline
|
CONSTANT: FD_SETSIZE 1024
|
||||||
|
|
||||||
C-STRUCT: addrinfo
|
C-STRUCT: addrinfo
|
||||||
{ "int" "flags" }
|
{ "int" "flags" }
|
||||||
|
@ -20,92 +20,92 @@ C-STRUCT: dirent
|
||||||
{ "__uint8_t" "d_namlen" }
|
{ "__uint8_t" "d_namlen" }
|
||||||
{ { "char" 256 } "d_name" } ;
|
{ { "char" 256 } "d_name" } ;
|
||||||
|
|
||||||
: EPERM 1 ; inline
|
CONSTANT: EPERM 1
|
||||||
: ENOENT 2 ; inline
|
CONSTANT: ENOENT 2
|
||||||
: ESRCH 3 ; inline
|
CONSTANT: ESRCH 3
|
||||||
: EINTR 4 ; inline
|
CONSTANT: EINTR 4
|
||||||
: EIO 5 ; inline
|
CONSTANT: EIO 5
|
||||||
: ENXIO 6 ; inline
|
CONSTANT: ENXIO 6
|
||||||
: E2BIG 7 ; inline
|
CONSTANT: E2BIG 7
|
||||||
: ENOEXEC 8 ; inline
|
CONSTANT: ENOEXEC 8
|
||||||
: EBADF 9 ; inline
|
CONSTANT: EBADF 9
|
||||||
: ECHILD 10 ; inline
|
CONSTANT: ECHILD 10
|
||||||
: EDEADLK 11 ; inline
|
CONSTANT: EDEADLK 11
|
||||||
: ENOMEM 12 ; inline
|
CONSTANT: ENOMEM 12
|
||||||
: EACCES 13 ; inline
|
CONSTANT: EACCES 13
|
||||||
: EFAULT 14 ; inline
|
CONSTANT: EFAULT 14
|
||||||
: ENOTBLK 15 ; inline
|
CONSTANT: ENOTBLK 15
|
||||||
: EBUSY 16 ; inline
|
CONSTANT: EBUSY 16
|
||||||
: EEXIST 17 ; inline
|
CONSTANT: EEXIST 17
|
||||||
: EXDEV 18 ; inline
|
CONSTANT: EXDEV 18
|
||||||
: ENODEV 19 ; inline
|
CONSTANT: ENODEV 19
|
||||||
: ENOTDIR 20 ; inline
|
CONSTANT: ENOTDIR 20
|
||||||
: EISDIR 21 ; inline
|
CONSTANT: EISDIR 21
|
||||||
: EINVAL 22 ; inline
|
CONSTANT: EINVAL 22
|
||||||
: ENFILE 23 ; inline
|
CONSTANT: ENFILE 23
|
||||||
: EMFILE 24 ; inline
|
CONSTANT: EMFILE 24
|
||||||
: ENOTTY 25 ; inline
|
CONSTANT: ENOTTY 25
|
||||||
: ETXTBSY 26 ; inline
|
CONSTANT: ETXTBSY 26
|
||||||
: EFBIG 27 ; inline
|
CONSTANT: EFBIG 27
|
||||||
: ENOSPC 28 ; inline
|
CONSTANT: ENOSPC 28
|
||||||
: ESPIPE 29 ; inline
|
CONSTANT: ESPIPE 29
|
||||||
: EROFS 30 ; inline
|
CONSTANT: EROFS 30
|
||||||
: EMLINK 31 ; inline
|
CONSTANT: EMLINK 31
|
||||||
: EPIPE 32 ; inline
|
CONSTANT: EPIPE 32
|
||||||
: EDOM 33 ; inline
|
CONSTANT: EDOM 33
|
||||||
: ERANGE 34 ; inline
|
CONSTANT: ERANGE 34
|
||||||
: EAGAIN 35 ; inline
|
CONSTANT: EAGAIN 35
|
||||||
: EWOULDBLOCK EAGAIN ; inline
|
ALIAS: EWOULDBLOCK EAGAIN
|
||||||
: EINPROGRESS 36 ; inline
|
CONSTANT: EINPROGRESS 36
|
||||||
: EALREADY 37 ; inline
|
CONSTANT: EALREADY 37
|
||||||
: ENOTSOCK 38 ; inline
|
CONSTANT: ENOTSOCK 38
|
||||||
: EDESTADDRREQ 39 ; inline
|
CONSTANT: EDESTADDRREQ 39
|
||||||
: EMSGSIZE 40 ; inline
|
CONSTANT: EMSGSIZE 40
|
||||||
: EPROTOTYPE 41 ; inline
|
CONSTANT: EPROTOTYPE 41
|
||||||
: ENOPROTOOPT 42 ; inline
|
CONSTANT: ENOPROTOOPT 42
|
||||||
: EPROTONOSUPPORT 43 ; inline
|
CONSTANT: EPROTONOSUPPORT 43
|
||||||
: ESOCKTNOSUPPORT 44 ; inline
|
CONSTANT: ESOCKTNOSUPPORT 44
|
||||||
: EOPNOTSUPP 45 ; inline
|
CONSTANT: EOPNOTSUPP 45
|
||||||
: EPFNOSUPPORT 46 ; inline
|
CONSTANT: EPFNOSUPPORT 46
|
||||||
: EAFNOSUPPORT 47 ; inline
|
CONSTANT: EAFNOSUPPORT 47
|
||||||
: EADDRINUSE 48 ; inline
|
CONSTANT: EADDRINUSE 48
|
||||||
: EADDRNOTAVAIL 49 ; inline
|
CONSTANT: EADDRNOTAVAIL 49
|
||||||
: ENETDOWN 50 ; inline
|
CONSTANT: ENETDOWN 50
|
||||||
: ENETUNREACH 51 ; inline
|
CONSTANT: ENETUNREACH 51
|
||||||
: ENETRESET 52 ; inline
|
CONSTANT: ENETRESET 52
|
||||||
: ECONNABORTED 53 ; inline
|
CONSTANT: ECONNABORTED 53
|
||||||
: ECONNRESET 54 ; inline
|
CONSTANT: ECONNRESET 54
|
||||||
: ENOBUFS 55 ; inline
|
CONSTANT: ENOBUFS 55
|
||||||
: EISCONN 56 ; inline
|
CONSTANT: EISCONN 56
|
||||||
: ENOTCONN 57 ; inline
|
CONSTANT: ENOTCONN 57
|
||||||
: ESHUTDOWN 58 ; inline
|
CONSTANT: ESHUTDOWN 58
|
||||||
: ETOOMANYREFS 59 ; inline
|
CONSTANT: ETOOMANYREFS 59
|
||||||
: ETIMEDOUT 60 ; inline
|
CONSTANT: ETIMEDOUT 60
|
||||||
: ECONNREFUSED 61 ; inline
|
CONSTANT: ECONNREFUSED 61
|
||||||
: ELOOP 62 ; inline
|
CONSTANT: ELOOP 62
|
||||||
: ENAMETOOLONG 63 ; inline
|
CONSTANT: ENAMETOOLONG 63
|
||||||
: EHOSTDOWN 64 ; inline
|
CONSTANT: EHOSTDOWN 64
|
||||||
: EHOSTUNREACH 65 ; inline
|
CONSTANT: EHOSTUNREACH 65
|
||||||
: ENOTEMPTY 66 ; inline
|
CONSTANT: ENOTEMPTY 66
|
||||||
: EPROCLIM 67 ; inline
|
CONSTANT: EPROCLIM 67
|
||||||
: EUSERS 68 ; inline
|
CONSTANT: EUSERS 68
|
||||||
: EDQUOT 69 ; inline
|
CONSTANT: EDQUOT 69
|
||||||
: ESTALE 70 ; inline
|
CONSTANT: ESTALE 70
|
||||||
: EREMOTE 71 ; inline
|
CONSTANT: EREMOTE 71
|
||||||
: EBADRPC 72 ; inline
|
CONSTANT: EBADRPC 72
|
||||||
: ERPCMISMATCH 73 ; inline
|
CONSTANT: ERPCMISMATCH 73
|
||||||
: EPROGUNAVAIL 74 ; inline
|
CONSTANT: EPROGUNAVAIL 74
|
||||||
: EPROGMISMATCH 75 ; inline
|
CONSTANT: EPROGMISMATCH 75
|
||||||
: EPROCUNAVAIL 76 ; inline
|
CONSTANT: EPROCUNAVAIL 76
|
||||||
: ENOLCK 77 ; inline
|
CONSTANT: ENOLCK 77
|
||||||
: ENOSYS 78 ; inline
|
CONSTANT: ENOSYS 78
|
||||||
: EFTYPE 79 ; inline
|
CONSTANT: EFTYPE 79
|
||||||
: EAUTH 80 ; inline
|
CONSTANT: EAUTH 80
|
||||||
: ENEEDAUTH 81 ; inline
|
CONSTANT: ENEEDAUTH 81
|
||||||
: EIPSEC 82 ; inline
|
CONSTANT: EIPSEC 82
|
||||||
: ENOATTR 83 ; inline
|
CONSTANT: ENOATTR 83
|
||||||
: EILSEQ 84 ; inline
|
CONSTANT: EILSEQ 84
|
||||||
: ENOMEDIUM 85 ; inline
|
CONSTANT: ENOMEDIUM 85
|
||||||
: EMEDIUMTYPE 86 ; inline
|
CONSTANT: EMEDIUMTYPE 86
|
||||||
: EOVERFLOW 87 ; inline
|
CONSTANT: EOVERFLOW 87
|
||||||
: ECANCELED 88 ; inline
|
CONSTANT: ECANCELED 88
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
! Copyright (C) 2008 Doug Coleman.
|
! Copyright (C) 2008 Doug Coleman.
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: alien.syntax ;
|
USING: alien.syntax constants ;
|
||||||
IN: unix.getfsstat.freebsd
|
IN: unix.getfsstat.freebsd
|
||||||
|
|
||||||
: MNT_WAIT 1 ; inline ! synchronously wait for I/O to complete
|
CONSTANT: MNT_WAIT 1 ! synchronously wait for I/O to complete
|
||||||
: MNT_NOWAIT 2 ; inline ! start all I/O, but do not wait for it
|
CONSTANT: MNT_NOWAIT 2 ! start all I/O, but do not wait for it
|
||||||
: MNT_LAZY 3 ; inline ! push data not written by filesystem syncer
|
CONSTANT: MNT_LAZY 3 ! push data not written by filesystem syncer
|
||||||
: MNT_SUSPEND 4 ; inline ! Suspend file system after sync
|
CONSTANT: MNT_SUSPEND 4 ! Suspend file system after sync
|
||||||
|
|
||||||
FUNCTION: int getfsstat ( statfs* buf, int bufsize, int flags ) ;
|
FUNCTION: int getfsstat ( statfs* buf, int bufsize, int flags ) ;
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
! Copyright (C) 2008 Doug Coleman.
|
! Copyright (C) 2008 Doug Coleman.
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: alien.syntax ;
|
USING: alien.syntax constants ;
|
||||||
IN: unix.getfsstat.macosx
|
IN: unix.getfsstat.macosx
|
||||||
|
|
||||||
: MNT_WAIT 1 ; inline ! synchronously wait for I/O to complete
|
CONSTANT: MNT_WAIT 1 ! synchronously wait for I/O to complete
|
||||||
: MNT_NOWAIT 2 ; inline ! start all I/O, but do not wait for it
|
CONSTANT: MNT_NOWAIT 2 ! start all I/O, but do not wait for it
|
||||||
|
|
||||||
FUNCTION: int getfsstat64 ( statfs* buf, int bufsize, int flags ) ;
|
FUNCTION: int getfsstat64 ( statfs* buf, int bufsize, int flags ) ;
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
! Copyright (C) 2008 Doug Coleman.
|
! Copyright (C) 2008 Doug Coleman.
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: alien.syntax ;
|
USING: alien.syntax constants ;
|
||||||
IN: unix.getfsstat.netbsd
|
IN: unix.getfsstat.netbsd
|
||||||
|
|
||||||
: MNT_WAIT 1 ; inline ! synchronously wait for I/O to complete
|
CONSTANT: MNT_WAIT 1 ! synchronously wait for I/O to complete
|
||||||
: MNT_NOWAIT 2 ; inline ! start all I/O, but do not wait for it
|
CONSTANT: MNT_NOWAIT 2 ! start all I/O, but do not wait for it
|
||||||
: MNT_LAZY 3 ; inline ! push data not written by filesystem syncer
|
CONSTANT: MNT_LAZY 3 ! push data not written by filesystem syncer
|
||||||
|
|
||||||
FUNCTION: int getvfsstat ( statfs* buf, int bufsize, int flags ) ;
|
FUNCTION: int getvfsstat ( statfs* buf, int bufsize, int flags ) ;
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
! Copyright (C) 2008 Doug Coleman.
|
! Copyright (C) 2008 Doug Coleman.
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: alien.syntax ;
|
USING: alien.syntax constants ;
|
||||||
IN: unix.getfsstat.openbsd
|
IN: unix.getfsstat.openbsd
|
||||||
|
|
||||||
: MNT_WAIT 1 ; ! synchronously wait for I/O to complete
|
CONSTANT: MNT_WAIT 1 ! synchronously wait for I/O to complete
|
||||||
: MNT_NOWAIT 2 ; ! start all I/O, but do not wait for it
|
CONSTANT: MNT_NOWAIT 2 ! start all I/O, but do not wait for it
|
||||||
: MNT_LAZY 3 ; ! push data not written by filesystem syncer
|
CONSTANT: MNT_LAZY 3 ! push data not written by filesystem syncer
|
||||||
|
|
||||||
FUNCTION: int getfsstat ( statfs* buf, int bufsize, int flags ) ;
|
FUNCTION: int getfsstat ( statfs* buf, int bufsize, int flags ) ;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
USE: alien.syntax
|
USING: alien.syntax constants ;
|
||||||
IN: unix.kqueue
|
IN: unix.kqueue
|
||||||
|
|
||||||
C-STRUCT: kevent
|
C-STRUCT: kevent
|
||||||
|
@ -12,12 +12,12 @@ C-STRUCT: kevent
|
||||||
|
|
||||||
FUNCTION: int kevent ( int kq, kevent* changelist, int nchanges, kevent* eventlist, int nevents, timespec* timeout ) ;
|
FUNCTION: int kevent ( int kq, kevent* changelist, int nchanges, kevent* eventlist, int nevents, timespec* timeout ) ;
|
||||||
|
|
||||||
: EVFILT_READ -1 ; inline
|
CONSTANT: EVFILT_READ -1
|
||||||
: EVFILT_WRITE -2 ; inline
|
CONSTANT: EVFILT_WRITE -2
|
||||||
: EVFILT_AIO -3 ; inline ! attached to aio requests
|
CONSTANT: EVFILT_AIO -3 ! attached to aio requests
|
||||||
: EVFILT_VNODE -4 ; inline ! attached to vnodes
|
CONSTANT: EVFILT_VNODE -4 ! attached to vnodes
|
||||||
: EVFILT_PROC -5 ; inline ! attached to struct proc
|
CONSTANT: EVFILT_PROC -5 ! attached to struct proc
|
||||||
: EVFILT_SIGNAL -6 ; inline ! attached to struct proc
|
CONSTANT: EVFILT_SIGNAL -6 ! attached to struct proc
|
||||||
: EVFILT_TIMER -7 ; inline ! timers
|
CONSTANT: EVFILT_TIMER -7 ! timers
|
||||||
: EVFILT_NETDEV -8 ; inline ! Mach ports
|
CONSTANT: EVFILT_NETDEV -8 ! Mach ports
|
||||||
: EVFILT_FS -9 ; inline ! Filesystem events
|
CONSTANT: EVFILT_FS -9 ! Filesystem events
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
! Copyright (C) 2008 Slava Pestov.
|
! Copyright (C) 2008 Slava Pestov.
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: alien.syntax system sequences vocabs.loader words
|
USING: alien.syntax system sequences vocabs.loader words
|
||||||
accessors ;
|
accessors alias constants ;
|
||||||
IN: unix.kqueue
|
IN: unix.kqueue
|
||||||
|
|
||||||
<< "unix.kqueue." os name>> append require >>
|
<< "unix.kqueue." os name>> append require >>
|
||||||
|
@ -9,47 +9,47 @@ IN: unix.kqueue
|
||||||
FUNCTION: int kqueue ( ) ;
|
FUNCTION: int kqueue ( ) ;
|
||||||
|
|
||||||
! actions
|
! actions
|
||||||
: EV_ADD HEX: 1 ; inline ! add event to kq (implies enable)
|
CONSTANT: EV_ADD HEX: 1 ! add event to kq (implies enable)
|
||||||
: EV_DELETE HEX: 2 ; inline ! delete event from kq
|
CONSTANT: EV_DELETE HEX: 2 ! delete event from kq
|
||||||
: EV_ENABLE HEX: 4 ; inline ! enable event
|
CONSTANT: EV_ENABLE HEX: 4 ! enable event
|
||||||
: EV_DISABLE HEX: 8 ; inline ! disable event (not reported)
|
CONSTANT: EV_DISABLE HEX: 8 ! disable event (not reported)
|
||||||
|
|
||||||
! flags
|
! flags
|
||||||
: EV_ONESHOT HEX: 10 ; inline ! only report one occurrence
|
CONSTANT: EV_ONESHOT HEX: 10 ! only report one occurrence
|
||||||
: EV_CLEAR HEX: 20 ; inline ! clear event state after reporting
|
CONSTANT: EV_CLEAR HEX: 20 ! clear event state after reporting
|
||||||
|
|
||||||
: EV_SYSFLAGS HEX: f000 ; inline ! reserved by system
|
CONSTANT: EV_SYSFLAGS HEX: f000 ! reserved by system
|
||||||
: EV_FLAG0 HEX: 1000 ; inline ! filter-specific flag
|
CONSTANT: EV_FLAG0 HEX: 1000 ! filter-specific flag
|
||||||
: EV_FLAG1 HEX: 2000 ; inline ! filter-specific flag
|
CONSTANT: EV_FLAG1 HEX: 2000 ! filter-specific flag
|
||||||
|
|
||||||
! returned values
|
! returned values
|
||||||
: EV_EOF HEX: 8000 ; inline ! EOF detected
|
CONSTANT: EV_EOF HEX: 8000 ! EOF detected
|
||||||
: EV_ERROR HEX: 4000 ; inline ! error, data contains errno
|
CONSTANT: EV_ERROR HEX: 4000 ! error, data contains errno
|
||||||
|
|
||||||
: EV_POLL EV_FLAG0 ; inline
|
ALIAS: EV_POLL EV_FLAG0
|
||||||
: EV_OOBAND EV_FLAG1 ; inline
|
ALIAS: EV_OOBAND EV_FLAG1
|
||||||
|
|
||||||
: NOTE_LOWAT HEX: 00000001 ; inline ! low water mark
|
CONSTANT: NOTE_LOWAT HEX: 00000001 ! low water mark
|
||||||
|
|
||||||
: NOTE_DELETE HEX: 00000001 ; inline ! vnode was removed
|
CONSTANT: NOTE_DELETE HEX: 00000001 ! vnode was removed
|
||||||
: NOTE_WRITE HEX: 00000002 ; inline ! data contents changed
|
CONSTANT: NOTE_WRITE HEX: 00000002 ! data contents changed
|
||||||
: NOTE_EXTEND HEX: 00000004 ; inline ! size increased
|
CONSTANT: NOTE_EXTEND HEX: 00000004 ! size increased
|
||||||
: NOTE_ATTRIB HEX: 00000008 ; inline ! attributes changed
|
CONSTANT: NOTE_ATTRIB HEX: 00000008 ! attributes changed
|
||||||
: NOTE_LINK HEX: 00000010 ; inline ! link count changed
|
CONSTANT: NOTE_LINK HEX: 00000010 ! link count changed
|
||||||
: NOTE_RENAME HEX: 00000020 ; inline ! vnode was renamed
|
CONSTANT: NOTE_RENAME HEX: 00000020 ! vnode was renamed
|
||||||
: NOTE_REVOKE HEX: 00000040 ; inline ! vnode access was revoked
|
CONSTANT: NOTE_REVOKE HEX: 00000040 ! vnode access was revoked
|
||||||
|
|
||||||
: NOTE_EXIT HEX: 80000000 ; inline ! process exited
|
CONSTANT: NOTE_EXIT HEX: 80000000 ! process exited
|
||||||
: NOTE_FORK HEX: 40000000 ; inline ! process forked
|
CONSTANT: NOTE_FORK HEX: 40000000 ! process forked
|
||||||
: NOTE_EXEC HEX: 20000000 ; inline ! process exec'd
|
CONSTANT: NOTE_EXEC HEX: 20000000 ! process exec'd
|
||||||
: NOTE_PCTRLMASK HEX: f0000000 ; inline ! mask for hint bits
|
CONSTANT: NOTE_PCTRLMASK HEX: f0000000 ! mask for hint bits
|
||||||
: NOTE_PDATAMASK HEX: 000fffff ; inline ! mask for pid
|
CONSTANT: NOTE_PDATAMASK HEX: 000fffff ! mask for pid
|
||||||
|
|
||||||
: NOTE_SECONDS HEX: 00000001 ; inline ! data is seconds
|
CONSTANT: NOTE_SECONDS HEX: 00000001 ! data is seconds
|
||||||
: NOTE_USECONDS HEX: 00000002 ; inline ! data is microseconds
|
CONSTANT: NOTE_USECONDS HEX: 00000002 ! data is microseconds
|
||||||
: NOTE_NSECONDS HEX: 00000004 ; inline ! data is nanoseconds
|
CONSTANT: NOTE_NSECONDS HEX: 00000004 ! data is nanoseconds
|
||||||
: NOTE_ABSOLUTE HEX: 00000008 ; inline ! absolute timeout
|
CONSTANT: NOTE_ABSOLUTE HEX: 00000008 ! absolute timeout
|
||||||
|
|
||||||
: NOTE_TRACK HEX: 00000001 ; inline ! follow across forks
|
CONSTANT: NOTE_TRACK HEX: 00000001 ! follow across forks
|
||||||
: NOTE_TRACKERR HEX: 00000002 ; inline ! could not track child
|
CONSTANT: NOTE_TRACKERR HEX: 00000002 ! could not track child
|
||||||
: NOTE_CHILD HEX: 00000004 ; inline ! am a child process
|
CONSTANT: NOTE_CHILD HEX: 00000004 ! am a child process
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
USE: alien.syntax
|
USING: alien.syntax constants ;
|
||||||
IN: unix.kqueue
|
IN: unix.kqueue
|
||||||
|
|
||||||
C-STRUCT: kevent
|
C-STRUCT: kevent
|
||||||
|
@ -12,12 +12,12 @@ C-STRUCT: kevent
|
||||||
|
|
||||||
FUNCTION: int kevent ( int kq, kevent* changelist, int nchanges, kevent* eventlist, int nevents, timespec* timeout ) ;
|
FUNCTION: int kevent ( int kq, kevent* changelist, int nchanges, kevent* eventlist, int nevents, timespec* timeout ) ;
|
||||||
|
|
||||||
: EVFILT_READ -1 ; inline
|
CONSTANT: EVFILT_READ -1
|
||||||
: EVFILT_WRITE -2 ; inline
|
CONSTANT: EVFILT_WRITE -2
|
||||||
: EVFILT_AIO -3 ; inline ! attached to aio requests
|
CONSTANT: EVFILT_AIO -3 ! attached to aio requests
|
||||||
: EVFILT_VNODE -4 ; inline ! attached to vnodes
|
CONSTANT: EVFILT_VNODE -4 ! attached to vnodes
|
||||||
: EVFILT_PROC -5 ; inline ! attached to struct proc
|
CONSTANT: EVFILT_PROC -5 ! attached to struct proc
|
||||||
: EVFILT_SIGNAL -6 ; inline ! attached to struct proc
|
CONSTANT: EVFILT_SIGNAL -6 ! attached to struct proc
|
||||||
: EVFILT_TIMER -7 ; inline ! timers
|
CONSTANT: EVFILT_TIMER -7 ! timers
|
||||||
: EVFILT_MACHPORT -8 ; inline ! Mach ports
|
CONSTANT: EVFILT_MACHPORT -8 ! Mach ports
|
||||||
: EVFILT_FS -9 ; inline ! Filesystem events
|
CONSTANT: EVFILT_FS -9 ! Filesystem events
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
USE: alien.syntax
|
USING: alien.syntax constants ;
|
||||||
IN: unix.kqueue
|
IN: unix.kqueue
|
||||||
|
|
||||||
C-STRUCT: kevent
|
C-STRUCT: kevent
|
||||||
|
@ -12,11 +12,11 @@ C-STRUCT: kevent
|
||||||
|
|
||||||
FUNCTION: int kevent ( int kq, kevent* changelist, size_t nchanges, kevent* eventlist, size_t nevents, timespec* timeout ) ;
|
FUNCTION: int kevent ( int kq, kevent* changelist, size_t nchanges, kevent* eventlist, size_t nevents, timespec* timeout ) ;
|
||||||
|
|
||||||
: EVFILT_READ 0 ; inline
|
CONSTANT: EVFILT_READ 0
|
||||||
: EVFILT_WRITE 1 ; inline
|
CONSTANT: EVFILT_WRITE 1
|
||||||
: EVFILT_AIO 2 ; inline ! attached to aio requests
|
CONSTANT: EVFILT_AIO 2 ! attached to aio requests
|
||||||
: EVFILT_VNODE 3 ; inline ! attached to vnodes
|
CONSTANT: EVFILT_VNODE 3 ! attached to vnodes
|
||||||
: EVFILT_PROC 4 ; inline ! attached to struct proc
|
CONSTANT: EVFILT_PROC 4 ! attached to struct proc
|
||||||
: EVFILT_SIGNAL 5 ; inline ! attached to struct proc
|
CONSTANT: EVFILT_SIGNAL 5 ! attached to struct proc
|
||||||
: EVFILT_TIMER 6 ; inline ! timers
|
CONSTANT: EVFILT_TIMER 6 ! timers
|
||||||
: EVFILT_SYSCOUNT 7 ; inline ! Filesystem events
|
CONSTANT: EVFILT_SYSCOUNT 7 ! Filesystem events
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue