Merge branch 'master' of git://factorcode.org/git/factor

db4
John Benediktsson 2008-12-16 07:16:38 -08:00
commit bd157e01e1
213 changed files with 4687 additions and 4421 deletions

View File

@ -1,18 +1,19 @@
! Copyright (C) 2008 Slava Pestov.
! 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
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
[ call-next-method ] [ f "alias" set-word-prop ] bi ;
M: alias 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

View File

@ -234,17 +234,16 @@ M: long-long-type box-return ( type -- )
f swap box-parameter ;
: define-deref ( name -- )
[ CHAR: * prefix "alien.c-types" create ]
[ c-getter 0 prefix ] bi
define-inline ;
[ CHAR: * prefix "alien.c-types" create ] [ c-getter 0 prefix ] bi
(( c-ptr -- value )) define-inline ;
: define-out ( name -- )
[ "alien.c-types" constructor-word ]
[ dup c-setter '[ _ <c-object> [ 0 @ ] keep ] ]
bi define-inline ;
[ dup c-setter '[ _ <c-object> [ 0 @ ] keep ] ] bi
(( value -- c-ptr )) define-inline ;
: c-bool> ( int -- ? )
zero? not ;
0 = not ; inline
: define-primitive-type ( type name -- )
[ typedef ]

View File

@ -52,8 +52,8 @@ PREDICATE: slot-writer < word "writing" word-prop >boolean ;
[ (>>offset) ] [ type>> heap-size + ] 2bi
] reduce ;
: define-struct-slot-word ( word quot spec -- )
offset>> prefix define-inline ;
: define-struct-slot-word ( word quot spec effect -- )
[ offset>> prefix ] dip define-inline ;
: define-getter ( type spec -- )
[ set-reader-props ] keep
@ -62,11 +62,13 @@ PREDICATE: slot-writer < word "writing" word-prop >boolean ;
type>>
[ 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 -- )
[ 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-getter ] [ define-setter ] 2bi ;

View File

@ -11,7 +11,7 @@ TUPLE: bit-array
<PRIVATE
: n>byte -3 shift ; inline
: n>byte ( m -- n ) -3 shift ; inline
: byte/bit ( n alien -- byte bit )
over n>byte alien-unsigned-1 swap 7 bitand ; inline
@ -19,9 +19,9 @@ TUPLE: bit-array
: set-bit ( ? byte bit -- byte )
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 -- )
[ [ length bits>cells ] keep ] dip swap underlying>>

View File

@ -66,7 +66,7 @@ M: id equal?
SYMBOL: objects
: (objects) <id> objects get ; inline
: (objects) ( obj -- id assoc ) <id> objects get ; inline
: lookup-object ( obj -- n/f ) (objects) at ;

View File

@ -211,7 +211,7 @@ M: real +minute ( timestamp n -- timestamp )
M: number +second ( timestamp n -- timestamp )
[ over second>> + seconds/minutes [ >>second ] dip +minute ] unless-zero ;
: (time+)
: (time+) ( timestamp duration -- timestamp' duration )
[ second>> +second ] keep
[ minute>> +minute ] keep
[ hour>> +hour ] keep
@ -219,7 +219,8 @@ M: number +second ( timestamp n -- timestamp )
[ month>> +month ] keep
[ year>> +year ] keep ; inline
: +slots [ bi@ + ] curry 2keep ; inline
: +slots ( obj1 obj2 quot -- n obj1 obj2 )
[ bi@ + ] curry 2keep ; inline
PRIVATE>

View File

@ -6,6 +6,7 @@ IN: channels.remote
HELP: <remote-channel>
{ $values { "node" "a node object" }
{ "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 "
"channel on another node. The remote node's channel must have been "

View File

@ -4,8 +4,8 @@ USING: help.syntax help.markup ;
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." } ;
HELP: <openssl-checksum> ( name -- checksum )
{ $values { "name" "an EVP message digest name" } { "checksum" openssl-checksum } }
HELP: <openssl-checksum>
{ $values { "name" "an EVP message digest name" } { "openssl-checksum" openssl-checksum } }
{ $description "Creates a new OpenSSL checksum object." } ;
HELP: openssl-md5

View File

@ -14,7 +14,7 @@ IN: cocoa.windows
: NSBackingStoreNonretained 1 ; inline
: NSBackingStoreBuffered 2 ; inline
: standard-window-type
: standard-window-type ( -- n )
{
NSTitledWindowMask
NSClosableWindowMask

View File

@ -4,8 +4,8 @@ IN: columns
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> } "." } ;
HELP: <column> ( seq n -- column )
{ $values { "seq" sequence } { "n" "a non-negative integer" } { "column" column } }
HELP: <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." }
{ $examples
{ $example

View File

@ -68,7 +68,8 @@ IN: compiler.cfg.alias-analysis
! Map vregs -> alias classes
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 )
#! Only vregs produced by ##allot, ##peek and ##slot can

View File

@ -5,17 +5,17 @@ sequences classes.tuple cpu.architecture compiler.cfg.registers
compiler.cfg.instructions ;
IN: compiler.cfg.hats
: i int-regs next-vreg ; inline
: ^^i i dup ; inline
: ^^i1 [ ^^i ] dip ; inline
: ^^i2 [ ^^i ] 2dip ; inline
: ^^i3 [ ^^i ] 3dip ; inline
: i ( -- vreg ) int-regs next-vreg ; inline
: ^^i ( -- vreg vreg ) i dup ; inline
: ^^i1 ( obj -- vreg vreg obj ) [ ^^i ] dip ; inline
: ^^i2 ( obj obj -- vreg vreg obj obj ) [ ^^i ] 2dip ; inline
: ^^i3 ( obj obj obj -- vreg vreg obj obj obj ) [ ^^i ] 3dip ; inline
: d double-float-regs next-vreg ; inline
: ^^d d dup ; inline
: ^^d1 [ ^^d ] dip ; inline
: ^^d2 [ ^^d ] 2dip ; inline
: ^^d3 [ ^^d ] 3dip ; inline
: d ( -- vreg ) double-float-regs next-vreg ; inline
: ^^d ( -- vreg vreg ) d dup ; inline
: ^^d1 ( obj -- vreg vreg obj ) [ ^^d ] dip ; inline
: ^^d2 ( obj obj -- vreg vreg obj obj ) [ ^^d ] 2dip ; inline
: ^^d3 ( obj obj obj -- vreg vreg obj obj obj ) [ ^^d ] 3dip ; inline
: ^^load-literal ( obj -- dst ) ^^i1 ##load-literal ; inline
: ^^peek ( loc -- dst ) ^^i1 ##peek ; inline

View File

@ -1,7 +1,7 @@
! Copyright (C) 2008 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: classes.tuple classes.tuple.parser kernel words
make fry sequences parser ;
make fry sequences parser accessors ;
IN: compiler.cfg.instructions.syntax
: insn-word ( -- word )
@ -10,10 +10,13 @@ IN: compiler.cfg.instructions.syntax
#! this one.
"insn" "compiler.cfg.instructions" lookup ;
: insn-effect ( word -- effect )
boa-effect [ but-last ] change-in { } >>out ;
: INSN:
parse-tuple-definition "regs" suffix
[ dup tuple eq? [ drop insn-word ] when ] dip
[ define-tuple-class ]
[ 2drop save-location ]
[ 2drop dup '[ f _ boa , ] define-inline ]
[ 2drop [ ] [ '[ f _ boa , ] ] [ insn-effect ] tri define-inline ]
3tri ; parsing

View File

@ -37,7 +37,7 @@ M: insn linearize-insn , drop ;
M: ##branch linearize-insn
drop dup successors>> first emit-branch ;
: (binary-conditional)
: (binary-conditional) ( basic-block insn -- basic-block successor1 successor2 src1 src2 cc )
[ dup successors>> first2 ]
[ [ src1>> ] [ src2>> ] [ cc>> ] tri ] bi* ; inline

View File

@ -95,7 +95,7 @@ M: ##dispatch-label generate-insn label>> %dispatch-label ;
M: ##dispatch generate-insn
[ src>> register ] [ temp>> register ] [ offset>> ] tri %dispatch ;
: >slot<
: >slot< ( insn -- dst obj slot tag )
{
[ dst>> register ]
[ obj>> register ]
@ -109,7 +109,7 @@ M: ##slot generate-insn
M: ##slot-imm generate-insn
>slot< %slot-imm ;
: >set-slot<
: >set-slot< ( insn -- src obj slot tag )
{
[ src>> 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-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-2 generate-insn >alien-setter< %set-alien-integer-2 ;

3
basis/concurrency/combinators/combinators.factor Normal file → Executable file
View File

@ -28,7 +28,8 @@ PRIVATE>
: [future] ( quot -- quot' ) '[ _ curry future ] ; inline
: future-values dup [ ?future ] change-each ; inline
: future-values ( futures -- futures )
dup [ ?future ] change-each ; inline
PRIVATE>

View File

@ -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

View File

@ -189,21 +189,21 @@ MTSPR: LR 8
MTSPR: CTR 9
! Pseudo-instructions
: LI 0 rot ADDI ; inline
: SUBI neg ADDI ; inline
: LIS 0 rot ADDIS ; inline
: SUBIC neg ADDIC ; inline
: SUBIC. neg ADDIC. ; inline
: NOT dup NOR ; inline
: NOT. dup NOR. ; inline
: MR dup OR ; inline
: MR. dup OR. ; inline
: (SLWI) 0 31 pick - ; inline
: LI ( value dst -- ) 0 rot ADDI ; inline
: SUBI ( dst src1 src2 -- ) neg ADDI ; inline
: LIS ( value dst -- ) 0 rot ADDIS ; inline
: SUBIC ( dst src1 src2 -- ) neg ADDIC ; inline
: SUBIC. ( dst src1 src2 -- ) neg ADDIC. ; inline
: NOT ( dst src -- ) dup NOR ; inline
: NOT. ( dst src -- ) dup NOR. ; inline
: MR ( dst src -- ) dup OR ; inline
: MR. ( dst src -- ) dup OR. ; 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. ;
: (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. ;
: 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? ;
: LOAD ( n r -- ) over immediate? [ LI ] [ LOAD32 ] if ;

View File

@ -79,8 +79,8 @@ M: label (B) 0 -rot (B) rc-relative-ppc-3 label-fixup ;
GENERIC: BC ( a b c -- )
M: integer BC 0 0 16 b-insn ;
M: word BC >r 0 BC r> rc-relative-ppc-2 rel-word ;
M: label BC >r 0 BC r> rc-relative-ppc-2 label-fixup ;
M: word BC [ 0 BC ] dip rc-relative-ppc-2 rel-word ;
M: label BC [ 0 BC ] dip rc-relative-ppc-2 label-fixup ;
: CREATE-B ( -- word ) scan "B" prepend create-in ;

View File

@ -467,19 +467,21 @@ M: ppc %gc
M: ppc %prologue ( n -- )
0 11 LOAD32 rc-absolute-ppc-2/2 rel-this
0 MFLR
1 1 pick neg ADDI
11 1 pick xt-save STW
dup 11 LI
11 1 pick next-save STW
0 1 rot lr-save + STW ;
{
[ [ 1 1 ] dip neg ADDI ]
[ [ 11 1 ] dip xt-save STW ]
[ 11 LI ]
[ [ 11 1 ] dip next-save STW ]
[ [ 0 1 ] dip lr-save + STW ]
} cleave ;
M: ppc %epilogue ( n -- )
#! At the end of each word that calls a subroutine, we store
#! the previous link register value in r0 by popping it off
#! the stack, set the link register to the contents of r0,
#! and jump to the link register.
0 1 pick lr-save + LWZ
1 1 rot ADDI
[ [ 0 1 ] dip lr-save + LWZ ]
[ [ 1 1 ] dip ADDI ] bi
0 MTLR ;
:: (%boolean) ( dst temp word -- )
@ -541,17 +543,17 @@ GENERIC: STF ( src dst off reg-class -- )
M: single-float-regs STF drop STFS ;
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 -- )
M: single-float-regs LF drop LFS ;
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 -- )
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>> + ;
@ -559,8 +561,8 @@ M: stack-params %save-param-reg ( stack reg reg-class -- )
#! Funky. Read the parameter from the caller's stack frame.
#! This word is used in callbacks
drop
0 1 rot next-param@ LWZ
0 1 rot local@ STW ;
[ 0 1 ] dip next-param@ LWZ
[ 0 1 ] dip local@ STW ;
M: ppc %prepare-unbox ( -- )
! First parameter is top of stack
@ -580,14 +582,14 @@ M: ppc %unbox-long-long ( n func -- )
f %alien-invoke
! Store the return value on the C stack
[
3 1 pick local@ STW
4 1 rot cell + local@ STW
[ [ 3 1 ] dip local@ STW ]
[ [ 4 1 ] dip cell + local@ STW ] bi
] when* ;
M: ppc %unbox-large-struct ( n c-type -- )
! Value must be in r3
! 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
"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 f, then we assume the value is already in
! freg #0.
>r
over [ 0 over param-reg swap %load-param-reg ] [ 2drop ] if
r> f %alien-invoke ;
[ over [ 0 over param-reg swap %load-param-reg ] [ 2drop ] if ] dip
f %alien-invoke ;
M: ppc %box-long-long ( n func -- )
>r [
3 1 pick local@ LWZ
4 1 rot cell + local@ LWZ
] when* r> f %alien-invoke ;
[
[
[ [ 3 1 ] dip local@ LWZ ]
[ [ 4 1 ] dip cell + local@ LWZ ] bi
] when*
] dip f %alien-invoke ;
: struct-return@ ( n -- n )
[ stack-frame get params>> ] unless* local@ ;
@ -616,7 +619,7 @@ M: ppc %prepare-box-struct ( -- )
M: ppc %box-large-struct ( n c-type -- )
! If n = f, then we're boxing a returned struct
! 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
"box_value_struct" f %alien-invoke ;

View File

@ -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-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: float-regs return-reg drop XMM0 ;

View File

@ -79,9 +79,10 @@ big-endian off
! compute quotation location
temp0 temp1 ADD
! load quotation
temp0 temp0 array-start-offset [+] MOV
! execute branch
temp0 quot-xt-offset [+] JMP
arg temp0 array-start-offset [+] MOV
! execute branch. the quot must be in arg, since it might
! not be compiled yet
arg quot-xt-offset [+] JMP
] rc-absolute-cell rt-immediate 1 rex-length + jit-dispatch jit-define
: jit->r ( -- )

View File

@ -12,7 +12,7 @@ SYMBOL: delimiter
CHAR: , delimiter set-global
: delimiter> delimiter get ; inline
: delimiter> ( -- delimiter ) delimiter get ; inline
DEFER: quoted-field ( -- endchar )

View File

@ -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+ } "." } ;
HELP: <generator-bind>
{ $values { "slot-name" object } { "key" object } { "generator-singleton" object } { "type" object } { "generator-bind" generator-bind } }
{ $description "" } ;
HELP: <literal-bind>
{ $values { "key" object } { "type" object } { "value" object } { "literal-bind" literal-bind } }
{ $description "" } ;
HELP: <low-level-binding>
{ $values { "value" object } { "low-level-binding" low-level-binding } }
{ $description "" } ;
HELP: BIG-INTEGER

View File

@ -1,6 +1,6 @@
USING: definitions kernel parser words sequences math.parser
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
: editpadlite-path ( -- path )

View File

@ -1,6 +1,6 @@
USING: definitions kernel parser words sequences math.parser
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
: editpadpro-path ( -- path )

View File

@ -1,5 +1,6 @@
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
: editplus-path ( -- path )

View File

@ -1,5 +1,6 @@
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
: emeditor-path ( -- path )

View File

@ -1,7 +1,7 @@
! Copyright (C) 2008 Kibleur Christophe.
! See http://factorcode.org/license.txt for BSD license.
USING: editors io.files io.launcher kernel math.parser
namespaces sequences windows.shell32 io.paths.windows make ;
USING: editors io.files io.launcher kernel math.parser make
namespaces sequences windows.shell32 io.directories.search.windows ;
IN: editors.etexteditor
: etexteditor-path ( -- str )

View File

@ -1,5 +1,6 @@
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
M: windows gvim-path

View File

@ -1,10 +1,10 @@
USING: editors io.files io.launcher kernel math.parser
namespaces sequences windows.shell32 make ;
namespaces sequences windows.shell32 make io.pathnames ;
IN: editors.notepad2
: notepad2-path ( -- path )
\ notepad2-path get-global [
"C:\\Windows\\system32\\notepad.exe"
windows-directory "system32\\notepad.exe" append-path
] unless* ;
: notepad2 ( file line -- )

View File

@ -1,5 +1,5 @@
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
: notepadpp-path ( -- path )

View File

@ -1,7 +1,7 @@
! Copyright (C) 2007 Clemens F. Hofreither.
! See http://factorcode.org/license.txt for BSD license.
! 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 ;
IN: editors.scite

View File

@ -1,5 +1,5 @@
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
: ted-notepad-path ( -- path )

View File

@ -0,0 +1 @@
Doug Coleman

View File

@ -0,0 +1 @@
TextPad editor integration

View File

@ -0,0 +1 @@
unportable

View File

@ -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

View File

@ -1,5 +1,5 @@
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
: ultraedit-path ( -- path )

View File

@ -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
ARTICLE: { "vim" "vim" } "Vim support"

View File

@ -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 ;
IN: editors.wordpad

View File

@ -8,7 +8,7 @@ sequences ftp io.launcher.unix.parser unicode.case splitting
assocs classes io.servers.connection destructors calendar
io.timeouts io.streams.duplex threads continuations math
concurrency.promises byte-arrays io.backend tools.hexdump
tools.files io.streams.string ;
tools.files io.streams.string math.bitwise ;
IN: ftp.server
TUPLE: ftp-client url mode state command-promise user password ;
@ -49,7 +49,7 @@ C: <ftp-list> ftp-list
[ >>raw ] [ tokenize-command >>tokenized ] bi ;
: (send-response) ( n string separator -- )
rot number>string write write ftp-send ;
[ number>string write ] 2dip write ftp-send ;
: send-response ( ftp-response -- )
[ n>> ] [ strings>> ] bi
@ -102,7 +102,7 @@ ERROR: type-error type ;
: handle-TYPE ( obj -- )
[
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
] recover ;
@ -111,11 +111,11 @@ ERROR: type-error type ;
remote-address get class new 0 >>port binary <server> ;
: port>bytes ( port -- hi lo )
[ -8 shift ] keep [ HEX: ff bitand ] bi@ ;
[ -8 shift ] keep [ 8 bits ] bi@ ;
: handle-PWD ( obj -- )
drop
257 current-directory get "\"" "\"" surround server-response ;
257 current-directory get "\"" dup surround server-response ;
: handle-SYST ( obj -- )
drop
@ -155,15 +155,19 @@ M: ftp-list service-command ( stream obj -- )
finish-directory ;
: transfer-outgoing-file ( path -- )
150 "Opening BINARY mode data connection for "
rot
[ file-name ] [
" " swap file-info size>> number>string
"(" " bytes)." surround append
] bi 3append server-response ;
[
150
"Opening BINARY mode data connection for "
] dip
[
file-name
] [
file-info size>> number>string
"(" " bytes)." surround
] bi " " glue append server-response ;
: transfer-incoming-file ( path -- )
150 "Opening BINARY mode data connection for " rot append
[ 150 ] dip "Opening BINARY mode data connection for " prepend
server-response ;
: finish-file-transfer ( -- )
@ -209,8 +213,9 @@ M: ftp-put service-command ( stream obj -- )
: handle-SIZE ( obj -- )
[
[ 213 ] dip
tokenized>> second file-info size>>
213 swap number>string server-response
number>string server-response
] [
2drop
550 "Could not get file size" server-response
@ -228,21 +233,20 @@ M: ftp-put service-command ( stream obj -- )
: handle-PASV ( obj -- )
drop client get passive >>mode drop
expect-connection
[
"Entering Passive Mode (127,0,0,1," %
port>bytes [ number>string ] bi@ "," glue %
")" %
] "" make 227 swap server-response ;
221
expect-connection port>bytes [ number>string ] bi@ "," glue
"Entering Passive Mode (127,0,0,1," ")" surround
server-response ;
: handle-EPSV ( obj -- )
drop
client get command-promise>> [
"You already have a passive stream" ftp-error
] [
229 "Entering Extended Passive Mode (|||"
229
expect-connection number>string
"|)" 3append server-response
"Entering Extended Passive Mode (|||" "|)" surround
server-response
] if ;
! LPRT 6,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,242,186

View File

@ -10,8 +10,8 @@ HELP: <redirect>
{ $values { "url" url } { "response" response } }
{ $description "Creates a response which redirects the client to the given URL." } ;
HELP: <secure-only> ( responder -- responder' )
{ $values { "responder" "a responder" } { "responder'" "a responder" } }
HELP: <secure-only>
{ $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." } ;
HELP: <secure-redirect>

View File

@ -8,7 +8,8 @@ IN: grouping
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 )
[ check-groups ] dip boa ; inline

View File

@ -87,7 +87,8 @@ M: heap heap-size ( heap -- n )
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? ;

View File

@ -43,9 +43,9 @@ IN: help.lint
: check-values ( word element -- )
{
[ drop { [ symbol? ] [ macro? ] [ parsing-word? ] } 1|| ]
[ drop "declared-effect" word-prop not ]
[ nip contains-funky-elements? ]
[ drop macro? ]
[
[ effect-values >array ]
[ extract-values >array ]
@ -59,7 +59,7 @@ IN: help.lint
] each ;
: vocab-exists? ( name -- ? )
dup vocab swap "all-vocabs" get member? or ;
[ vocab ] [ "all-vocabs" get member? ] bi or ;
: check-modules ( element -- )
\ $vocab-link swap elements [

View File

@ -4,8 +4,8 @@ html.templates html.templates.chloe.syntax
html.templates.chloe.compiler html.templates.chloe.components
math xml.data strings quotations namespaces ;
HELP: <chloe> ( path -- template )
{ $values { "path" "a pathname string without the trailing " { $snippet ".xml" } " extension" } { "template" chloe } }
HELP: <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 } "." } ;
HELP: required-attr

View File

@ -1,7 +1,7 @@
IN: html.templates.fhtml
USING: help.markup help.syntax ;
HELP: <fhtml> ( path -- fhtml )
HELP: <fhtml>
{ $values { "path" "a pathname string" } { "fhtml" fhtml } }
{ $description "Creates an FHTML template descriptor." } ;

View File

@ -4,8 +4,8 @@ IN: http.server
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> } "." } ;
HELP: <trivial-responder> ( response -- responder )
{ $values { "response" response } { "responder" trivial-responder } }
HELP: <trivial-responder>
{ $values { "response" response } { "trivial-responder" trivial-responder } }
{ $description "Creates a new trivial responder which outputs the same response for every request." } ;
HELP: benchmark?

View File

@ -21,6 +21,9 @@ C: <io-callback> io-callback
[ (make-overlapped) ] dip
handle>> ptr>> [ over set-OVERLAPPED-offset ] when* ;
M: winnt FileArgs-overlapped ( port -- overlapped )
make-overlapped ;
: <completion-port> ( handle existing -- handle )
f 1 CreateIoCompletionPort dup win32-error=0/f ;

View File

@ -56,4 +56,4 @@ PRIVATE>
: find-in-directories ( directories bfs? quot -- path' )
'[ _ _ find-file ] attempt-all ; inline
os windows? [ "io.paths.windows" require ] when
os windows? [ "io.directories.search.windows" require ] when

View File

@ -1,7 +1,8 @@
! Copyright (C) 2008 Doug Coleman.
! See http://factorcode.org/license.txt for BSD license.
USING: arrays fry io.pathnames kernel sequences windows.shell32 ;
IN: io.paths
USING: arrays fry io.pathnames kernel sequences windows.shell32
io.directories.search ;
IN: io.directories.search.windows
: program-files-directories ( -- array )
program-files program-files-x86 2array ; inline

View File

@ -0,0 +1 @@
unportable

View File

@ -0,0 +1 @@
unportable

View File

@ -0,0 +1 @@
unportable

View File

@ -11,14 +11,15 @@ M: unix cwd ( -- path )
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 ;
M: unix (file-reader) ( path -- stream )
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 )
write-flags file-mode open-file ;
@ -26,7 +27,8 @@ M: unix (file-reader) ( path -- stream )
M: unix (file-writer) ( path -- stream )
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 )
[

View File

@ -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 ;
IN: io.files.windows.nt.tests

View File

@ -1,10 +1,10 @@
USING: continuations destructors io.buffers io.files io.backend
io.timeouts io.ports io.pathnames io.files.private io.backend.windows
io.files.windows io.backend.windows.nt io.encodings.utf16n
windows windows.kernel32 kernel libc math threads system
environment alien.c-types alien.arrays alien.strings sequences
combinators combinators.short-circuit ascii splitting alien
strings assocs namespaces make accessors tr ;
io.timeouts io.ports io.pathnames io.files.private
io.backend.windows io.files.windows io.encodings.utf16n windows
windows.kernel32 kernel libc math threads system environment
alien.c-types alien.arrays alien.strings sequences combinators
combinators.short-circuit ascii splitting alien strings assocs
namespaces make accessors tr ;
IN: io.files.windows.nt
M: winnt cwd
@ -44,9 +44,6 @@ M: winnt normalize-path ( string -- string' )
M: winnt CreateFile-flags ( DWORD -- DWORD )
FILE_FLAG_OVERLAPPED bitor ;
M: winnt FileArgs-overlapped ( port -- overlapped )
make-overlapped ;
M: winnt open-append
0 ! [ dup file-info size>> ] [ drop 0 ] recover
[ (open-append) ] dip >>ptr ;

View File

@ -1,6 +1,7 @@
USING: io.launcher tools.test calendar accessors environment
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
[ ] [

View File

@ -86,7 +86,7 @@ ARTICLE: "ssl-contexts" "Secure socket contexts"
HELP: secure
{ $class-description "The class of secure socket addresses." } ;
HELP: <secure> ( addrspec -- secure )
HELP: <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> } "." } ;

View File

@ -15,7 +15,7 @@ HELP: duplex-stream
{ $class-description "A bidirectional stream wrapping an input and output 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." } ;
HELP: with-stream

View File

@ -150,7 +150,7 @@ HELP: input
{ $code "\"2 3 + .\" dup <input> write-object nl" }
} ;
HELP: <input> ( string -- input )
HELP: <input>
{ $values { "string" string } { "input" input } }
{ $description "Creates a new " { $link input } "." } ;

View File

@ -3,6 +3,6 @@
USING: slots.private ;
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

5
basis/math/bitwise/bitwise.factor Normal file → Executable file
View File

@ -66,7 +66,10 @@ DEFER: byte-bit-count
\ byte-bit-count
256 [
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
>>

View File

@ -46,7 +46,8 @@ M: real sqrt
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
[ factor-2s ] dip [ (^n) ] keep rot * shift ;

View File

@ -11,7 +11,7 @@ HELP: 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 } } }
{ $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
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 } } }
{ $description "Creates a new rectangle with the specified top-left and bottom-right corner locations." } ;

View File

@ -93,7 +93,7 @@ $nl
$nl
"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 } }
{ $description "Creates a new interval. Usually it is more convenient to create intervals using one of the following words instead:"
{ $list

View File

@ -11,7 +11,7 @@ SYMBOL: full-interval
TUPLE: interval { from read-only } { to read-only } ;
: <interval> ( from to -- int )
: <interval> ( from to -- interval )
2dup [ first ] bi@ {
{ [ 2dup > ] [ 2drop 2drop empty-interval ] }
{ [ 2dup = ] [

View File

@ -10,7 +10,7 @@ IN: math.quaternions
<PRIVATE
: ** conjugate * ; inline
: ** ( x y -- z ) conjugate * ; inline
: 2q ( u v -- u' u'' v' v'' ) [ first2 ] bi@ ; inline

View File

@ -20,11 +20,11 @@ M: range nth-unsafe ( n range -- obj )
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

View File

@ -20,7 +20,7 @@ $nl
$nl
"Mirrors are created by calling " { $link <mirror> } " or " { $link make-mirror } "." } ;
HELP: <mirror> ( object -- mirror )
HELP: <mirror>
{ $values { "object" object } { "mirror" mirror } }
{ $description "Creates a " { $link mirror } " reflecting an object." }
{ $examples

View File

@ -22,7 +22,8 @@ PRIVATE>
: STRING:
CREATE-WORD
parse-here 1quotation define-inline ; parsing
parse-here 1quotation
(( -- string )) define-inline ; parsing
<PRIVATE
: (parse-multiline-string) ( start-index end-text -- end-index )

View File

@ -12,7 +12,7 @@ TUPLE: nibble-array
: nibble BIN: 1111 ; inline
: nibbles>bytes 1 + 2/ ; inline
: nibbles>bytes ( m -- n ) 1 + 2/ ; inline
: byte/nibble ( n -- shift n' )
[ 1 bitand 2 shift ] [ -1 shift ] bi ; inline

File diff suppressed because it is too large Load Diff

View File

@ -2,7 +2,8 @@
! Portions copyright (C) 2008 Slava Pestov
! See http://factorcode.org/license.txt for BSD license.
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
@ -13,64 +14,64 @@ IN: openssl.libssl
{ [ os unix? ] [ "libssl" "libssl.so" "cdecl" add-library ] }
} cond >>
: X509_FILETYPE_PEM 1 ; inline
: X509_FILETYPE_ASN1 2 ; inline
: X509_FILETYPE_DEFAULT 3 ; inline
CONSTANT: X509_FILETYPE_PEM 1
CONSTANT: X509_FILETYPE_ASN1 2
CONSTANT: X509_FILETYPE_DEFAULT 3
: SSL_FILETYPE_ASN1 X509_FILETYPE_ASN1 ; inline
: SSL_FILETYPE_PEM X509_FILETYPE_PEM ; inline
ALIAS: SSL_FILETYPE_ASN1 X509_FILETYPE_ASN1
ALIAS: SSL_FILETYPE_PEM X509_FILETYPE_PEM
: SSL_CTRL_NEED_TMP_RSA 1 ; inline
: SSL_CTRL_SET_TMP_RSA 2 ; inline
: SSL_CTRL_SET_TMP_DH 3 ; inline
: SSL_CTRL_SET_TMP_RSA_CB 4 ; inline
: SSL_CTRL_SET_TMP_DH_CB 5 ; inline
CONSTANT: SSL_CTRL_NEED_TMP_RSA 1
CONSTANT: SSL_CTRL_SET_TMP_RSA 2
CONSTANT: SSL_CTRL_SET_TMP_DH 3
CONSTANT: SSL_CTRL_SET_TMP_RSA_CB 4
CONSTANT: SSL_CTRL_SET_TMP_DH_CB 5
: SSL_CTRL_GET_SESSION_REUSED 6 ; inline
: SSL_CTRL_GET_CLIENT_CERT_REQUEST 7 ; inline
: SSL_CTRL_GET_NUM_RENEGOTIATIONS 8 ; inline
: SSL_CTRL_CLEAR_NUM_RENEGOTIATIONS 9 ; inline
: SSL_CTRL_GET_TOTAL_RENEGOTIATIONS 10 ; inline
: SSL_CTRL_GET_FLAGS 11 ; inline
: SSL_CTRL_EXTRA_CHAIN_CERT 12 ; inline
CONSTANT: SSL_CTRL_GET_SESSION_REUSED 6
CONSTANT: SSL_CTRL_GET_CLIENT_CERT_REQUEST 7
CONSTANT: SSL_CTRL_GET_NUM_RENEGOTIATIONS 8
CONSTANT: SSL_CTRL_CLEAR_NUM_RENEGOTIATIONS 9
CONSTANT: SSL_CTRL_GET_TOTAL_RENEGOTIATIONS 10
CONSTANT: SSL_CTRL_GET_FLAGS 11
CONSTANT: SSL_CTRL_EXTRA_CHAIN_CERT 12
: SSL_CTRL_SET_MSG_CALLBACK 13 ; inline
: SSL_CTRL_SET_MSG_CALLBACK_ARG 14 ; inline
CONSTANT: SSL_CTRL_SET_MSG_CALLBACK 13
CONSTANT: SSL_CTRL_SET_MSG_CALLBACK_ARG 14
: SSL_CTRL_SESS_NUMBER 20 ; inline
: SSL_CTRL_SESS_CONNECT 21 ; inline
: SSL_CTRL_SESS_CONNECT_GOOD 22 ; inline
: SSL_CTRL_SESS_CONNECT_RENEGOTIATE 23 ; inline
: SSL_CTRL_SESS_ACCEPT 24 ; inline
: SSL_CTRL_SESS_ACCEPT_GOOD 25 ; inline
: SSL_CTRL_SESS_ACCEPT_RENEGOTIATE 26 ; inline
: SSL_CTRL_SESS_HIT 27 ; inline
: SSL_CTRL_SESS_CB_HIT 28 ; inline
: SSL_CTRL_SESS_MISSES 29 ; inline
: SSL_CTRL_SESS_TIMEOUTS 30 ; inline
: SSL_CTRL_SESS_CACHE_FULL 31 ; inline
: SSL_CTRL_OPTIONS 32 ; inline
: SSL_CTRL_MODE 33 ; inline
CONSTANT: SSL_CTRL_SESS_NUMBER 20
CONSTANT: SSL_CTRL_SESS_CONNECT 21
CONSTANT: SSL_CTRL_SESS_CONNECT_GOOD 22
CONSTANT: SSL_CTRL_SESS_CONNECT_RENEGOTIATE 23
CONSTANT: SSL_CTRL_SESS_ACCEPT 24
CONSTANT: SSL_CTRL_SESS_ACCEPT_GOOD 25
CONSTANT: SSL_CTRL_SESS_ACCEPT_RENEGOTIATE 26
CONSTANT: SSL_CTRL_SESS_HIT 27
CONSTANT: SSL_CTRL_SESS_CB_HIT 28
CONSTANT: SSL_CTRL_SESS_MISSES 29
CONSTANT: SSL_CTRL_SESS_TIMEOUTS 30
CONSTANT: SSL_CTRL_SESS_CACHE_FULL 31
CONSTANT: SSL_CTRL_OPTIONS 32
CONSTANT: SSL_CTRL_MODE 33
: SSL_CTRL_GET_READ_AHEAD 40 ; inline
: SSL_CTRL_SET_READ_AHEAD 41 ; inline
: SSL_CTRL_SET_SESS_CACHE_SIZE 42 ; inline
: SSL_CTRL_GET_SESS_CACHE_SIZE 43 ; inline
: SSL_CTRL_SET_SESS_CACHE_MODE 44 ; inline
: SSL_CTRL_GET_SESS_CACHE_MODE 45 ; inline
CONSTANT: SSL_CTRL_GET_READ_AHEAD 40
CONSTANT: SSL_CTRL_SET_READ_AHEAD 41
CONSTANT: SSL_CTRL_SET_SESS_CACHE_SIZE 42
CONSTANT: SSL_CTRL_GET_SESS_CACHE_SIZE 43
CONSTANT: SSL_CTRL_SET_SESS_CACHE_MODE 44
CONSTANT: SSL_CTRL_GET_SESS_CACHE_MODE 45
: SSL_CTRL_GET_MAX_CERT_LIST 50 ; inline
: SSL_CTRL_SET_MAX_CERT_LIST 51 ; inline
CONSTANT: SSL_CTRL_GET_MAX_CERT_LIST 50
CONSTANT: SSL_CTRL_SET_MAX_CERT_LIST 51
: SSL_ERROR_NONE 0 ; inline
: SSL_ERROR_SSL 1 ; inline
: SSL_ERROR_WANT_READ 2 ; inline
: SSL_ERROR_WANT_WRITE 3 ; inline
: SSL_ERROR_WANT_X509_LOOKUP 4 ; inline
: SSL_ERROR_SYSCALL 5 ; inline ! consult errno for details
: SSL_ERROR_ZERO_RETURN 6 ; inline
: SSL_ERROR_WANT_CONNECT 7 ; inline
: SSL_ERROR_WANT_ACCEPT 8 ; inline
CONSTANT: SSL_ERROR_NONE 0
CONSTANT: SSL_ERROR_SSL 1
CONSTANT: SSL_ERROR_WANT_READ 2
CONSTANT: SSL_ERROR_WANT_WRITE 3
CONSTANT: SSL_ERROR_WANT_X509_LOOKUP 4
CONSTANT: SSL_ERROR_SYSCALL 5 ! consult errno for details
CONSTANT: SSL_ERROR_ZERO_RETURN 6
CONSTANT: SSL_ERROR_WANT_CONNECT 7
CONSTANT: SSL_ERROR_WANT_ACCEPT 8
! Error messages table
: error-messages ( -- hash )
@ -157,8 +158,8 @@ FUNCTION: int SSL_read ( SSL* ssl, void* buf, int num ) ;
FUNCTION: int SSL_shutdown ( SSL* ssl ) ;
: SSL_SENT_SHUTDOWN 1 ;
: SSL_RECEIVED_SHUTDOWN 2 ;
CONSTANT: SSL_SENT_SHUTDOWN 1
CONSTANT: SSL_RECEIVED_SHUTDOWN 2
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 ) ;
: SSL_NOTHING 1 ; inline
: SSL_WRITING 2 ; inline
: SSL_READING 3 ; inline
: SSL_X509_LOOKUP 4 ; inline
CONSTANT: SSL_NOTHING 1
CONSTANT: SSL_WRITING 2
CONSTANT: SSL_READING 3
CONSTANT: SSL_X509_LOOKUP 4
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 ) ;
: SSL_VERIFY_NONE 0 ; inline
: SSL_VERIFY_PEER 1 ; inline
: SSL_VERIFY_FAIL_IF_NO_PEER_CERT 2 ; inline
: SSL_VERIFY_CLIENT_ONCE 4 ; inline
CONSTANT: SSL_VERIFY_NONE 0
CONSTANT: SSL_VERIFY_PEER 1
CONSTANT: SSL_VERIFY_FAIL_IF_NO_PEER_CERT 2
CONSTANT: SSL_VERIFY_CLIENT_ONCE 4
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_CTRL_SET_SESS_CACHE_MODE ] dip f SSL_CTX_ctrl ;
: SSL_SESS_CACHE_OFF HEX: 0000 ; inline
: SSL_SESS_CACHE_CLIENT HEX: 0001 ; inline
: SSL_SESS_CACHE_SERVER HEX: 0002 ; inline
CONSTANT: SSL_SESS_CACHE_OFF HEX: 0000
CONSTANT: SSL_SESS_CACHE_CLIENT HEX: 0001
CONSTANT: SSL_SESS_CACHE_SERVER HEX: 0002
: SSL_SESS_CACHE_BOTH ( -- n )
{ SSL_SESS_CACHE_CLIENT SSL_SESS_CACHE_SERVER } flags ; inline
: SSL_SESS_CACHE_NO_AUTO_CLEAR HEX: 0080 ; inline
: SSL_SESS_CACHE_NO_INTERNAL_LOOKUP HEX: 0100 ; inline
: SSL_SESS_CACHE_NO_INTERNAL_STORE HEX: 0200 ; inline
CONSTANT: SSL_SESS_CACHE_NO_AUTO_CLEAR HEX: 0080
CONSTANT: SSL_SESS_CACHE_NO_INTERNAL_LOOKUP HEX: 0100
CONSTANT: SSL_SESS_CACHE_NO_INTERNAL_STORE HEX: 0200
: SSL_SESS_CACHE_NO_INTERNAL ( -- n )
{ 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_:
scan "X509_V_" prepend create-in
scan-word
[ 1quotation define-inline ]
[ verify-messages get set-at ] 2bi ; parsing
[ 1quotation (( -- value )) define-inline ]
[ verify-messages get set-at ]
2bi ; parsing
>>
@ -333,4 +335,4 @@ X509_V_: ERR_APPLICATION_VERIFICATION 50
! obj_mac.h
! ===============================================
: NID_commonName 13 ; inline
CONSTANT: NID_commonName 13

View File

@ -22,9 +22,9 @@ M: persistent-vector length count>> ;
: 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-mask ] [ children>> ] bi* nth ;

View File

@ -5,7 +5,7 @@ IN: refs
TUPLE: ref assoc key ;
: >ref< [ key>> ] [ assoc>> ] bi ; inline
: >ref< ( ref -- key value ) [ key>> ] [ assoc>> ] bi ; inline
: delete-ref ( ref -- ) >ref< delete-at ;
GENERIC: get-ref ( ref -- obj )

View File

@ -10,6 +10,6 @@ $nl
ABOUT: "search-deques"
HELP: <search-deque> ( assoc deque -- search-deque )
HELP: <search-deque>
{ $values { "assoc" assoc } { "deque" deque } { "search-deque" search-deque } }
{ $description "Creates a new " { $link search-deque } "." } ;

View File

@ -3,7 +3,8 @@ IN: sequences.next
<PRIVATE
: iterate-seq [ dup length swap ] dip ; inline
: iterate-seq ( seq quot -- i seq quot )
[ [ length ] keep ] dip ; inline
: (map-next) ( i seq quot -- )
! this uses O(n) more bounds checks than is really necessary

View File

@ -25,7 +25,7 @@ HELP: no-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." } ;
HELP: <plain-auth> ( username password -- plain-auth )
HELP: <plain-auth>
{ $values { "username" string } { "password" string } { "plain-auth" plain-auth } }
{ $description "Creates a new " { $link plain-auth } " instance." } ;

View File

@ -18,7 +18,7 @@ WHERE
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
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 ;
: >V V new clone-like ; inline
: >V ( seq -- vector ) V new clone-like ; inline
M: V pprint-delims drop V{ \ } ;

View File

@ -145,7 +145,6 @@ M: object apply-object push-literal ;
: effect-required? ( word -- ? )
{
{ [ dup inline? ] [ drop f ] }
{ [ dup deferred? ] [ drop f ] }
{ [ dup crossref? not ] [ drop f ] }
[ def>> [ word? ] contains? ]

View File

@ -20,8 +20,9 @@ TYPEDEF: char[592] ud
FUNCTION: void ud_translate_intel ( ud* u ) ;
FUNCTION: void ud_translate_att ( ud* u ) ;
: UD_SYN_INTEL &: ud_translate_intel ; inline
: UD_SYN_ATT &: ud_translate_att ; inline
: UD_SYN_INTEL ( -- addr ) &: ud_translate_intel ; inline
: UD_SYN_ATT ( -- addr ) &: ud_translate_att ; inline
: UD_EOI -1 ; inline
: UD_INP_CACHE_SZ 32 ; inline
: UD_VENDOR_AMD 0 ; inline

View File

@ -2,7 +2,7 @@
! See http://factorcode.org/license.txt for BSD license.
USING: accessors calendar.format combinators io.files
kernel math.parser sequences splitting system tools.files
generalizations tools.files.private ;
generalizations tools.files.private io.files.info ;
IN: tools.files.windows
<PRIVATE

View File

@ -78,9 +78,9 @@ SYMBOL: dpi
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 )
face-size face-size-y-scale FT_MulFix ;

View File

@ -11,7 +11,7 @@ C: <grid-lines> grid-lines
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 )
half-gap v-

View File

@ -49,8 +49,8 @@ HELP: <pane-control>
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> } "." } ;
HELP: <pane-stream> ( pane -- stream )
{ $values { "pane" pane } { "stream" "a new " { $link pane-stream } } }
HELP: <pane-stream>
{ $values { "pane" pane } { "pane-stream" "a new " { $link pane-stream } } }
{ $description "Creates a new " { $link pane-stream } " for writing to " { $snippet "pane" } "." } ;
{ with-pane make-pane } related-words

View File

@ -1,30 +1,31 @@
! Copyright (C) 2005, 2006 Slava Pestov.
! 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
: MAXPATHLEN 1024 ; inline
CONSTANT: MAXPATHLEN 1024
: O_RDONLY HEX: 0000 ; inline
: O_WRONLY HEX: 0001 ; inline
: O_RDWR HEX: 0002 ; inline
: O_NONBLOCK HEX: 0004 ; inline
: O_APPEND HEX: 0008 ; inline
: O_CREAT HEX: 0200 ; inline
: O_TRUNC HEX: 0400 ; inline
: O_EXCL HEX: 0800 ; inline
: O_NOCTTY HEX: 20000 ; inline
: O_NDELAY O_NONBLOCK ; inline
CONSTANT: O_RDONLY HEX: 0000
CONSTANT: O_WRONLY HEX: 0001
CONSTANT: O_RDWR HEX: 0002
CONSTANT: O_NONBLOCK HEX: 0004
CONSTANT: O_APPEND HEX: 0008
CONSTANT: O_CREAT HEX: 0200
CONSTANT: O_TRUNC HEX: 0400
CONSTANT: O_EXCL HEX: 0800
CONSTANT: O_NOCTTY HEX: 20000
ALIAS: O_NDELAY O_NONBLOCK
: SOL_SOCKET HEX: ffff ; inline
: SO_REUSEADDR HEX: 4 ; inline
: SO_OOBINLINE HEX: 100 ; inline
: SO_SNDTIMEO HEX: 1005 ; inline
: SO_RCVTIMEO HEX: 1006 ; inline
CONSTANT: SOL_SOCKET HEX: ffff
CONSTANT: SO_REUSEADDR HEX: 4
CONSTANT: SO_OOBINLINE HEX: 100
CONSTANT: SO_SNDTIMEO HEX: 1005
CONSTANT: SO_RCVTIMEO HEX: 1006
: F_SETFD 2 ; inline
: F_SETFL 4 ; inline
: FD_CLOEXEC 1 ; inline
CONSTANT: F_SETFD 2
CONSTANT: F_SETFL 4
CONSTANT: FD_CLOEXEC 1
C-STRUCT: sockaddr-in
{ "uchar" "len" }
@ -59,29 +60,29 @@ C-STRUCT: passwd
{ "time_t" "pw_expire" }
{ "int" "pw_fields" } ;
: max-un-path 104 ; inline
CONSTANT: max-un-path 104
: SOCK_STREAM 1 ; inline
: SOCK_DGRAM 2 ; inline
CONSTANT: SOCK_STREAM 1
CONSTANT: SOCK_DGRAM 2
: AF_UNSPEC 0 ; inline
: AF_UNIX 1 ; inline
: AF_INET 2 ; inline
: AF_INET6 30 ; inline
CONSTANT: AF_UNSPEC 0
CONSTANT: AF_UNIX 1
CONSTANT: AF_INET 2
CONSTANT: AF_INET6 30
: PF_UNSPEC AF_UNSPEC ; inline
: PF_UNIX AF_UNIX ; inline
: PF_INET AF_INET ; inline
: PF_INET6 AF_INET6 ; inline
ALIAS: PF_UNSPEC AF_UNSPEC
ALIAS: PF_UNIX AF_UNIX
ALIAS: PF_INET AF_INET
ALIAS: PF_INET6 AF_INET6
: IPPROTO_TCP 6 ; inline
: IPPROTO_UDP 17 ; inline
CONSTANT: IPPROTO_TCP 6
CONSTANT: IPPROTO_UDP 17
: AI_PASSIVE 1 ; inline
CONSTANT: AI_PASSIVE 1
: SEEK_SET 0 ; inline
: SEEK_CUR 1 ; inline
: SEEK_END 2 ; inline
CONSTANT: SEEK_SET 0
CONSTANT: SEEK_CUR 1
CONSTANT: SEEK_END 2
os {
{ macosx [ "unix.bsd.macosx" require ] }

View File

@ -1,4 +1,4 @@
USING: alien.syntax ;
USING: alien.syntax alias constants ;
IN: unix
: FD_SETSIZE 1024 ;
@ -20,97 +20,97 @@ C-STRUCT: dirent
{ "u_int8_t" "d_namlen" }
{ { "char" 256 } "d_name" } ;
: EPERM 1 ; inline
: ENOENT 2 ; inline
: ESRCH 3 ; inline
: EINTR 4 ; inline
: EIO 5 ; inline
: ENXIO 6 ; inline
: E2BIG 7 ; inline
: ENOEXEC 8 ; inline
: EBADF 9 ; inline
: ECHILD 10 ; inline
: EDEADLK 11 ; inline
: ENOMEM 12 ; inline
: EACCES 13 ; inline
: EFAULT 14 ; inline
: ENOTBLK 15 ; inline
: EBUSY 16 ; inline
: EEXIST 17 ; inline
: EXDEV 18 ; inline
: ENODEV 19 ; inline
: ENOTDIR 20 ; inline
: EISDIR 21 ; inline
: EINVAL 22 ; inline
: ENFILE 23 ; inline
: EMFILE 24 ; inline
: ENOTTY 25 ; inline
: ETXTBSY 26 ; inline
: EFBIG 27 ; inline
: ENOSPC 28 ; inline
: ESPIPE 29 ; inline
: EROFS 30 ; inline
: EMLINK 31 ; inline
: EPIPE 32 ; inline
: EDOM 33 ; inline
: ERANGE 34 ; inline
: EAGAIN 35 ; inline
: EWOULDBLOCK EAGAIN ; inline
: EINPROGRESS 36 ; inline
: EALREADY 37 ; inline
: ENOTSOCK 38 ; inline
: EDESTADDRREQ 39 ; inline
: EMSGSIZE 40 ; inline
: EPROTOTYPE 41 ; inline
: ENOPROTOOPT 42 ; inline
: EPROTONOSUPPORT 43 ; inline
: ESOCKTNOSUPPORT 44 ; inline
: EOPNOTSUPP 45 ; inline
: ENOTSUP EOPNOTSUPP ; inline
: EPFNOSUPPORT 46 ; inline
: EAFNOSUPPORT 47 ; inline
: EADDRINUSE 48 ; inline
: EADDRNOTAVAIL 49 ; inline
: ENETDOWN 50 ; inline
: ENETUNREACH 51 ; inline
: ENETRESET 52 ; inline
: ECONNABORTED 53 ; inline
: ECONNRESET 54 ; inline
: ENOBUFS 55 ; inline
: EISCONN 56 ; inline
: ENOTCONN 57 ; inline
: ESHUTDOWN 58 ; inline
: ETOOMANYREFS 59 ; inline
: ETIMEDOUT 60 ; inline
: ECONNREFUSED 61 ; inline
: ELOOP 62 ; inline
: ENAMETOOLONG 63 ; inline
: EHOSTDOWN 64 ; inline
: EHOSTUNREACH 65 ; inline
: ENOTEMPTY 66 ; inline
: EPROCLIM 67 ; inline
: EUSERS 68 ; inline
: EDQUOT 69 ; inline
: ESTALE 70 ; inline
: EREMOTE 71 ; inline
: EBADRPC 72 ; inline
: ERPCMISMATCH 73 ; inline
: EPROGUNAVAIL 74 ; inline
: EPROGMISMATCH 75 ; inline
: EPROCUNAVAIL 76 ; inline
: ENOLCK 77 ; inline
: ENOSYS 78 ; inline
: EFTYPE 79 ; inline
: EAUTH 80 ; inline
: ENEEDAUTH 81 ; inline
: EIDRM 82 ; inline
: ENOMSG 83 ; inline
: EOVERFLOW 84 ; inline
: ECANCELED 85 ; inline
: EILSEQ 86 ; inline
: ENOATTR 87 ; inline
: EDOOFUS 88 ; inline
: EBADMSG 89 ; inline
: EMULTIHOP 90 ; inline
: ENOLINK 91 ; inline
: EPROTO 92 ; inline
CONSTANT: EPERM 1
CONSTANT: ENOENT 2
CONSTANT: ESRCH 3
CONSTANT: EINTR 4
CONSTANT: EIO 5
CONSTANT: ENXIO 6
CONSTANT: E2BIG 7
CONSTANT: ENOEXEC 8
CONSTANT: EBADF 9
CONSTANT: ECHILD 10
CONSTANT: EDEADLK 11
CONSTANT: ENOMEM 12
CONSTANT: EACCES 13
CONSTANT: EFAULT 14
CONSTANT: ENOTBLK 15
CONSTANT: EBUSY 16
CONSTANT: EEXIST 17
CONSTANT: EXDEV 18
CONSTANT: ENODEV 19
CONSTANT: ENOTDIR 20
CONSTANT: EISDIR 21
CONSTANT: EINVAL 22
CONSTANT: ENFILE 23
CONSTANT: EMFILE 24
CONSTANT: ENOTTY 25
CONSTANT: ETXTBSY 26
CONSTANT: EFBIG 27
CONSTANT: ENOSPC 28
CONSTANT: ESPIPE 29
CONSTANT: EROFS 30
CONSTANT: EMLINK 31
CONSTANT: EPIPE 32
CONSTANT: EDOM 33
CONSTANT: ERANGE 34
CONSTANT: EAGAIN 35
ALIAS: EWOULDBLOCK EAGAIN
CONSTANT: EINPROGRESS 36
CONSTANT: EALREADY 37
CONSTANT: ENOTSOCK 38
CONSTANT: EDESTADDRREQ 39
CONSTANT: EMSGSIZE 40
CONSTANT: EPROTOTYPE 41
CONSTANT: ENOPROTOOPT 42
CONSTANT: EPROTONOSUPPORT 43
CONSTANT: ESOCKTNOSUPPORT 44
CONSTANT: EOPNOTSUPP 45
ALIAS: ENOTSUP EOPNOTSUPP
CONSTANT: EPFNOSUPPORT 46
CONSTANT: EAFNOSUPPORT 47
CONSTANT: EADDRINUSE 48
CONSTANT: EADDRNOTAVAIL 49
CONSTANT: ENETDOWN 50
CONSTANT: ENETUNREACH 51
CONSTANT: ENETRESET 52
CONSTANT: ECONNABORTED 53
CONSTANT: ECONNRESET 54
CONSTANT: ENOBUFS 55
CONSTANT: EISCONN 56
CONSTANT: ENOTCONN 57
CONSTANT: ESHUTDOWN 58
CONSTANT: ETOOMANYREFS 59
CONSTANT: ETIMEDOUT 60
CONSTANT: ECONNREFUSED 61
CONSTANT: ELOOP 62
CONSTANT: ENAMETOOLONG 63
CONSTANT: EHOSTDOWN 64
CONSTANT: EHOSTUNREACH 65
CONSTANT: ENOTEMPTY 66
CONSTANT: EPROCLIM 67
CONSTANT: EUSERS 68
CONSTANT: EDQUOT 69
CONSTANT: ESTALE 70
CONSTANT: EREMOTE 71
CONSTANT: EBADRPC 72
CONSTANT: ERPCMISMATCH 73
CONSTANT: EPROGUNAVAIL 74
CONSTANT: EPROGMISMATCH 75
CONSTANT: EPROCUNAVAIL 76
CONSTANT: ENOLCK 77
CONSTANT: ENOSYS 78
CONSTANT: EFTYPE 79
CONSTANT: EAUTH 80
CONSTANT: ENEEDAUTH 81
CONSTANT: EIDRM 82
CONSTANT: ENOMSG 83
CONSTANT: EOVERFLOW 84
CONSTANT: ECANCELED 85
CONSTANT: EILSEQ 86
CONSTANT: ENOATTR 87
CONSTANT: EDOOFUS 88
CONSTANT: EBADMSG 89
CONSTANT: EMULTIHOP 90
CONSTANT: ENOLINK 91
CONSTANT: EPROTO 92

View File

@ -1,7 +1,7 @@
USING: alien.syntax unix.time ;
USING: alien.syntax unix.time alias constants ;
IN: unix
: FD_SETSIZE 1024 ; inline
CONSTANT: FD_SETSIZE 1024
C-STRUCT: addrinfo
{ "int" "flags" }
@ -13,10 +13,10 @@ C-STRUCT: addrinfo
{ "void*" "addr" }
{ "addrinfo*" "next" } ;
: _UTX_USERSIZE 256 ; inline
: _UTX_LINESIZE 32 ; inline
: _UTX_IDSIZE 4 ; inline
: _UTX_HOSTSIZE 256 ; inline
CONSTANT: _UTX_USERSIZE 256
CONSTANT: _UTX_LINESIZE 32
CONSTANT: _UTX_IDSIZE 4
CONSTANT: _UTX_HOSTSIZE 256
C-STRUCT: utmpx
{ { "char" _UTX_USERSIZE } "ut_user" }
@ -28,9 +28,9 @@ C-STRUCT: utmpx
{ { "char" _UTX_HOSTSIZE } "ut_host" }
{ { "uint" 16 } "ut_pad" } ;
: __DARWIN_MAXPATHLEN 1024 ; inline
: __DARWIN_MAXNAMELEN 255 ; inline
: __DARWIN_MAXNAMELEN+1 255 ; inline
CONSTANT: __DARWIN_MAXPATHLEN 1024
CONSTANT: __DARWIN_MAXNAMELEN 255
CONSTANT: __DARWIN_MAXNAMELEN+1 255
C-STRUCT: dirent
{ "ino_t" "d_ino" }
@ -39,107 +39,107 @@ C-STRUCT: dirent
{ "__uint8_t" "d_namlen" }
{ { "char" __DARWIN_MAXNAMELEN+1 } "d_name" } ;
: EPERM 1 ; inline
: ENOENT 2 ; inline
: ESRCH 3 ; inline
: EINTR 4 ; inline
: EIO 5 ; inline
: ENXIO 6 ; inline
: E2BIG 7 ; inline
: ENOEXEC 8 ; inline
: EBADF 9 ; inline
: ECHILD 10 ; inline
: EDEADLK 11 ; inline
: ENOMEM 12 ; inline
: EACCES 13 ; inline
: EFAULT 14 ; inline
: ENOTBLK 15 ; inline
: EBUSY 16 ; inline
: EEXIST 17 ; inline
: EXDEV 18 ; inline
: ENODEV 19 ; inline
: ENOTDIR 20 ; inline
: EISDIR 21 ; inline
: EINVAL 22 ; inline
: ENFILE 23 ; inline
: EMFILE 24 ; inline
: ENOTTY 25 ; inline
: ETXTBSY 26 ; inline
: EFBIG 27 ; inline
: ENOSPC 28 ; inline
: ESPIPE 29 ; inline
: EROFS 30 ; inline
: EMLINK 31 ; inline
: EPIPE 32 ; inline
: EDOM 33 ; inline
: ERANGE 34 ; inline
: EAGAIN 35 ; inline
: EWOULDBLOCK EAGAIN ; inline
: EINPROGRESS 36 ; inline
: EALREADY 37 ; inline
: ENOTSOCK 38 ; inline
: EDESTADDRREQ 39 ; inline
: EMSGSIZE 40 ; inline
: EPROTOTYPE 41 ; inline
: ENOPROTOOPT 42 ; inline
: EPROTONOSUPPORT 43 ; inline
: ESOCKTNOSUPPORT 44 ; inline
: ENOTSUP 45 ; inline
: EPFNOSUPPORT 46 ; inline
: EAFNOSUPPORT 47 ; inline
: EADDRINUSE 48 ; inline
: EADDRNOTAVAIL 49 ; inline
: ENETDOWN 50 ; inline
: ENETUNREACH 51 ; inline
: ENETRESET 52 ; inline
: ECONNABORTED 53 ; inline
: ECONNRESET 54 ; inline
: ENOBUFS 55 ; inline
: EISCONN 56 ; inline
: ENOTCONN 57 ; inline
: ESHUTDOWN 58 ; inline
: ETOOMANYREFS 59 ; inline
: ETIMEDOUT 60 ; inline
: ECONNREFUSED 61 ; inline
: ELOOP 62 ; inline
: ENAMETOOLONG 63 ; inline
: EHOSTDOWN 64 ; inline
: EHOSTUNREACH 65 ; inline
: ENOTEMPTY 66 ; inline
: EPROCLIM 67 ; inline
: EUSERS 68 ; inline
: EDQUOT 69 ; inline
: ESTALE 70 ; inline
: EREMOTE 71 ; inline
: EBADRPC 72 ; inline
: ERPCMISMATCH 73 ; inline
: EPROGUNAVAIL 74 ; inline
: EPROGMISMATCH 75 ; inline
: EPROCUNAVAIL 76 ; inline
: ENOLCK 77 ; inline
: ENOSYS 78 ; inline
: EFTYPE 79 ; inline
: EAUTH 80 ; inline
: ENEEDAUTH 81 ; inline
: EPWROFF 82 ; inline
: EDEVERR 83 ; inline
: EOVERFLOW 84 ; inline
: EBADEXEC 85 ; inline
: EBADARCH 86 ; inline
: ESHLIBVERS 87 ; inline
: EBADMACHO 88 ; inline
: ECANCELED 89 ; inline
: EIDRM 90 ; inline
: ENOMSG 91 ; inline
: EILSEQ 92 ; inline
: ENOATTR 93 ; inline
: EBADMSG 94 ; inline
: EMULTIHOP 95 ; inline
: ENODATA 96 ; inline
: ENOLINK 97 ; inline
: ENOSR 98 ; inline
: ENOSTR 99 ; inline
: EPROTO 100 ; inline
: ETIME 101 ; inline
: EOPNOTSUPP 102 ; inline
: ENOPOLICY 103 ; inline
CONSTANT: EPERM 1
CONSTANT: ENOENT 2
CONSTANT: ESRCH 3
CONSTANT: EINTR 4
CONSTANT: EIO 5
CONSTANT: ENXIO 6
CONSTANT: E2BIG 7
CONSTANT: ENOEXEC 8
CONSTANT: EBADF 9
CONSTANT: ECHILD 10
CONSTANT: EDEADLK 11
CONSTANT: ENOMEM 12
CONSTANT: EACCES 13
CONSTANT: EFAULT 14
CONSTANT: ENOTBLK 15
CONSTANT: EBUSY 16
CONSTANT: EEXIST 17
CONSTANT: EXDEV 18
CONSTANT: ENODEV 19
CONSTANT: ENOTDIR 20
CONSTANT: EISDIR 21
CONSTANT: EINVAL 22
CONSTANT: ENFILE 23
CONSTANT: EMFILE 24
CONSTANT: ENOTTY 25
CONSTANT: ETXTBSY 26
CONSTANT: EFBIG 27
CONSTANT: ENOSPC 28
CONSTANT: ESPIPE 29
CONSTANT: EROFS 30
CONSTANT: EMLINK 31
CONSTANT: EPIPE 32
CONSTANT: EDOM 33
CONSTANT: ERANGE 34
CONSTANT: EAGAIN 35
ALIAS: EWOULDBLOCK EAGAIN
CONSTANT: EINPROGRESS 36
CONSTANT: EALREADY 37
CONSTANT: ENOTSOCK 38
CONSTANT: EDESTADDRREQ 39
CONSTANT: EMSGSIZE 40
CONSTANT: EPROTOTYPE 41
CONSTANT: ENOPROTOOPT 42
CONSTANT: EPROTONOSUPPORT 43
CONSTANT: ESOCKTNOSUPPORT 44
CONSTANT: ENOTSUP 45
CONSTANT: EPFNOSUPPORT 46
CONSTANT: EAFNOSUPPORT 47
CONSTANT: EADDRINUSE 48
CONSTANT: EADDRNOTAVAIL 49
CONSTANT: ENETDOWN 50
CONSTANT: ENETUNREACH 51
CONSTANT: ENETRESET 52
CONSTANT: ECONNABORTED 53
CONSTANT: ECONNRESET 54
CONSTANT: ENOBUFS 55
CONSTANT: EISCONN 56
CONSTANT: ENOTCONN 57
CONSTANT: ESHUTDOWN 58
CONSTANT: ETOOMANYREFS 59
CONSTANT: ETIMEDOUT 60
CONSTANT: ECONNREFUSED 61
CONSTANT: ELOOP 62
CONSTANT: ENAMETOOLONG 63
CONSTANT: EHOSTDOWN 64
CONSTANT: EHOSTUNREACH 65
CONSTANT: ENOTEMPTY 66
CONSTANT: EPROCLIM 67
CONSTANT: EUSERS 68
CONSTANT: EDQUOT 69
CONSTANT: ESTALE 70
CONSTANT: EREMOTE 71
CONSTANT: EBADRPC 72
CONSTANT: ERPCMISMATCH 73
CONSTANT: EPROGUNAVAIL 74
CONSTANT: EPROGMISMATCH 75
CONSTANT: EPROCUNAVAIL 76
CONSTANT: ENOLCK 77
CONSTANT: ENOSYS 78
CONSTANT: EFTYPE 79
CONSTANT: EAUTH 80
CONSTANT: ENEEDAUTH 81
CONSTANT: EPWROFF 82
CONSTANT: EDEVERR 83
CONSTANT: EOVERFLOW 84
CONSTANT: EBADEXEC 85
CONSTANT: EBADARCH 86
CONSTANT: ESHLIBVERS 87
CONSTANT: EBADMACHO 88
CONSTANT: ECANCELED 89
CONSTANT: EIDRM 90
CONSTANT: ENOMSG 91
CONSTANT: EILSEQ 92
CONSTANT: ENOATTR 93
CONSTANT: EBADMSG 94
CONSTANT: EMULTIHOP 95
CONSTANT: ENODATA 96
CONSTANT: ENOLINK 97
CONSTANT: ENOSR 98
CONSTANT: ENOSTR 99
CONSTANT: EPROTO 100
CONSTANT: ETIME 101
CONSTANT: EOPNOTSUPP 102
CONSTANT: ENOPOLICY 103

View File

@ -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
: FD_SETSIZE 256 ; inline
CONSTANT: FD_SETSIZE 256
C-STRUCT: addrinfo
{ "int" "flags" }
@ -20,111 +20,111 @@ C-STRUCT: dirent
{ "__uint8_t" "d_namlen" }
{ { "char" 256 } "d_name" } ;
: EPERM 1 ; inline
: ENOENT 2 ; inline
: ESRCH 3 ; inline
: EINTR 4 ; inline
: EIO 5 ; inline
: ENXIO 6 ; inline
: E2BIG 7 ; inline
: ENOEXEC 8 ; inline
: EBADF 9 ; inline
: ECHILD 10 ; inline
: EDEADLK 11 ; inline
: ENOMEM 12 ; inline
: EACCES 13 ; inline
: EFAULT 14 ; inline
: ENOTBLK 15 ; inline
: EBUSY 16 ; inline
: EEXIST 17 ; inline
: EXDEV 18 ; inline
: ENODEV 19 ; inline
: ENOTDIR 20 ; inline
: EISDIR 21 ; inline
: EINVAL 22 ; inline
: ENFILE 23 ; inline
: EMFILE 24 ; inline
: ENOTTY 25 ; inline
: ETXTBSY 26 ; inline
: EFBIG 27 ; inline
: ENOSPC 28 ; inline
: ESPIPE 29 ; inline
: EROFS 30 ; inline
: EMLINK 31 ; inline
: EPIPE 32 ; inline
: EDOM 33 ; inline
: ERANGE 34 ; inline
: EAGAIN 35 ; inline
: EWOULDBLOCK EAGAIN ; inline
: EINPROGRESS 36 ; inline
: EALREADY 37 ; inline
: ENOTSOCK 38 ; inline
: EDESTADDRREQ 39 ; inline
: EMSGSIZE 40 ; inline
: EPROTOTYPE 41 ; inline
: ENOPROTOOPT 42 ; inline
: EPROTONOSUPPORT 43 ; inline
: ESOCKTNOSUPPORT 44 ; inline
: EOPNOTSUPP 45 ; inline
: EPFNOSUPPORT 46 ; inline
: EAFNOSUPPORT 47 ; inline
: EADDRINUSE 48 ; inline
: EADDRNOTAVAIL 49 ; inline
: ENETDOWN 50 ; inline
: ENETUNREACH 51 ; inline
: ENETRESET 52 ; inline
: ECONNABORTED 53 ; inline
: ECONNRESET 54 ; inline
: ENOBUFS 55 ; inline
: EISCONN 56 ; inline
: ENOTCONN 57 ; inline
: ESHUTDOWN 58 ; inline
: ETOOMANYREFS 59 ; inline
: ETIMEDOUT 60 ; inline
: ECONNREFUSED 61 ; inline
: ELOOP 62 ; inline
: ENAMETOOLONG 63 ; inline
: EHOSTDOWN 64 ; inline
: EHOSTUNREACH 65 ; inline
: ENOTEMPTY 66 ; inline
: EPROCLIM 67 ; inline
: EUSERS 68 ; inline
: EDQUOT 69 ; inline
: ESTALE 70 ; inline
: EREMOTE 71 ; inline
: EBADRPC 72 ; inline
: ERPCMISMATCH 73 ; inline
: EPROGUNAVAIL 74 ; inline
: EPROGMISMATCH 75 ; inline
: EPROCUNAVAIL 76 ; inline
: ENOLCK 77 ; inline
: ENOSYS 78 ; inline
: EFTYPE 79 ; inline
: EAUTH 80 ; inline
: ENEEDAUTH 81 ; inline
: EIDRM 82 ; inline
: ENOMSG 83 ; inline
: EOVERFLOW 84 ; inline
: EILSEQ 85 ; inline
: ENOTSUP 86 ; inline
: ECANCELED 87 ; inline
: EBADMSG 88 ; inline
: ENODATA 89 ; inline
: ENOSR 90 ; inline
: ENOSTR 91 ; inline
: ETIME 92 ; inline
: ENOATTR 93 ; inline
: EMULTIHOP 94 ; inline
: ENOLINK 95 ; inline
: EPROTO 96 ; inline
: ELAST 96 ; inline
CONSTANT: EPERM 1
CONSTANT: ENOENT 2
CONSTANT: ESRCH 3
CONSTANT: EINTR 4
CONSTANT: EIO 5
CONSTANT: ENXIO 6
CONSTANT: E2BIG 7
CONSTANT: ENOEXEC 8
CONSTANT: EBADF 9
CONSTANT: ECHILD 10
CONSTANT: EDEADLK 11
CONSTANT: ENOMEM 12
CONSTANT: EACCES 13
CONSTANT: EFAULT 14
CONSTANT: ENOTBLK 15
CONSTANT: EBUSY 16
CONSTANT: EEXIST 17
CONSTANT: EXDEV 18
CONSTANT: ENODEV 19
CONSTANT: ENOTDIR 20
CONSTANT: EISDIR 21
CONSTANT: EINVAL 22
CONSTANT: ENFILE 23
CONSTANT: EMFILE 24
CONSTANT: ENOTTY 25
CONSTANT: ETXTBSY 26
CONSTANT: EFBIG 27
CONSTANT: ENOSPC 28
CONSTANT: ESPIPE 29
CONSTANT: EROFS 30
CONSTANT: EMLINK 31
CONSTANT: EPIPE 32
CONSTANT: EDOM 33
CONSTANT: ERANGE 34
CONSTANT: EAGAIN 35
ALIAS: EWOULDBLOCK EAGAIN
CONSTANT: EINPROGRESS 36
CONSTANT: EALREADY 37
CONSTANT: ENOTSOCK 38
CONSTANT: EDESTADDRREQ 39
CONSTANT: EMSGSIZE 40
CONSTANT: EPROTOTYPE 41
CONSTANT: ENOPROTOOPT 42
CONSTANT: EPROTONOSUPPORT 43
CONSTANT: ESOCKTNOSUPPORT 44
CONSTANT: EOPNOTSUPP 45
CONSTANT: EPFNOSUPPORT 46
CONSTANT: EAFNOSUPPORT 47
CONSTANT: EADDRINUSE 48
CONSTANT: EADDRNOTAVAIL 49
CONSTANT: ENETDOWN 50
CONSTANT: ENETUNREACH 51
CONSTANT: ENETRESET 52
CONSTANT: ECONNABORTED 53
CONSTANT: ECONNRESET 54
CONSTANT: ENOBUFS 55
CONSTANT: EISCONN 56
CONSTANT: ENOTCONN 57
CONSTANT: ESHUTDOWN 58
CONSTANT: ETOOMANYREFS 59
CONSTANT: ETIMEDOUT 60
CONSTANT: ECONNREFUSED 61
CONSTANT: ELOOP 62
CONSTANT: ENAMETOOLONG 63
CONSTANT: EHOSTDOWN 64
CONSTANT: EHOSTUNREACH 65
CONSTANT: ENOTEMPTY 66
CONSTANT: EPROCLIM 67
CONSTANT: EUSERS 68
CONSTANT: EDQUOT 69
CONSTANT: ESTALE 70
CONSTANT: EREMOTE 71
CONSTANT: EBADRPC 72
CONSTANT: ERPCMISMATCH 73
CONSTANT: EPROGUNAVAIL 74
CONSTANT: EPROGMISMATCH 75
CONSTANT: EPROCUNAVAIL 76
CONSTANT: ENOLCK 77
CONSTANT: ENOSYS 78
CONSTANT: EFTYPE 79
CONSTANT: EAUTH 80
CONSTANT: ENEEDAUTH 81
CONSTANT: EIDRM 82
CONSTANT: ENOMSG 83
CONSTANT: EOVERFLOW 84
CONSTANT: EILSEQ 85
CONSTANT: ENOTSUP 86
CONSTANT: ECANCELED 87
CONSTANT: EBADMSG 88
CONSTANT: ENODATA 89
CONSTANT: ENOSR 90
CONSTANT: ENOSTR 91
CONSTANT: ETIME 92
CONSTANT: ENOATTR 93
CONSTANT: EMULTIHOP 94
CONSTANT: ENOLINK 95
CONSTANT: EPROTO 96
CONSTANT: ELAST 96
TYPEDEF: __uint8_t sa_family_t
: _UTX_USERSIZE 32 ; inline
: _UTX_LINESIZE 32 ; inline
: _UTX_IDSIZE 4 ; inline
: _UTX_HOSTSIZE 256 ; inline
CONSTANT: _UTX_USERSIZE 32
CONSTANT: _UTX_LINESIZE 32
CONSTANT: _UTX_IDSIZE 4
CONSTANT: _UTX_HOSTSIZE 256
: _SS_MAXSIZE ( -- n )
128 ; inline

View File

@ -1,7 +1,7 @@
USING: alien.syntax ;
USING: alien.syntax constants alias ;
IN: unix
: FD_SETSIZE 1024 ; inline
CONSTANT: FD_SETSIZE 1024
C-STRUCT: addrinfo
{ "int" "flags" }
@ -20,92 +20,92 @@ C-STRUCT: dirent
{ "__uint8_t" "d_namlen" }
{ { "char" 256 } "d_name" } ;
: EPERM 1 ; inline
: ENOENT 2 ; inline
: ESRCH 3 ; inline
: EINTR 4 ; inline
: EIO 5 ; inline
: ENXIO 6 ; inline
: E2BIG 7 ; inline
: ENOEXEC 8 ; inline
: EBADF 9 ; inline
: ECHILD 10 ; inline
: EDEADLK 11 ; inline
: ENOMEM 12 ; inline
: EACCES 13 ; inline
: EFAULT 14 ; inline
: ENOTBLK 15 ; inline
: EBUSY 16 ; inline
: EEXIST 17 ; inline
: EXDEV 18 ; inline
: ENODEV 19 ; inline
: ENOTDIR 20 ; inline
: EISDIR 21 ; inline
: EINVAL 22 ; inline
: ENFILE 23 ; inline
: EMFILE 24 ; inline
: ENOTTY 25 ; inline
: ETXTBSY 26 ; inline
: EFBIG 27 ; inline
: ENOSPC 28 ; inline
: ESPIPE 29 ; inline
: EROFS 30 ; inline
: EMLINK 31 ; inline
: EPIPE 32 ; inline
: EDOM 33 ; inline
: ERANGE 34 ; inline
: EAGAIN 35 ; inline
: EWOULDBLOCK EAGAIN ; inline
: EINPROGRESS 36 ; inline
: EALREADY 37 ; inline
: ENOTSOCK 38 ; inline
: EDESTADDRREQ 39 ; inline
: EMSGSIZE 40 ; inline
: EPROTOTYPE 41 ; inline
: ENOPROTOOPT 42 ; inline
: EPROTONOSUPPORT 43 ; inline
: ESOCKTNOSUPPORT 44 ; inline
: EOPNOTSUPP 45 ; inline
: EPFNOSUPPORT 46 ; inline
: EAFNOSUPPORT 47 ; inline
: EADDRINUSE 48 ; inline
: EADDRNOTAVAIL 49 ; inline
: ENETDOWN 50 ; inline
: ENETUNREACH 51 ; inline
: ENETRESET 52 ; inline
: ECONNABORTED 53 ; inline
: ECONNRESET 54 ; inline
: ENOBUFS 55 ; inline
: EISCONN 56 ; inline
: ENOTCONN 57 ; inline
: ESHUTDOWN 58 ; inline
: ETOOMANYREFS 59 ; inline
: ETIMEDOUT 60 ; inline
: ECONNREFUSED 61 ; inline
: ELOOP 62 ; inline
: ENAMETOOLONG 63 ; inline
: EHOSTDOWN 64 ; inline
: EHOSTUNREACH 65 ; inline
: ENOTEMPTY 66 ; inline
: EPROCLIM 67 ; inline
: EUSERS 68 ; inline
: EDQUOT 69 ; inline
: ESTALE 70 ; inline
: EREMOTE 71 ; inline
: EBADRPC 72 ; inline
: ERPCMISMATCH 73 ; inline
: EPROGUNAVAIL 74 ; inline
: EPROGMISMATCH 75 ; inline
: EPROCUNAVAIL 76 ; inline
: ENOLCK 77 ; inline
: ENOSYS 78 ; inline
: EFTYPE 79 ; inline
: EAUTH 80 ; inline
: ENEEDAUTH 81 ; inline
: EIPSEC 82 ; inline
: ENOATTR 83 ; inline
: EILSEQ 84 ; inline
: ENOMEDIUM 85 ; inline
: EMEDIUMTYPE 86 ; inline
: EOVERFLOW 87 ; inline
: ECANCELED 88 ; inline
CONSTANT: EPERM 1
CONSTANT: ENOENT 2
CONSTANT: ESRCH 3
CONSTANT: EINTR 4
CONSTANT: EIO 5
CONSTANT: ENXIO 6
CONSTANT: E2BIG 7
CONSTANT: ENOEXEC 8
CONSTANT: EBADF 9
CONSTANT: ECHILD 10
CONSTANT: EDEADLK 11
CONSTANT: ENOMEM 12
CONSTANT: EACCES 13
CONSTANT: EFAULT 14
CONSTANT: ENOTBLK 15
CONSTANT: EBUSY 16
CONSTANT: EEXIST 17
CONSTANT: EXDEV 18
CONSTANT: ENODEV 19
CONSTANT: ENOTDIR 20
CONSTANT: EISDIR 21
CONSTANT: EINVAL 22
CONSTANT: ENFILE 23
CONSTANT: EMFILE 24
CONSTANT: ENOTTY 25
CONSTANT: ETXTBSY 26
CONSTANT: EFBIG 27
CONSTANT: ENOSPC 28
CONSTANT: ESPIPE 29
CONSTANT: EROFS 30
CONSTANT: EMLINK 31
CONSTANT: EPIPE 32
CONSTANT: EDOM 33
CONSTANT: ERANGE 34
CONSTANT: EAGAIN 35
ALIAS: EWOULDBLOCK EAGAIN
CONSTANT: EINPROGRESS 36
CONSTANT: EALREADY 37
CONSTANT: ENOTSOCK 38
CONSTANT: EDESTADDRREQ 39
CONSTANT: EMSGSIZE 40
CONSTANT: EPROTOTYPE 41
CONSTANT: ENOPROTOOPT 42
CONSTANT: EPROTONOSUPPORT 43
CONSTANT: ESOCKTNOSUPPORT 44
CONSTANT: EOPNOTSUPP 45
CONSTANT: EPFNOSUPPORT 46
CONSTANT: EAFNOSUPPORT 47
CONSTANT: EADDRINUSE 48
CONSTANT: EADDRNOTAVAIL 49
CONSTANT: ENETDOWN 50
CONSTANT: ENETUNREACH 51
CONSTANT: ENETRESET 52
CONSTANT: ECONNABORTED 53
CONSTANT: ECONNRESET 54
CONSTANT: ENOBUFS 55
CONSTANT: EISCONN 56
CONSTANT: ENOTCONN 57
CONSTANT: ESHUTDOWN 58
CONSTANT: ETOOMANYREFS 59
CONSTANT: ETIMEDOUT 60
CONSTANT: ECONNREFUSED 61
CONSTANT: ELOOP 62
CONSTANT: ENAMETOOLONG 63
CONSTANT: EHOSTDOWN 64
CONSTANT: EHOSTUNREACH 65
CONSTANT: ENOTEMPTY 66
CONSTANT: EPROCLIM 67
CONSTANT: EUSERS 68
CONSTANT: EDQUOT 69
CONSTANT: ESTALE 70
CONSTANT: EREMOTE 71
CONSTANT: EBADRPC 72
CONSTANT: ERPCMISMATCH 73
CONSTANT: EPROGUNAVAIL 74
CONSTANT: EPROGMISMATCH 75
CONSTANT: EPROCUNAVAIL 76
CONSTANT: ENOLCK 77
CONSTANT: ENOSYS 78
CONSTANT: EFTYPE 79
CONSTANT: EAUTH 80
CONSTANT: ENEEDAUTH 81
CONSTANT: EIPSEC 82
CONSTANT: ENOATTR 83
CONSTANT: EILSEQ 84
CONSTANT: ENOMEDIUM 85
CONSTANT: EMEDIUMTYPE 86
CONSTANT: EOVERFLOW 87
CONSTANT: ECANCELED 88

View File

@ -1,11 +1,11 @@
! Copyright (C) 2008 Doug Coleman.
! See http://factorcode.org/license.txt for BSD license.
USING: alien.syntax ;
USING: alien.syntax constants ;
IN: unix.getfsstat.freebsd
: MNT_WAIT 1 ; inline ! synchronously wait for I/O to complete
: MNT_NOWAIT 2 ; inline ! start all I/O, but do not wait for it
: MNT_LAZY 3 ; inline ! push data not written by filesystem syncer
: MNT_SUSPEND 4 ; inline ! Suspend file system after sync
CONSTANT: MNT_WAIT 1 ! synchronously wait for I/O to complete
CONSTANT: MNT_NOWAIT 2 ! start all I/O, but do not wait for it
CONSTANT: MNT_LAZY 3 ! push data not written by filesystem syncer
CONSTANT: MNT_SUSPEND 4 ! Suspend file system after sync
FUNCTION: int getfsstat ( statfs* buf, int bufsize, int flags ) ;

View File

@ -1,9 +1,9 @@
! Copyright (C) 2008 Doug Coleman.
! See http://factorcode.org/license.txt for BSD license.
USING: alien.syntax ;
USING: alien.syntax constants ;
IN: unix.getfsstat.macosx
: MNT_WAIT 1 ; inline ! synchronously wait for I/O to complete
: MNT_NOWAIT 2 ; inline ! start all I/O, but do not wait for it
CONSTANT: MNT_WAIT 1 ! synchronously wait for I/O to complete
CONSTANT: MNT_NOWAIT 2 ! start all I/O, but do not wait for it
FUNCTION: int getfsstat64 ( statfs* buf, int bufsize, int flags ) ;

View File

@ -1,10 +1,10 @@
! Copyright (C) 2008 Doug Coleman.
! See http://factorcode.org/license.txt for BSD license.
USING: alien.syntax ;
USING: alien.syntax constants ;
IN: unix.getfsstat.netbsd
: MNT_WAIT 1 ; inline ! synchronously wait for I/O to complete
: MNT_NOWAIT 2 ; inline ! start all I/O, but do not wait for it
: MNT_LAZY 3 ; inline ! push data not written by filesystem syncer
CONSTANT: MNT_WAIT 1 ! synchronously wait for I/O to complete
CONSTANT: MNT_NOWAIT 2 ! start all I/O, but do not wait for it
CONSTANT: MNT_LAZY 3 ! push data not written by filesystem syncer
FUNCTION: int getvfsstat ( statfs* buf, int bufsize, int flags ) ;

View File

@ -1,10 +1,10 @@
! Copyright (C) 2008 Doug Coleman.
! See http://factorcode.org/license.txt for BSD license.
USING: alien.syntax ;
USING: alien.syntax constants ;
IN: unix.getfsstat.openbsd
: MNT_WAIT 1 ; ! synchronously wait for I/O to complete
: 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_WAIT 1 ! synchronously wait for I/O to complete
CONSTANT: MNT_NOWAIT 2 ! start all I/O, but do not wait for it
CONSTANT: MNT_LAZY 3 ! push data not written by filesystem syncer
FUNCTION: int getfsstat ( statfs* buf, int bufsize, int flags ) ;

View File

@ -1,4 +1,4 @@
USE: alien.syntax
USING: alien.syntax constants ;
IN: unix.kqueue
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 ) ;
: EVFILT_READ -1 ; inline
: EVFILT_WRITE -2 ; inline
: EVFILT_AIO -3 ; inline ! attached to aio requests
: EVFILT_VNODE -4 ; inline ! attached to vnodes
: EVFILT_PROC -5 ; inline ! attached to struct proc
: EVFILT_SIGNAL -6 ; inline ! attached to struct proc
: EVFILT_TIMER -7 ; inline ! timers
: EVFILT_NETDEV -8 ; inline ! Mach ports
: EVFILT_FS -9 ; inline ! Filesystem events
CONSTANT: EVFILT_READ -1
CONSTANT: EVFILT_WRITE -2
CONSTANT: EVFILT_AIO -3 ! attached to aio requests
CONSTANT: EVFILT_VNODE -4 ! attached to vnodes
CONSTANT: EVFILT_PROC -5 ! attached to struct proc
CONSTANT: EVFILT_SIGNAL -6 ! attached to struct proc
CONSTANT: EVFILT_TIMER -7 ! timers
CONSTANT: EVFILT_NETDEV -8 ! Mach ports
CONSTANT: EVFILT_FS -9 ! Filesystem events

View File

@ -1,7 +1,7 @@
! Copyright (C) 2008 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: alien.syntax system sequences vocabs.loader words
accessors ;
accessors alias constants ;
IN: unix.kqueue
<< "unix.kqueue." os name>> append require >>
@ -9,47 +9,47 @@ IN: unix.kqueue
FUNCTION: int kqueue ( ) ;
! actions
: EV_ADD HEX: 1 ; inline ! add event to kq (implies enable)
: EV_DELETE HEX: 2 ; inline ! delete event from kq
: EV_ENABLE HEX: 4 ; inline ! enable event
: EV_DISABLE HEX: 8 ; inline ! disable event (not reported)
CONSTANT: EV_ADD HEX: 1 ! add event to kq (implies enable)
CONSTANT: EV_DELETE HEX: 2 ! delete event from kq
CONSTANT: EV_ENABLE HEX: 4 ! enable event
CONSTANT: EV_DISABLE HEX: 8 ! disable event (not reported)
! flags
: EV_ONESHOT HEX: 10 ; inline ! only report one occurrence
: EV_CLEAR HEX: 20 ; inline ! clear event state after reporting
CONSTANT: EV_ONESHOT HEX: 10 ! only report one occurrence
CONSTANT: EV_CLEAR HEX: 20 ! clear event state after reporting
: EV_SYSFLAGS HEX: f000 ; inline ! reserved by system
: EV_FLAG0 HEX: 1000 ; inline ! filter-specific flag
: EV_FLAG1 HEX: 2000 ; inline ! filter-specific flag
CONSTANT: EV_SYSFLAGS HEX: f000 ! reserved by system
CONSTANT: EV_FLAG0 HEX: 1000 ! filter-specific flag
CONSTANT: EV_FLAG1 HEX: 2000 ! filter-specific flag
! returned values
: EV_EOF HEX: 8000 ; inline ! EOF detected
: EV_ERROR HEX: 4000 ; inline ! error, data contains errno
CONSTANT: EV_EOF HEX: 8000 ! EOF detected
CONSTANT: EV_ERROR HEX: 4000 ! error, data contains errno
: EV_POLL EV_FLAG0 ; inline
: EV_OOBAND EV_FLAG1 ; inline
ALIAS: EV_POLL EV_FLAG0
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
: NOTE_WRITE HEX: 00000002 ; inline ! data contents changed
: NOTE_EXTEND HEX: 00000004 ; inline ! size increased
: NOTE_ATTRIB HEX: 00000008 ; inline ! attributes changed
: NOTE_LINK HEX: 00000010 ; inline ! link count changed
: NOTE_RENAME HEX: 00000020 ; inline ! vnode was renamed
: NOTE_REVOKE HEX: 00000040 ; inline ! vnode access was revoked
CONSTANT: NOTE_DELETE HEX: 00000001 ! vnode was removed
CONSTANT: NOTE_WRITE HEX: 00000002 ! data contents changed
CONSTANT: NOTE_EXTEND HEX: 00000004 ! size increased
CONSTANT: NOTE_ATTRIB HEX: 00000008 ! attributes changed
CONSTANT: NOTE_LINK HEX: 00000010 ! link count changed
CONSTANT: NOTE_RENAME HEX: 00000020 ! vnode was renamed
CONSTANT: NOTE_REVOKE HEX: 00000040 ! vnode access was revoked
: NOTE_EXIT HEX: 80000000 ; inline ! process exited
: NOTE_FORK HEX: 40000000 ; inline ! process forked
: NOTE_EXEC HEX: 20000000 ; inline ! process exec'd
: NOTE_PCTRLMASK HEX: f0000000 ; inline ! mask for hint bits
: NOTE_PDATAMASK HEX: 000fffff ; inline ! mask for pid
CONSTANT: NOTE_EXIT HEX: 80000000 ! process exited
CONSTANT: NOTE_FORK HEX: 40000000 ! process forked
CONSTANT: NOTE_EXEC HEX: 20000000 ! process exec'd
CONSTANT: NOTE_PCTRLMASK HEX: f0000000 ! mask for hint bits
CONSTANT: NOTE_PDATAMASK HEX: 000fffff ! mask for pid
: NOTE_SECONDS HEX: 00000001 ; inline ! data is seconds
: NOTE_USECONDS HEX: 00000002 ; inline ! data is microseconds
: NOTE_NSECONDS HEX: 00000004 ; inline ! data is nanoseconds
: NOTE_ABSOLUTE HEX: 00000008 ; inline ! absolute timeout
CONSTANT: NOTE_SECONDS HEX: 00000001 ! data is seconds
CONSTANT: NOTE_USECONDS HEX: 00000002 ! data is microseconds
CONSTANT: NOTE_NSECONDS HEX: 00000004 ! data is nanoseconds
CONSTANT: NOTE_ABSOLUTE HEX: 00000008 ! absolute timeout
: NOTE_TRACK HEX: 00000001 ; inline ! follow across forks
: NOTE_TRACKERR HEX: 00000002 ; inline ! could not track child
: NOTE_CHILD HEX: 00000004 ; inline ! am a child process
CONSTANT: NOTE_TRACK HEX: 00000001 ! follow across forks
CONSTANT: NOTE_TRACKERR HEX: 00000002 ! could not track child
CONSTANT: NOTE_CHILD HEX: 00000004 ! am a child process

View File

@ -1,4 +1,4 @@
USE: alien.syntax
USING: alien.syntax constants ;
IN: unix.kqueue
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 ) ;
: EVFILT_READ -1 ; inline
: EVFILT_WRITE -2 ; inline
: EVFILT_AIO -3 ; inline ! attached to aio requests
: EVFILT_VNODE -4 ; inline ! attached to vnodes
: EVFILT_PROC -5 ; inline ! attached to struct proc
: EVFILT_SIGNAL -6 ; inline ! attached to struct proc
: EVFILT_TIMER -7 ; inline ! timers
: EVFILT_MACHPORT -8 ; inline ! Mach ports
: EVFILT_FS -9 ; inline ! Filesystem events
CONSTANT: EVFILT_READ -1
CONSTANT: EVFILT_WRITE -2
CONSTANT: EVFILT_AIO -3 ! attached to aio requests
CONSTANT: EVFILT_VNODE -4 ! attached to vnodes
CONSTANT: EVFILT_PROC -5 ! attached to struct proc
CONSTANT: EVFILT_SIGNAL -6 ! attached to struct proc
CONSTANT: EVFILT_TIMER -7 ! timers
CONSTANT: EVFILT_MACHPORT -8 ! Mach ports
CONSTANT: EVFILT_FS -9 ! Filesystem events

View File

@ -1,4 +1,4 @@
USE: alien.syntax
USING: alien.syntax constants ;
IN: unix.kqueue
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 ) ;
: EVFILT_READ 0 ; inline
: EVFILT_WRITE 1 ; inline
: EVFILT_AIO 2 ; inline ! attached to aio requests
: EVFILT_VNODE 3 ; inline ! attached to vnodes
: EVFILT_PROC 4 ; inline ! attached to struct proc
: EVFILT_SIGNAL 5 ; inline ! attached to struct proc
: EVFILT_TIMER 6 ; inline ! timers
: EVFILT_SYSCOUNT 7 ; inline ! Filesystem events
CONSTANT: EVFILT_READ 0
CONSTANT: EVFILT_WRITE 1
CONSTANT: EVFILT_AIO 2 ! attached to aio requests
CONSTANT: EVFILT_VNODE 3 ! attached to vnodes
CONSTANT: EVFILT_PROC 4 ! attached to struct proc
CONSTANT: EVFILT_SIGNAL 5 ! attached to struct proc
CONSTANT: EVFILT_TIMER 6 ! timers
CONSTANT: EVFILT_SYSCOUNT 7 ! Filesystem events

Some files were not shown because too many files have changed in this diff Show More