version 1.2, 2003/08/16 19:46:11
|
version 1.3, 2003/08/16 21:09:47
|
Line 142 Variable callbacks
|
Line 142 Variable callbacks
|
Create 0 ] postpone >r also cb-decl |
Create 0 ] postpone >r also cb-decl |
DOES> |
DOES> |
Create here >r 0 , callbacks @ A, r@ callbacks ! |
Create here >r 0 , callbacks @ A, r@ callbacks ! |
swap postpone Literal compile, postpone EXIT |
swap postpone Literal postpone call , postpone EXIT |
r> dup cell+ cell+ alloc-callback swap ! |
r> dup cell+ cell+ alloc-callback swap ! |
DOES> @ ; |
DOES> @ ; |
|
|
Line 198 library libm /lib/libm.so.6
|
Line 198 library libm /lib/libm.so.6
|
libm fmodf sf sf (sf) fmodf |
libm fmodf sf sf (sf) fmodf |
libm fmod df df (fp) fmod |
libm fmod df df (fp) fmod |
|
|
|
\ example for a windows callback |
|
|
callback wincall (int) int int int int callback; |
callback wincall (int) int int int int callback; |
|
|
:noname ( a b c d -- e ) 2drop 2drop 0 ; wincall do_timer |
:noname ( a b c d -- e ) 2drop 2drop 0 ; wincall do_timer |
|
|
|
\ test a callback |
|
|
|
callback 2:1 (int) int int callback; |
|
|
|
: cb-test ( a b -- c ) |
|
cr ." Testing callback" |
|
cr ." arguments: " .s |
|
cr ." result " + .s cr ; |
|
' cb-test 2:1 c_plus |
|
|
|
: test c_plus av-start-int av-int av-int av-call-int ; |
|
|
|
\ 3 4 test |
|
|
[then] |
[then] |