Fix conflict

db4
Slava Pestov 2009-02-22 20:02:13 -06:00
commit 91d0c4ed1f
140 changed files with 2034 additions and 2011 deletions

View File

@ -170,8 +170,8 @@ M: character-type (fortran-type>c-type)
: (parse-fortran-type) ( fortran-type-string -- type ) : (parse-fortran-type) ( fortran-type-string -- type )
parse-out swap parse-dims swap parse-size swap parse-out swap parse-dims swap parse-size swap
dup >lower fortran>c-types at* >lower fortran>c-types ?at
[ nip new-fortran-type ] [ drop misc-type boa ] if ; [ new-fortran-type ] [ misc-type boa ] if ;
: parse-fortran-type ( fortran-type-string/f -- type/f ) : parse-fortran-type ( fortran-type-string/f -- type/f )
dup [ (parse-fortran-type) ] when ; dup [ (parse-fortran-type) ] when ;

View File

@ -77,20 +77,20 @@ SYMBOL: objects
! Constants ! Constants
: image-magic HEX: 0f0e0d0c ; inline CONSTANT: image-magic HEX: 0f0e0d0c
: image-version 4 ; inline CONSTANT: image-version 4
: data-base 1024 ; inline CONSTANT: data-base 1024
: userenv-size 70 ; inline CONSTANT: userenv-size 70
: header-size 10 ; inline CONSTANT: header-size 10
: data-heap-size-offset 3 ; inline CONSTANT: data-heap-size-offset 3
: t-offset 6 ; inline CONSTANT: t-offset 6
: 0-offset 7 ; inline CONSTANT: 0-offset 7
: 1-offset 8 ; inline CONSTANT: 1-offset 8
: -1-offset 9 ; inline CONSTANT: -1-offset 9
SYMBOL: sub-primitives SYMBOL: sub-primitives

View File

@ -61,7 +61,7 @@ PRIVATE>
: month-abbreviation ( n -- string ) : month-abbreviation ( n -- string )
check-month 1- month-abbreviations nth ; check-month 1- month-abbreviations nth ;
: day-counts { 0 31 28 31 30 31 30 31 31 30 31 30 31 } ; inline CONSTANT: day-counts { 0 31 28 31 30 31 30 31 31 30 31 30 31 }
: day-names ( -- array ) : day-names ( -- array )
{ {

View File

@ -6,7 +6,7 @@ IN: checksums.adler-32
SINGLETON: adler-32 SINGLETON: adler-32
: adler-32-modulus 65521 ; inline CONSTANT: adler-32-modulus 65521
M: adler-32 checksum-bytes ( bytes checksum -- value ) M: adler-32 checksum-bytes ( bytes checksum -- value )
drop drop

View File

@ -9,14 +9,14 @@ IN: checksums.sha2
SYMBOLS: vars M K H S0 S1 process-M word-size block-size ; SYMBOLS: vars M K H S0 S1 process-M word-size block-size ;
: a 0 ; inline CONSTANT: a 0
: b 1 ; inline CONSTANT: b 1
: c 2 ; inline CONSTANT: c 2
: d 3 ; inline CONSTANT: d 3
: e 4 ; inline CONSTANT: e 4
: f 5 ; inline CONSTANT: f 5
: g 6 ; inline CONSTANT: g 6
: h 7 ; inline CONSTANT: h 7
: initial-H-256 ( -- seq ) : initial-H-256 ( -- seq )
{ {

View File

@ -5,7 +5,7 @@ sequences vectors fry libc destructors
specialized-arrays.direct.alien ; specialized-arrays.direct.alien ;
IN: cocoa.enumeration IN: cocoa.enumeration
: NS-EACH-BUFFER-SIZE 16 ; inline CONSTANT: NS-EACH-BUFFER-SIZE 16
: with-enumeration-buffers ( quot -- ) : with-enumeration-buffers ( quot -- )
'[ '[

View File

@ -4,15 +4,15 @@ USING: arrays kernel math cocoa cocoa.messages cocoa.classes
sequences math.bitwise ; sequences math.bitwise ;
IN: cocoa.windows IN: cocoa.windows
: NSBorderlessWindowMask 0 ; inline CONSTANT: NSBorderlessWindowMask 0
: NSTitledWindowMask 1 ; inline CONSTANT: NSTitledWindowMask 1
: NSClosableWindowMask 2 ; inline CONSTANT: NSClosableWindowMask 2
: NSMiniaturizableWindowMask 4 ; inline CONSTANT: NSMiniaturizableWindowMask 4
: NSResizableWindowMask 8 ; inline CONSTANT: NSResizableWindowMask 8
: NSBackingStoreRetained 0 ; inline CONSTANT: NSBackingStoreRetained 0
: NSBackingStoreNonretained 1 ; inline CONSTANT: NSBackingStoreNonretained 1
: NSBackingStoreBuffered 2 ; inline CONSTANT: NSBackingStoreBuffered 2
: standard-window-type ( -- n ) : standard-window-type ( -- n )
{ {

View File

@ -6,7 +6,11 @@ IN: colors
TUPLE: color ; TUPLE: color ;
TUPLE: rgba < color { red read-only } { green read-only } { blue read-only } { alpha read-only } ; TUPLE: rgba < color
{ red read-only }
{ green read-only }
{ blue read-only }
{ alpha read-only } ;
C: <rgba> rgba C: <rgba> rgba

View File

@ -4,8 +4,8 @@ USING: math kernel layouts system strings ;
IN: compiler.constants IN: compiler.constants
! These constants must match vm/memory.h ! These constants must match vm/memory.h
: card-bits 8 ; inline CONSTANT: card-bits 8
: deck-bits 18 ; inline CONSTANT: deck-bits 18
: card-mark ( -- n ) HEX: 40 HEX: 80 bitor ; inline : card-mark ( -- n ) HEX: 40 HEX: 80 bitor ; inline
! These constants must match vm/layouts.h ! These constants must match vm/layouts.h
@ -26,25 +26,25 @@ IN: compiler.constants
: compiled-header-size ( -- n ) 4 bootstrap-cells ; inline : compiled-header-size ( -- n ) 4 bootstrap-cells ; inline
! Relocation classes ! Relocation classes
: rc-absolute-cell 0 ; inline CONSTANT: rc-absolute-cell 0
: rc-absolute 1 ; inline CONSTANT: rc-absolute 1
: rc-relative 2 ; inline CONSTANT: rc-relative 2
: rc-absolute-ppc-2/2 3 ; inline CONSTANT: rc-absolute-ppc-2/2 3
: rc-relative-ppc-2 4 ; inline CONSTANT: rc-relative-ppc-2 4
: rc-relative-ppc-3 5 ; inline CONSTANT: rc-relative-ppc-3 5
: rc-relative-arm-3 6 ; inline CONSTANT: rc-relative-arm-3 6
: rc-indirect-arm 7 ; inline CONSTANT: rc-indirect-arm 7
: rc-indirect-arm-pc 8 ; inline CONSTANT: rc-indirect-arm-pc 8
! Relocation types ! Relocation types
: rt-primitive 0 ; inline CONSTANT: rt-primitive 0
: rt-dlsym 1 ; inline CONSTANT: rt-dlsym 1
: rt-dispatch 2 ; inline CONSTANT: rt-dispatch 2
: rt-xt 3 ; inline CONSTANT: rt-xt 3
: rt-here 4 ; inline CONSTANT: rt-here 4
: rt-label 5 ; inline CONSTANT: rt-label 5
: rt-immediate 6 ; inline CONSTANT: rt-immediate 6
: rt-stack-chain 7 ; inline CONSTANT: rt-stack-chain 7
: rc-absolute? ( n -- ? ) : rc-absolute? ( n -- ? )
[ rc-absolute-ppc-2/2 = ] [ rc-absolute-ppc-2/2 = ]

View File

@ -32,9 +32,9 @@ literal?
length length
slots ; slots ;
: null-info T{ value-info f null empty-interval } ; inline CONSTANT: null-info T{ value-info f null empty-interval }
: object-info T{ value-info f object full-interval } ; inline CONSTANT: object-info T{ value-info f object full-interval }
: class-interval ( class -- interval ) : class-interval ( class -- interval )
dup real class<= dup real class<=

View File

@ -69,11 +69,11 @@ ERROR: index-too-big n ;
: omega-k-in-table? ( lzw -- ? ) : omega-k-in-table? ( lzw -- ? )
[ omega-k>> ] [ table>> ] bi key? ; [ omega-k>> ] [ table>> ] bi key? ;
ERROR: not-in-table ; ERROR: not-in-table value ;
: write-output ( lzw -- ) : write-output ( lzw -- )
[ [
[ omega>> ] [ table>> ] bi at* [ not-in-table ] unless [ omega>> ] [ table>> ] bi ?at [ not-in-table ] unless
] [ ] [
[ lzw-bit-width-compress ] [ lzw-bit-width-compress ]
[ output>> write-bits ] bi [ output>> write-bits ] bi

View File

@ -15,8 +15,8 @@ FUNCTION: CFFileDescriptorRef CFFileDescriptorCreate (
CFFileDescriptorContext* context CFFileDescriptorContext* context
) ; ) ;
: kCFFileDescriptorReadCallBack 1 ; inline CONSTANT: kCFFileDescriptorReadCallBack 1
: kCFFileDescriptorWriteCallBack 2 ; inline CONSTANT: kCFFileDescriptorWriteCallBack 2
FUNCTION: void CFFileDescriptorEnableCallBacks ( FUNCTION: void CFFileDescriptorEnableCallBacks (
CFFileDescriptorRef f, CFFileDescriptorRef f,

View File

@ -9,17 +9,17 @@ core-foundation core-foundation.run-loop core-foundation.strings
core-foundation.time ; core-foundation.time ;
IN: core-foundation.fsevents IN: core-foundation.fsevents
: kFSEventStreamCreateFlagUseCFTypes 2 ; inline CONSTANT: kFSEventStreamCreateFlagUseCFTypes 2
: kFSEventStreamCreateFlagWatchRoot 4 ; inline CONSTANT: kFSEventStreamCreateFlagWatchRoot 4
: kFSEventStreamEventFlagMustScanSubDirs 1 ; inline CONSTANT: kFSEventStreamEventFlagMustScanSubDirs 1
: kFSEventStreamEventFlagUserDropped 2 ; inline CONSTANT: kFSEventStreamEventFlagUserDropped 2
: kFSEventStreamEventFlagKernelDropped 4 ; inline CONSTANT: kFSEventStreamEventFlagKernelDropped 4
: kFSEventStreamEventFlagEventIdsWrapped 8 ; inline CONSTANT: kFSEventStreamEventFlagEventIdsWrapped 8
: kFSEventStreamEventFlagHistoryDone 16 ; inline CONSTANT: kFSEventStreamEventFlagHistoryDone 16
: kFSEventStreamEventFlagRootChanged 32 ; inline CONSTANT: kFSEventStreamEventFlagRootChanged 32
: kFSEventStreamEventFlagMount 64 ; inline CONSTANT: kFSEventStreamEventFlagMount 64
: kFSEventStreamEventFlagUnmount 128 ; inline CONSTANT: kFSEventStreamEventFlagUnmount 128
TYPEDEF: int FSEventStreamCreateFlags TYPEDEF: int FSEventStreamCreateFlags
TYPEDEF: int FSEventStreamEventFlags TYPEDEF: int FSEventStreamEventFlags
@ -36,7 +36,7 @@ C-STRUCT: FSEventStreamContext
! callback(FSEventStreamRef streamRef, void *clientCallBackInfo, size_t numEvents, void *eventPaths, const FSEventStreamEventFlags eventFlags[], const FSEventStreamEventId eventIds[]); ! callback(FSEventStreamRef streamRef, void *clientCallBackInfo, size_t numEvents, void *eventPaths, const FSEventStreamEventFlags eventFlags[], const FSEventStreamEventId eventIds[]);
TYPEDEF: void* FSEventStreamCallback TYPEDEF: void* FSEventStreamCallback
: FSEventStreamEventIdSinceNow HEX: FFFFFFFFFFFFFFFF ; inline CONSTANT: FSEventStreamEventIdSinceNow HEX: FFFFFFFFFFFFFFFF
FUNCTION: FSEventStreamRef FSEventStreamCreate ( FUNCTION: FSEventStreamRef FSEventStreamCreate (
CFAllocatorRef allocator, CFAllocatorRef allocator,

View File

@ -7,10 +7,10 @@ core-foundation.file-descriptors core-foundation.timers
core-foundation.time ; core-foundation.time ;
IN: core-foundation.run-loop IN: core-foundation.run-loop
: kCFRunLoopRunFinished 1 ; inline CONSTANT: kCFRunLoopRunFinished 1
: kCFRunLoopRunStopped 2 ; inline CONSTANT: kCFRunLoopRunStopped 2
: kCFRunLoopRunTimedOut 3 ; inline CONSTANT: kCFRunLoopRunTimedOut 3
: kCFRunLoopRunHandledSource 4 ; inline CONSTANT: kCFRunLoopRunHandledSource 4
TYPEDEF: void* CFRunLoopRef TYPEDEF: void* CFRunLoopRef
TYPEDEF: void* CFRunLoopSourceRef TYPEDEF: void* CFRunLoopSourceRef

View File

@ -4,7 +4,7 @@ USING: alien.syntax kernel core-foundation.strings
core-foundation ; core-foundation ;
IN: core-foundation.urls IN: core-foundation.urls
: kCFURLPOSIXPathStyle 0 ; inline CONSTANT: kCFURLPOSIXPathStyle 0
TYPEDEF: void* CFURLRef TYPEDEF: void* CFURLRef

View File

@ -27,8 +27,8 @@ M: ppc machine-registers
{ double-float-regs T{ range f 0 29 1 } } { double-float-regs T{ range f 0 29 1 } }
} ; } ;
: scratch-reg 28 ; inline CONSTANT: scratch-reg 28
: fp-scratch-reg 30 ; inline CONSTANT: fp-scratch-reg 30
M: ppc two-operand? f ; M: ppc two-operand? f ;
@ -40,8 +40,8 @@ M: ppc %load-reference ( reg obj -- )
M: ppc %alien-global ( register symbol dll -- ) M: ppc %alien-global ( register symbol dll -- )
[ 0 swap LOAD32 ] 2dip rc-absolute-ppc-2/2 rel-dlsym ; [ 0 swap LOAD32 ] 2dip rc-absolute-ppc-2/2 rel-dlsym ;
: ds-reg 29 ; inline CONSTANT: ds-reg 29
: rs-reg 30 ; inline CONSTANT: rs-reg 30
GENERIC: loc-reg ( loc -- reg ) GENERIC: loc-reg ( loc -- reg )

View File

@ -2,17 +2,17 @@
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: arrays assocs classes continuations destructors kernel math USING: arrays assocs classes continuations destructors kernel math
namespaces sequences classes.tuple words strings namespaces sequences classes.tuple words strings
tools.walker accessors combinators fry ; tools.walker accessors combinators fry db.errors ;
IN: db IN: db
<PRIVATE
TUPLE: db-connection TUPLE: db-connection
handle handle
insert-statements insert-statements
update-statements update-statements
delete-statements ; delete-statements ;
<PRIVATE
: new-db-connection ( class -- obj ) : new-db-connection ( class -- obj )
new new
H{ } clone >>insert-statements H{ } clone >>insert-statements
@ -23,6 +23,7 @@ PRIVATE>
GENERIC: db-open ( db -- db-connection ) GENERIC: db-open ( db -- db-connection )
HOOK: db-close db-connection ( handle -- ) HOOK: db-close db-connection ( handle -- )
HOOK: parse-db-error db-connection ( error -- error' )
: dispose-statements ( assoc -- ) values dispose-each ; : dispose-statements ( assoc -- ) values dispose-each ;
@ -77,7 +78,11 @@ GENERIC: bind-tuple ( tuple statement -- )
GENERIC: execute-statement* ( statement type -- ) GENERIC: execute-statement* ( statement type -- )
M: object execute-statement* ( statement type -- ) M: object execute-statement* ( statement type -- )
drop query-results dispose ; '[
_ _ drop query-results dispose
] [
parse-db-error rethrow
] recover ;
: execute-one-statement ( statement -- ) : execute-one-statement ( statement -- )
dup type>> execute-statement* ; dup type>> execute-statement* ;

View File

@ -1,10 +1,54 @@
! 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: kernel ; USING: accessors kernel continuations fry words ;
IN: db.errors IN: db.errors
ERROR: db-error ; ERROR: db-error ;
ERROR: sql-error ; ERROR: sql-error location ;
ERROR: table-exists ;
ERROR: bad-schema ; ERROR: bad-schema ;
ERROR: sql-unknown-error < sql-error message ;
: <sql-unknown-error> ( message -- error )
\ sql-unknown-error new
swap >>message ;
ERROR: sql-table-exists < sql-error table ;
: <sql-table-exists> ( table -- error )
\ sql-table-exists new
swap >>table ;
ERROR: sql-table-missing < sql-error table ;
: <sql-table-missing> ( table -- error )
\ sql-table-missing new
swap >>table ;
ERROR: sql-syntax-error < sql-error message ;
: <sql-syntax-error> ( message -- error )
\ sql-syntax-error new
swap >>message ;
ERROR: sql-function-exists < sql-error message ;
: <sql-function-exists> ( message -- error )
\ sql-function-exists new
swap >>message ;
ERROR: sql-function-missing < sql-error message ;
: <sql-function-missing> ( message -- error )
\ sql-function-missing new
swap >>message ;
: ignore-error ( quot word -- )
'[ dup _ execute [ drop ] [ rethrow ] if ] recover ; inline
: ignore-table-exists ( quot -- )
\ sql-table-exists? ignore-error ; inline
: ignore-table-missing ( quot -- )
\ sql-table-missing? ignore-error ; inline
: ignore-function-exists ( quot -- )
\ sql-function-exists? ignore-error ; inline
: ignore-function-missing ( quot -- )
\ sql-function-missing? ignore-error ; inline

View File

@ -0,0 +1 @@
Doug Coleman

View File

@ -0,0 +1,32 @@
! Copyright (C) 2009 Doug Coleman.
! See http://factorcode.org/license.txt for BSD license.
USING: accessors combinators.short-circuit db db.errors
db.errors.postgresql db.postgresql io.files.unique kernel namespaces
tools.test db.tester continuations ;
IN: db.errors.postgresql.tests
postgresql-test-db [
[ "drop table foo;" sql-command ] ignore-errors
[ "drop table ship;" sql-command ] ignore-errors
[
"insert into foo (id) values('1');" sql-command
] [
{ [ sql-table-missing? ] [ table>> "foo" = ] } 1&&
] must-fail-with
[
"create table ship(id integer);" sql-command
"create table ship(id integer);" sql-command
] [
{ [ sql-table-exists? ] [ table>> "ship" = ] } 1&&
] must-fail-with
[
"create table foo(id) lol;" sql-command
] [
sql-syntax-error?
] must-fail-with
] with-db

View File

@ -0,0 +1,53 @@
! Copyright (C) 2009 Doug Coleman.
! See http://factorcode.org/license.txt for BSD license.
USING: kernel db.errors peg.ebnf strings sequences math
combinators.short-circuit accessors math.parser quoting ;
IN: db.errors.postgresql
EBNF: parse-postgresql-sql-error
Error = "ERROR:" [ ]+
TableError =
Error ("relation "|"table ")(!(" already exists").)+:table " already exists"
=> [[ table >string unquote <sql-table-exists> ]]
| Error ("relation "|"table ")(!(" does not exist").)+:table " does not exist"
=> [[ table >string unquote <sql-table-missing> ]]
FunctionError =
Error "function" (!(" already exists").)+:table " already exists"
=> [[ table >string <sql-function-exists> ]]
| Error "function" (!(" does not exist").)+:table " does not exist"
=> [[ table >string <sql-function-missing> ]]
SyntaxError =
Error "syntax error at end of input":error
=> [[ error >string <sql-syntax-error> ]]
| Error "syntax error at or near " .+:syntaxerror
=> [[ syntaxerror >string unquote <sql-syntax-error> ]]
UnknownError = .* => [[ >string <sql-unknown-error> ]]
PostgresqlSqlError = (TableError | FunctionError | SyntaxError | UnknownError)
;EBNF
ERROR: parse-postgresql-location column line text ;
C: <parse-postgresql-location> parse-postgresql-location
EBNF: parse-postgresql-line-error
Line = "LINE " [0-9]+:line ": " .+:sql
=> [[ f line >string string>number sql >string <parse-postgresql-location> ]]
;EBNF
:: set-caret-position ( error caret-line -- error )
caret-line length
error line>> number>string length "LINE : " length +
- [ error ] dip >>column ;
: postgresql-location ( line column -- obj )
[ parse-postgresql-line-error ] dip
set-caret-position ;

View File

@ -0,0 +1 @@
Doug Coleman

View File

@ -0,0 +1,26 @@
! Copyright (C) 2009 Doug Coleman.
! See http://factorcode.org/license.txt for BSD license.
USING: accessors combinators.short-circuit db db.errors
db.errors.sqlite db.sqlite io.files.unique kernel namespaces
tools.test ;
IN: db.errors.sqlite.tests
: sqlite-error-test-db-path ( -- path )
"sqlite" "error-test" make-unique-file ;
sqlite-error-test-db-path <sqlite-db> [
[
"insert into foo (id) values('1');" sql-command
] [
{ [ sql-table-missing? ] [ table>> "foo" = ] } 1&&
] must-fail-with
[
"create table foo(id);" sql-command
"create table foo(id);" sql-command
] [
{ [ sql-table-exists? ] [ table>> "foo" = ] } 1&&
] must-fail-with
] with-db

View File

@ -0,0 +1,25 @@
! Copyright (C) 2009 Doug Coleman.
! See http://factorcode.org/license.txt for BSD license.
USING: accessors combinators db kernel sequences peg.ebnf
strings db.errors ;
IN: db.errors.sqlite
ERROR: unparsed-sqlite-error error ;
SINGLETONS: table-exists table-missing ;
: sqlite-table-error ( table message -- error )
{
{ table-exists [ <sql-table-exists> ] }
} case ;
EBNF: parse-sqlite-sql-error
TableMessage = " already exists" => [[ table-exists ]]
SqliteError =
"table " (!(TableMessage).)+:table TableMessage:message
=> [[ table >string message sqlite-table-error ]]
| "no such table: " .+:table
=> [[ table >string <sql-table-missing> ]]
;EBNF

View File

@ -1,20 +1,13 @@
USING: kernel db.postgresql alien continuations io classes USING: kernel db.postgresql alien continuations io classes
prettyprint sequences namespaces tools.test db db.private prettyprint sequences namespaces tools.test db db.private
db.tuples db.types unicode.case accessors system ; db.tuples db.types unicode.case accessors system db.tester ;
IN: db.postgresql.tests IN: db.postgresql.tests
: test-db ( -- postgresql-db )
<postgresql-db>
"localhost" >>host
"postgres" >>username
"thepasswordistrust" >>password
"factor-test" >>database ;
os windows? cpu x86.64? and [ os windows? cpu x86.64? and [
[ ] [ test-db [ ] with-db ] unit-test [ ] [ postgresql-test-db [ ] with-db ] unit-test
[ ] [ [ ] [
test-db [ postgresql-test-db [
[ "drop table person;" sql-command ] ignore-errors [ "drop table person;" sql-command ] ignore-errors
"create table person (name varchar(30), country varchar(30));" "create table person (name varchar(30), country varchar(30));"
sql-command sql-command
@ -30,7 +23,7 @@ os windows? cpu x86.64? and [
{ "Jane" "New Zealand" } { "Jane" "New Zealand" }
} }
] [ ] [
test-db [ postgresql-test-db [
"select * from person" sql-query "select * from person" sql-query
] with-db ] with-db
] unit-test ] unit-test
@ -40,11 +33,11 @@ os windows? cpu x86.64? and [
{ "John" "America" } { "John" "America" }
{ "Jane" "New Zealand" } { "Jane" "New Zealand" }
} }
] [ test-db [ "select * from person" sql-query ] with-db ] unit-test ] [ postgresql-test-db [ "select * from person" sql-query ] with-db ] unit-test
[ [
] [ ] [
test-db [ postgresql-test-db [
"insert into person(name, country) values('Jimmy', 'Canada')" "insert into person(name, country) values('Jimmy', 'Canada')"
sql-command sql-command
] with-db ] with-db
@ -56,10 +49,10 @@ os windows? cpu x86.64? and [
{ "Jane" "New Zealand" } { "Jane" "New Zealand" }
{ "Jimmy" "Canada" } { "Jimmy" "Canada" }
} }
] [ test-db [ "select * from person" sql-query ] with-db ] unit-test ] [ postgresql-test-db [ "select * from person" sql-query ] with-db ] unit-test
[ [
test-db [ postgresql-test-db [
[ [
"insert into person(name, country) values('Jose', 'Mexico')" sql-command "insert into person(name, country) values('Jose', 'Mexico')" sql-command
"insert into person(name, country) values('Jose', 'Mexico')" sql-command "insert into person(name, country) values('Jose', 'Mexico')" sql-command
@ -69,14 +62,14 @@ os windows? cpu x86.64? and [
] must-fail ] must-fail
[ 3 ] [ [ 3 ] [
test-db [ postgresql-test-db [
"select * from person" sql-query length "select * from person" sql-query length
] with-db ] with-db
] unit-test ] unit-test
[ [
] [ ] [
test-db [ postgresql-test-db [
[ [
"insert into person(name, country) values('Jose', 'Mexico')" "insert into person(name, country) values('Jose', 'Mexico')"
sql-command sql-command
@ -87,7 +80,7 @@ os windows? cpu x86.64? and [
] unit-test ] unit-test
[ 5 ] [ [ 5 ] [
test-db [ postgresql-test-db [
"select * from person" sql-query length "select * from person" sql-query length
] with-db ] with-db
] unit-test ] unit-test

View File

@ -5,8 +5,8 @@ kernel math math.parser namespaces make prettyprint quotations
sequences debugger db db.postgresql.lib db.postgresql.ffi sequences debugger db db.postgresql.lib db.postgresql.ffi
db.tuples db.types tools.annotations math.ranges db.tuples db.types tools.annotations math.ranges
combinators classes locals words tools.walker db.private combinators classes locals words tools.walker db.private
nmake accessors random db.queries destructors db.tuples.private ; nmake accessors random db.queries destructors db.tuples.private
USE: tools.walker db.postgresql db.errors.postgresql splitting ;
IN: db.postgresql IN: db.postgresql
TUPLE: postgresql-db host port pgopts pgtty database username password ; TUPLE: postgresql-db host port pgopts pgtty database username password ;
@ -280,3 +280,14 @@ M: postgresql-db-connection compound ( string object -- string' )
{ "references" [ >reference-string ] } { "references" [ >reference-string ] }
[ drop no-compound-found ] [ drop no-compound-found ]
} case ; } case ;
M: postgresql-db-connection parse-db-error
"\n" split dup length {
{ 1 [ first parse-postgresql-sql-error ] }
{ 3 [
first3
[ parse-postgresql-sql-error ] 2dip
postgresql-location >>location
] }
} case ;

View File

@ -11,12 +11,17 @@ IN: db.sqlite.lib
ERROR: sqlite-error < db-error n string ; ERROR: sqlite-error < db-error n string ;
ERROR: sqlite-sql-error < sql-error n string ; ERROR: sqlite-sql-error < sql-error n string ;
: <sqlite-sql-error> ( n string -- error )
\ sqlite-sql-error new
swap >>string
swap >>n ;
: throw-sqlite-error ( n -- * ) : throw-sqlite-error ( n -- * )
dup sqlite-error-messages nth sqlite-error ; dup sqlite-error-messages nth sqlite-error ;
: sqlite-statement-error ( -- * ) : sqlite-statement-error ( -- * )
SQLITE_ERROR SQLITE_ERROR
db-connection get handle>> sqlite3_errmsg sqlite-sql-error ; db-connection get handle>> sqlite3_errmsg <sqlite-sql-error> throw ;
: sqlite-check-result ( n -- ) : sqlite-check-result ( n -- )
{ {

View File

@ -123,12 +123,8 @@ hi "HELLO" {
] with-db ] with-db
] unit-test ] unit-test
[ ] [
test.db [ ! Test SQLite triggers
hi create-table
hi drop-table
] with-db
] unit-test
TUPLE: show id ; TUPLE: show id ;
TUPLE: user username data ; TUPLE: user username data ;
@ -144,12 +140,12 @@ show "SHOW" {
} define-persistent } define-persistent
watch "WATCH" { watch "WATCH" {
{ "user" "USER" TEXT +not-null+ { "user" "USER" TEXT +not-null+ +user-assigned-id+
{ +foreign-id+ user "USERNAME" } +user-assigned-id+ } { +foreign-id+ user "USERNAME" } }
{ "show" "SHOW" BIG-INTEGER +not-null+ { "show" "SHOW" BIG-INTEGER +not-null+ +user-assigned-id+
{ +foreign-id+ show "ID" } +user-assigned-id+ } { +foreign-id+ show "ID" } }
} define-persistent } define-persistent
[ T{ user { username "littledan" } { data "foo" } } ] [ [ T{ user { username "littledan" } { data "foo" } } ] [
test.db [ test.db [
user create-table user create-table
@ -160,7 +156,7 @@ watch "WATCH" {
show new insert-tuple show new insert-tuple
show new select-tuple show new select-tuple
"littledan" f user boa select-tuple "littledan" f user boa select-tuple
swap [ username>> ] [ id>> ] bi* [ id>> ] [ username>> ] bi*
watch boa insert-tuple watch boa insert-tuple
watch new select-tuple watch new select-tuple
user>> f user boa select-tuple user>> f user boa select-tuple

View File

@ -6,7 +6,8 @@ sequences strings classes.tuple alien.c-types continuations
db.sqlite.lib db.sqlite.ffi db.tuples words db.types combinators db.sqlite.lib db.sqlite.ffi db.tuples words db.types combinators
math.intervals io nmake accessors vectors math.ranges random math.intervals io nmake accessors vectors math.ranges random
math.bitwise db.queries destructors db.tuples.private interpolate math.bitwise db.queries destructors db.tuples.private interpolate
io.streams.string multiline make db.private sequences.deep ; io.streams.string multiline make db.private sequences.deep
db.errors.sqlite ;
IN: db.sqlite IN: db.sqlite
TUPLE: sqlite-db path ; TUPLE: sqlite-db path ;
@ -204,7 +205,7 @@ M: sqlite-db-connection persistent-table ( -- assoc )
CREATE TRIGGER fki_${table-name}_${table-id}_${foreign-table-name}_${foreign-table-id}_id CREATE TRIGGER fki_${table-name}_${table-id}_${foreign-table-name}_${foreign-table-id}_id
BEFORE INSERT ON ${table-name} BEFORE INSERT ON ${table-name}
FOR EACH ROW BEGIN FOR EACH ROW BEGIN
SELECT RAISE(ROLLBACK, 'insert on table "${table-name}" violates foreign key constraint "fk_${foreign-table-name}_id"') SELECT RAISE(ROLLBACK, 'insert on table "${table-name}" violates foreign key constraint "fki_${table-name}_$table-id}_${foreign-table-name}_${foreign-table-id}_id"')
WHERE (SELECT ${foreign-table-id} FROM ${foreign-table-name} WHERE ${foreign-table-id} = NEW.${table-id}) IS NULL; WHERE (SELECT ${foreign-table-id} FROM ${foreign-table-name} WHERE ${foreign-table-id} = NEW.${table-id}) IS NULL;
END; END;
"> interpolate "> interpolate
@ -216,28 +217,21 @@ M: sqlite-db-connection persistent-table ( -- assoc )
CREATE TRIGGER fki_${table-name}_${table-id}_${foreign-table-name}_${foreign-table-id}_id CREATE TRIGGER fki_${table-name}_${table-id}_${foreign-table-name}_${foreign-table-id}_id
BEFORE INSERT ON ${table-name} BEFORE INSERT ON ${table-name}
FOR EACH ROW BEGIN FOR EACH ROW BEGIN
SELECT RAISE(ROLLBACK, 'insert on table "${table-name}" violates foreign key constraint "fk_${foreign-table-name}_id"') SELECT RAISE(ROLLBACK, 'insert on table "${table-name}" violates foreign key constraint "fki_${table-name}_$table-id}_${foreign-table-name}_${foreign-table-id}_id"')
WHERE NEW.${foreign-table-id} IS NOT NULL WHERE NEW.${table-id} IS NOT NULL
AND (SELECT ${foreign-table-id} FROM ${foreign-table-name} WHERE ${foreign-table-id} = NEW.${table-id}) IS NULL; AND (SELECT ${foreign-table-id} FROM ${foreign-table-name} WHERE ${foreign-table-id} = NEW.${table-id}) IS NULL;
END; END;
"> interpolate "> interpolate
] with-string-writer ; ] with-string-writer ;
: drop-insert-trigger ( -- string )
[
<"
DROP TRIGGER fki_${table-name}_${table-id}_${foreign-table-name}_${foreign-table-id}_id;
"> interpolate
] with-string-writer ;
: update-trigger ( -- string ) : update-trigger ( -- string )
[ [
<" <"
CREATE TRIGGER fku_${table-name}_${table-id}_${foreign-table-name}_${foreign-table-id}_id CREATE TRIGGER fku_${table-name}_${table-id}_${foreign-table-name}_${foreign-table-id}_id
BEFORE UPDATE ON ${table-name} BEFORE UPDATE ON ${table-name}
FOR EACH ROW BEGIN FOR EACH ROW BEGIN
SELECT RAISE(ROLLBACK, 'update on table "${table-name}" violates foreign key constraint "fk_${foreign-table-name}_id"') SELECT RAISE(ROLLBACK, 'update on table "${table-name}" violates foreign key constraint "fku_${table-name}_$table-id}_${foreign-table-name}_${foreign-table-id}_id"')
WHERE (SELECT ${foreign-table-id} FROM ${foreign-table-name} WHERE ${foreign-table-id} = NEW.${table-id}) IS NULL; WHERE (SELECT ${foreign-table-id} FROM ${foreign-table-name} WHERE ${foreign-table-id} = NEW.${table-id}) IS NULL;
END; END;
"> interpolate "> interpolate
] with-string-writer ; ] with-string-writer ;
@ -248,39 +242,25 @@ M: sqlite-db-connection persistent-table ( -- assoc )
CREATE TRIGGER fku_${table-name}_${table-id}_${foreign-table-name}_${foreign-table-id}_id CREATE TRIGGER fku_${table-name}_${table-id}_${foreign-table-name}_${foreign-table-id}_id
BEFORE UPDATE ON ${table-name} BEFORE UPDATE ON ${table-name}
FOR EACH ROW BEGIN FOR EACH ROW BEGIN
SELECT RAISE(ROLLBACK, 'update on table "${table-name}" violates foreign key constraint "fk_${foreign-table-name}_id"') SELECT RAISE(ROLLBACK, 'update on table "${table-name}" violates foreign key constraint "fku_${table-name}_$table-id}_${foreign-table-name}_${foreign-table-id}_id"')
WHERE NEW.${foreign-table-id} IS NOT NULL WHERE NEW.${table-id} IS NOT NULL
AND (SELECT ${foreign-table-id} FROM ${foreign-table-name} WHERE ${foreign-table-id} = NEW.${table-id}) IS NULL; AND (SELECT ${foreign-table-id} FROM ${foreign-table-name} WHERE ${foreign-table-id} = NEW.${table-id}) IS NULL;
END; END;
"> interpolate "> interpolate
] with-string-writer ; ] with-string-writer ;
: drop-update-trigger ( -- string )
[
<"
DROP TRIGGER fku_${table-name}_${table-id}_${foreign-table-name}_${foreign-table-id}_id;
"> interpolate
] with-string-writer ;
: delete-trigger-restrict ( -- string ) : delete-trigger-restrict ( -- string )
[ [
<" <"
CREATE TRIGGER fkd_${table-name}_${table-id}_${foreign-table-name}_${foreign-table-id}_id CREATE TRIGGER fkd_${table-name}_${table-id}_${foreign-table-name}_${foreign-table-id}_id
BEFORE DELETE ON ${foreign-table-name} BEFORE DELETE ON ${foreign-table-name}
FOR EACH ROW BEGIN FOR EACH ROW BEGIN
SELECT RAISE(ROLLBACK, 'delete on table "${foreign-table-name}" violates foreign key constraint "fk_${foreign-table-name}_id"') SELECT RAISE(ROLLBACK, 'delete on table "${foreign-table-name}" violates foreign key constraint "fkd_${table-name}_$table-id}_${foreign-table-name}_${foreign-table-id}_id"')
WHERE (SELECT ${foreign-table-id} FROM ${foreign-table-name} WHERE ${foreign-table-id} = OLD.${foreign-table-id}) IS NOT NULL; WHERE (SELECT ${foreign-table-id} FROM ${foreign-table-name} WHERE ${foreign-table-id} = OLD.${foreign-table-id}) IS NOT NULL;
END; END;
"> interpolate "> interpolate
] with-string-writer ; ] with-string-writer ;
: drop-delete-trigger-restrict ( -- string )
[
<"
DROP TRIGGER fkd_${table-name}_${table-id}_${foreign-table-name}_${foreign-table-id}_id;
"> interpolate
] with-string-writer ;
: delete-trigger-cascade ( -- string ) : delete-trigger-cascade ( -- string )
[ [
<" <"
@ -292,13 +272,6 @@ M: sqlite-db-connection persistent-table ( -- assoc )
"> interpolate "> interpolate
] with-string-writer ; ] with-string-writer ;
: drop-delete-trigger-cascade ( -- string )
[
<"
DROP TRIGGER fkd_${table-name}_${table-id}_${foreign-table-name}_${foreign-table-id}_id;
"> interpolate
] with-string-writer ;
: can-be-null? ( -- ? ) : can-be-null? ( -- ? )
"sql-spec" get modifiers>> [ +not-null+ = ] any? not ; "sql-spec" get modifiers>> [ +not-null+ = ] any? not ;
@ -322,31 +295,22 @@ M: sqlite-db-connection persistent-table ( -- assoc )
delete-trigger-restrict sqlite-trigger, delete-trigger-restrict sqlite-trigger,
] if ; ] if ;
: drop-sqlite-triggers ( -- ) : create-db-triggers ( sql-specs -- )
drop-insert-trigger sqlite-trigger, [ modifiers>> [ +foreign-id+ = ] deep-any? ] filter
drop-update-trigger sqlite-trigger, [
delete-cascade? [ [ class>> db-table-name "db-table" set ]
drop-delete-trigger-cascade sqlite-trigger,
] [
drop-delete-trigger-restrict sqlite-trigger,
] if ;
: db-triggers ( sql-specs word -- )
'[
[ modifiers>> [ +foreign-id+ = ] deep-any? ] filter
[ [
[ class>> db-table-name "db-table" set ] [ "sql-spec" set ]
[ column-name>> "table-id" set ] [ column-name>> "table-id" set ]
[ ] tri
modifiers>> [ [ +foreign-id+ = ] deep-any? ] filter
[ [
modifiers>> [ [ +foreign-id+ = ] deep-any? ] filter [ second db-table-name "foreign-table-name" set ]
[ [ third "foreign-table-id" set ] bi
[ second db-table-name "foreign-table-name" set ] create-sqlite-triggers
[ third "foreign-table-id" set ] bi ] each
_ execute ] bi
] each ] each ;
] tri
] each
] call ;
: sqlite-create-table ( sql-specs class-name -- ) : sqlite-create-table ( sql-specs class-name -- )
[ [
@ -371,16 +335,12 @@ M: sqlite-db-connection persistent-table ( -- assoc )
M: sqlite-db-connection create-sql-statement ( class -- statement ) M: sqlite-db-connection create-sql-statement ( class -- statement )
[ [
! specs name
[ sqlite-create-table ] [ sqlite-create-table ]
[ drop \ create-sqlite-triggers db-triggers ] 2bi [ drop create-db-triggers ] 2bi
] query-make ; ] query-make ;
M: sqlite-db-connection drop-sql-statement ( class -- statements ) M: sqlite-db-connection drop-sql-statement ( class -- statements )
[ [ nip "drop table " 0% 0% ";" 0% ] query-make ;
[ nip "drop table " 0% 0% ";" 0% ]
[ drop \ drop-sqlite-triggers db-triggers ] 2bi
] query-make ;
M: sqlite-db-connection compound ( string seq -- new-string ) M: sqlite-db-connection compound ( string seq -- new-string )
over { over {
@ -388,3 +348,9 @@ M: sqlite-db-connection compound ( string seq -- new-string )
{ "references" [ >reference-string ] } { "references" [ >reference-string ] }
[ 2drop ] [ 2drop ]
} case ; } case ;
M: sqlite-db-connection parse-db-error
dup n>> {
{ 1 [ string>> parse-sqlite-sql-error ] }
[ drop ]
} case ;

View File

@ -2,9 +2,42 @@
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: concurrency.combinators db.pools db.sqlite db.tuples USING: concurrency.combinators db.pools db.sqlite db.tuples
db.types kernel math random threads tools.test db sequences db.types kernel math random threads tools.test db sequences
io prettyprint ; io prettyprint db.postgresql db.sqlite accessors io.files.temp
namespaces fry system ;
IN: db.tester IN: db.tester
: postgresql-test-db ( -- postgresql-db )
<postgresql-db>
"localhost" >>host
"postgres" >>username
"thepasswordistrust" >>password
"factor-test" >>database ;
: sqlite-test-db ( -- sqlite-db )
"tuples-test.db" temp-file <sqlite-db> ;
! These words leak resources, but are useful for interactivel testing
: set-sqlite-db ( -- )
sqlite-db db-open db-connection set ;
: set-postgresql-db ( -- )
postgresql-db db-open db-connection set ;
: test-sqlite ( quot -- )
'[
[ ] [ sqlite-test-db _ with-db ] unit-test
] call ; inline
: test-postgresql ( quot -- )
'[
os windows? cpu x86.64? and [
[ ] [ postgresql-test-db _ with-db ] unit-test
] unless
] call ; inline
TUPLE: test-1 id a b c ; TUPLE: test-1 id a b c ;
test-1 "TEST1" { test-1 "TEST1" {
@ -23,9 +56,6 @@ test-2 "TEST2" {
{ "z" "Z" { VARCHAR 256 } +not-null+ } { "z" "Z" { VARCHAR 256 } +not-null+ }
} define-persistent } define-persistent
: sqlite-test-db ( -- db ) "test.db" <sqlite-db> ;
: test-db ( -- db ) "test.db" <sqlite-db> ;
: db-tester ( test-db -- ) : db-tester ( test-db -- )
[ [
[ [

View File

@ -4,40 +4,10 @@ USING: io.files io.files.temp kernel tools.test db db.tuples classes
db.types continuations namespaces math math.ranges db.types continuations namespaces math math.ranges
prettyprint calendar sequences db.sqlite math.intervals prettyprint calendar sequences db.sqlite math.intervals
db.postgresql accessors random math.bitwise system db.postgresql accessors random math.bitwise system
math.ranges strings urls fry db.tuples.private db.private ; math.ranges strings urls fry db.tuples.private db.private
db.tester ;
IN: db.tuples.tests IN: db.tuples.tests
: sqlite-db ( -- sqlite-db )
"tuples-test.db" temp-file <sqlite-db> ;
: test-sqlite ( quot -- )
'[
[ ] [
"tuples-test.db" temp-file <sqlite-db> _ with-db
] unit-test
] call ; inline
: postgresql-db ( -- postgresql-db )
<postgresql-db>
"localhost" >>host
"postgres" >>username
"thepasswordistrust" >>password
"factor-test" >>database ;
: test-postgresql ( quot -- )
'[
os windows? cpu x86.64? and [
[ ] [ postgresql-db _ with-db ] unit-test
] unless
] call ; inline
! These words leak resources, but are useful for interactivel testing
: sqlite-test-db ( -- )
sqlite-db db-open db-connection set ;
: postgresql-test-db ( -- )
postgresql-db db-open db-connection set ;
TUPLE: person the-id the-name the-number the-real TUPLE: person the-id the-name the-number the-real
ts date time blob factor-blob url ; ts date time blob factor-blob url ;

View File

@ -4,7 +4,7 @@ USING: arrays assocs classes db kernel namespaces
classes.tuple words sequences slots math accessors classes.tuple words sequences slots math accessors
math.parser io prettyprint db.types continuations math.parser io prettyprint db.types continuations
destructors mirrors sets db.types db.private fry destructors mirrors sets db.types db.private fry
combinators.short-circuit ; combinators.short-circuit db.errors ;
IN: db.tuples IN: db.tuples
HOOK: create-sql-statement db-connection ( class -- object ) HOOK: create-sql-statement db-connection ( class -- object )
@ -118,13 +118,15 @@ ERROR: no-defined-persistent object ;
ensure-defined-persistent ensure-defined-persistent
[ [
'[ '[
_ drop-sql-statement [ execute-statement ] with-disposals [
] ignore-errors _ drop-sql-statement [ execute-statement ] with-disposals
] ignore-table-missing
] ignore-function-missing
] [ create-table ] bi ; ] [ create-table ] bi ;
: ensure-table ( class -- ) : ensure-table ( class -- )
ensure-defined-persistent ensure-defined-persistent
'[ _ create-table ] ignore-errors ; '[ [ _ create-table ] ignore-table-exists ] ignore-function-exists ;
: ensure-tables ( classes -- ) [ ensure-table ] each ; : ensure-tables ( classes -- ) [ ensure-table ] each ;

View File

@ -124,9 +124,6 @@ FACTOR-BLOB NULL URL ;
! PostgreSQL Types: ! PostgreSQL Types:
! http://developer.postgresql.org/pgdocs/postgres/datatype.html ! http://developer.postgresql.org/pgdocs/postgres/datatype.html
: ?at ( obj assoc -- value/obj ? )
dupd at* [ [ nip ] [ drop ] if ] keep ;
ERROR: unknown-modifier modifier ; ERROR: unknown-modifier modifier ;
: lookup-modifier ( obj -- string ) : lookup-modifier ( obj -- string )

View File

@ -1,17 +1,24 @@
USING: definitions io.launcher kernel parser words sequences math USING: definitions io.launcher kernel parser words sequences math
math.parser namespaces editors make system ; math.parser namespaces editors make system combinators.short-circuit
fry threads ;
IN: editors.emacs IN: editors.emacs
SYMBOL: emacsclient-path
HOOK: default-emacsclient os ( -- path )
M: object default-emacsclient ( -- path ) "emacsclient" ;
: emacsclient ( file line -- ) : emacsclient ( file line -- )
[ [
\ emacsclient get "emacsclient" or , { [ \ emacsclient-path get ] [ default-emacsclient ] } 0|| ,
os windows? [ "--no-wait" , ] unless "--no-wait" ,
"+" swap number>string append , number>string "+" prepend ,
, ,
] { } make try-process ; ] { } make
os windows? [ run-detached drop ] [ try-process ] if ;
: emacs ( word -- ) : emacs ( word -- )
where first2 emacsclient ; where first2 emacsclient ;
[ emacsclient ] edit-hook set-global [ emacsclient ] edit-hook set-global

View File

View File

@ -0,0 +1,12 @@
! Copyright (C) 2009 Doug Coleman.
! See http://factorcode.org/license.txt for BSD license.
USING: editors.emacs io.directories.search.windows kernel sequences
system combinators.short-circuit ;
IN: editors.emacs.windows
M: windows default-emacsclient
{
[ "Emacs" t [ "emacsclientw.exe" tail? ] find-in-program-files ]
[ "Emacs" t [ "emacsclient.exe" tail? ] find-in-program-files ]
[ "emacsclient.exe" ]
} 0|| ;

View File

@ -55,7 +55,7 @@ M: no-article summary
drop "Help article does not exist" ; drop "Help article does not exist" ;
: article ( name -- article ) : article ( name -- article )
dup articles get at* [ nip ] [ drop no-article ] if ; articles get ?at [ no-article ] unless ;
M: object article-name article article-name ; M: object article-name article article-name ;
M: object article-title article article-title ; M: object article-title article article-title ;

View File

@ -243,9 +243,6 @@ ERROR: bad-tiff-magic bytes ;
ERROR: no-tag class ; ERROR: no-tag class ;
: ?at ( key assoc -- value/key ? )
dupd at* [ nip t ] [ drop f ] if ; inline
: find-tag ( idf class -- tag ) : find-tag ( idf class -- tag )
swap processed-tags>> ?at [ no-tag ] unless ; swap processed-tags>> ?at [ no-tag ] unless ;

View File

@ -57,8 +57,14 @@ PRIVATE>
pusher [ [ f ] compose iterate-directory drop ] dip pusher [ [ f ] compose iterate-directory drop ] dip
] [ drop f ] recover ; inline ] [ drop f ] recover ; inline
ERROR: file-not-found ;
: find-in-directories ( directories bfs? quot: ( obj -- ? ) -- path'/f ) : find-in-directories ( directories bfs? quot: ( obj -- ? ) -- path'/f )
'[ _ _ find-file ] attempt-all ; [
'[ _ _ find-file [ file-not-found ] unless* ] attempt-all
] [
drop f
] recover ;
: find-all-in-directories ( directories bfs? quot: ( obj -- ? ) -- paths/f ) : find-all-in-directories ( directories bfs? quot: ( obj -- ? ) -- paths/f )
'[ _ _ find-all-files ] map concat ; '[ _ _ find-all-files ] map concat ;

View File

@ -114,21 +114,21 @@ M: file-info file-mode? [ permissions>> ] dip mask? ;
PRIVATE> PRIVATE>
: UID OCT: 0004000 ; inline CONSTANT: UID OCT: 0004000
: GID OCT: 0002000 ; inline CONSTANT: GID OCT: 0002000
: STICKY OCT: 0001000 ; inline CONSTANT: STICKY OCT: 0001000
: USER-ALL OCT: 0000700 ; inline CONSTANT: USER-ALL OCT: 0000700
: USER-READ OCT: 0000400 ; inline CONSTANT: USER-READ OCT: 0000400
: USER-WRITE OCT: 0000200 ; inline CONSTANT: USER-WRITE OCT: 0000200
: USER-EXECUTE OCT: 0000100 ; inline CONSTANT: USER-EXECUTE OCT: 0000100
: GROUP-ALL OCT: 0000070 ; inline CONSTANT: GROUP-ALL OCT: 0000070
: GROUP-READ OCT: 0000040 ; inline CONSTANT: GROUP-READ OCT: 0000040
: GROUP-WRITE OCT: 0000020 ; inline CONSTANT: GROUP-WRITE OCT: 0000020
: GROUP-EXECUTE OCT: 0000010 ; inline CONSTANT: GROUP-EXECUTE OCT: 0000010
: OTHER-ALL OCT: 0000007 ; inline CONSTANT: OTHER-ALL OCT: 0000007
: OTHER-READ OCT: 0000004 ; inline CONSTANT: OTHER-READ OCT: 0000004
: OTHER-WRITE OCT: 0000002 ; inline CONSTANT: OTHER-WRITE OCT: 0000002
: OTHER-EXECUTE OCT: 0000001 ; inline CONSTANT: OTHER-EXECUTE OCT: 0000001
: uid? ( obj -- ? ) UID file-mode? ; : uid? ( obj -- ? ) UID file-mode? ;
: gid? ( obj -- ? ) GID file-mode? ; : gid? ( obj -- ? ) GID file-mode? ;

View File

@ -94,7 +94,7 @@ M: unix (datagram)
SYMBOL: receive-buffer SYMBOL: receive-buffer
: packet-size 65536 ; inline CONSTANT: packet-size 65536
[ packet-size malloc receive-buffer set-global ] "io.sockets.unix" add-init-hook [ packet-size malloc receive-buffer set-global ] "io.sockets.unix" add-init-hook

View File

@ -0,0 +1 @@
Daniel Ehrenberg

View File

@ -0,0 +1,26 @@
! Copyright (C) 2009 Daniel Ehrenberg
! See http://factorcode.org/license.txt for BSD license.
USING: help.syntax help.markup math ;
IN: math.bits
ABOUT: "math.bits"
ARTICLE: "math.bits" "Number bits virtual sequence"
{ $subsection bits }
{ $subsection <bits> }
{ $subsection make-bits } ;
HELP: bits
{ $class-description "Virtual sequence class of bits of a number. The first bit is the least significant bit. This can be constructed with " { $link <bits> } " or " { $link make-bits } "." } ;
HELP: <bits>
{ $values { "number" integer } { "length" integer } { "bits" bits } }
{ $description "Creates a virtual sequence of bits of a number in little endian order, with the given length." } ;
HELP: make-bits
{ $values { "number" integer } { "bits" bits } }
{ $description "Creates a " { $link bits } " object out of the given number, using its log base 2 as the length. This implies that the last element, corresponding to the most significant bit, will be 1." }
{ $examples
{ $example "USING: math.bits prettyprint arrays ;" "BIN: 1101 make-bits >array ." "{ t f t t }" }
{ $example "USING: math.bits prettyprint arrays ;" "-3 make-bits >array ." "{ t f }" }
} ;

View File

@ -0,0 +1,31 @@
! Copyright (C) 2009 Daniel Ehrenberg
! See http://factorcode.org/license.txt for BSD license.
USING: tools.test math math.bits sequences arrays ;
IN: math.bits.tests
[ t ] [ BIN: 111111 3 <bits> second ] unit-test
[ { t t t } ] [ BIN: 111111 3 <bits> >array ] unit-test
[ f ] [ BIN: 111101 3 <bits> second ] unit-test
[ { f f t } ] [ BIN: 111100 3 <bits> >array ] unit-test
[ 3 ] [ BIN: 111111 3 <bits> length ] unit-test
[ 6 ] [ BIN: 111111 make-bits length ] unit-test
[ 0 ] [ 0 make-bits length ] unit-test
[ 2 ] [ 3 make-bits length ] unit-test
[ 2 ] [ -3 make-bits length ] unit-test
[ 1 ] [ 1 make-bits length ] unit-test
[ 1 ] [ -1 make-bits length ] unit-test
! Odd bug
[ t ] [
1067811677921310779 make-bits
1067811677921310779 >bignum make-bits
sequence=
] unit-test
[ t ] [
1067811677921310779 make-bits peek
] unit-test
[ t ] [
1067811677921310779 >bignum make-bits peek
] unit-test

View File

@ -0,0 +1,16 @@
! Copyright (C) 2009 Daniel Ehrenberg
! See http://factorcode.org/license.txt for BSD license.
USING: sequences kernel math accessors sequences.private ;
IN: math.bits
TUPLE: bits { number read-only } { length read-only } ;
C: <bits> bits
: make-bits ( number -- bits )
dup zero? [ drop T{ bits f 0 0 } ] [ dup abs log2 1+ <bits> ] if ; inline
M: bits length length>> ;
M: bits nth-unsafe number>> swap bit? ;
INSTANCE: bits immutable-sequence

View File

@ -0,0 +1 @@
Virtual sequence for bits of an integer

View File

@ -19,8 +19,8 @@ IN: math.bitwise.tests
[ 268 ] [ 1 { 8 { 3 2 } } bitfield ] unit-test [ 268 ] [ 1 { 8 { 3 2 } } bitfield ] unit-test
[ 512 ] [ 1 { { 1+ 8 } } bitfield ] unit-test [ 512 ] [ 1 { { 1+ 8 } } bitfield ] unit-test
: a 1 ; inline CONSTANT: a 1
: b 2 ; inline CONSTANT: b 2
: foo ( -- flags ) { a b } flags ; : foo ( -- flags ) { a b } flags ;

View File

@ -1,6 +1,6 @@
! Copyright (C) 2007, 2008 Slava Pestov, Doug Coleman. ! Copyright (C) 2007, 2008 Slava Pestov, Doug Coleman.
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: arrays kernel math math.functions sequences USING: arrays kernel math sequences accessors math.bits
sequences.private words namespaces macros hints sequences.private words namespaces macros hints
combinators fry io.binary combinators.smart ; combinators fry io.binary combinators.smart ;
IN: math.bitwise IN: math.bitwise
@ -65,7 +65,7 @@ DEFER: byte-bit-count
\ byte-bit-count \ byte-bit-count
256 [ 256 [
0 swap [ [ 1+ ] when ] each-bit 8 <bits> 0 [ [ 1+ ] when ] reduce
] B{ } map-as '[ HEX: ff bitand _ nth-unsafe ] ] B{ } map-as '[ HEX: ff bitand _ nth-unsafe ]
(( byte -- table )) define-declared (( byte -- table )) define-declared

View File

@ -278,14 +278,6 @@ HELP: mod-inv
{ $example "USING: math prettyprint ;" "173 815 * 1119 mod ." "1" } { $example "USING: math prettyprint ;" "173 815 * 1119 mod ." "1" }
} ; } ;
HELP: each-bit
{ $values { "n" integer } { "quot" { $quotation "( ? -- )" } } }
{ $description "Applies the quotation to each bit of the integer, starting from the least significant bit, and stopping at the last bit from which point on all bits are either clear (if the integer is positive) or all bits are set (if the integer is negataive)." }
{ $examples
{ $example "USING: math.functions make prettyprint ;" "[ BIN: 1101 [ , ] each-bit ] { } make ." "{ t f t t }" }
{ $example "USING: math.functions make prettyprint ;" "[ -3 [ , ] each-bit ] { } make ." "{ t f }" }
} ;
HELP: ~ HELP: ~
{ $values { "x" real } { "y" real } { "epsilon" real } { "?" "a boolean" } } { $values { "x" real } { "y" real } { "epsilon" real } { "?" "a boolean" } }
{ $description "Tests if " { $snippet "x" } " and " { $snippet "y" } " are approximately equal to each other. There are three possible comparison tests, chosen based on the sign of " { $snippet "epsilon" } ":" { $description "Tests if " { $snippet "x" } " and " { $snippet "y" } " are approximately equal to each other. There are three possible comparison tests, chosen based on the sign of " { $snippet "epsilon" } ":"

View File

@ -137,3 +137,17 @@ IN: math.functions.tests
[ 6 59967 ] [ 3837888 factor-2s ] unit-test [ 6 59967 ] [ 3837888 factor-2s ] unit-test
[ 6 -59967 ] [ -3837888 factor-2s ] unit-test [ 6 -59967 ] [ -3837888 factor-2s ] unit-test
[ 1 ] [
183009416410801897
1067811677921310779
2135623355842621559
^mod
] unit-test
[ 1 ] [
183009416410801897
1067811677921310779
2135623355842621559
[ >bignum ] tri@ ^mod
] unit-test

View File

@ -1,6 +1,6 @@
! Copyright (C) 2004, 2008 Slava Pestov. ! Copyright (C) 2004, 2008 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: math kernel math.constants math.private USING: math kernel math.constants math.private math.bits
math.libm combinators math.order sequences ; math.libm combinators math.order sequences ;
IN: math.functions IN: math.functions
@ -26,16 +26,6 @@ GENERIC: sqrt ( x -- y ) foldable
M: real sqrt M: real sqrt
>float dup 0.0 < [ neg fsqrt 0.0 swap rect> ] [ fsqrt ] if ; >float dup 0.0 < [ neg fsqrt 0.0 swap rect> ] [ fsqrt ] if ;
: each-bit ( n quot: ( ? -- ) -- )
over [ 0 = ] [ -1 = ] bi or [
2drop
] [
2dup { [ odd? ] [ call ] [ 2/ ] [ each-bit ] } spread
] if ; inline recursive
: map-bits ( n quot: ( ? -- obj ) -- seq )
accumulator [ each-bit ] dip ; inline
: factor-2s ( n -- r s ) : factor-2s ( n -- r s )
#! factor an integer into 2^r * s #! factor an integer into 2^r * s
dup 0 = [ 1 ] [ dup 0 = [ 1 ] [
@ -47,7 +37,7 @@ M: real sqrt
GENERIC# ^n 1 ( z w -- z^w ) GENERIC# ^n 1 ( z w -- z^w )
: (^n) ( z w -- z^w ) : (^n) ( z w -- z^w )
1 swap [ [ dupd * ] when [ sq ] dip ] each-bit nip ; inline make-bits 1 [ [ dupd * ] when [ sq ] dip ] reduce nip ; inline
M: integer ^n M: integer ^n
[ factor-2s ] dip [ (^n) ] keep rot * shift ; [ factor-2s ] dip [ (^n) ] keep rot * shift ;
@ -94,9 +84,9 @@ PRIVATE>
dup zero? [ drop 0./0. ] [ 0 < 1./0. 0 ? ] if ; inline dup zero? [ drop 0./0. ] [ 0 < 1./0. 0 ? ] if ; inline
: (^mod) ( n x y -- z ) : (^mod) ( n x y -- z )
1 swap [ make-bits 1 [
[ dupd * pick mod ] when [ sq over mod ] dip [ dupd * pick mod ] when [ sq over mod ] dip
] each-bit 2nip ; inline ] reduce 2nip ; inline
: (gcd) ( b a x y -- a d ) : (gcd) ( b a x y -- a d )
over zero? [ over zero? [

View File

@ -7,4 +7,5 @@ IN: math.miller-rabin.tests
[ f ] [ 36 miller-rabin ] unit-test [ f ] [ 36 miller-rabin ] unit-test
[ t ] [ 37 miller-rabin ] unit-test [ t ] [ 37 miller-rabin ] unit-test
[ 101 ] [ 100 next-prime ] unit-test [ 101 ] [ 100 next-prime ] unit-test
[ 100000000000031 ] [ 100000000000000 next-prime ] unit-test [ t ] [ 2135623355842621559 miller-rabin ] unit-test
[ 100000000000031 ] [ 100000000000000 next-prime ] unit-test

View File

@ -3,7 +3,8 @@
USING: multiline kernel sequences io splitting fry namespaces USING: multiline kernel sequences io splitting fry namespaces
http.parsers hashtables assocs combinators ascii io.files.unique http.parsers hashtables assocs combinators ascii io.files.unique
accessors io.encodings.binary io.files byte-arrays math accessors io.encodings.binary io.files byte-arrays math
io.streams.string combinators.short-circuit strings math.order ; io.streams.string combinators.short-circuit strings math.order
quoting ;
IN: mime.multipart IN: mime.multipart
CONSTANT: buffer-size 65536 CONSTANT: buffer-size 65536
@ -75,18 +76,6 @@ ERROR: end-of-stream multipart ;
: empty-name? ( string -- ? ) : empty-name? ( string -- ? )
{ "''" "\"\"" "" f } member? ; { "''" "\"\"" "" f } member? ;
: quote? ( ch -- ? ) "'\"" member? ;
: quoted? ( str -- ? )
{
[ length 1 > ]
[ first quote? ]
[ [ first ] [ peek ] bi = ]
} 1&& ;
: unquote ( str -- newstr )
dup quoted? [ but-last-slice rest-slice >string ] when ;
: save-uploaded-file ( multipart -- ) : save-uploaded-file ( multipart -- )
dup filename>> empty-name? [ dup filename>> empty-name? [
drop drop

View File

@ -48,14 +48,14 @@ C-STRUCT: bio
{ "void*" "crypto-ex-data-stack" } { "void*" "crypto-ex-data-stack" }
{ "int" "crypto-ex-data-dummy" } ; { "int" "crypto-ex-data-dummy" } ;
: BIO_NOCLOSE HEX: 00 ; inline CONSTANT: BIO_NOCLOSE HEX: 00
: BIO_CLOSE HEX: 01 ; inline CONSTANT: BIO_CLOSE HEX: 01
: RSA_3 HEX: 3 ; inline CONSTANT: RSA_3 HEX: 3
: RSA_F4 HEX: 10001 ; inline CONSTANT: RSA_F4 HEX: 10001
: BIO_C_SET_SSL 109 ; inline CONSTANT: BIO_C_SET_SSL 109
: BIO_C_GET_SSL 110 ; inline CONSTANT: BIO_C_GET_SSL 110
LIBRARY: libcrypto LIBRARY: libcrypto

View File

@ -20,7 +20,7 @@ TUPLE: persistent-vector
M: persistent-vector length count>> ; M: persistent-vector length count>> ;
: node-size 32 ; inline CONSTANT: node-size 32
: node-mask ( m -- n ) node-size mod ; inline : node-mask ( m -- n ) node-size mod ; inline

View File

View File

@ -0,0 +1,32 @@
! Copyright (C) 2009 Doug Coleman.
! See http://factorcode.org/license.txt for BSD license.
USING: help.markup help.syntax strings ;
IN: quoting
HELP: quote?
{ $values
{ "ch" "a character" }
{ "?" "a boolean" }
}
{ $description "Returns true if the character is a single or double quote." } ;
HELP: quoted?
{ $values
{ "str" string }
{ "?" "a boolean" }
}
{ $description "Returns true if a string is surrounded by matching single or double quotes as the first and last characters." } ;
HELP: unquote
{ $values
{ "str" string }
{ "newstr" string }
}
{ $description "Removes a pair of matching single or double quotes from a string." } ;
ARTICLE: "quoting" "Quotation marks"
"The " { $vocab-link "quoting" } " vocabulary is for removing quotes from a string." $nl
"Removing quotes:"
{ $subsection unquote } ;
ABOUT: "quoting"

View File

@ -0,0 +1,10 @@
! Copyright (C) 2009 Doug Coleman.
! See http://factorcode.org/license.txt for BSD license.
USING: tools.test quoting ;
IN: quoting.tests
[ "abc" ] [ "'abc'" unquote ] unit-test
[ "abc" ] [ "\"abc\"" unquote ] unit-test
[ "'abc" ] [ "'abc" unquote ] unit-test
[ "abc'" ] [ "abc'" unquote ] unit-test

View File

@ -0,0 +1,16 @@
! Copyright (C) 2009 Doug Coleman.
! See http://factorcode.org/license.txt for BSD license.
USING: combinators.short-circuit kernel math sequences strings ;
IN: quoting
: quote? ( ch -- ? ) "'\"" member? ;
: quoted? ( str -- ? )
{
[ length 1 > ]
[ first quote? ]
[ [ first ] [ peek ] bi = ]
} 1&& ;
: unquote ( str -- newstr )
dup quoted? [ but-last-slice rest-slice >string ] when ;

View File

@ -11,9 +11,9 @@ IN: random.mersenne-twister
TUPLE: mersenne-twister { seq uint-array } { i fixnum } ; TUPLE: mersenne-twister { seq uint-array } { i fixnum } ;
: n 624 ; inline CONSTANT: n 624
: m 397 ; inline CONSTANT: m 397
: a uint-array{ 0 HEX: 9908b0df } ; inline CONSTANT: a uint-array{ 0 HEX: 9908b0df }
: y ( n seq -- y ) : y ( n seq -- y )
[ nth-unsafe 31 mask-bit ] [ nth-unsafe 31 mask-bit ]

View File

@ -105,7 +105,7 @@ IN: stack-checker.transforms
] 1 define-transform ] 1 define-transform
! Membership testing ! Membership testing
: bit-member-n 256 ; inline CONSTANT: bit-member-n 256
: bit-member? ( seq -- ? ) : bit-member? ( seq -- ? )
#! Can we use a fast byte array test here? #! Can we use a fast byte array test here?

View File

@ -24,10 +24,10 @@ FUNCTION: void ud_translate_att ( ud* u ) ;
: UD_SYN_INTEL ( -- addr ) &: ud_translate_intel ; inline : UD_SYN_INTEL ( -- addr ) &: ud_translate_intel ; inline
: UD_SYN_ATT ( -- addr ) &: ud_translate_att ; inline : UD_SYN_ATT ( -- addr ) &: ud_translate_att ; inline
: UD_EOI -1 ; inline CONSTANT: UD_EOI -1
: UD_INP_CACHE_SZ 32 ; inline CONSTANT: UD_INP_CACHE_SZ 32
: UD_VENDOR_AMD 0 ; inline CONSTANT: UD_VENDOR_AMD 0
: UD_VENDOR_INTEL 1 ; inline CONSTANT: UD_VENDOR_INTEL 1
FUNCTION: void ud_init ( ud* u ) ; FUNCTION: void ud_init ( ud* u ) ;
FUNCTION: void ud_set_mode ( ud* u, uint8_t mode ) ; FUNCTION: void ud_set_mode ( ud* u, uint8_t mode ) ;

View File

@ -1,6 +1,6 @@
! 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: help.markup help.syntax kernel strings words ; USING: help.markup help.syntax kernel strings words vocabs ;
IN: tools.scaffold IN: tools.scaffold
HELP: developer-name HELP: developer-name
@ -13,7 +13,7 @@ HELP: help.
{ $description "Prints out scaffold help markup for a given word." } ; { $description "Prints out scaffold help markup for a given word." } ;
HELP: scaffold-help HELP: scaffold-help
{ $values { "string" string } } { $values { "vocab" vocab } }
{ $description "Takes an existing vocabulary and creates a help file with scaffolded help for each word. This word only works if no help file yet exists." } ; { $description "Takes an existing vocabulary and creates a help file with scaffolded help for each word. This word only works if no help file yet exists." } ;
HELP: scaffold-undocumented HELP: scaffold-undocumented
@ -28,6 +28,21 @@ HELP: scaffold-vocab
{ "vocab-root" "a vocabulary root string" } { "string" string } } { "vocab-root" "a vocabulary root string" } { "string" string } }
{ $description "Creates a directory in the given root for a new vocabulary and adds a main .factor file, a tests file, and an authors.txt file." } ; { $description "Creates a directory in the given root for a new vocabulary and adds a main .factor file, a tests file, and an authors.txt file." } ;
HELP: scaffold-emacs
{ $description "Touches the .emacs file in your home directory and provides a clickable link to open it in an editor." } ;
HELP: scaffold-factor-boot-rc
{ $description "Touches the .factor-boot-rc file in your home directory and provides a clickable link to open it in an editor." } ;
HELP: scaffold-factor-rc
{ $description "Touches the .factor-rc file in your home directory and provides a clickable link to open it in an editor." } ;
HELP: scaffold-rc
{ $values
{ "path" "a pathname string" }
}
{ $description "Touches the given path in your home directory and provides a clickable link to open it in an editor." } ;
HELP: using HELP: using
{ $description "Stores the vocabularies that are pulled into the documentation file from looking up the stack effect types." } ; { $description "Stores the vocabularies that are pulled into the documentation file from looking up the stack effect types." } ;
@ -40,7 +55,12 @@ ARTICLE: "tools.scaffold" "Scaffold tool"
{ $subsection scaffold-help } { $subsection scaffold-help }
{ $subsection scaffold-undocumented } { $subsection scaffold-undocumented }
{ $subsection help. } { $subsection help. }
"Types that are unrecognized by the scaffold generator will be of type " { $link null } ". The developer should change these to strings that describe the stack effect names instead." "Types that are unrecognized by the scaffold generator will be of type " { $link null } ". The developer should change these to strings that describe the stack effect names instead." $nl
"Scaffolding a configuration file:"
{ $subsection scaffold-rc }
{ $subsection scaffold-factor-boot-rc }
{ $subsection scaffold-factor-rc }
{ $subsection scaffold-emacs }
; ;
ABOUT: "tools.scaffold" ABOUT: "tools.scaffold"

View File

@ -5,7 +5,7 @@ io.encodings.utf8 hashtables kernel namespaces sequences
vocabs.loader io combinators calendar accessors math.parser vocabs.loader io combinators calendar accessors math.parser
io.streams.string ui.tools.operations quotations strings arrays io.streams.string ui.tools.operations quotations strings arrays
prettyprint words vocabs sorting sets classes math alien urls prettyprint words vocabs sorting sets classes math alien urls
splitting ascii ; splitting ascii combinators.short-circuit ;
IN: tools.scaffold IN: tools.scaffold
SYMBOL: developer-name SYMBOL: developer-name
@ -18,37 +18,61 @@ ERROR: no-vocab vocab ;
<PRIVATE <PRIVATE
: root? ( string -- ? ) vocab-roots get member? ; : vocab-root? ( string -- ? ) vocab-roots get member? ;
: contains-dot? ( string -- ? ) ".." swap subseq? ; : contains-dot? ( string -- ? ) ".." swap subseq? ;
: contains-separator? ( string -- ? ) [ path-separator? ] any? ; : contains-separator? ( string -- ? ) [ path-separator? ] any? ;
: check-vocab-name ( string -- string ) : check-vocab-name ( string -- string )
dup contains-dot? [ vocab-name-contains-dot ] when [ ]
dup contains-separator? [ vocab-name-contains-separator ] when ; [ contains-dot? [ vocab-name-contains-dot ] when ]
[ contains-separator? [ vocab-name-contains-separator ] when ] tri ;
: check-root ( string -- string ) : check-root ( string -- string )
dup root? [ not-a-vocab-root ] unless ; dup vocab-root? [ not-a-vocab-root ] unless ;
: check-vocab ( vocab -- vocab )
dup find-vocab-root [ no-vocab ] unless ;
: check-vocab-root/vocab ( vocab-root string -- vocab-root string )
[ check-root ] [ check-vocab-name ] bi* ;
: replace-vocab-separators ( vocab -- path )
path-separator first CHAR: . associate substitute ; inline
: vocab-root/vocab>path ( vocab-root vocab -- path )
check-vocab-root/vocab
[ ] [ replace-vocab-separators ] bi* append-path ;
: vocab>path ( vocab -- path )
check-vocab
[ find-vocab-root ] keep vocab-root/vocab>path ;
: vocab-root/vocab/file>path ( vocab-root vocab file -- path )
[ vocab-root/vocab>path ] dip append-path ;
: vocab-root/vocab/suffix>path ( vocab-root vocab suffix -- path )
[ vocab-root/vocab>path dup file-name append-path ] dip append ;
: vocab/suffix>path ( vocab suffix -- path )
[ vocab>path dup file-name append-path ] dip append ;
: directory-exists ( path -- ) : directory-exists ( path -- )
"Not creating a directory, it already exists: " write print ; "Not creating a directory, it already exists: " write print ;
: scaffold-directory ( path -- ) : scaffold-directory ( vocab-root vocab -- )
vocab-root/vocab>path
dup exists? [ directory-exists ] [ make-directories ] if ; dup exists? [ directory-exists ] [ make-directories ] if ;
: not-scaffolding ( path -- ) : not-scaffolding ( path -- path )
"Not creating scaffolding for " write <pathname> . ; "Not creating scaffolding for " write dup <pathname> . ;
: scaffolding ( path -- ) : scaffolding ( path -- path )
"Creating scaffolding for " write <pathname> . ; "Creating scaffolding for " write dup <pathname> . ;
: (scaffold-path) ( path string -- path ) : scaffolding? ( path -- path ? )
dupd [ file-name ] dip append append-path ; dup exists? [ not-scaffolding f ] [ scaffolding t ] if ;
: scaffold-path ( path string -- path ? )
(scaffold-path)
dup exists? [ dup not-scaffolding f ] [ dup scaffolding t ] if ;
: scaffold-copyright ( -- ) : scaffold-copyright ( -- )
"! Copyright (C) " write now year>> number>string write "! Copyright (C) " write now year>> number>string write
@ -62,37 +86,25 @@ ERROR: no-vocab vocab ;
"IN: " write print "IN: " write print
] with-string-writer ; ] with-string-writer ;
: set-scaffold-main-file ( path vocab -- ) : set-scaffold-main-file ( vocab path -- )
main-file-string swap utf8 set-file-contents ; [ main-file-string ] dip utf8 set-file-contents ;
: scaffold-main ( path vocab -- ) : scaffold-main ( vocab-root vocab -- )
[ ".factor" scaffold-path ] dip tuck ".factor" vocab-root/vocab/suffix>path scaffolding? [
swap [ set-scaffold-main-file ] [ 2drop ] if ; set-scaffold-main-file
: tests-file-string ( vocab -- string )
[
scaffold-copyright
"USING: tools.test " write dup write " ;" print
"IN: " write write ".tests" print
] with-string-writer ;
: set-scaffold-tests-file ( path vocab -- )
tests-file-string swap utf8 set-file-contents ;
: scaffold-tests ( path vocab -- )
[ "-tests.factor" scaffold-path ] dip
swap [ set-scaffold-tests-file ] [ 2drop ] if ;
: scaffold-authors ( path -- )
"authors.txt" append-path dup exists? [
not-scaffolding
] [ ] [
dup scaffolding 2drop
developer-name get swap utf8 set-file-contents ] if ;
: scaffold-authors ( vocab-root vocab -- )
"authors.txt" vocab-root/vocab/file>path scaffolding? [
[ developer-name get ] dip utf8 set-file-contents
] [
drop
] if ; ] if ;
: lookup-type ( string -- object/string ? ) : lookup-type ( string -- object/string ? )
"new" ?head drop [ [ CHAR: ' = ] [ digit? ] bi or ] trim-tail "new" ?head drop [ { [ CHAR: ' = ] [ digit? ] } 1|| ] trim-tail
H{ H{
{ "object" object } { "obj" object } { "object" object } { "obj" object }
{ "quot" quotation } { "quot" quotation }
@ -134,6 +146,9 @@ ERROR: no-vocab vocab ;
" }" write " }" write
] each ; ] each ;
: 4bl ( -- )
" " write ; inline
: $values. ( word -- ) : $values. ( word -- )
"declared-effect" word-prop [ "declared-effect" word-prop [
[ in>> ] [ out>> ] bi [ in>> ] [ out>> ] bi
@ -141,8 +156,8 @@ ERROR: no-vocab vocab ;
2drop 2drop
] [ ] [
"{ $values" print "{ $values" print
[ " " write ($values.) ] [ 4bl ($values.) ]
[ [ nl " " write ($values.) ] unless-empty ] bi* [ [ nl 4bl ($values.) ] unless-empty ] bi*
nl "}" print nl "}" print
] if ] if
] when* ; ] when* ;
@ -151,21 +166,21 @@ ERROR: no-vocab vocab ;
drop drop
"{ $description \"\" } ;" print ; "{ $description \"\" } ;" print ;
: help-header. ( word -- ) : docs-header. ( word -- )
"HELP: " write name>> print ; "HELP: " write name>> print ;
: (help.) ( word -- ) : (help.) ( word -- )
[ help-header. ] [ $values. ] [ $description. ] tri ; [ docs-header. ] [ $values. ] [ $description. ] tri ;
: interesting-words ( vocab -- array ) : interesting-words ( vocab -- array )
words words
[ [ "help" word-prop ] [ predicate? ] bi or not ] filter [ { [ "help" word-prop ] [ predicate? ] } 1|| not ] filter
natural-sort ; natural-sort ;
: interesting-words. ( vocab -- ) : interesting-words. ( vocab -- )
interesting-words [ (help.) nl ] each ; interesting-words [ (help.) nl ] each ;
: help-file-string ( vocab -- str2 ) : docs-file-string ( vocab -- str2 )
[ [
{ {
[ "IN: " write print nl ] [ "IN: " write print nl ]
@ -186,62 +201,68 @@ ERROR: no-vocab vocab ;
[ bl write ] each [ bl write ] each
" ;" print ; " ;" print ;
: set-scaffold-help-file ( path vocab -- ) : set-scaffold-docs-file ( vocab path -- )
swap utf8 <file-writer> [ utf8 <file-writer> [
scaffold-copyright scaffold-copyright
[ help-file-string ] [ write-using ] bi [ docs-file-string ] [ write-using ] bi
write write
] with-output-stream ; ] with-output-stream ;
: check-scaffold ( vocab-root string -- vocab-root string )
[ check-root ] [ check-vocab-name ] bi* ;
: vocab>scaffold-path ( vocab-root string -- path )
path-separator first CHAR: . associate substitute
append-path ;
: prepare-scaffold ( vocab-root string -- string path )
check-scaffold [ vocab>scaffold-path ] keep ;
: with-scaffold ( quot -- ) : with-scaffold ( quot -- )
[ H{ } clone using ] dip with-variable ; inline [ H{ } clone using ] dip with-variable ; inline
: check-vocab ( vocab -- vocab )
dup find-vocab-root [ no-vocab ] unless ;
PRIVATE>
: link-vocab ( vocab -- ) : link-vocab ( vocab -- )
check-vocab check-vocab
"Edit documentation: " write "Edit documentation: " write
[ find-vocab-root ] "-docs.factor" vocab/suffix>path <pathname> . ;
[ vocab>scaffold-path ] bi
"-docs.factor" (scaffold-path) <pathname> . ; PRIVATE>
: help. ( word -- ) : help. ( word -- )
[ (help.) ] [ nl vocabulary>> link-vocab ] bi ; [ (help.) ] [ nl vocabulary>> link-vocab ] bi ;
: scaffold-help ( string -- ) : scaffold-help ( vocab -- )
[ [
[ find-vocab-root ] [ check-vocab ] bi dup "-docs.factor" vocab/suffix>path scaffolding? [
prepare-scaffold set-scaffold-docs-file
[ "-docs.factor" scaffold-path ] dip ] [
swap [ set-scaffold-help-file ] [ 2drop ] if 2drop
] if
] with-scaffold ; ] with-scaffold ;
: scaffold-undocumented ( string -- ) : scaffold-undocumented ( string -- )
[ interesting-words. ] [ link-vocab ] bi ; [ interesting-words. ] [ link-vocab ] bi ;
: scaffold-vocab ( vocab-root string -- ) : scaffold-vocab ( vocab-root string -- )
prepare-scaffold
{ {
[ drop scaffold-directory ] [ scaffold-directory ]
[ scaffold-main ] [ scaffold-main ]
[ scaffold-tests ] [ scaffold-authors ]
[ drop scaffold-authors ]
[ nip require ] [ nip require ]
} 2cleave ; } 2cleave ;
<PRIVATE
: tests-file-string ( vocab -- string )
[
scaffold-copyright
"USING: tools.test " write dup write " ;" print
"IN: " write write ".tests" print
] with-string-writer ;
: set-scaffold-tests-file ( vocab path -- )
[ tests-file-string ] dip utf8 set-file-contents ;
PRIVATE>
: scaffold-tests ( vocab -- )
dup "-tests.factor" vocab/suffix>path
scaffolding? [
set-scaffold-tests-file
] [
2drop
] if ;
SYMBOL: examples-flag SYMBOL: examples-flag
: example ( -- ) : example ( -- )
@ -250,7 +271,7 @@ SYMBOL: examples-flag
" \"\"" " \"\""
" \"\"" " \"\""
"}" "}"
} [ examples-flag get [ " " write ] when print ] each ; } [ examples-flag get [ 4bl ] when print ] each ;
: examples ( n -- ) : examples ( n -- )
t \ examples-flag [ t \ examples-flag [
@ -260,10 +281,11 @@ SYMBOL: examples-flag
] with-variable ; ] with-variable ;
: scaffold-rc ( path -- ) : scaffold-rc ( path -- )
[ home ] dip append-path
[ touch-file ] [ "Click to edit: " write <pathname> . ] bi ; [ touch-file ] [ "Click to edit: " write <pathname> . ] bi ;
: scaffold-factor-boot-rc ( -- ) : scaffold-factor-boot-rc ( -- ) ".factor-boot-rc" scaffold-rc ;
home ".factor-boot-rc" append-path scaffold-rc ;
: scaffold-factor-rc ( -- ) : scaffold-factor-rc ( -- ) ".factor-rc" scaffold-rc ;
home ".factor-rc" append-path scaffold-rc ;
: scaffold-emacs ( -- ) ".emacs" scaffold-rc ;

View File

@ -46,7 +46,7 @@ PRIVATE>
: group-name ( id -- string ) : group-name ( id -- string )
dup group-cache get [ dup group-cache get [
dupd at* [ name>> nip ] [ drop number>string ] if ?at [ name>> ] [ number>string ] if
] [ ] [
group-struct [ group-gr_name ] [ f ] if* group-struct [ group-gr_name ] [ f ] if*
] if* ] if*

View File

@ -6,8 +6,8 @@ cell-bits {
{ 64 [ "unix.stat.netbsd.64" require ] } { 64 [ "unix.stat.netbsd.64" require ] }
} case } case
: _VFS_NAMELEN 32 ; inline CONSTANT: _VFS_NAMELEN 32
: _VFS_MNAMELEN 1024 ; inline CONSTANT: _VFS_MNAMELEN 1024
C-STRUCT: statvfs C-STRUCT: statvfs
{ "ulong" "f_flag" } { "ulong" "f_flag" }

View File

@ -4,7 +4,7 @@ USING: arrays math kernel accessors sequences sequences.private
deques search-deques hashtables ; deques search-deques hashtables ;
IN: unrolled-lists IN: unrolled-lists
: unroll-factor 32 ; inline CONSTANT: unroll-factor 32
<PRIVATE <PRIVATE

View File

@ -1226,7 +1226,7 @@ FUNCTION: BOOL GetExitCodeProcess ( HANDLE hProcess, LPDWORD lpExitCode ) ;
FUNCTION: DWORD GetFileAttributesW ( LPCTSTR lpFileName ) ; FUNCTION: DWORD GetFileAttributesW ( LPCTSTR lpFileName ) ;
! FUNCTION: GetFileAttributesExA ! FUNCTION: GetFileAttributesExA
: GetFileExInfoStandard 0 ; inline CONSTANT: GetFileExInfoStandard 0
FUNCTION: BOOL GetFileAttributesExW ( LPCTSTR lpFileName, GET_FILEEX_INFO_LEVELS fInfoLevelId, LPVOID lpFileInformation ) ; FUNCTION: BOOL GetFileAttributesExW ( LPCTSTR lpFileName, GET_FILEEX_INFO_LEVELS fInfoLevelId, LPVOID lpFileInformation ) ;

View File

@ -20,61 +20,61 @@ FUNCTION: BOOL IsEqualGUID ( REFGUID rguid1, REFGUID rguid2 ) ;
FUNCTION: int StringFromGUID2 ( REFGUID rguid, LPOLESTR lpsz, int cchMax ) ; FUNCTION: int StringFromGUID2 ( REFGUID rguid, LPOLESTR lpsz, int cchMax ) ;
FUNCTION: HRESULT CLSIDFromString ( LPOLESTR lpsz, REFGUID out_rguid ) ; FUNCTION: HRESULT CLSIDFromString ( LPOLESTR lpsz, REFGUID out_rguid ) ;
: S_OK 0 ; inline CONSTANT: S_OK 0
: S_FALSE 1 ; inline CONSTANT: S_FALSE 1
: E_NOINTERFACE HEX: 80004002 ; inline CONSTANT: E_NOINTERFACE HEX: 80004002
: E_FAIL HEX: 80004005 ; inline CONSTANT: E_FAIL HEX: 80004005
: E_INVALIDARG HEX: 80070057 ; inline CONSTANT: E_INVALIDARG HEX: 80070057
: MK_ALT HEX: 20 ; inline CONSTANT: MK_ALT HEX: 20
: DROPEFFECT_NONE 0 ; inline CONSTANT: DROPEFFECT_NONE 0
: DROPEFFECT_COPY 1 ; inline CONSTANT: DROPEFFECT_COPY 1
: DROPEFFECT_MOVE 2 ; inline CONSTANT: DROPEFFECT_MOVE 2
: DROPEFFECT_LINK 4 ; inline CONSTANT: DROPEFFECT_LINK 4
: DROPEFFECT_SCROLL HEX: 80000000 ; inline CONSTANT: DROPEFFECT_SCROLL HEX: 80000000
: DD_DEFSCROLLINSET 11 ; inline CONSTANT: DD_DEFSCROLLINSET 11
: DD_DEFSCROLLDELAY 50 ; inline CONSTANT: DD_DEFSCROLLDELAY 50
: DD_DEFSCROLLINTERVAL 50 ; inline CONSTANT: DD_DEFSCROLLINTERVAL 50
: DD_DEFDRAGDELAY 200 ; inline CONSTANT: DD_DEFDRAGDELAY 200
: DD_DEFDRAGMINDIST 2 ; inline CONSTANT: DD_DEFDRAGMINDIST 2
: CF_TEXT 1 ; inline CONSTANT: CF_TEXT 1
: CF_BITMAP 2 ; inline CONSTANT: CF_BITMAP 2
: CF_METAFILEPICT 3 ; inline CONSTANT: CF_METAFILEPICT 3
: CF_SYLK 4 ; inline CONSTANT: CF_SYLK 4
: CF_DIF 5 ; inline CONSTANT: CF_DIF 5
: CF_TIFF 6 ; inline CONSTANT: CF_TIFF 6
: CF_OEMTEXT 7 ; inline CONSTANT: CF_OEMTEXT 7
: CF_DIB 8 ; inline CONSTANT: CF_DIB 8
: CF_PALETTE 9 ; inline CONSTANT: CF_PALETTE 9
: CF_PENDATA 10 ; inline CONSTANT: CF_PENDATA 10
: CF_RIFF 11 ; inline CONSTANT: CF_RIFF 11
: CF_WAVE 12 ; inline CONSTANT: CF_WAVE 12
: CF_UNICODETEXT 13 ; inline CONSTANT: CF_UNICODETEXT 13
: CF_ENHMETAFILE 14 ; inline CONSTANT: CF_ENHMETAFILE 14
: CF_HDROP 15 ; inline CONSTANT: CF_HDROP 15
: CF_LOCALE 16 ; inline CONSTANT: CF_LOCALE 16
: CF_MAX 17 ; inline CONSTANT: CF_MAX 17
: CF_OWNERDISPLAY HEX: 0080 ; inline CONSTANT: CF_OWNERDISPLAY HEX: 0080
: CF_DSPTEXT HEX: 0081 ; inline CONSTANT: CF_DSPTEXT HEX: 0081
: CF_DSPBITMAP HEX: 0082 ; inline CONSTANT: CF_DSPBITMAP HEX: 0082
: CF_DSPMETAFILEPICT HEX: 0083 ; inline CONSTANT: CF_DSPMETAFILEPICT HEX: 0083
: CF_DSPENHMETAFILE HEX: 008E ; inline CONSTANT: CF_DSPENHMETAFILE HEX: 008E
: DVASPECT_CONTENT 1 ; inline CONSTANT: DVASPECT_CONTENT 1
: DVASPECT_THUMBNAIL 2 ; inline CONSTANT: DVASPECT_THUMBNAIL 2
: DVASPECT_ICON 4 ; inline CONSTANT: DVASPECT_ICON 4
: DVASPECT_DOCPRINT 8 ; inline CONSTANT: DVASPECT_DOCPRINT 8
: TYMED_HGLOBAL 1 ; inline CONSTANT: TYMED_HGLOBAL 1
: TYMED_FILE 2 ; inline CONSTANT: TYMED_FILE 2
: TYMED_ISTREAM 4 ; inline CONSTANT: TYMED_ISTREAM 4
: TYMED_ISTORAGE 8 ; inline CONSTANT: TYMED_ISTORAGE 8
: TYMED_GDI 16 ; inline CONSTANT: TYMED_GDI 16
: TYMED_MFPICT 32 ; inline CONSTANT: TYMED_MFPICT 32
: TYMED_ENHMF 64 ; inline CONSTANT: TYMED_ENHMF 64
: TYMED_NULL 0 ; inline CONSTANT: TYMED_NULL 0
C-STRUCT: DVTARGETDEVICE C-STRUCT: DVTARGETDEVICE
{ "DWORD" "tdSize" } { "DWORD" "tdSize" }
@ -101,10 +101,10 @@ C-STRUCT: STGMEDIUM
{ "LPUNKNOWN" "punkForRelease" } ; { "LPUNKNOWN" "punkForRelease" } ;
TYPEDEF: STGMEDIUM* LPSTGMEDIUM TYPEDEF: STGMEDIUM* LPSTGMEDIUM
: COINIT_MULTITHREADED 0 ; inline CONSTANT: COINIT_MULTITHREADED 0
: COINIT_APARTMENTTHREADED 2 ; inline CONSTANT: COINIT_APARTMENTTHREADED 2
: COINIT_DISABLE_OLE1DDE 4 ; inline CONSTANT: COINIT_DISABLE_OLE1DDE 4
: COINIT_SPEED_OVER_MEMORY 8 ; inline CONSTANT: COINIT_SPEED_OVER_MEMORY 8
FUNCTION: HRESULT OleInitialize ( void* reserved ) ; FUNCTION: HRESULT OleInitialize ( void* reserved ) ;
FUNCTION: HRESULT CoInitializeEx ( void* reserved, DWORD dwCoInit ) ; FUNCTION: HRESULT CoInitializeEx ( void* reserved, DWORD dwCoInit ) ;

View File

@ -6,70 +6,70 @@ sequences libc ;
IN: windows.opengl32 IN: windows.opengl32
! PIXELFORMATDESCRIPTOR flags ! PIXELFORMATDESCRIPTOR flags
: PFD_DOUBLEBUFFER HEX: 00000001 ; inline CONSTANT: PFD_DOUBLEBUFFER HEX: 00000001
: PFD_STEREO HEX: 00000002 ; inline CONSTANT: PFD_STEREO HEX: 00000002
: PFD_DRAW_TO_WINDOW HEX: 00000004 ; inline CONSTANT: PFD_DRAW_TO_WINDOW HEX: 00000004
: PFD_DRAW_TO_BITMAP HEX: 00000008 ; inline CONSTANT: PFD_DRAW_TO_BITMAP HEX: 00000008
: PFD_SUPPORT_GDI HEX: 00000010 ; inline CONSTANT: PFD_SUPPORT_GDI HEX: 00000010
: PFD_SUPPORT_OPENGL HEX: 00000020 ; inline CONSTANT: PFD_SUPPORT_OPENGL HEX: 00000020
: PFD_GENERIC_FORMAT HEX: 00000040 ; inline CONSTANT: PFD_GENERIC_FORMAT HEX: 00000040
: PFD_NEED_PALETTE HEX: 00000080 ; inline CONSTANT: PFD_NEED_PALETTE HEX: 00000080
: PFD_NEED_SYSTEM_PALETTE HEX: 00000100 ; inline CONSTANT: PFD_NEED_SYSTEM_PALETTE HEX: 00000100
: PFD_SWAP_EXCHANGE HEX: 00000200 ; inline CONSTANT: PFD_SWAP_EXCHANGE HEX: 00000200
: PFD_SWAP_COPY HEX: 00000400 ; inline CONSTANT: PFD_SWAP_COPY HEX: 00000400
: PFD_SWAP_LAYER_BUFFERS HEX: 00000800 ; inline CONSTANT: PFD_SWAP_LAYER_BUFFERS HEX: 00000800
: PFD_GENERIC_ACCELERATED HEX: 00001000 ; inline CONSTANT: PFD_GENERIC_ACCELERATED HEX: 00001000
: PFD_SUPPORT_DIRECTDRAW HEX: 00002000 ; inline CONSTANT: PFD_SUPPORT_DIRECTDRAW HEX: 00002000
! PIXELFORMATDESCRIPTOR flags for use in ChoosePixelFormat only ! PIXELFORMATDESCRIPTOR flags for use in ChoosePixelFormat only
: PFD_DEPTH_DONTCARE HEX: 20000000 ; inline CONSTANT: PFD_DEPTH_DONTCARE HEX: 20000000
: PFD_DOUBLEBUFFER_DONTCARE HEX: 40000000 ; inline CONSTANT: PFD_DOUBLEBUFFER_DONTCARE HEX: 40000000
: PFD_STEREO_DONTCARE HEX: 80000000 ; inline CONSTANT: PFD_STEREO_DONTCARE HEX: 80000000
! pixel types ! pixel types
: PFD_TYPE_RGBA 0 ; inline CONSTANT: PFD_TYPE_RGBA 0
: PFD_TYPE_COLORINDEX 1 ; inline CONSTANT: PFD_TYPE_COLORINDEX 1
! layer types ! layer types
: PFD_MAIN_PLANE 0 ; inline CONSTANT: PFD_MAIN_PLANE 0
: PFD_OVERLAY_PLANE 1 ; inline CONSTANT: PFD_OVERLAY_PLANE 1
: PFD_UNDERLAY_PLANE -1 ; inline CONSTANT: PFD_UNDERLAY_PLANE -1
: LPD_TYPE_RGBA 0 ; inline CONSTANT: LPD_TYPE_RGBA 0
: LPD_TYPE_COLORINDEX 1 ; inline CONSTANT: LPD_TYPE_COLORINDEX 1
! wglSwapLayerBuffers flags ! wglSwapLayerBuffers flags
: WGL_SWAP_MAIN_PLANE HEX: 00000001 ; inline CONSTANT: WGL_SWAP_MAIN_PLANE HEX: 00000001
: WGL_SWAP_OVERLAY1 HEX: 00000002 ; inline CONSTANT: WGL_SWAP_OVERLAY1 HEX: 00000002
: WGL_SWAP_OVERLAY2 HEX: 00000004 ; inline CONSTANT: WGL_SWAP_OVERLAY2 HEX: 00000004
: WGL_SWAP_OVERLAY3 HEX: 00000008 ; inline CONSTANT: WGL_SWAP_OVERLAY3 HEX: 00000008
: WGL_SWAP_OVERLAY4 HEX: 00000010 ; inline CONSTANT: WGL_SWAP_OVERLAY4 HEX: 00000010
: WGL_SWAP_OVERLAY5 HEX: 00000020 ; inline CONSTANT: WGL_SWAP_OVERLAY5 HEX: 00000020
: WGL_SWAP_OVERLAY6 HEX: 00000040 ; inline CONSTANT: WGL_SWAP_OVERLAY6 HEX: 00000040
: WGL_SWAP_OVERLAY7 HEX: 00000080 ; inline CONSTANT: WGL_SWAP_OVERLAY7 HEX: 00000080
: WGL_SWAP_OVERLAY8 HEX: 00000100 ; inline CONSTANT: WGL_SWAP_OVERLAY8 HEX: 00000100
: WGL_SWAP_OVERLAY9 HEX: 00000200 ; inline CONSTANT: WGL_SWAP_OVERLAY9 HEX: 00000200
: WGL_SWAP_OVERLAY10 HEX: 00000400 ; inline CONSTANT: WGL_SWAP_OVERLAY10 HEX: 00000400
: WGL_SWAP_OVERLAY11 HEX: 00000800 ; inline CONSTANT: WGL_SWAP_OVERLAY11 HEX: 00000800
: WGL_SWAP_OVERLAY12 HEX: 00001000 ; inline CONSTANT: WGL_SWAP_OVERLAY12 HEX: 00001000
: WGL_SWAP_OVERLAY13 HEX: 00002000 ; inline CONSTANT: WGL_SWAP_OVERLAY13 HEX: 00002000
: WGL_SWAP_OVERLAY14 HEX: 00004000 ; inline CONSTANT: WGL_SWAP_OVERLAY14 HEX: 00004000
: WGL_SWAP_OVERLAY15 HEX: 00008000 ; inline CONSTANT: WGL_SWAP_OVERLAY15 HEX: 00008000
: WGL_SWAP_UNDERLAY1 HEX: 00010000 ; inline CONSTANT: WGL_SWAP_UNDERLAY1 HEX: 00010000
: WGL_SWAP_UNDERLAY2 HEX: 00020000 ; inline CONSTANT: WGL_SWAP_UNDERLAY2 HEX: 00020000
: WGL_SWAP_UNDERLAY3 HEX: 00040000 ; inline CONSTANT: WGL_SWAP_UNDERLAY3 HEX: 00040000
: WGL_SWAP_UNDERLAY4 HEX: 00080000 ; inline CONSTANT: WGL_SWAP_UNDERLAY4 HEX: 00080000
: WGL_SWAP_UNDERLAY5 HEX: 00100000 ; inline CONSTANT: WGL_SWAP_UNDERLAY5 HEX: 00100000
: WGL_SWAP_UNDERLAY6 HEX: 00200000 ; inline CONSTANT: WGL_SWAP_UNDERLAY6 HEX: 00200000
: WGL_SWAP_UNDERLAY7 HEX: 00400000 ; inline CONSTANT: WGL_SWAP_UNDERLAY7 HEX: 00400000
: WGL_SWAP_UNDERLAY8 HEX: 00800000 ; inline CONSTANT: WGL_SWAP_UNDERLAY8 HEX: 00800000
: WGL_SWAP_UNDERLAY9 HEX: 01000000 ; inline CONSTANT: WGL_SWAP_UNDERLAY9 HEX: 01000000
: WGL_SWAP_UNDERLAY10 HEX: 02000000 ; inline CONSTANT: WGL_SWAP_UNDERLAY10 HEX: 02000000
: WGL_SWAP_UNDERLAY11 HEX: 04000000 ; inline CONSTANT: WGL_SWAP_UNDERLAY11 HEX: 04000000
: WGL_SWAP_UNDERLAY12 HEX: 08000000 ; inline CONSTANT: WGL_SWAP_UNDERLAY12 HEX: 08000000
: WGL_SWAP_UNDERLAY13 HEX: 10000000 ; inline CONSTANT: WGL_SWAP_UNDERLAY13 HEX: 10000000
: WGL_SWAP_UNDERLAY14 HEX: 20000000 ; inline CONSTANT: WGL_SWAP_UNDERLAY14 HEX: 20000000
: WGL_SWAP_UNDERLAY15 HEX: 40000000 ; inline CONSTANT: WGL_SWAP_UNDERLAY15 HEX: 40000000
: windowed-pfd-dwFlags ( -- n ) : windowed-pfd-dwFlags ( -- n )
{ PFD_DRAW_TO_WINDOW PFD_SUPPORT_OPENGL PFD_DOUBLEBUFFER } flags ; { PFD_DRAW_TO_WINDOW PFD_SUPPORT_OPENGL PFD_DOUBLEBUFFER } flags ;

View File

@ -190,9 +190,9 @@ TYPEDEF: ITEMIDLIST ITEMID_CHILD
TYPEDEF: ITEMID_CHILD* PITEMID_CHILD TYPEDEF: ITEMID_CHILD* PITEMID_CHILD
TYPEDEF: ITEMID_CHILD* PCUITEMID_CHILD TYPEDEF: ITEMID_CHILD* PCUITEMID_CHILD
: STRRET_WSTR 0 ; inline CONSTANT: STRRET_WSTR 0
: STRRET_OFFSET 1 ; inline CONSTANT: STRRET_OFFSET 1
: STRRET_CSTR 2 ; inline CONSTANT: STRRET_CSTR 2
C-UNION: STRRET-union "LPWSTR" "LPSTR" "UINT" "char[260]" ; C-UNION: STRRET-union "LPWSTR" "LPSTR" "UINT" "char[260]" ;
C-STRUCT: STRRET C-STRUCT: STRRET

View File

@ -205,10 +205,10 @@ TYPEDEF: size_t socklen_t
TYPEDEF: void* WNDPROC TYPEDEF: void* WNDPROC
: FALSE 0 ; inline CONSTANT: FALSE 0
: TRUE 1 ; inline CONSTANT: TRUE 1
: >BOOLEAN ( ? -- 1/0 ) 1 0 ? ; inline : >BOOLEAN ( ? -- 1/0 ) TRUE FALSE ? ; inline
! typedef LRESULT (CALLBACK* WNDPROC)(HWND, UINT, WPARAM, LPARAM); ! typedef LRESULT (CALLBACK* WNDPROC)(HWND, UINT, WPARAM, LPARAM);

View File

@ -150,377 +150,377 @@ CONSTANT: PM_NOYIELD 2
! !
! Standard Cursor IDs ! Standard Cursor IDs
! !
: IDC_ARROW 32512 ; inline CONSTANT: IDC_ARROW 32512
: IDC_IBEAM 32513 ; inline CONSTANT: IDC_IBEAM 32513
: IDC_WAIT 32514 ; inline CONSTANT: IDC_WAIT 32514
: IDC_CROSS 32515 ; inline CONSTANT: IDC_CROSS 32515
: IDC_UPARROW 32516 ; inline CONSTANT: IDC_UPARROW 32516
: IDC_SIZE 32640 ; inline ! OBSOLETE: use IDC_SIZEALL CONSTANT: IDC_SIZE 32640 ! OBSOLETE: use IDC_SIZEALL
: IDC_ICON 32641 ; inline ! OBSOLETE: use IDC_ARROW CONSTANT: IDC_ICON 32641 ! OBSOLETE: use IDC_ARROW
: IDC_SIZENWSE 32642 ; inline CONSTANT: IDC_SIZENWSE 32642
: IDC_SIZENESW 32643 ; inline CONSTANT: IDC_SIZENESW 32643
: IDC_SIZEWE 32644 ; inline CONSTANT: IDC_SIZEWE 32644
: IDC_SIZENS 32645 ; inline CONSTANT: IDC_SIZENS 32645
: IDC_SIZEALL 32646 ; inline CONSTANT: IDC_SIZEALL 32646
: IDC_NO 32648 ; inline ! not in win3.1 CONSTANT: IDC_NO 32648 ! not in win3.1
: IDC_HAND 32649 ; inline CONSTANT: IDC_HAND 32649
: IDC_APPSTARTING 32650 ; inline ! not in win3.1 CONSTANT: IDC_APPSTARTING 32650 ! not in win3.1
: IDC_HELP 32651 ; inline CONSTANT: IDC_HELP 32651
! Predefined Clipboard Formats ! Predefined Clipboard Formats
: CF_TEXT 1 ; inline CONSTANT: CF_TEXT 1
: CF_BITMAP 2 ; inline CONSTANT: CF_BITMAP 2
: CF_METAFILEPICT 3 ; inline CONSTANT: CF_METAFILEPICT 3
: CF_SYLK 4 ; inline CONSTANT: CF_SYLK 4
: CF_DIF 5 ; inline CONSTANT: CF_DIF 5
: CF_TIFF 6 ; inline CONSTANT: CF_TIFF 6
: CF_OEMTEXT 7 ; inline CONSTANT: CF_OEMTEXT 7
: CF_DIB 8 ; inline CONSTANT: CF_DIB 8
: CF_PALETTE 9 ; inline CONSTANT: CF_PALETTE 9
: CF_PENDATA 10 ; inline CONSTANT: CF_PENDATA 10
: CF_RIFF 11 ; inline CONSTANT: CF_RIFF 11
: CF_WAVE 12 ; inline CONSTANT: CF_WAVE 12
: CF_UNICODETEXT 13 ; inline CONSTANT: CF_UNICODETEXT 13
: CF_ENHMETAFILE 14 ; inline CONSTANT: CF_ENHMETAFILE 14
: CF_HDROP 15 ; inline CONSTANT: CF_HDROP 15
: CF_LOCALE 16 ; inline CONSTANT: CF_LOCALE 16
: CF_DIBV5 17 ; inline CONSTANT: CF_DIBV5 17
: CF_MAX 18 ; inline CONSTANT: CF_MAX 18
: CF_OWNERDISPLAY HEX: 0080 ; inline CONSTANT: CF_OWNERDISPLAY HEX: 0080
: CF_DSPTEXT HEX: 0081 ; inline CONSTANT: CF_DSPTEXT HEX: 0081
: CF_DSPBITMAP HEX: 0082 ; inline CONSTANT: CF_DSPBITMAP HEX: 0082
: CF_DSPMETAFILEPICT HEX: 0083 ; inline CONSTANT: CF_DSPMETAFILEPICT HEX: 0083
: CF_DSPENHMETAFILE HEX: 008E ; inline CONSTANT: CF_DSPENHMETAFILE HEX: 008E
! "Private" formats don't get GlobalFree()'d ! "Private" formats don't get GlobalFree()'d
: CF_PRIVATEFIRST HEX: 200 ; inline CONSTANT: CF_PRIVATEFIRST HEX: 200
: CF_PRIVATELAST HEX: 2FF ; inline CONSTANT: CF_PRIVATELAST HEX: 2FF
! "GDIOBJ" formats do get DeleteObject()'d ! "GDIOBJ" formats do get DeleteObject()'d
: CF_GDIOBJFIRST HEX: 300 ; inline CONSTANT: CF_GDIOBJFIRST HEX: 300
: CF_GDIOBJLAST HEX: 3FF ; inline CONSTANT: CF_GDIOBJLAST HEX: 3FF
! Virtual Keys, Standard Set ! Virtual Keys, Standard Set
: VK_LBUTTON HEX: 01 ; inline CONSTANT: VK_LBUTTON HEX: 01
: VK_RBUTTON HEX: 02 ; inline CONSTANT: VK_RBUTTON HEX: 02
: VK_CANCEL HEX: 03 ; inline CONSTANT: VK_CANCEL HEX: 03
: VK_MBUTTON HEX: 04 ; inline ! NOT contiguous with L & RBUTTON CONSTANT: VK_MBUTTON HEX: 04 ! NOT contiguous with L & RBUTTON
: VK_XBUTTON1 HEX: 05 ; inline ! NOT contiguous with L & RBUTTON CONSTANT: VK_XBUTTON1 HEX: 05 ! NOT contiguous with L & RBUTTON
: VK_XBUTTON2 HEX: 06 ; inline ! NOT contiguous with L & RBUTTON CONSTANT: VK_XBUTTON2 HEX: 06 ! NOT contiguous with L & RBUTTON
! 0x07 : unassigned ! 0x07 : unassigned
: VK_BACK HEX: 08 ; inline CONSTANT: VK_BACK HEX: 08
: VK_TAB HEX: 09 ; inline CONSTANT: VK_TAB HEX: 09
! 0x0A - 0x0B : reserved ! 0x0A - 0x0B : reserved
: VK_CLEAR HEX: 0C ; inline CONSTANT: VK_CLEAR HEX: 0C
: VK_RETURN HEX: 0D ; inline CONSTANT: VK_RETURN HEX: 0D
: VK_SHIFT HEX: 10 ; inline CONSTANT: VK_SHIFT HEX: 10
: VK_CONTROL HEX: 11 ; inline CONSTANT: VK_CONTROL HEX: 11
: VK_MENU HEX: 12 ; inline CONSTANT: VK_MENU HEX: 12
: VK_PAUSE HEX: 13 ; inline CONSTANT: VK_PAUSE HEX: 13
: VK_CAPITAL HEX: 14 ; inline CONSTANT: VK_CAPITAL HEX: 14
: VK_KANA HEX: 15 ; inline CONSTANT: VK_KANA HEX: 15
: VK_HANGEUL HEX: 15 ; inline ! old name - here for compatibility CONSTANT: VK_HANGEUL HEX: 15 ! old name - here for compatibility
: VK_HANGUL HEX: 15 ; inline CONSTANT: VK_HANGUL HEX: 15
: VK_JUNJA HEX: 17 ; inline CONSTANT: VK_JUNJA HEX: 17
: VK_FINAL HEX: 18 ; inline CONSTANT: VK_FINAL HEX: 18
: VK_HANJA HEX: 19 ; inline CONSTANT: VK_HANJA HEX: 19
: VK_KANJI HEX: 19 ; inline CONSTANT: VK_KANJI HEX: 19
: VK_ESCAPE HEX: 1B ; inline CONSTANT: VK_ESCAPE HEX: 1B
: VK_CONVERT HEX: 1C ; inline CONSTANT: VK_CONVERT HEX: 1C
: VK_NONCONVERT HEX: 1D ; inline CONSTANT: VK_NONCONVERT HEX: 1D
: VK_ACCEPT HEX: 1E ; inline CONSTANT: VK_ACCEPT HEX: 1E
: VK_MODECHANGE HEX: 1F ; inline CONSTANT: VK_MODECHANGE HEX: 1F
: VK_SPACE HEX: 20 ; inline CONSTANT: VK_SPACE HEX: 20
: VK_PRIOR HEX: 21 ; inline CONSTANT: VK_PRIOR HEX: 21
: VK_NEXT HEX: 22 ; inline CONSTANT: VK_NEXT HEX: 22
: VK_END HEX: 23 ; inline CONSTANT: VK_END HEX: 23
: VK_HOME HEX: 24 ; inline CONSTANT: VK_HOME HEX: 24
: VK_LEFT HEX: 25 ; inline CONSTANT: VK_LEFT HEX: 25
: VK_UP HEX: 26 ; inline CONSTANT: VK_UP HEX: 26
: VK_RIGHT HEX: 27 ; inline CONSTANT: VK_RIGHT HEX: 27
: VK_DOWN HEX: 28 ; inline CONSTANT: VK_DOWN HEX: 28
: VK_SELECT HEX: 29 ; inline CONSTANT: VK_SELECT HEX: 29
: VK_PRINT HEX: 2A ; inline CONSTANT: VK_PRINT HEX: 2A
: VK_EXECUTE HEX: 2B ; inline CONSTANT: VK_EXECUTE HEX: 2B
: VK_SNAPSHOT HEX: 2C ; inline CONSTANT: VK_SNAPSHOT HEX: 2C
: VK_INSERT HEX: 2D ; inline CONSTANT: VK_INSERT HEX: 2D
: VK_DELETE HEX: 2E ; inline CONSTANT: VK_DELETE HEX: 2E
: VK_HELP HEX: 2F ; inline CONSTANT: VK_HELP HEX: 2F
: VK_0 CHAR: 0 ; inline CONSTANT: VK_0 CHAR: 0
: VK_1 CHAR: 1 ; inline CONSTANT: VK_1 CHAR: 1
: VK_2 CHAR: 2 ; inline CONSTANT: VK_2 CHAR: 2
: VK_3 CHAR: 3 ; inline CONSTANT: VK_3 CHAR: 3
: VK_4 CHAR: 4 ; inline CONSTANT: VK_4 CHAR: 4
: VK_5 CHAR: 5 ; inline CONSTANT: VK_5 CHAR: 5
: VK_6 CHAR: 6 ; inline CONSTANT: VK_6 CHAR: 6
: VK_7 CHAR: 7 ; inline CONSTANT: VK_7 CHAR: 7
: VK_8 CHAR: 8 ; inline CONSTANT: VK_8 CHAR: 8
: VK_9 CHAR: 9 ; inline CONSTANT: VK_9 CHAR: 9
: VK_A CHAR: A ; inline CONSTANT: VK_A CHAR: A
: VK_B CHAR: B ; inline CONSTANT: VK_B CHAR: B
: VK_C CHAR: C ; inline CONSTANT: VK_C CHAR: C
: VK_D CHAR: D ; inline CONSTANT: VK_D CHAR: D
: VK_E CHAR: E ; inline CONSTANT: VK_E CHAR: E
: VK_F CHAR: F ; inline CONSTANT: VK_F CHAR: F
: VK_G CHAR: G ; inline CONSTANT: VK_G CHAR: G
: VK_H CHAR: H ; inline CONSTANT: VK_H CHAR: H
: VK_I CHAR: I ; inline CONSTANT: VK_I CHAR: I
: VK_J CHAR: J ; inline CONSTANT: VK_J CHAR: J
: VK_K CHAR: K ; inline CONSTANT: VK_K CHAR: K
: VK_L CHAR: L ; inline CONSTANT: VK_L CHAR: L
: VK_M CHAR: M ; inline CONSTANT: VK_M CHAR: M
: VK_N CHAR: N ; inline CONSTANT: VK_N CHAR: N
: VK_O CHAR: O ; inline CONSTANT: VK_O CHAR: O
: VK_P CHAR: P ; inline CONSTANT: VK_P CHAR: P
: VK_Q CHAR: Q ; inline CONSTANT: VK_Q CHAR: Q
: VK_R CHAR: R ; inline CONSTANT: VK_R CHAR: R
: VK_S CHAR: S ; inline CONSTANT: VK_S CHAR: S
: VK_T CHAR: T ; inline CONSTANT: VK_T CHAR: T
: VK_U CHAR: U ; inline CONSTANT: VK_U CHAR: U
: VK_V CHAR: V ; inline CONSTANT: VK_V CHAR: V
: VK_W CHAR: W ; inline CONSTANT: VK_W CHAR: W
: VK_X CHAR: X ; inline CONSTANT: VK_X CHAR: X
: VK_Y CHAR: Y ; inline CONSTANT: VK_Y CHAR: Y
: VK_Z CHAR: Z ; inline CONSTANT: VK_Z CHAR: Z
: VK_LWIN HEX: 5B ; inline CONSTANT: VK_LWIN HEX: 5B
: VK_RWIN HEX: 5C ; inline CONSTANT: VK_RWIN HEX: 5C
: VK_APPS HEX: 5D ; inline CONSTANT: VK_APPS HEX: 5D
! 0x5E : reserved ! 0x5E : reserved
: VK_SLEEP HEX: 5F ; inline CONSTANT: VK_SLEEP HEX: 5F
: VK_NUMPAD0 HEX: 60 ; inline CONSTANT: VK_NUMPAD0 HEX: 60
: VK_NUMPAD1 HEX: 61 ; inline CONSTANT: VK_NUMPAD1 HEX: 61
: VK_NUMPAD2 HEX: 62 ; inline CONSTANT: VK_NUMPAD2 HEX: 62
: VK_NUMPAD3 HEX: 63 ; inline CONSTANT: VK_NUMPAD3 HEX: 63
: VK_NUMPAD4 HEX: 64 ; inline CONSTANT: VK_NUMPAD4 HEX: 64
: VK_NUMPAD5 HEX: 65 ; inline CONSTANT: VK_NUMPAD5 HEX: 65
: VK_NUMPAD6 HEX: 66 ; inline CONSTANT: VK_NUMPAD6 HEX: 66
: VK_NUMPAD7 HEX: 67 ; inline CONSTANT: VK_NUMPAD7 HEX: 67
: VK_NUMPAD8 HEX: 68 ; inline CONSTANT: VK_NUMPAD8 HEX: 68
: VK_NUMPAD9 HEX: 69 ; inline CONSTANT: VK_NUMPAD9 HEX: 69
: VK_MULTIPLY HEX: 6A ; inline CONSTANT: VK_MULTIPLY HEX: 6A
: VK_ADD HEX: 6B ; inline CONSTANT: VK_ADD HEX: 6B
: VK_SEPARATOR HEX: 6C ; inline CONSTANT: VK_SEPARATOR HEX: 6C
: VK_SUBTRACT HEX: 6D ; inline CONSTANT: VK_SUBTRACT HEX: 6D
: VK_DECIMAL HEX: 6E ; inline CONSTANT: VK_DECIMAL HEX: 6E
: VK_DIVIDE HEX: 6F ; inline CONSTANT: VK_DIVIDE HEX: 6F
: VK_F1 HEX: 70 ; inline CONSTANT: VK_F1 HEX: 70
: VK_F2 HEX: 71 ; inline CONSTANT: VK_F2 HEX: 71
: VK_F3 HEX: 72 ; inline CONSTANT: VK_F3 HEX: 72
: VK_F4 HEX: 73 ; inline CONSTANT: VK_F4 HEX: 73
: VK_F5 HEX: 74 ; inline CONSTANT: VK_F5 HEX: 74
: VK_F6 HEX: 75 ; inline CONSTANT: VK_F6 HEX: 75
: VK_F7 HEX: 76 ; inline CONSTANT: VK_F7 HEX: 76
: VK_F8 HEX: 77 ; inline CONSTANT: VK_F8 HEX: 77
: VK_F9 HEX: 78 ; inline CONSTANT: VK_F9 HEX: 78
: VK_F10 HEX: 79 ; inline CONSTANT: VK_F10 HEX: 79
: VK_F11 HEX: 7A ; inline CONSTANT: VK_F11 HEX: 7A
: VK_F12 HEX: 7B ; inline CONSTANT: VK_F12 HEX: 7B
: VK_F13 HEX: 7C ; inline CONSTANT: VK_F13 HEX: 7C
: VK_F14 HEX: 7D ; inline CONSTANT: VK_F14 HEX: 7D
: VK_F15 HEX: 7E ; inline CONSTANT: VK_F15 HEX: 7E
: VK_F16 HEX: 7F ; inline CONSTANT: VK_F16 HEX: 7F
: VK_F17 HEX: 80 ; inline CONSTANT: VK_F17 HEX: 80
: VK_F18 HEX: 81 ; inline CONSTANT: VK_F18 HEX: 81
: VK_F19 HEX: 82 ; inline CONSTANT: VK_F19 HEX: 82
: VK_F20 HEX: 83 ; inline CONSTANT: VK_F20 HEX: 83
: VK_F21 HEX: 84 ; inline CONSTANT: VK_F21 HEX: 84
: VK_F22 HEX: 85 ; inline CONSTANT: VK_F22 HEX: 85
: VK_F23 HEX: 86 ; inline CONSTANT: VK_F23 HEX: 86
: VK_F24 HEX: 87 ; inline CONSTANT: VK_F24 HEX: 87
! 0x88 - 0x8F : unassigned ! 0x88 - 0x8F : unassigned
: VK_NUMLOCK HEX: 90 ; inline CONSTANT: VK_NUMLOCK HEX: 90
: VK_SCROLL HEX: 91 ; inline CONSTANT: VK_SCROLL HEX: 91
! NEC PC-9800 kbd definitions ! NEC PC-9800 kbd definitions
: VK_OEM_NEC_EQUAL HEX: 92 ; inline ! '=' key on numpad CONSTANT: VK_OEM_NEC_EQUAL HEX: 92 ! '=' key on numpad
! Fujitsu/OASYS kbd definitions ! Fujitsu/OASYS kbd definitions
: VK_OEM_FJ_JISHO HEX: 92 ; inline ! 'Dictionary' key CONSTANT: VK_OEM_FJ_JISHO HEX: 92 ! 'Dictionary' key
: VK_OEM_FJ_MASSHOU HEX: 93 ; inline ! 'Unregister word' key CONSTANT: VK_OEM_FJ_MASSHOU HEX: 93 ! 'Unregister word' key
: VK_OEM_FJ_TOUROKU HEX: 94 ; inline ! 'Register word' key CONSTANT: VK_OEM_FJ_TOUROKU HEX: 94 ! 'Register word' key
: VK_OEM_FJ_LOYA HEX: 95 ; inline ! 'Left OYAYUBI' key CONSTANT: VK_OEM_FJ_LOYA HEX: 95 ! 'Left OYAYUBI' key
: VK_OEM_FJ_ROYA HEX: 96 ; inline ! 'Right OYAYUBI' key CONSTANT: VK_OEM_FJ_ROYA HEX: 96 ! 'Right OYAYUBI' key
! 0x97 - 0x9F : unassigned ! 0x97 - 0x9F : unassigned
! VK_L* & VK_R* - left and right Alt, Ctrl and Shift virtual keys. ! VK_L* & VK_R* - left and right Alt, Ctrl and Shift virtual keys.
! Used only as parameters to GetAsyncKeyState() and GetKeyState(). ! Used only as parameters to GetAsyncKeyState() and GetKeyState().
! No other API or message will distinguish left and right keys in this way. ! No other API or message will distinguish left and right keys in this way.
: VK_LSHIFT HEX: A0 ; inline CONSTANT: VK_LSHIFT HEX: A0
: VK_RSHIFT HEX: A1 ; inline CONSTANT: VK_RSHIFT HEX: A1
: VK_LCONTROL HEX: A2 ; inline CONSTANT: VK_LCONTROL HEX: A2
: VK_RCONTROL HEX: A3 ; inline CONSTANT: VK_RCONTROL HEX: A3
: VK_LMENU HEX: A4 ; inline CONSTANT: VK_LMENU HEX: A4
: VK_RMENU HEX: A5 ; inline CONSTANT: VK_RMENU HEX: A5
: VK_BROWSER_BACK HEX: A6 ; inline CONSTANT: VK_BROWSER_BACK HEX: A6
: VK_BROWSER_FORWARD HEX: A7 ; inline CONSTANT: VK_BROWSER_FORWARD HEX: A7
: VK_BROWSER_REFRESH HEX: A8 ; inline CONSTANT: VK_BROWSER_REFRESH HEX: A8
: VK_BROWSER_STOP HEX: A9 ; inline CONSTANT: VK_BROWSER_STOP HEX: A9
: VK_BROWSER_SEARCH HEX: AA ; inline CONSTANT: VK_BROWSER_SEARCH HEX: AA
: VK_BROWSER_FAVORITES HEX: AB ; inline CONSTANT: VK_BROWSER_FAVORITES HEX: AB
: VK_BROWSER_HOME HEX: AC ; inline CONSTANT: VK_BROWSER_HOME HEX: AC
: VK_VOLUME_MUTE HEX: AD ; inline CONSTANT: VK_VOLUME_MUTE HEX: AD
: VK_VOLUME_DOWN HEX: AE ; inline CONSTANT: VK_VOLUME_DOWN HEX: AE
: VK_VOLUME_UP HEX: AF ; inline CONSTANT: VK_VOLUME_UP HEX: AF
: VK_MEDIA_NEXT_TRACK HEX: B0 ; inline CONSTANT: VK_MEDIA_NEXT_TRACK HEX: B0
: VK_MEDIA_PREV_TRACK HEX: B1 ; inline CONSTANT: VK_MEDIA_PREV_TRACK HEX: B1
: VK_MEDIA_STOP HEX: B2 ; inline CONSTANT: VK_MEDIA_STOP HEX: B2
: VK_MEDIA_PLAY_PAUSE HEX: B3 ; inline CONSTANT: VK_MEDIA_PLAY_PAUSE HEX: B3
: VK_LAUNCH_MAIL HEX: B4 ; inline CONSTANT: VK_LAUNCH_MAIL HEX: B4
: VK_LAUNCH_MEDIA_SELECT HEX: B5 ; inline CONSTANT: VK_LAUNCH_MEDIA_SELECT HEX: B5
: VK_LAUNCH_APP1 HEX: B6 ; inline CONSTANT: VK_LAUNCH_APP1 HEX: B6
: VK_LAUNCH_APP2 HEX: B7 ; inline CONSTANT: VK_LAUNCH_APP2 HEX: B7
! 0xB8 - 0xB9 : reserved ! 0xB8 - 0xB9 : reserved
: VK_OEM_1 HEX: BA ; inline ! ';:' for US CONSTANT: VK_OEM_1 HEX: BA ! ';:' for US
: VK_OEM_PLUS HEX: BB ; inline ! '+' any country CONSTANT: VK_OEM_PLUS HEX: BB ! '+' any country
: VK_OEM_COMMA HEX: BC ; inline ! ',' any country CONSTANT: VK_OEM_COMMA HEX: BC ! ',' any country
: VK_OEM_MINUS HEX: BD ; inline ! '-' any country CONSTANT: VK_OEM_MINUS HEX: BD ! '-' any country
: VK_OEM_PERIOD HEX: BE ; inline ! '.' any country CONSTANT: VK_OEM_PERIOD HEX: BE ! '.' any country
: VK_OEM_2 HEX: BF ; inline ! '/?' for US CONSTANT: VK_OEM_2 HEX: BF ! '/?' for US
: VK_OEM_3 HEX: C0 ; inline ! '`~' for US CONSTANT: VK_OEM_3 HEX: C0 ! '`~' for US
! 0xC1 - 0xD7 : reserved ! 0xC1 - 0xD7 : reserved
! 0xD8 - 0xDA : unassigned ! 0xD8 - 0xDA : unassigned
: VK_OEM_4 HEX: DB ; inline ! '[{' for US CONSTANT: VK_OEM_4 HEX: DB ! '[{' for US
: VK_OEM_5 HEX: DC ; inline ! '\|' for US CONSTANT: VK_OEM_5 HEX: DC ! '\|' for US
: VK_OEM_6 HEX: DD ; inline ! ']}' for US CONSTANT: VK_OEM_6 HEX: DD ! ']}' for US
: VK_OEM_7 HEX: DE ; inline ! ''"' for US CONSTANT: VK_OEM_7 HEX: DE ! ''"' for US
: VK_OEM_8 HEX: DF ; inline CONSTANT: VK_OEM_8 HEX: DF
! 0xE0 : reserved ! 0xE0 : reserved
! Various extended or enhanced keyboards ! Various extended or enhanced keyboards
: VK_OEM_AX HEX: E1 ; inline ! 'AX' key on Japanese AX kbd CONSTANT: VK_OEM_AX HEX: E1 ! 'AX' key on Japanese AX kbd
: VK_OEM_102 HEX: E2 ; inline ! "<>" or "\|" on RT 102-key kbd. CONSTANT: VK_OEM_102 HEX: E2 ! "<>" or "\|" on RT 102-key kbd.
: VK_ICO_HELP HEX: E3 ; inline ! Help key on ICO CONSTANT: VK_ICO_HELP HEX: E3 ! Help key on ICO
: VK_ICO_00 HEX: E4 ; inline ! 00 key on ICO CONSTANT: VK_ICO_00 HEX: E4 ! 00 key on ICO
: VK_PROCESSKEY HEX: E5 ; inline CONSTANT: VK_PROCESSKEY HEX: E5
: VK_ICO_CLEAR HEX: E6 ; inline CONSTANT: VK_ICO_CLEAR HEX: E6
: VK_PACKET HEX: E7 ; inline CONSTANT: VK_PACKET HEX: E7
! 0xE8 : unassigned ! 0xE8 : unassigned
! Nokia/Ericsson definitions ! Nokia/Ericsson definitions
: VK_OEM_RESET HEX: E9 ; inline CONSTANT: VK_OEM_RESET HEX: E9
: VK_OEM_JUMP HEX: EA ; inline CONSTANT: VK_OEM_JUMP HEX: EA
: VK_OEM_PA1 HEX: EB ; inline CONSTANT: VK_OEM_PA1 HEX: EB
: VK_OEM_PA2 HEX: EC ; inline CONSTANT: VK_OEM_PA2 HEX: EC
: VK_OEM_PA3 HEX: ED ; inline CONSTANT: VK_OEM_PA3 HEX: ED
: VK_OEM_WSCTRL HEX: EE ; inline CONSTANT: VK_OEM_WSCTRL HEX: EE
: VK_OEM_CUSEL HEX: EF ; inline CONSTANT: VK_OEM_CUSEL HEX: EF
: VK_OEM_ATTN HEX: F0 ; inline CONSTANT: VK_OEM_ATTN HEX: F0
: VK_OEM_FINISH HEX: F1 ; inline CONSTANT: VK_OEM_FINISH HEX: F1
: VK_OEM_COPY HEX: F2 ; inline CONSTANT: VK_OEM_COPY HEX: F2
: VK_OEM_AUTO HEX: F3 ; inline CONSTANT: VK_OEM_AUTO HEX: F3
: VK_OEM_ENLW HEX: F4 ; inline CONSTANT: VK_OEM_ENLW HEX: F4
: VK_OEM_BACKTAB HEX: F5 ; inline CONSTANT: VK_OEM_BACKTAB HEX: F5
: VK_ATTN HEX: F6 ; inline CONSTANT: VK_ATTN HEX: F6
: VK_CRSEL HEX: F7 ; inline CONSTANT: VK_CRSEL HEX: F7
: VK_EXSEL HEX: F8 ; inline CONSTANT: VK_EXSEL HEX: F8
: VK_EREOF HEX: F9 ; inline CONSTANT: VK_EREOF HEX: F9
: VK_PLAY HEX: FA ; inline CONSTANT: VK_PLAY HEX: FA
: VK_ZOOM HEX: FB ; inline CONSTANT: VK_ZOOM HEX: FB
: VK_NONAME HEX: FC ; inline CONSTANT: VK_NONAME HEX: FC
: VK_PA1 HEX: FD ; inline CONSTANT: VK_PA1 HEX: FD
: VK_OEM_CLEAR HEX: FE ; inline CONSTANT: VK_OEM_CLEAR HEX: FE
! 0xFF : reserved ! 0xFF : reserved
! Key State Masks for Mouse Messages ! Key State Masks for Mouse Messages
: MK_LBUTTON HEX: 0001 ; inline CONSTANT: MK_LBUTTON HEX: 0001
: MK_RBUTTON HEX: 0002 ; inline CONSTANT: MK_RBUTTON HEX: 0002
: MK_SHIFT HEX: 0004 ; inline CONSTANT: MK_SHIFT HEX: 0004
: MK_CONTROL HEX: 0008 ; inline CONSTANT: MK_CONTROL HEX: 0008
: MK_MBUTTON HEX: 0010 ; inline CONSTANT: MK_MBUTTON HEX: 0010
: MK_XBUTTON1 HEX: 0020 ; inline CONSTANT: MK_XBUTTON1 HEX: 0020
: MK_XBUTTON2 HEX: 0040 ; inline CONSTANT: MK_XBUTTON2 HEX: 0040
! Some fields are not defined for win64 ! Some fields are not defined for win64
! Window field offsets for GetWindowLong() ! Window field offsets for GetWindowLong()
: GWL_WNDPROC -4 ; inline CONSTANT: GWL_WNDPROC -4
: GWL_HINSTANCE -6 ; inline CONSTANT: GWL_HINSTANCE -6
: GWL_HWNDPARENT -8 ; inline CONSTANT: GWL_HWNDPARENT -8
: GWL_USERDATA -21 ; inline CONSTANT: GWL_USERDATA -21
: GWL_ID -12 ; inline CONSTANT: GWL_ID -12
: GWL_STYLE -16 ; inline CONSTANT: GWL_STYLE -16
: GWL_EXSTYLE -20 ; inline CONSTANT: GWL_EXSTYLE -20
: GWLP_WNDPROC -4 ; inline CONSTANT: GWLP_WNDPROC -4
: GWLP_HINSTANCE -6 ; inline CONSTANT: GWLP_HINSTANCE -6
: GWLP_HWNDPARENT -8 ; inline CONSTANT: GWLP_HWNDPARENT -8
: GWLP_USERDATA -21 ; inline CONSTANT: GWLP_USERDATA -21
: GWLP_ID -12 ; inline CONSTANT: GWLP_ID -12
! Class field offsets for GetClassLong() ! Class field offsets for GetClassLong()
: GCL_MENUNAME -8 ; inline CONSTANT: GCL_MENUNAME -8
: GCL_HBRBACKGROUND -10 ; inline CONSTANT: GCL_HBRBACKGROUND -10
: GCL_HCURSOR -12 ; inline CONSTANT: GCL_HCURSOR -12
: GCL_HICON -14 ; inline CONSTANT: GCL_HICON -14
: GCL_HMODULE -16 ; inline CONSTANT: GCL_HMODULE -16
: GCL_WNDPROC -24 ; inline CONSTANT: GCL_WNDPROC -24
: GCL_HICONSM -34 ; inline CONSTANT: GCL_HICONSM -34
: GCL_CBWNDEXTRA -18 ; inline CONSTANT: GCL_CBWNDEXTRA -18
: GCL_CBCLSEXTRA -20 ; inline CONSTANT: GCL_CBCLSEXTRA -20
: GCL_STYLE -26 ; inline CONSTANT: GCL_STYLE -26
: GCW_ATOM -32 ; inline CONSTANT: GCW_ATOM -32
: GCLP_MENUNAME -8 ; inline CONSTANT: GCLP_MENUNAME -8
: GCLP_HBRBACKGROUND -10 ; inline CONSTANT: GCLP_HBRBACKGROUND -10
: GCLP_HCURSOR -12 ; inline CONSTANT: GCLP_HCURSOR -12
: GCLP_HICON -14 ; inline CONSTANT: GCLP_HICON -14
: GCLP_HMODULE -16 ; inline CONSTANT: GCLP_HMODULE -16
: GCLP_WNDPROC -24 ; inline CONSTANT: GCLP_WNDPROC -24
: GCLP_HICONSM -34 ; inline CONSTANT: GCLP_HICONSM -34
: MB_ICONASTERISK HEX: 00000040 ; inline CONSTANT: MB_ICONASTERISK HEX: 00000040
: MB_ICONEXCLAMATION HEX: 00000030 ; inline CONSTANT: MB_ICONEXCLAMATION HEX: 00000030
: MB_ICONHAND HEX: 00000010 ; inline CONSTANT: MB_ICONHAND HEX: 00000010
: MB_ICONQUESTION HEX: 00000020 ; inline CONSTANT: MB_ICONQUESTION HEX: 00000020
: MB_OK HEX: 00000000 ; inline CONSTANT: MB_OK HEX: 00000000
ALIAS: FVIRTKEY TRUE ALIAS: FVIRTKEY TRUE
: FNOINVERT 2 ; inline CONSTANT: FNOINVERT 2
: FSHIFT 4 ; inline CONSTANT: FSHIFT 4
: FCONTROL 8 ; inline CONSTANT: FCONTROL 8
: FALT 16 ; inline CONSTANT: FALT 16
: MAPVK_VK_TO_VSC 0 ; inline CONSTANT: MAPVK_VK_TO_VSC 0
: MAPVK_VSC_TO_VK 1 ; inline CONSTANT: MAPVK_VSC_TO_VK 1
: MAPVK_VK_TO_CHAR 2 ; inline CONSTANT: MAPVK_VK_TO_CHAR 2
: MAPVK_VSC_TO_VK_EX 3 ; inline CONSTANT: MAPVK_VSC_TO_VK_EX 3
: MAPVK_VK_TO_VSC_EX 3 ; inline CONSTANT: MAPVK_VK_TO_VSC_EX 3
: TME_HOVER 1 ; inline CONSTANT: TME_HOVER 1
: TME_LEAVE 2 ; inline CONSTANT: TME_LEAVE 2
: TME_NONCLIENT 16 ; inline CONSTANT: TME_NONCLIENT 16
: TME_QUERY HEX: 40000000 ; inline CONSTANT: TME_QUERY HEX: 40000000
: TME_CANCEL HEX: 80000000 ; inline CONSTANT: TME_CANCEL HEX: 80000000
: HOVER_DEFAULT HEX: ffffffff ; inline CONSTANT: HOVER_DEFAULT HEX: ffffffff
C-STRUCT: TRACKMOUSEEVENT C-STRUCT: TRACKMOUSEEVENT
{ "DWORD" "cbSize" } { "DWORD" "cbSize" }
{ "DWORD" "dwFlags" } { "DWORD" "dwFlags" }
@ -528,15 +528,15 @@ C-STRUCT: TRACKMOUSEEVENT
{ "DWORD" "dwHoverTime" } ; { "DWORD" "dwHoverTime" } ;
TYPEDEF: TRACKMOUSEEVENT* LPTRACKMOUSEEVENT TYPEDEF: TRACKMOUSEEVENT* LPTRACKMOUSEEVENT
: DBT_DEVICEARRIVAL HEX: 8000 ; inline CONSTANT: DBT_DEVICEARRIVAL HEX: 8000
: DBT_DEVICEREMOVECOMPLETE HEX: 8004 ; inline CONSTANT: DBT_DEVICEREMOVECOMPLETE HEX: 8004
: DBT_DEVTYP_DEVICEINTERFACE 5 ; inline CONSTANT: DBT_DEVTYP_DEVICEINTERFACE 5
: DEVICE_NOTIFY_WINDOW_HANDLE 0 ; inline CONSTANT: DEVICE_NOTIFY_WINDOW_HANDLE 0
: DEVICE_NOTIFY_SERVICE_HANDLE 1 ; inline CONSTANT: DEVICE_NOTIFY_SERVICE_HANDLE 1
: DEVICE_NOTIFY_ALL_INTERFACE_CLASSES 4 ; inline CONSTANT: DEVICE_NOTIFY_ALL_INTERFACE_CLASSES 4
C-STRUCT: DEV_BROADCAST_HDR C-STRUCT: DEV_BROADCAST_HDR
{ "DWORD" "dbch_size" } { "DWORD" "dbch_size" }
@ -672,7 +672,6 @@ ALIAS: CreateWindowEx CreateWindowExW
: CreateWindow ( a b c d e f g h i j k -- hwnd ) 0 12 -nrot CreateWindowEx ; inline : CreateWindow ( a b c d e f g h i j k -- hwnd ) 0 12 -nrot CreateWindowEx ; inline
! FUNCTION: CreateWindowStationA ! FUNCTION: CreateWindowStationA
! FUNCTION: CreateWindowStationW ! FUNCTION: CreateWindowStationW
! FUNCTION: CsrBroadcastSystemMessageExW ! FUNCTION: CsrBroadcastSystemMessageExW

View File

@ -8,7 +8,7 @@ IN: windows
: lo-word ( wparam -- lo ) <short> *short ; inline : lo-word ( wparam -- lo ) <short> *short ; inline
: hi-word ( wparam -- hi ) -16 shift lo-word ; inline : hi-word ( wparam -- hi ) -16 shift lo-word ; inline
: MAX_UNICODE_PATH 32768 ; inline CONSTANT: MAX_UNICODE_PATH 32768
! You must LocalFree the return value! ! You must LocalFree the return value!
FUNCTION: void* error_message ( DWORD id ) ; FUNCTION: void* error_message ( DWORD id ) ;

View File

@ -131,19 +131,19 @@ C-STRUCT: XSetWindowAttributes
{ "Colormap" "colormap" } { "Colormap" "colormap" }
{ "Cursor" "cursor" } ; { "Cursor" "cursor" } ;
: UnmapGravity 0 ; inline CONSTANT: UnmapGravity 0
: ForgetGravity 0 ; inline CONSTANT: ForgetGravity 0
: NorthWestGravity 1 ; inline CONSTANT: NorthWestGravity 1
: NorthGravity 2 ; inline CONSTANT: NorthGravity 2
: NorthEastGravity 3 ; inline CONSTANT: NorthEastGravity 3
: WestGravity 4 ; inline CONSTANT: WestGravity 4
: CenterGravity 5 ; inline CONSTANT: CenterGravity 5
: EastGravity 6 ; inline CONSTANT: EastGravity 6
: SouthWestGravity 7 ; inline CONSTANT: SouthWestGravity 7
: SouthGravity 8 ; inline CONSTANT: SouthGravity 8
: SouthEastGravity 9 ; inline CONSTANT: SouthEastGravity 9
: StaticGravity 10 ; inline CONSTANT: StaticGravity 10
! 3.3 - Creating Windows ! 3.3 - Creating Windows
@ -238,9 +238,9 @@ C-STRUCT: XWindowAttributes
FUNCTION: Status XGetWindowAttributes ( Display* display, Window w, XWindowAttributes* attr ) ; FUNCTION: Status XGetWindowAttributes ( Display* display, Window w, XWindowAttributes* attr ) ;
: IsUnmapped 0 ; inline CONSTANT: IsUnmapped 0
: IsUnviewable 1 ; inline CONSTANT: IsUnviewable 1
: IsViewable 2 ; inline CONSTANT: IsViewable 2
FUNCTION: Status XGetGeometry ( FUNCTION: Status XGetGeometry (
Display* display, Display* display,
@ -336,22 +336,22 @@ FUNCTION: Colormap XCreateColormap ( Display* display, Window w, Visual* visual,
: GCDashList ( -- n ) 21 2^ ; inline : GCDashList ( -- n ) 21 2^ ; inline
: GCArcMode ( -- n ) 22 2^ ; inline : GCArcMode ( -- n ) 22 2^ ; inline
: GXclear HEX: 0 ; inline CONSTANT: GXclear HEX: 0
: GXand HEX: 1 ; inline CONSTANT: GXand HEX: 1
: GXandReverse HEX: 2 ; inline CONSTANT: GXandReverse HEX: 2
: GXcopy HEX: 3 ; inline CONSTANT: GXcopy HEX: 3
: GXandInverted HEX: 4 ; inline CONSTANT: GXandInverted HEX: 4
: GXnoop HEX: 5 ; inline CONSTANT: GXnoop HEX: 5
: GXxor HEX: 6 ; inline CONSTANT: GXxor HEX: 6
: GXor HEX: 7 ; inline CONSTANT: GXor HEX: 7
: GXnor HEX: 8 ; inline CONSTANT: GXnor HEX: 8
: GXequiv HEX: 9 ; inline CONSTANT: GXequiv HEX: 9
: GXinvert HEX: a ; inline CONSTANT: GXinvert HEX: a
: GXorReverse HEX: b ; inline CONSTANT: GXorReverse HEX: b
: GXcopyInverted HEX: c ; inline CONSTANT: GXcopyInverted HEX: c
: GXorInverted HEX: d ; inline CONSTANT: GXorInverted HEX: d
: GXnand HEX: e ; inline CONSTANT: GXnand HEX: e
: GXset HEX: f ; inline CONSTANT: GXset HEX: f
C-STRUCT: XGCValues C-STRUCT: XGCValues
{ "int" "function" } { "int" "function" }
@ -447,10 +447,10 @@ FUNCTION: Status XDrawString (
! 8.7 - Transferring Images between Client and Server ! 8.7 - Transferring Images between Client and Server
: XYBitmap 0 ; inline CONSTANT: XYBitmap 0
: XYPixmap 1 ; inline CONSTANT: XYPixmap 1
: ZPixmap 2 ; inline CONSTANT: ZPixmap 2
: AllPlanes -1 ; inline CONSTANT: AllPlanes -1
C-STRUCT: XImage-funcs C-STRUCT: XImage-funcs
{ "void*" "create_image" } { "void*" "create_image" }
@ -532,40 +532,40 @@ FUNCTION: Status XKillClient ( Display* display, XID resource ) ;
: ColormapChangeMask ( -- n ) 23 2^ ; inline : ColormapChangeMask ( -- n ) 23 2^ ; inline
: OwnerGrabButtonMask ( -- n ) 24 2^ ; inline : OwnerGrabButtonMask ( -- n ) 24 2^ ; inline
: KeyPress 2 ; inline CONSTANT: KeyPress 2
: KeyRelease 3 ; inline CONSTANT: KeyRelease 3
: ButtonPress 4 ; inline CONSTANT: ButtonPress 4
: ButtonRelease 5 ; inline CONSTANT: ButtonRelease 5
: MotionNotify 6 ; inline CONSTANT: MotionNotify 6
: EnterNotify 7 ; inline CONSTANT: EnterNotify 7
: LeaveNotify 8 ; inline CONSTANT: LeaveNotify 8
: FocusIn 9 ; inline CONSTANT: FocusIn 9
: FocusOut 10 ; inline CONSTANT: FocusOut 10
: KeymapNotify 11 ; inline CONSTANT: KeymapNotify 11
: Expose 12 ; inline CONSTANT: Expose 12
: GraphicsExpose 13 ; inline CONSTANT: GraphicsExpose 13
: NoExpose 14 ; inline CONSTANT: NoExpose 14
: VisibilityNotify 15 ; inline CONSTANT: VisibilityNotify 15
: CreateNotify 16 ; inline CONSTANT: CreateNotify 16
: DestroyNotify 17 ; inline CONSTANT: DestroyNotify 17
: UnmapNotify 18 ; inline CONSTANT: UnmapNotify 18
: MapNotify 19 ; inline CONSTANT: MapNotify 19
: MapRequest 20 ; inline CONSTANT: MapRequest 20
: ReparentNotify 21 ; inline CONSTANT: ReparentNotify 21
: ConfigureNotify 22 ; inline CONSTANT: ConfigureNotify 22
: ConfigureRequest 23 ; inline CONSTANT: ConfigureRequest 23
: GravityNotify 24 ; inline CONSTANT: GravityNotify 24
: ResizeRequest 25 ; inline CONSTANT: ResizeRequest 25
: CirculateNotify 26 ; inline CONSTANT: CirculateNotify 26
: CirculateRequest 27 ; inline CONSTANT: CirculateRequest 27
: PropertyNotify 28 ; inline CONSTANT: PropertyNotify 28
: SelectionClear 29 ; inline CONSTANT: SelectionClear 29
: SelectionRequest 30 ; inline CONSTANT: SelectionRequest 30
: SelectionNotify 31 ; inline CONSTANT: SelectionNotify 31
: ColormapNotify 32 ; inline CONSTANT: ColormapNotify 32
: ClientMessage 33 ; inline CONSTANT: ClientMessage 33
: MappingNotify 34 ; inline CONSTANT: MappingNotify 34
: LASTEvent 35 ; inline CONSTANT: LASTEvent 35
C-STRUCT: XAnyEvent C-STRUCT: XAnyEvent
{ "int" "type" } { "int" "type" }
@ -578,11 +578,11 @@ C-STRUCT: XAnyEvent
! 10.5 Keyboard and Pointer Events ! 10.5 Keyboard and Pointer Events
: Button1 1 ; inline CONSTANT: Button1 1
: Button2 2 ; inline CONSTANT: Button2 2
: Button3 3 ; inline CONSTANT: Button3 3
: Button4 4 ; inline CONSTANT: Button4 4
: Button5 5 ; inline CONSTANT: Button5 5
: Button1Mask ( -- n ) 1 8 shift ; inline : Button1Mask ( -- n ) 1 8 shift ; inline
: Button2Mask ( -- n ) 1 9 shift ; inline : Button2Mask ( -- n ) 1 9 shift ; inline
@ -1074,9 +1074,9 @@ FUNCTION: Status XMaskEvent ( Display* display, long event_mask, XEvent* event_r
! 11.3 - Event Queue Management ! 11.3 - Event Queue Management
: QueuedAlready 0 ; inline CONSTANT: QueuedAlready 0
: QueuedAfterReading 1 ; inline CONSTANT: QueuedAfterReading 1
: QueuedAfterFlush 2 ; inline CONSTANT: QueuedAfterFlush 2
FUNCTION: int XEventsQueued ( Display* display, int mode ) ; FUNCTION: int XEventsQueued ( Display* display, int mode ) ;
FUNCTION: int XPending ( Display* display ) ; FUNCTION: int XPending ( Display* display ) ;
@ -1093,7 +1093,7 @@ FUNCTION: int XSetErrorHandler ( void* handler ) ;
! 12 - Input Device Functions ! 12 - Input Device Functions
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
: None 0 ; inline CONSTANT: None 0
FUNCTION: int XGrabPointer ( FUNCTION: int XGrabPointer (
Display* display, Display* display,
@ -1199,17 +1199,17 @@ FUNCTION: int XLookupString (
! 16.7 Determining the Appropriate Visual Type ! 16.7 Determining the Appropriate Visual Type
: VisualNoMask HEX: 0 ; inline CONSTANT: VisualNoMask HEX: 0
: VisualIDMask HEX: 1 ; inline CONSTANT: VisualIDMask HEX: 1
: VisualScreenMask HEX: 2 ; inline CONSTANT: VisualScreenMask HEX: 2
: VisualDepthMask HEX: 4 ; inline CONSTANT: VisualDepthMask HEX: 4
: VisualClassMask HEX: 8 ; inline CONSTANT: VisualClassMask HEX: 8
: VisualRedMaskMask HEX: 10 ; inline CONSTANT: VisualRedMaskMask HEX: 10
: VisualGreenMaskMask HEX: 20 ; inline CONSTANT: VisualGreenMaskMask HEX: 20
: VisualBlueMaskMask HEX: 40 ; inline CONSTANT: VisualBlueMaskMask HEX: 40
: VisualColormapSizeMask HEX: 80 ; inline CONSTANT: VisualColormapSizeMask HEX: 80
: VisualBitsPerRGBMask HEX: 100 ; inline CONSTANT: VisualBitsPerRGBMask HEX: 100
: VisualAllMask HEX: 1FF ; inline CONSTANT: VisualAllMask HEX: 1FF
C-STRUCT: XVisualInfo C-STRUCT: XVisualInfo
{ "Visual*" "visual" } { "Visual*" "visual" }
@ -1239,76 +1239,76 @@ FUNCTION: Status XSetStandardProperties (
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
: XA_PRIMARY 1 ; inline CONSTANT: XA_PRIMARY 1
: XA_SECONDARY 2 ; inline CONSTANT: XA_SECONDARY 2
: XA_ARC 3 ; inline CONSTANT: XA_ARC 3
: XA_ATOM 4 ; inline CONSTANT: XA_ATOM 4
: XA_BITMAP 5 ; inline CONSTANT: XA_BITMAP 5
: XA_CARDINAL 6 ; inline CONSTANT: XA_CARDINAL 6
: XA_COLORMAP 7 ; inline CONSTANT: XA_COLORMAP 7
: XA_CURSOR 8 ; inline CONSTANT: XA_CURSOR 8
: XA_CUT_BUFFER0 9 ; inline CONSTANT: XA_CUT_BUFFER0 9
: XA_CUT_BUFFER1 10 ; inline CONSTANT: XA_CUT_BUFFER1 10
: XA_CUT_BUFFER2 11 ; inline CONSTANT: XA_CUT_BUFFER2 11
: XA_CUT_BUFFER3 12 ; inline CONSTANT: XA_CUT_BUFFER3 12
: XA_CUT_BUFFER4 13 ; inline CONSTANT: XA_CUT_BUFFER4 13
: XA_CUT_BUFFER5 14 ; inline CONSTANT: XA_CUT_BUFFER5 14
: XA_CUT_BUFFER6 15 ; inline CONSTANT: XA_CUT_BUFFER6 15
: XA_CUT_BUFFER7 16 ; inline CONSTANT: XA_CUT_BUFFER7 16
: XA_DRAWABLE 17 ; inline CONSTANT: XA_DRAWABLE 17
: XA_FONT 18 ; inline CONSTANT: XA_FONT 18
: XA_INTEGER 19 ; inline CONSTANT: XA_INTEGER 19
: XA_PIXMAP 20 ; inline CONSTANT: XA_PIXMAP 20
: XA_POINT 21 ; inline CONSTANT: XA_POINT 21
: XA_RECTANGLE 22 ; inline CONSTANT: XA_RECTANGLE 22
: XA_RESOURCE_MANAGER 23 ; inline CONSTANT: XA_RESOURCE_MANAGER 23
: XA_RGB_COLOR_MAP 24 ; inline CONSTANT: XA_RGB_COLOR_MAP 24
: XA_RGB_BEST_MAP 25 ; inline CONSTANT: XA_RGB_BEST_MAP 25
: XA_RGB_BLUE_MAP 26 ; inline CONSTANT: XA_RGB_BLUE_MAP 26
: XA_RGB_DEFAULT_MAP 27 ; inline CONSTANT: XA_RGB_DEFAULT_MAP 27
: XA_RGB_GRAY_MAP 28 ; inline CONSTANT: XA_RGB_GRAY_MAP 28
: XA_RGB_GREEN_MAP 29 ; inline CONSTANT: XA_RGB_GREEN_MAP 29
: XA_RGB_RED_MAP 30 ; inline CONSTANT: XA_RGB_RED_MAP 30
: XA_STRING 31 ; inline CONSTANT: XA_STRING 31
: XA_VISUALID 32 ; inline CONSTANT: XA_VISUALID 32
: XA_WINDOW 33 ; inline CONSTANT: XA_WINDOW 33
: XA_WM_COMMAND 34 ; inline CONSTANT: XA_WM_COMMAND 34
: XA_WM_HINTS 35 ; inline CONSTANT: XA_WM_HINTS 35
: XA_WM_CLIENT_MACHINE 36 ; inline CONSTANT: XA_WM_CLIENT_MACHINE 36
: XA_WM_ICON_NAME 37 ; inline CONSTANT: XA_WM_ICON_NAME 37
: XA_WM_ICON_SIZE 38 ; inline CONSTANT: XA_WM_ICON_SIZE 38
: XA_WM_NAME 39 ; inline CONSTANT: XA_WM_NAME 39
: XA_WM_NORMAL_HINTS 40 ; inline CONSTANT: XA_WM_NORMAL_HINTS 40
: XA_WM_SIZE_HINTS 41 ; inline CONSTANT: XA_WM_SIZE_HINTS 41
: XA_WM_ZOOM_HINTS 42 ; inline CONSTANT: XA_WM_ZOOM_HINTS 42
: XA_MIN_SPACE 43 ; inline CONSTANT: XA_MIN_SPACE 43
: XA_NORM_SPACE 44 ; inline CONSTANT: XA_NORM_SPACE 44
: XA_MAX_SPACE 45 ; inline CONSTANT: XA_MAX_SPACE 45
: XA_END_SPACE 46 ; inline CONSTANT: XA_END_SPACE 46
: XA_SUPERSCRIPT_X 47 ; inline CONSTANT: XA_SUPERSCRIPT_X 47
: XA_SUPERSCRIPT_Y 48 ; inline CONSTANT: XA_SUPERSCRIPT_Y 48
: XA_SUBSCRIPT_X 49 ; inline CONSTANT: XA_SUBSCRIPT_X 49
: XA_SUBSCRIPT_Y 50 ; inline CONSTANT: XA_SUBSCRIPT_Y 50
: XA_UNDERLINE_POSITION 51 ; inline CONSTANT: XA_UNDERLINE_POSITION 51
: XA_UNDERLINE_THICKNESS 52 ; inline CONSTANT: XA_UNDERLINE_THICKNESS 52
: XA_STRIKEOUT_ASCENT 53 ; inline CONSTANT: XA_STRIKEOUT_ASCENT 53
: XA_STRIKEOUT_DESCENT 54 ; inline CONSTANT: XA_STRIKEOUT_DESCENT 54
: XA_ITALIC_ANGLE 55 ; inline CONSTANT: XA_ITALIC_ANGLE 55
: XA_X_HEIGHT 56 ; inline CONSTANT: XA_X_HEIGHT 56
: XA_QUAD_WIDTH 57 ; inline CONSTANT: XA_QUAD_WIDTH 57
: XA_WEIGHT 58 ; inline CONSTANT: XA_WEIGHT 58
: XA_POINT_SIZE 59 ; inline CONSTANT: XA_POINT_SIZE 59
: XA_RESOLUTION 60 ; inline CONSTANT: XA_RESOLUTION 60
: XA_COPYRIGHT 61 ; inline CONSTANT: XA_COPYRIGHT 61
: XA_NOTICE 62 ; inline CONSTANT: XA_NOTICE 62
: XA_FONT_NAME 63 ; inline CONSTANT: XA_FONT_NAME 63
: XA_FAMILY_NAME 64 ; inline CONSTANT: XA_FAMILY_NAME 64
: XA_FULL_NAME 65 ; inline CONSTANT: XA_FULL_NAME 65
: XA_CAP_HEIGHT 66 ; inline CONSTANT: XA_CAP_HEIGHT 66
: XA_WM_CLASS 67 ; inline CONSTANT: XA_WM_CLASS 67
: XA_WM_TRANSIENT_FOR 68 ; inline CONSTANT: XA_WM_TRANSIENT_FOR 68
: XA_LAST_PREDEFINED 68 ; inline CONSTANT: XA_LAST_PREDEFINED 68
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! The rest of the stuff is not from the book. ! The rest of the stuff is not from the book.
@ -1321,65 +1321,65 @@ FUNCTION: int XBell ( Display* display, int percent ) ;
! !!! INPUT METHODS ! !!! INPUT METHODS
: XIMPreeditArea HEX: 0001 ; inline CONSTANT: XIMPreeditArea HEX: 0001
: XIMPreeditCallbacks HEX: 0002 ; inline CONSTANT: XIMPreeditCallbacks HEX: 0002
: XIMPreeditPosition HEX: 0004 ; inline CONSTANT: XIMPreeditPosition HEX: 0004
: XIMPreeditNothing HEX: 0008 ; inline CONSTANT: XIMPreeditNothing HEX: 0008
: XIMPreeditNone HEX: 0010 ; inline CONSTANT: XIMPreeditNone HEX: 0010
: XIMStatusArea HEX: 0100 ; inline CONSTANT: XIMStatusArea HEX: 0100
: XIMStatusCallbacks HEX: 0200 ; inline CONSTANT: XIMStatusCallbacks HEX: 0200
: XIMStatusNothing HEX: 0400 ; inline CONSTANT: XIMStatusNothing HEX: 0400
: XIMStatusNone HEX: 0800 ; inline CONSTANT: XIMStatusNone HEX: 0800
: XNVaNestedList "XNVaNestedList" ; CONSTANT: XNVaNestedList "XNVaNestedList"
: XNQueryInputStyle "queryInputStyle" ; CONSTANT: XNQueryInputStyle "queryInputStyle"
: XNClientWindow "clientWindow" ; CONSTANT: XNClientWindow "clientWindow"
: XNInputStyle "inputStyle" ; CONSTANT: XNInputStyle "inputStyle"
: XNFocusWindow "focusWindow" ; CONSTANT: XNFocusWindow "focusWindow"
: XNResourceName "resourceName" ; CONSTANT: XNResourceName "resourceName"
: XNResourceClass "resourceClass" ; CONSTANT: XNResourceClass "resourceClass"
: XNGeometryCallback "geometryCallback" ; CONSTANT: XNGeometryCallback "geometryCallback"
: XNDestroyCallback "destroyCallback" ; CONSTANT: XNDestroyCallback "destroyCallback"
: XNFilterEvents "filterEvents" ; CONSTANT: XNFilterEvents "filterEvents"
: XNPreeditStartCallback "preeditStartCallback" ; CONSTANT: XNPreeditStartCallback "preeditStartCallback"
: XNPreeditDoneCallback "preeditDoneCallback" ; CONSTANT: XNPreeditDoneCallback "preeditDoneCallback"
: XNPreeditDrawCallback "preeditDrawCallback" ; CONSTANT: XNPreeditDrawCallback "preeditDrawCallback"
: XNPreeditCaretCallback "preeditCaretCallback" ; CONSTANT: XNPreeditCaretCallback "preeditCaretCallback"
: XNPreeditStateNotifyCallback "preeditStateNotifyCallback" ; CONSTANT: XNPreeditStateNotifyCallback "preeditStateNotifyCallback"
: XNPreeditAttributes "preeditAttributes" ; CONSTANT: XNPreeditAttributes "preeditAttributes"
: XNStatusStartCallback "statusStartCallback" ; CONSTANT: XNStatusStartCallback "statusStartCallback"
: XNStatusDoneCallback "statusDoneCallback" ; CONSTANT: XNStatusDoneCallback "statusDoneCallback"
: XNStatusDrawCallback "statusDrawCallback" ; CONSTANT: XNStatusDrawCallback "statusDrawCallback"
: XNStatusAttributes "statusAttributes" ; CONSTANT: XNStatusAttributes "statusAttributes"
: XNArea "area" ; CONSTANT: XNArea "area"
: XNAreaNeeded "areaNeeded" ; CONSTANT: XNAreaNeeded "areaNeeded"
: XNSpotLocation "spotLocation" ; CONSTANT: XNSpotLocation "spotLocation"
: XNColormap "colorMap" ; CONSTANT: XNColormap "colorMap"
: XNStdColormap "stdColorMap" ; CONSTANT: XNStdColormap "stdColorMap"
: XNForeground "foreground" ; CONSTANT: XNForeground "foreground"
: XNBackground "background" ; CONSTANT: XNBackground "background"
: XNBackgroundPixmap "backgroundPixmap" ; CONSTANT: XNBackgroundPixmap "backgroundPixmap"
: XNFontSet "fontSet" ; CONSTANT: XNFontSet "fontSet"
: XNLineSpace "lineSpace" ; CONSTANT: XNLineSpace "lineSpace"
: XNCursor "cursor" ; CONSTANT: XNCursor "cursor"
: XNQueryIMValuesList "queryIMValuesList" ; CONSTANT: XNQueryIMValuesList "queryIMValuesList"
: XNQueryICValuesList "queryICValuesList" ; CONSTANT: XNQueryICValuesList "queryICValuesList"
: XNVisiblePosition "visiblePosition" ; CONSTANT: XNVisiblePosition "visiblePosition"
: XNR6PreeditCallback "r6PreeditCallback" ; CONSTANT: XNR6PreeditCallback "r6PreeditCallback"
: XNStringConversionCallback "stringConversionCallback" ; CONSTANT: XNStringConversionCallback "stringConversionCallback"
: XNStringConversion "stringConversion" ; CONSTANT: XNStringConversion "stringConversion"
: XNResetState "resetState" ; CONSTANT: XNResetState "resetState"
: XNHotKey "hotKey" ; CONSTANT: XNHotKey "hotKey"
: XNHotKeyState "hotKeyState" ; CONSTANT: XNHotKeyState "hotKeyState"
: XNPreeditState "preeditState" ; CONSTANT: XNPreeditState "preeditState"
: XNSeparatorofNestedList "separatorofNestedList" ; CONSTANT: XNSeparatorofNestedList "separatorofNestedList"
: XBufferOverflow -1 ; CONSTANT: XBufferOverflow -1
: XLookupNone 1 ; CONSTANT: XLookupNone 1
: XLookupChars 2 ; CONSTANT: XLookupChars 2
: XLookupKeySym 3 ; CONSTANT: XLookupKeySym 3
: XLookupBoth 4 ; CONSTANT: XLookupBoth 4
FUNCTION: Bool XFilterEvent ( XEvent* event, Window w ) ; FUNCTION: Bool XFilterEvent ( XEvent* event, Window w ) ;
@ -1400,12 +1400,12 @@ FUNCTION: int XwcLookupString ( XIC ic, XKeyPressedEvent* event, ulong* buffer_r
FUNCTION: int Xutf8LookupString ( XIC ic, XKeyPressedEvent* event, char* buffer_return, int bytes_buffer, KeySym* keysym_return, Status* status_return ) ; FUNCTION: int Xutf8LookupString ( XIC ic, XKeyPressedEvent* event, char* buffer_return, int bytes_buffer, KeySym* keysym_return, Status* status_return ) ;
! !!! category of setlocale ! !!! category of setlocale
: LC_ALL 0 ; inline CONSTANT: LC_ALL 0
: LC_COLLATE 1 ; inline CONSTANT: LC_COLLATE 1
: LC_CTYPE 2 ; inline CONSTANT: LC_CTYPE 2
: LC_MONETARY 3 ; inline CONSTANT: LC_MONETARY 3
: LC_NUMERIC 4 ; inline CONSTANT: LC_NUMERIC 4
: LC_TIME 5 ; inline CONSTANT: LC_TIME 5
FUNCTION: char* setlocale ( int category, char* name ) ; FUNCTION: char* setlocale ( int category, char* name ) ;

View File

@ -58,6 +58,7 @@ ARTICLE: "assocs-lookup" "Lookup and querying of assocs"
"Utility operations built up from the " { $link "assocs-protocol" } ":" "Utility operations built up from the " { $link "assocs-protocol" } ":"
{ $subsection key? } { $subsection key? }
{ $subsection at } { $subsection at }
{ $subsection ?at }
{ $subsection assoc-empty? } { $subsection assoc-empty? }
{ $subsection keys } { $subsection keys }
{ $subsection values } { $subsection values }
@ -188,12 +189,16 @@ HELP: key?
{ $values { "key" object } { "assoc" assoc } { "?" "a boolean" } } { $values { "key" object } { "assoc" assoc } { "?" "a boolean" } }
{ $description "Tests if an assoc contains a key." } ; { $description "Tests if an assoc contains a key." } ;
{ at at* key? } related-words { at at* key? ?at } related-words
HELP: at HELP: at
{ $values { "key" "an object" } { "assoc" assoc } { "value/f" "the value associated to the key, or " { $link f } " if the key is not present in the assoc" } } { $values { "key" "an object" } { "assoc" assoc } { "value/f" "the value associated to the key, or " { $link f } " if the key is not present in the assoc" } }
{ $description "Looks up the value associated with a key. This word makes no distinction between a missing value and a value set to " { $link f } "; if the difference is important, use " { $link at* } "." } ; { $description "Looks up the value associated with a key. This word makes no distinction between a missing value and a value set to " { $link f } "; if the difference is important, use " { $link at* } "." } ;
HELP: ?at
{ $values { "key" "an object" } { "assoc" assoc } { "value/key" "the value associated to the key, or the key if the key is not present in the assoc" } { "?" "a boolean" } }
{ $description "Looks up the value associated with a key. If the key was not present, an error can be thrown without extra stack shuffling. This word handles assocs that store " { $link f } "." } ;
HELP: assoc-each HELP: assoc-each
{ $values { "assoc" assoc } { "quot" { $quotation "( key value -- )" } } } { $values { "assoc" assoc } { "quot" { $quotation "( key value -- )" } } }
{ $description "Applies a quotation to each entry in the assoc." } { $description "Applies a quotation to each entry in the assoc." }

View File

@ -138,4 +138,7 @@ unit-test
{ "c" [ 3 ] } { "c" [ 3 ] }
{ "d" [ 4 ] } { "d" [ 4 ] }
} [ nip first even? ] assoc-partition } [ nip first even? ] assoc-partition
] unit-test ] unit-test
[ 1 f ] [ 1 H{ } ?at ] unit-test
[ 2 t ] [ 1 H{ { 1 2 } } ?at ] unit-test

View File

@ -19,6 +19,9 @@ GENERIC: >alist ( assoc -- newassoc )
M: assoc assoc-like drop ; M: assoc assoc-like drop ;
: ?at ( key assoc -- value/key ? )
dupd at* [ [ nip ] [ drop ] if ] keep ; inline
<PRIVATE <PRIVATE
: (assoc-each) ( assoc quot -- seq quot' ) : (assoc-each) ( assoc quot -- seq quot' )
@ -36,7 +39,7 @@ M: assoc assoc-like drop ;
[ first = ] with find swap ; inline [ first = ] with find swap ; inline
: substituter ( assoc -- quot ) : substituter ( assoc -- quot )
[ dupd at* [ nip ] [ drop ] if ] curry ; inline [ ?at drop ] curry ; inline
: with-assoc ( assoc quot: ( value key -- assoc ) -- quot: ( key value -- ) ) : with-assoc ( assoc quot: ( value key -- assoc ) -- quot: ( key value -- ) )
curry [ swap ] prepose ; inline curry [ swap ] prepose ; inline
@ -80,7 +83,7 @@ PRIVATE>
at* drop ; inline at* drop ; inline
: at-default ( key assoc -- value/key ) : at-default ( key assoc -- value/key )
2dup at* [ 2nip ] [ 2drop ] if ; inline ?at drop ; inline
M: assoc assoc-clone-like ( assoc exemplar -- newassoc ) M: assoc assoc-clone-like ( assoc exemplar -- newassoc )
[ dup assoc-size ] dip new-assoc [ dup assoc-size ] dip new-assoc

View File

@ -5,9 +5,9 @@ words io io.binary io.files quotations
definitions checksums ; definitions checksums ;
IN: checksums.crc32 IN: checksums.crc32
: crc32-polynomial HEX: edb88320 ; inline CONSTANT: crc32-polynomial HEX: edb88320
: crc32-table V{ } ; inline CONSTANT: crc32-table V{ }
256 [ 256 [
8 [ 8 [

View File

@ -176,8 +176,8 @@ IN: combinators.tests
[ "an array" ] [ { 1 2 3 } case-test-3 ] unit-test [ "an array" ] [ { 1 2 3 } case-test-3 ] unit-test
: case-const-1 1 ; CONSTANT: case-const-1 1
: case-const-2 2 ; inline CONSTANT: case-const-2 2
! Compiled ! Compiled
: case-test-4 ( obj -- str ) : case-test-4 ( obj -- str )

View File

@ -14,7 +14,7 @@ GENERIC: encode-char ( char stream encoding -- )
GENERIC: <decoder> ( stream encoding -- newstream ) GENERIC: <decoder> ( stream encoding -- newstream )
: replacement-char HEX: fffd ; inline CONSTANT: replacement-char HEX: fffd
TUPLE: decoder stream code cr ; TUPLE: decoder stream code cr ;

View File

@ -91,6 +91,8 @@ unit-test
[ f ] [ BIN: -1101 >bignum 3 bit? ] unit-test [ f ] [ BIN: -1101 >bignum 3 bit? ] unit-test
[ t ] [ BIN: -1101 >bignum 4 bit? ] unit-test [ t ] [ BIN: -1101 >bignum 4 bit? ] unit-test
[ t ] [ 1067811677921310779 >bignum 59 bit? ] unit-test
[ 2 ] [ 0 next-power-of-2 ] unit-test [ 2 ] [ 0 next-power-of-2 ] unit-test
[ 2 ] [ 1 next-power-of-2 ] unit-test [ 2 ] [ 1 next-power-of-2 ] unit-test
[ 2 ] [ 2 next-power-of-2 ] unit-test [ 2 ] [ 2 next-power-of-2 ] unit-test

View File

@ -133,7 +133,7 @@ compiled-generic-crossref [ H{ } clone ] initialize
SYMBOL: visited SYMBOL: visited
: reset-on-redefine { "inferred-effect" "cannot-infer" } ; inline CONSTANT: reset-on-redefine { "inferred-effect" "cannot-infer" }
: (redefined) ( word -- ) : (redefined) ( word -- )
dup visited get key? [ drop ] [ dup visited get key? [ drop ] [

View File

@ -1,4 +1,4 @@
! Copyright (C) 2008 Your name. ! Copyright (C) 2008 Jeff Bigot.
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: arrays help.markup help.syntax kernel sequences ; USING: arrays help.markup help.syntax kernel sequences ;
IN: adsoda.combinators IN: adsoda.combinators

View File

@ -1,6 +1,6 @@
USING: accessors arrays combinators definitions generalizations USING: accessors arrays combinators definitions generalizations
help help.markup help.topics kernel sequences sorting vocabs help help.markup help.topics kernel sequences sorting vocabs
words ; words combinators.smart ;
IN: annotations IN: annotations
<PRIVATE <PRIVATE
@ -13,17 +13,35 @@ PRIVATE>
first first
[ "!" " your comment here" surround 1array $syntax ] [ "!" " your comment here" surround 1array $syntax ]
[ [ "Treats the rest of the line after the exclamation point as a code annotation that can be looked up with the " \ $link ] dip comment-usage.-word 2array " word." 3array $description ] [ [ "Treats the rest of the line after the exclamation point as a code annotation that can be looked up with the " \ $link ] dip comment-usage.-word 2array " word." 3array $description ]
[ ": foo ( x y z -- w )\n !" " --w-ó()ò-w-- kilroy was here\n + * ;" surround 1array $unchecked-example ] [ ": foo ( x y z -- w )\n !" " --w-ó()ò-w-- kilroy was here\n + * ;" surround 1array $code ]
tri ; tri ;
: <$annotation> ( word -- element )
\ $annotation swap 2array 1array ;
: $annotation-usage. ( element -- ) : $annotation-usage. ( element -- )
first first
[ "Displays a list of words, help articles, and vocabularies that contain " \ $link ] dip comment-word 2array " annotations." 3array $description ; [ "Displays a list of words, help articles, and vocabularies that contain " \ $link ] dip comment-word 2array " annotations." 3array $description ;
: <$annotation-usage.> ( word -- element )
\ $annotation-usage. swap 2array 1array ;
: $annotation-usage ( element -- ) : $annotation-usage ( element -- )
first first [
{ "usages" sequence } $values [ "Returns a list of words, help articles, and vocabularies that contain " ] dip
[ "Returns a list of words, help articles, and vocabularies that contain " \ $link ] dip [ comment-word 2array " annotations. For a more user-friendly display, use the " \ $link ] [ comment-usage.-word 2array " word." 6 narray ] bi 1array $description ; [
comment-word <$link>
" annotations. For a more user-friendly display, use the "
] [
comment-usage.-word <$link>
" word."
] bi
] output>array $description ;
: <$annotation-usage> ( word -- element )
[ { $values { "usages" sequence } } ] dip
\ $annotation-usage swap 2array
2array ;
"Code annotations" "Code annotations"
{ {
@ -42,9 +60,9 @@ annotation-tags natural-sort
annotation-tags [ annotation-tags [
{ {
[ [ \ $annotation swap 2array 1array ] [ comment-word set-word-help ] bi ] [ [ <$annotation> ] [ comment-word set-word-help ] bi ]
[ [ \ $annotation-usage swap 2array 1array ] [ comment-usage-word set-word-help ] bi ] [ [ <$annotation-usage> ] [ comment-usage-word set-word-help ] bi ]
[ [ \ $annotation-usage. swap 2array 1array ] [ comment-usage.-word set-word-help ] bi ] [ [ <$annotation-usage.> ] [ comment-usage.-word set-word-help ] bi ]
[ [ comment-word ] [ comment-usage-word ] [ comment-usage.-word ] tri 3array related-words ] [ [ comment-word ] [ comment-usage-word ] [ comment-usage.-word ] tri 3array related-words ]
} cleave } cleave
] each ] each

View File

@ -3,9 +3,9 @@
IN: asn1.ldap IN: asn1.ldap
: SearchScope_BaseObject 0 ; inline CONSTANT: SearchScope_BaseObject 0
: SearchScope_SingleLevel 1 ; inline CONSTANT: SearchScope_SingleLevel 1
: SearchScope_WholeSubtree 2 ; inline CONSTANT: SearchScope_WholeSubtree 2
: asn-syntax ( -- hashtable ) : asn-syntax ( -- hashtable )
H{ H{

View File

@ -23,7 +23,7 @@ M: tree-node item-check
M: f item-check drop 0 ; M: f item-check drop 0 ;
: min-depth 4 ; inline CONSTANT: min-depth 4
: stretch-tree ( max-depth -- ) : stretch-tree ( max-depth -- )
1 + 0 over bottom-up-tree item-check 1 + 0 over bottom-up-tree item-check

View File

@ -4,11 +4,11 @@ sequences.private benchmark.reverse-complement hints io.encodings.ascii
byte-arrays specialized-arrays.double ; byte-arrays specialized-arrays.double ;
IN: benchmark.fasta IN: benchmark.fasta
: IM 139968 ; inline CONSTANT: IM 139968
: IA 3877 ; inline CONSTANT: IA 3877
: IC 29573 ; inline CONSTANT: IC 29573
: initial-seed 42 ; inline CONSTANT: initial-seed 42
: line-length 60 ; inline CONSTANT: line-length 60
USE: math.private USE: math.private
@ -17,7 +17,7 @@ USE: math.private
HINTS: random fixnum ; HINTS: random fixnum ;
: ALU "GGCCGGGCGCGGTGGCTCACGCCTGTAATCCCAGCACTTTGGGAGGCCGAGGCGGGCGGATCACCTGAGGTCAGGAGTTCGAGACCAGCCTGGCCAACATGGTGAAACCCCGTCTCTACTAAAAATACAAAAATTAGCCGGGCGTGGTGGCGCGCGCCTGTAATCCCAGCTACTCGGGAGGCTGAGGCAGGAGAATCGCTTGAACCCGGGAGGCGGAGGTTGCAGTGAGCCGAGATCGCGCCACTGCACTCCAGCCTGGGCGACAGAGCGAGACTCCGTCTCAAAAA" ; inline CONSTANT: ALU "GGCCGGGCGCGGTGGCTCACGCCTGTAATCCCAGCACTTTGGGAGGCCGAGGCGGGCGGATCACCTGAGGTCAGGAGTTCGAGACCAGCCTGGCCAACATGGTGAAACCCCGTCTCTACTAAAAATACAAAAATTAGCCGGGCGTGGTGGCGCGCGCCTGTAATCCCAGCTACTCGGGAGGCTGAGGCAGGAGAATCGCTTGAACCCGGGAGGCGGAGGTTGCAGTGAGCCGAGATCGCGCCACTGCACTCCAGCCTGGGCGACAGAGCGAGACTCCGTCTCAAAAA"
: IUB : IUB
{ {

View File

@ -7,8 +7,8 @@ IN: benchmark.mandel.colors
: scale-rgb ( rgba -- n ) : scale-rgb ( rgba -- n )
[ red>> scale ] [ green>> scale ] [ blue>> scale ] tri 3byte-array ; [ red>> scale ] [ green>> scale ] [ blue>> scale ] tri 3byte-array ;
: sat 0.85 ; inline CONSTANT: sat 0.85
: val 0.85 ; inline CONSTANT: val 0.85
: <color-map> ( nb-cols -- map ) : <color-map> ( nb-cols -- map )
dup [ dup [

View File

@ -1,8 +1,8 @@
IN: benchmark.mandel.params IN: benchmark.mandel.params
: max-color 360 ; inline CONSTANT: max-color 360
: zoom-fact 0.8 ; inline CONSTANT: zoom-fact 0.8
: width 640 ; inline CONSTANT: width 640
: height 480 ; inline CONSTANT: height 480
: max-iterations 40 ; inline CONSTANT: max-iterations 40
: center -0.65 ; inline CONSTANT: center -0.65

View File

@ -6,7 +6,7 @@ sequences hints arrays ;
IN: benchmark.nbody IN: benchmark.nbody
: solar-mass ( -- x ) 4 pi sq * ; inline : solar-mass ( -- x ) 4 pi sq * ; inline
: days-per-year 365.24 ; inline CONSTANT: days-per-year 365.24
TUPLE: body TUPLE: body
{ location double-array } { location double-array }

View File

@ -16,13 +16,13 @@ IN: benchmark.raytracer
0.5345224838248488 0.5345224838248488
} ; inline } ; inline
: oversampling 4 ; inline CONSTANT: oversampling 4
: levels 3 ; inline CONSTANT: levels 3
: size 200 ; inline CONSTANT: size 200
: delta 1.4901161193847656E-8 ; inline CONSTANT: delta 1.4901161193847656E-8
TUPLE: ray { orig double-array read-only } { dir double-array read-only } ; TUPLE: ray { orig double-array read-only } { dir double-array read-only } ;
@ -88,7 +88,7 @@ TUPLE: group < sphere { objs array read-only } ;
M: group intersect-scene ( hit ray group -- hit ) M: group intersect-scene ( hit ray group -- hit )
[ drop objs>> [ intersect-scene ] with each ] if-ray-sphere ; [ drop objs>> [ intersect-scene ] with each ] if-ray-sphere ;
: initial-hit T{ hit f double-array{ 0.0 0.0 0.0 } 1/0. } ; inline CONSTANT: initial-hit T{ hit f double-array{ 0.0 0.0 0.0 } 1/0. }
: initial-intersect ( ray scene -- hit ) : initial-intersect ( ray scene -- hit )
[ initial-hit ] 2dip intersect-scene ; inline [ initial-hit ] 2dip intersect-scene ; inline

View File

@ -4,7 +4,7 @@ USING: arrays kernel math memoize sequences math.bitwise
locals ; locals ;
IN: crypto.aes IN: crypto.aes
: AES_BLOCK_SIZE 16 ; inline CONSTANT: AES_BLOCK_SIZE 16
: sbox ( -- array ) : sbox ( -- array )
{ {

View File

@ -1,7 +1,7 @@
! 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: kernel base64 checksums.md5 sequences checksums USING: kernel base64 checksums.md5 sequences checksums
locals prettyprint math math.bitwise grouping io combinators locals prettyprint math math.bits grouping io combinators
fry make combinators.short-circuit math.functions splitting ; fry make combinators.short-circuit math.functions splitting ;
IN: crypto.passwd-md5 IN: crypto.passwd-md5
@ -22,8 +22,8 @@ PRIVATE>
password length password length
[ 16 / ceiling swap <repetition> concat ] keep [ 16 / ceiling swap <repetition> concat ] keep
head-slice append head-slice append
password [ length ] [ first ] bi password [ length make-bits ] [ first ] bi
'[ [ CHAR: \0 _ ? , ] each-bit ] "" make append '[ CHAR: \0 _ ? ] "" map-as append
md5 checksum-bytes ] | md5 checksum-bytes ] |
1000 [ 1000 [
"" swap "" swap

View File

@ -18,7 +18,7 @@ C: <rsa> rsa
<PRIVATE <PRIVATE
: public-key 65537 ; inline CONSTANT: public-key 65537
: rsa-primes ( numbits -- p q ) : rsa-primes ( numbits -- p q )
2/ 2 unique-primes first2 ; 2/ 2 unique-primes first2 ;

View File

@ -10,9 +10,9 @@ IN: curses
SYMBOL: curses-windows SYMBOL: curses-windows
SYMBOL: current-window SYMBOL: current-window
: ERR -1 ; inline CONSTANT: ERR -1
: FALSE 0 ; inline CONSTANT: FALSE 0
: TRUE 1 ; inline CONSTANT: TRUE 1
: >BOOLEAN ( n -- TRUE/FALSE ) >boolean TRUE FALSE ? ; inline : >BOOLEAN ( n -- TRUE/FALSE ) >boolean TRUE FALSE ? ; inline
ERROR: duplicate-window window ; ERROR: duplicate-window window ;

View File

@ -18,7 +18,7 @@ TYPEDEF: chtype attr_t
TYPEDEF: short NCURSES_SIZE_T TYPEDEF: short NCURSES_SIZE_T
TYPEDEF: ushort wchar_t TYPEDEF: ushort wchar_t
: CCHARW_MAX 5 ; inline CONSTANT: CCHARW_MAX 5
C-STRUCT: cchar_t C-STRUCT: cchar_t
{ "attr_t" "attr" } { "attr_t" "attr" }

View File

@ -1,4 +0,0 @@
! Copyright (C) 2008 Your name.
! See http://factorcode.org/license.txt for BSD license.
USING: tools.test fuel ;
IN: fuel.tests

View File

@ -21,33 +21,33 @@ iokit-game-input-backend game-input-backend set-global
[ &CFRelease NSFastEnumeration>vector ] [ f ] if* [ &CFRelease NSFastEnumeration>vector ] [ f ] if*
] with-destructors ; ] with-destructors ;
: game-devices-matching-seq CONSTANT: game-devices-matching-seq
{ {
H{ { "DeviceUsage" 4 } { "DeviceUsagePage" 1 } } ! joysticks H{ { "DeviceUsage" 4 } { "DeviceUsagePage" 1 } } ! joysticks
H{ { "DeviceUsage" 5 } { "DeviceUsagePage" 1 } } ! gamepads H{ { "DeviceUsage" 5 } { "DeviceUsagePage" 1 } } ! gamepads
H{ { "DeviceUsage" 6 } { "DeviceUsagePage" 1 } } ! keyboards H{ { "DeviceUsage" 6 } { "DeviceUsagePage" 1 } } ! keyboards
} ; inline }
: buttons-matching-hash CONSTANT: buttons-matching-hash
H{ { "UsagePage" 9 } { "Type" 2 } } ; inline H{ { "UsagePage" 9 } { "Type" 2 } }
: keys-matching-hash CONSTANT: keys-matching-hash
H{ { "UsagePage" 7 } { "Type" 2 } } ; inline H{ { "UsagePage" 7 } { "Type" 2 } }
: x-axis-matching-hash CONSTANT: x-axis-matching-hash
H{ { "UsagePage" 1 } { "Usage" HEX: 30 } { "Type" 1 } } ; inline H{ { "UsagePage" 1 } { "Usage" HEX: 30 } { "Type" 1 } }
: y-axis-matching-hash CONSTANT: y-axis-matching-hash
H{ { "UsagePage" 1 } { "Usage" HEX: 31 } { "Type" 1 } } ; inline H{ { "UsagePage" 1 } { "Usage" HEX: 31 } { "Type" 1 } }
: z-axis-matching-hash CONSTANT: z-axis-matching-hash
H{ { "UsagePage" 1 } { "Usage" HEX: 32 } { "Type" 1 } } ; inline H{ { "UsagePage" 1 } { "Usage" HEX: 32 } { "Type" 1 } }
: rx-axis-matching-hash CONSTANT: rx-axis-matching-hash
H{ { "UsagePage" 1 } { "Usage" HEX: 33 } { "Type" 1 } } ; inline H{ { "UsagePage" 1 } { "Usage" HEX: 33 } { "Type" 1 } }
: ry-axis-matching-hash CONSTANT: ry-axis-matching-hash
H{ { "UsagePage" 1 } { "Usage" HEX: 34 } { "Type" 1 } } ; inline H{ { "UsagePage" 1 } { "Usage" HEX: 34 } { "Type" 1 } }
: rz-axis-matching-hash CONSTANT: rz-axis-matching-hash
H{ { "UsagePage" 1 } { "Usage" HEX: 35 } { "Type" 1 } } ; inline H{ { "UsagePage" 1 } { "Usage" HEX: 35 } { "Type" 1 } }
: slider-matching-hash CONSTANT: slider-matching-hash
H{ { "UsagePage" 1 } { "Usage" HEX: 36 } { "Type" 1 } } ; inline H{ { "UsagePage" 1 } { "Usage" HEX: 36 } { "Type" 1 } }
: hat-switch-matching-hash CONSTANT: hat-switch-matching-hash
H{ { "UsagePage" 1 } { "Usage" HEX: 39 } { "Type" 1 } } ; inline H{ { "UsagePage" 1 } { "Usage" HEX: 39 } { "Type" 1 } }
: device-elements-matching ( device matching-hash -- vector ) : device-elements-matching ( device matching-hash -- vector )
[ [

View File

@ -1,175 +1,175 @@
IN: game-input.scancodes IN: game-input.scancodes
: key-undefined HEX: 0000 ; inline CONSTANT: key-undefined HEX: 0000
: key-error-roll-over HEX: 0001 ; inline CONSTANT: key-error-roll-over HEX: 0001
: key-error-post-fail HEX: 0002 ; inline CONSTANT: key-error-post-fail HEX: 0002
: key-error-undefined HEX: 0003 ; inline CONSTANT: key-error-undefined HEX: 0003
: key-a HEX: 0004 ; inline CONSTANT: key-a HEX: 0004
: key-b HEX: 0005 ; inline CONSTANT: key-b HEX: 0005
: key-c HEX: 0006 ; inline CONSTANT: key-c HEX: 0006
: key-d HEX: 0007 ; inline CONSTANT: key-d HEX: 0007
: key-e HEX: 0008 ; inline CONSTANT: key-e HEX: 0008
: key-f HEX: 0009 ; inline CONSTANT: key-f HEX: 0009
: key-g HEX: 000a ; inline CONSTANT: key-g HEX: 000a
: key-h HEX: 000b ; inline CONSTANT: key-h HEX: 000b
: key-i HEX: 000c ; inline CONSTANT: key-i HEX: 000c
: key-j HEX: 000d ; inline CONSTANT: key-j HEX: 000d
: key-k HEX: 000e ; inline CONSTANT: key-k HEX: 000e
: key-l HEX: 000f ; inline CONSTANT: key-l HEX: 000f
: key-m HEX: 0010 ; inline CONSTANT: key-m HEX: 0010
: key-n HEX: 0011 ; inline CONSTANT: key-n HEX: 0011
: key-o HEX: 0012 ; inline CONSTANT: key-o HEX: 0012
: key-p HEX: 0013 ; inline CONSTANT: key-p HEX: 0013
: key-q HEX: 0014 ; inline CONSTANT: key-q HEX: 0014
: key-r HEX: 0015 ; inline CONSTANT: key-r HEX: 0015
: key-s HEX: 0016 ; inline CONSTANT: key-s HEX: 0016
: key-t HEX: 0017 ; inline CONSTANT: key-t HEX: 0017
: key-u HEX: 0018 ; inline CONSTANT: key-u HEX: 0018
: key-v HEX: 0019 ; inline CONSTANT: key-v HEX: 0019
: key-w HEX: 001a ; inline CONSTANT: key-w HEX: 001a
: key-x HEX: 001b ; inline CONSTANT: key-x HEX: 001b
: key-y HEX: 001c ; inline CONSTANT: key-y HEX: 001c
: key-z HEX: 001d ; inline CONSTANT: key-z HEX: 001d
: key-1 HEX: 001e ; inline CONSTANT: key-1 HEX: 001e
: key-2 HEX: 001f ; inline CONSTANT: key-2 HEX: 001f
: key-3 HEX: 0020 ; inline CONSTANT: key-3 HEX: 0020
: key-4 HEX: 0021 ; inline CONSTANT: key-4 HEX: 0021
: key-5 HEX: 0022 ; inline CONSTANT: key-5 HEX: 0022
: key-6 HEX: 0023 ; inline CONSTANT: key-6 HEX: 0023
: key-7 HEX: 0024 ; inline CONSTANT: key-7 HEX: 0024
: key-8 HEX: 0025 ; inline CONSTANT: key-8 HEX: 0025
: key-9 HEX: 0026 ; inline CONSTANT: key-9 HEX: 0026
: key-0 HEX: 0027 ; inline CONSTANT: key-0 HEX: 0027
: key-return HEX: 0028 ; inline CONSTANT: key-return HEX: 0028
: key-escape HEX: 0029 ; inline CONSTANT: key-escape HEX: 0029
: key-backspace HEX: 002a ; inline CONSTANT: key-backspace HEX: 002a
: key-tab HEX: 002b ; inline CONSTANT: key-tab HEX: 002b
: key-space HEX: 002c ; inline CONSTANT: key-space HEX: 002c
: key-- HEX: 002d ; inline CONSTANT: key-- HEX: 002d
: key-= HEX: 002e ; inline CONSTANT: key-= HEX: 002e
: key-[ HEX: 002f ; inline CONSTANT: key-[ HEX: 002f
: key-] HEX: 0030 ; inline CONSTANT: key-] HEX: 0030
: key-\ HEX: 0031 ; inline CONSTANT: key-\ HEX: 0031
: key-#-non-us HEX: 0032 ; inline CONSTANT: key-#-non-us HEX: 0032
: key-; HEX: 0033 ; inline CONSTANT: key-; HEX: 0033
: key-' HEX: 0034 ; inline CONSTANT: key-' HEX: 0034
: key-` HEX: 0035 ; inline CONSTANT: key-` HEX: 0035
: key-, HEX: 0036 ; inline CONSTANT: key-, HEX: 0036
: key-. HEX: 0037 ; inline CONSTANT: key-. HEX: 0037
: key-/ HEX: 0038 ; inline CONSTANT: key-/ HEX: 0038
: key-caps-lock HEX: 0039 ; inline CONSTANT: key-caps-lock HEX: 0039
: key-f1 HEX: 003a ; inline CONSTANT: key-f1 HEX: 003a
: key-f2 HEX: 003b ; inline CONSTANT: key-f2 HEX: 003b
: key-f3 HEX: 003c ; inline CONSTANT: key-f3 HEX: 003c
: key-f4 HEX: 003d ; inline CONSTANT: key-f4 HEX: 003d
: key-f5 HEX: 003e ; inline CONSTANT: key-f5 HEX: 003e
: key-f6 HEX: 003f ; inline CONSTANT: key-f6 HEX: 003f
: key-f7 HEX: 0040 ; inline CONSTANT: key-f7 HEX: 0040
: key-f8 HEX: 0041 ; inline CONSTANT: key-f8 HEX: 0041
: key-f9 HEX: 0042 ; inline CONSTANT: key-f9 HEX: 0042
: key-f10 HEX: 0043 ; inline CONSTANT: key-f10 HEX: 0043
: key-f11 HEX: 0044 ; inline CONSTANT: key-f11 HEX: 0044
: key-f12 HEX: 0045 ; inline CONSTANT: key-f12 HEX: 0045
: key-print-screen HEX: 0046 ; inline CONSTANT: key-print-screen HEX: 0046
: key-scroll-lock HEX: 0047 ; inline CONSTANT: key-scroll-lock HEX: 0047
: key-pause HEX: 0048 ; inline CONSTANT: key-pause HEX: 0048
: key-insert HEX: 0049 ; inline CONSTANT: key-insert HEX: 0049
: key-home HEX: 004a ; inline CONSTANT: key-home HEX: 004a
: key-page-up HEX: 004b ; inline CONSTANT: key-page-up HEX: 004b
: key-delete HEX: 004c ; inline CONSTANT: key-delete HEX: 004c
: key-end HEX: 004d ; inline CONSTANT: key-end HEX: 004d
: key-page-down HEX: 004e ; inline CONSTANT: key-page-down HEX: 004e
: key-right-arrow HEX: 004f ; inline CONSTANT: key-right-arrow HEX: 004f
: key-left-arrow HEX: 0050 ; inline CONSTANT: key-left-arrow HEX: 0050
: key-down-arrow HEX: 0051 ; inline CONSTANT: key-down-arrow HEX: 0051
: key-up-arrow HEX: 0052 ; inline CONSTANT: key-up-arrow HEX: 0052
: key-keypad-numlock HEX: 0053 ; inline CONSTANT: key-keypad-numlock HEX: 0053
: key-keypad-/ HEX: 0054 ; inline CONSTANT: key-keypad-/ HEX: 0054
: key-keypad-* HEX: 0055 ; inline CONSTANT: key-keypad-* HEX: 0055
: key-keypad-- HEX: 0056 ; inline CONSTANT: key-keypad-- HEX: 0056
: key-keypad-+ HEX: 0057 ; inline CONSTANT: key-keypad-+ HEX: 0057
: key-keypad-enter HEX: 0058 ; inline CONSTANT: key-keypad-enter HEX: 0058
: key-keypad-1 HEX: 0059 ; inline CONSTANT: key-keypad-1 HEX: 0059
: key-keypad-2 HEX: 005a ; inline CONSTANT: key-keypad-2 HEX: 005a
: key-keypad-3 HEX: 005b ; inline CONSTANT: key-keypad-3 HEX: 005b
: key-keypad-4 HEX: 005c ; inline CONSTANT: key-keypad-4 HEX: 005c
: key-keypad-5 HEX: 005d ; inline CONSTANT: key-keypad-5 HEX: 005d
: key-keypad-6 HEX: 005e ; inline CONSTANT: key-keypad-6 HEX: 005e
: key-keypad-7 HEX: 005f ; inline CONSTANT: key-keypad-7 HEX: 005f
: key-keypad-8 HEX: 0060 ; inline CONSTANT: key-keypad-8 HEX: 0060
: key-keypad-9 HEX: 0061 ; inline CONSTANT: key-keypad-9 HEX: 0061
: key-keypad-0 HEX: 0062 ; inline CONSTANT: key-keypad-0 HEX: 0062
: key-keypad-. HEX: 0063 ; inline CONSTANT: key-keypad-. HEX: 0063
: key-\-non-us HEX: 0064 ; inline CONSTANT: key-\-non-us HEX: 0064
: key-application HEX: 0065 ; inline CONSTANT: key-application HEX: 0065
: key-power HEX: 0066 ; inline CONSTANT: key-power HEX: 0066
: key-keypad-= HEX: 0067 ; inline CONSTANT: key-keypad-= HEX: 0067
: key-f13 HEX: 0068 ; inline CONSTANT: key-f13 HEX: 0068
: key-f14 HEX: 0069 ; inline CONSTANT: key-f14 HEX: 0069
: key-f15 HEX: 006a ; inline CONSTANT: key-f15 HEX: 006a
: key-f16 HEX: 006b ; inline CONSTANT: key-f16 HEX: 006b
: key-f17 HEX: 006c ; inline CONSTANT: key-f17 HEX: 006c
: key-f18 HEX: 006d ; inline CONSTANT: key-f18 HEX: 006d
: key-f19 HEX: 006e ; inline CONSTANT: key-f19 HEX: 006e
: key-f20 HEX: 006f ; inline CONSTANT: key-f20 HEX: 006f
: key-f21 HEX: 0070 ; inline CONSTANT: key-f21 HEX: 0070
: key-f22 HEX: 0071 ; inline CONSTANT: key-f22 HEX: 0071
: key-f23 HEX: 0072 ; inline CONSTANT: key-f23 HEX: 0072
: key-f24 HEX: 0073 ; inline CONSTANT: key-f24 HEX: 0073
: key-execute HEX: 0074 ; inline CONSTANT: key-execute HEX: 0074
: key-help HEX: 0075 ; inline CONSTANT: key-help HEX: 0075
: key-menu HEX: 0076 ; inline CONSTANT: key-menu HEX: 0076
: key-select HEX: 0077 ; inline CONSTANT: key-select HEX: 0077
: key-stop HEX: 0078 ; inline CONSTANT: key-stop HEX: 0078
: key-again HEX: 0079 ; inline CONSTANT: key-again HEX: 0079
: key-undo HEX: 007a ; inline CONSTANT: key-undo HEX: 007a
: key-cut HEX: 007b ; inline CONSTANT: key-cut HEX: 007b
: key-copy HEX: 007c ; inline CONSTANT: key-copy HEX: 007c
: key-paste HEX: 007d ; inline CONSTANT: key-paste HEX: 007d
: key-find HEX: 007e ; inline CONSTANT: key-find HEX: 007e
: key-mute HEX: 007f ; inline CONSTANT: key-mute HEX: 007f
: key-volume-up HEX: 0080 ; inline CONSTANT: key-volume-up HEX: 0080
: key-volume-down HEX: 0081 ; inline CONSTANT: key-volume-down HEX: 0081
: key-locking-caps-lock HEX: 0082 ; inline CONSTANT: key-locking-caps-lock HEX: 0082
: key-locking-num-lock HEX: 0083 ; inline CONSTANT: key-locking-num-lock HEX: 0083
: key-locking-scroll-lock HEX: 0084 ; inline CONSTANT: key-locking-scroll-lock HEX: 0084
: key-keypad-, HEX: 0085 ; inline CONSTANT: key-keypad-, HEX: 0085
: key-keypad-=-as-400 HEX: 0086 ; inline CONSTANT: key-keypad-=-as-400 HEX: 0086
: key-international-1 HEX: 0087 ; inline CONSTANT: key-international-1 HEX: 0087
: key-international-2 HEX: 0088 ; inline CONSTANT: key-international-2 HEX: 0088
: key-international-3 HEX: 0089 ; inline CONSTANT: key-international-3 HEX: 0089
: key-international-4 HEX: 008a ; inline CONSTANT: key-international-4 HEX: 008a
: key-international-5 HEX: 008b ; inline CONSTANT: key-international-5 HEX: 008b
: key-international-6 HEX: 008c ; inline CONSTANT: key-international-6 HEX: 008c
: key-international-7 HEX: 008d ; inline CONSTANT: key-international-7 HEX: 008d
: key-international-8 HEX: 008e ; inline CONSTANT: key-international-8 HEX: 008e
: key-international-9 HEX: 008f ; inline CONSTANT: key-international-9 HEX: 008f
: key-lang-1 HEX: 0090 ; inline CONSTANT: key-lang-1 HEX: 0090
: key-lang-2 HEX: 0091 ; inline CONSTANT: key-lang-2 HEX: 0091
: key-lang-3 HEX: 0092 ; inline CONSTANT: key-lang-3 HEX: 0092
: key-lang-4 HEX: 0093 ; inline CONSTANT: key-lang-4 HEX: 0093
: key-lang-5 HEX: 0094 ; inline CONSTANT: key-lang-5 HEX: 0094
: key-lang-6 HEX: 0095 ; inline CONSTANT: key-lang-6 HEX: 0095
: key-lang-7 HEX: 0096 ; inline CONSTANT: key-lang-7 HEX: 0096
: key-lang-8 HEX: 0097 ; inline CONSTANT: key-lang-8 HEX: 0097
: key-lang-9 HEX: 0098 ; inline CONSTANT: key-lang-9 HEX: 0098
: key-alternate-erase HEX: 0099 ; inline CONSTANT: key-alternate-erase HEX: 0099
: key-sysreq HEX: 009a ; inline CONSTANT: key-sysreq HEX: 009a
: key-cancel HEX: 009b ; inline CONSTANT: key-cancel HEX: 009b
: key-clear HEX: 009c ; inline CONSTANT: key-clear HEX: 009c
: key-prior HEX: 009d ; inline CONSTANT: key-prior HEX: 009d
: key-enter HEX: 009e ; inline CONSTANT: key-enter HEX: 009e
: key-separator HEX: 009f ; inline CONSTANT: key-separator HEX: 009f
: key-out HEX: 00a0 ; inline CONSTANT: key-out HEX: 00a0
: key-oper HEX: 00a1 ; inline CONSTANT: key-oper HEX: 00a1
: key-clear-again HEX: 00a2 ; inline CONSTANT: key-clear-again HEX: 00a2
: key-crsel-props HEX: 00a3 ; inline CONSTANT: key-crsel-props HEX: 00a3
: key-exsel HEX: 00a4 ; inline CONSTANT: key-exsel HEX: 00a4
: key-left-control HEX: 00e0 ; inline CONSTANT: key-left-control HEX: 00e0
: key-left-shift HEX: 00e1 ; inline CONSTANT: key-left-shift HEX: 00e1
: key-left-alt HEX: 00e2 ; inline CONSTANT: key-left-alt HEX: 00e2
: key-left-gui HEX: 00e3 ; inline CONSTANT: key-left-gui HEX: 00e3
: key-right-control HEX: 00e4 ; inline CONSTANT: key-right-control HEX: 00e4
: key-right-shift HEX: 00e5 ; inline CONSTANT: key-right-shift HEX: 00e5
: key-right-alt HEX: 00e6 ; inline CONSTANT: key-right-alt HEX: 00e6
: key-right-gui HEX: 00e7 ; inline CONSTANT: key-right-gui HEX: 00e7

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