version 1.30, 2008/09/18 02:42:24
|
version 1.36, 2012/07/23 14:15:51
|
Line 1
|
Line 1
|
\ libffi.fs shared library support package 14aug05py |
\ libffi.fs shared library support package 14aug05py |
|
|
\ Copyright (C) 1995,1996,1997,1998,2000,2003,2005,2006,2007,2008 Free Software Foundation, Inc. |
\ Copyright (C) 1995,1996,1997,1998,2000,2003,2005,2006,2007,2008,2009 Free Software Foundation, Inc. |
|
|
\ This file is part of Gforth. |
\ This file is part of Gforth. |
|
|
Line 31 include-ffi.h-string save-c-prefix-line
|
Line 31 include-ffi.h-string save-c-prefix-line
|
\c static void **gforth_clist; |
\c static void **gforth_clist; |
\c static void *gforth_ritem; |
\c static void *gforth_ritem; |
\c #ifndef HAS_BACKLINK |
\c #ifndef HAS_BACKLINK |
\c static void **saved_gforth_pointers; |
\c static void *(*saved_gforth_pointers)(Cell); |
\c #endif |
\c #endif |
\c typedef void *Label; |
\c typedef void *Label; |
\c typedef Label *Xt; |
\c typedef Label *Xt; |
\c static void gforth_callback_ffi(ffi_cif * cif, void * resp, void ** args, void * ip) |
\c static void gforth_callback_ffi(ffi_cif * cif, void * resp, void ** args, void * ip) |
\c { |
\c { |
\c #ifndef HAS_BACKLINK |
\c #ifndef HAS_BACKLINK |
\c void **gforth_pointers = saved_gforth_pointers; |
\c void *(*gforth_pointers)(Cell) = saved_gforth_pointers; |
\c #endif |
\c #endif |
\c { |
\c { |
\c Cell *rp1 = gforth_RP; |
\c Cell *rp1 = gforth_RP; |
Line 51 include-ffi.h-string save-c-prefix-line
|
Line 51 include-ffi.h-string save-c-prefix-line
|
\c gforth_clist = args; |
\c gforth_clist = args; |
\c gforth_ritem = resp; |
\c gforth_ritem = resp; |
\c |
\c |
\c gforth_engine((Xt *)ip, sp, rp1, fp, lp, gforth_UP); |
\c gforth_engine((Xt *)ip); |
\c |
\c |
\c /* restore global variables */ |
\c /* restore global variables */ |
\c gforth_RP = rp1; |
\c gforth_RP = rp1; |
Line 231 DOES> ( -- ) dup thislib ! proc: ;
|
Line 231 DOES> ( -- ) dup thislib ! proc: ;
|
here thisproc @ 2 cells + ! parse-name s, |
here thisproc @ 2 cells + ! parse-name s, |
thislib @ thisproc @ @proc ; |
thislib @ thisproc @ @proc ; |
|
|
|
: func@ >body cell+ @ ; |
|
: func' ' func@ ; |
|
: [func'] postpone ['] postpone func@ ; immediate restrict |
|
|
\ stuff for libffi |
\ stuff for libffi |
|
|
\ libffi uses a parameter array for the input |
\ libffi uses a parameter array for the input |
Line 270 Create argptr maxargs 0 [DO] argbuf [I]
|
Line 274 Create argptr maxargs 0 [DO] argbuf [I]
|
: sf>x ( -- r ) retbuf sf@ ; |
: sf>x ( -- r ) retbuf sf@ ; |
: df>x ( -- r ) retbuf df@ ; |
: df>x ( -- r ) retbuf df@ ; |
|
|
wordlist constant cifs |
table constant cifs |
|
|
Variable cifbuf $40 allot \ maximum: 64 parameters |
Variable cifbuf $40 allot \ maximum: 64 parameters |
: cifreset cifbuf cell+ cifbuf ! ; |
: cifreset cifbuf cell+ cifbuf ! ; |