frameworks: more syntax

locals-and-roots
Doug Coleman 2016-06-05 14:12:12 -07:00
parent 040dfce0c4
commit 675d2b558f
7 changed files with 38 additions and 38 deletions

View File

@ -13,33 +13,33 @@ in: db.sqlite.ffi
} cond cdecl add-library >> } cond cdecl add-library >>
! Return values from sqlite functions ! Return values from sqlite functions
CONSTANT: SQLITE_OK 0 ! Successful result ; CONSTANT: SQLITE_OK 0 ; ! Successful result
CONSTANT: SQLITE_ERROR 1 ! SQL error or missing database ; CONSTANT: SQLITE_ERROR 1 ; ! SQL error or missing database
CONSTANT: SQLITE_INTERNAL 2 ! An internal logic error in SQLite ; CONSTANT: SQLITE_INTERNAL 2 ; ! An internal logic error in SQLite
CONSTANT: SQLITE_PERM 3 ! Access permission denied ; CONSTANT: SQLITE_PERM 3 ; ! Access permission denied
CONSTANT: SQLITE_ABORT 4 ! Callback routine requested an abort ; CONSTANT: SQLITE_ABORT 4 ; ! Callback routine requested an abort
CONSTANT: SQLITE_BUSY 5 ! The database file is locked ; CONSTANT: SQLITE_BUSY 5 ; ! The database file is locked
CONSTANT: SQLITE_LOCKED 6 ! A table in the database is locked ; CONSTANT: SQLITE_LOCKED 6 ; ! A table in the database is locked
CONSTANT: SQLITE_NOMEM 7 ! A malloc() failed ; CONSTANT: SQLITE_NOMEM 7 ; ! A malloc() failed
CONSTANT: SQLITE_READONLY 8 ! Attempt to write a readonly database ; CONSTANT: SQLITE_READONLY 8 ; ! Attempt to write a readonly database
CONSTANT: SQLITE_INTERRUPT 9 ! Operation terminated by sqlite_interrupt() ; CONSTANT: SQLITE_INTERRUPT 9 ; ! Operation terminated by sqlite_interrupt()
CONSTANT: SQLITE_IOERR 10 ! Some kind of disk I/O error occurred ; CONSTANT: SQLITE_IOERR 10 ; ! Some kind of disk I/O error occurred
CONSTANT: SQLITE_CORRUPT 11 ! The database disk image is malformed ; CONSTANT: SQLITE_CORRUPT 11 ; ! The database disk image is malformed
CONSTANT: SQLITE_NOTFOUND 12 ! (Internal Only) Table or record not found ; CONSTANT: SQLITE_NOTFOUND 12 ; ! (Internal Only) Table or record not found
CONSTANT: SQLITE_FULL 13 ! Insertion failed because database is full ; CONSTANT: SQLITE_FULL 13 ; ! Insertion failed because database is full
CONSTANT: SQLITE_CANTOPEN 14 ! Unable to open the database file ; CONSTANT: SQLITE_CANTOPEN 14 ; ! Unable to open the database file
CONSTANT: SQLITE_PROTOCOL 15 ! Database lock protocol error ; CONSTANT: SQLITE_PROTOCOL 15 ; ! Database lock protocol error
CONSTANT: SQLITE_EMPTY 16 ! (Internal Only) Database table is empty ; CONSTANT: SQLITE_EMPTY 16 ; ! (Internal Only) Database table is empty
CONSTANT: SQLITE_SCHEMA 17 ! The database schema changed ; CONSTANT: SQLITE_SCHEMA 17 ; ! The database schema changed
CONSTANT: SQLITE_TOOBIG 18 ! Too much data for one row of a table ; CONSTANT: SQLITE_TOOBIG 18 ; ! Too much data for one row of a table
CONSTANT: SQLITE_CONSTRAINT 19 ! Abort due to contraint violation ; CONSTANT: SQLITE_CONSTRAINT 19 ; ! Abort due to contraint violation
CONSTANT: SQLITE_MISMATCH 20 ! Data type mismatch ; CONSTANT: SQLITE_MISMATCH 20 ; ! Data type mismatch
CONSTANT: SQLITE_MISUSE 21 ! Library used incorrectly ; CONSTANT: SQLITE_MISUSE 21 ; ! Library used incorrectly
CONSTANT: SQLITE_NOLFS 22 ! Uses OS features not supported on host ; CONSTANT: SQLITE_NOLFS 22 ; ! Uses OS features not supported on host
CONSTANT: SQLITE_AUTH 23 ! Authorization denied ; CONSTANT: SQLITE_AUTH 23 ; ! Authorization denied
CONSTANT: SQLITE_FORMAT 24 ! Auxiliary database format error ; CONSTANT: SQLITE_FORMAT 24 ; ! Auxiliary database format error
CONSTANT: SQLITE_RANGE 25 ! 2nd parameter to sqlite3_bind out of range ; CONSTANT: SQLITE_RANGE 25 ; ! 2nd parameter to sqlite3_bind out of range
CONSTANT: SQLITE_NOTADB 26 ! File opened that is not a database file ; CONSTANT: SQLITE_NOTADB 26 ; ! File opened that is not a database file
: sqlite-error-messages ( -- seq ) { : sqlite-error-messages ( -- seq ) {
"Successful result" "Successful result"

View File

@ -275,7 +275,7 @@ CONSTANT: pov-values
{ {
pov-up pov-up-right pov-right pov-down-right pov-up pov-up-right pov-right pov-down-right
pov-down pov-down-left pov-left pov-up-left pov-down pov-down-left pov-left pov-up-left
} } ;
: >axis ( long -- float ) : >axis ( long -- float )
32767 - 32767.0 /f ; inline 32767 - 32767.0 /f ; inline

View File

@ -40,7 +40,7 @@ PIXEL-FORMAT-ATTRIBUTE-TABLE: NSOpenGLPFA { } H{
{ aux-buffers { $ NSOpenGLPFAAuxBuffers } } { aux-buffers { $ NSOpenGLPFAAuxBuffers } }
{ sample-buffers { $ NSOpenGLPFASampleBuffers } } { sample-buffers { $ NSOpenGLPFASampleBuffers } }
{ samples { $ NSOpenGLPFASamples } } { samples { $ NSOpenGLPFASamples } }
} } ;
M: cocoa-ui-backend (make-pixel-format) M: cocoa-ui-backend (make-pixel-format)
nip >NSOpenGLPFA-int-array nip >NSOpenGLPFA-int-array

View File

@ -96,14 +96,14 @@ CONSTANT: events-mask
GDK_KEY_PRESS_MASK GDK_KEY_PRESS_MASK
GDK_KEY_RELEASE_MASK GDK_KEY_RELEASE_MASK
GDK_FOCUS_CHANGE_MASK GDK_FOCUS_CHANGE_MASK
} } ;
CONSTANT: modifiers CONSTANT: modifiers
{ {
{ S+ $ GDK_SHIFT_MASK } { S+ $ GDK_SHIFT_MASK }
{ C+ $ GDK_CONTROL_MASK } { C+ $ GDK_CONTROL_MASK }
{ A+ $ GDK_MOD1_MASK } { A+ $ GDK_MOD1_MASK }
} } ;
CONSTANT: action-key-codes CONSTANT: action-key-codes
H{ H{
@ -135,7 +135,7 @@ CONSTANT: action-key-codes
{ $ GDK_KEY_F10 "F10" } { $ GDK_KEY_F10 "F10" }
{ $ GDK_KEY_F11 "F11" } { $ GDK_KEY_F11 "F11" }
{ $ GDK_KEY_F12 "F12" } { $ GDK_KEY_F12 "F12" }
} } ;
: event-modifiers ( event -- seq ) : event-modifiers ( event -- seq )
state>> modifiers modifier ; state>> modifiers modifier ;
@ -415,7 +415,7 @@ PIXEL-FORMAT-ATTRIBUTE-TABLE: gl-config-attribs
{ aux-buffers ${ GDK_GL_AUX_BUFFERS } } { aux-buffers ${ GDK_GL_AUX_BUFFERS } }
{ sample-buffers ${ GDK_GL_SAMPLE_BUFFERS } } { sample-buffers ${ GDK_GL_SAMPLE_BUFFERS } }
{ samples ${ GDK_GL_SAMPLES } } { samples ${ GDK_GL_SAMPLES } }
} } ;
M: gtk-ui-backend (make-pixel-format) M: gtk-ui-backend (make-pixel-format)
nip >gl-config-attribs-int-array gdk_gl_config_new ; nip >gl-config-attribs-int-array gdk_gl_config_new ;

View File

@ -31,7 +31,7 @@ CONSTANT: poll-fd-events
G_IO_ERR G_IO_ERR
G_IO_HUP G_IO_HUP
G_IO_NVAL G_IO_NVAL
} } ;
: <poll-fd> ( -- poll-fd ) : <poll-fd> ( -- poll-fd )
GPollFD malloc-struct &free GPollFD malloc-struct &free

View File

@ -78,7 +78,7 @@ PIXEL-FORMAT-ATTRIBUTE-TABLE: glx-visual { $ GLX_RGBA } H{
{ aux-buffers { $ GLX_AUX_BUFFERS } } { aux-buffers { $ GLX_AUX_BUFFERS } }
{ sample-buffers { $ GLX_SAMPLE_BUFFERS } } { sample-buffers { $ GLX_SAMPLE_BUFFERS } }
{ samples { $ GLX_SAMPLES } } { samples { $ GLX_SAMPLES } }
} } ;
M: x11-ui-backend (make-pixel-format) M: x11-ui-backend (make-pixel-format)
[ drop dpy get scr get ] dip [ drop dpy get scr get ] dip
@ -100,7 +100,7 @@ CONSTANT: modifiers
{ S+ 0x1 } { S+ 0x1 }
{ C+ 0x4 } { C+ 0x4 }
{ A+ 0x8 } { A+ 0x8 }
} } ;
CONSTANT: key-codes CONSTANT: key-codes
H{ H{
@ -145,7 +145,7 @@ CONSTANT: key-codes
{ 0xFFEC f } ! Right super { 0xFFEC f } ! Right super
{ 0xFFED f } ! Left hyper { 0xFFED f } ! Left hyper
{ 0xFFEE f } ! Right hyper { 0xFFEE f } ! Right hyper
} } ;
: key-code ( keysym -- keycode action? ) : key-code ( keysym -- keycode action? )
dup key-codes at* [ nip dup t and ] [ [ 1string ] dip ] if ; dup key-codes at* [ nip dup t and ] [ [ 1string ] dip ] if ;

View File

@ -84,7 +84,7 @@ M: pixel-format-attribute >PFA
;FUNCTOR ;FUNCTOR
SYNTAX: PIXEL-FORMAT-ATTRIBUTE-TABLE: SYNTAX: PIXEL-FORMAT-ATTRIBUTE-TABLE:
scan-token scan-object scan-object define-pixel-format-attribute-table ; scan-token scan-object scan-object ";" expect define-pixel-format-attribute-table ;
PRIVATE> PRIVATE>