1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-28 07:50:20 +02:00
guile/module
Ludovic Courtès d4149a510e Simplify the (system foreign) API.
Suggested by Neil Jerram.

* libguile/foreign.h (SCM_FOREIGN_TYPE, SCM_FOREIGN_VALUE_REF,
  SCM_FOREIGN_VALUE_SET, SCM_FOREIGN_LEN, SCM_FOREIGN_TYPED_P,
  SCM_FOREIGN_VALUE_P, SCM_VALIDATE_FOREIGN_VALUE, scm_foreign_set_x,
  scm_foreign_type): Remove.
  (scm_foreign_ref): Rename to...
  (scm_foreign_address): ... this.
  (scm_take_foreign_pointer): Update.
  (SCM_FOREIGN_POINTER): Remove CTYPE argument.  Update callers.
  (scm_make_pointer): New declaration.

* libguile/foreign.c (scm_to_uintptr, scm_from_uintptr): New macros.
  (scm_make_pointer): New function.
  (scm_take_foreign_pointer): Remove TYPE and LEN arguments.  Update
  callers.
  (scm_foreign_ref): Remove to...
  (scm_foreign_address): ... this.  Remove type-related code.
  (scm_foreign_set_x): Remove.
  (scm_foreign_to_bytevector): Change argument order; make LEN argument
  compulsory.
  (scm_i_foreign_print): Remove type printing.
  (unpack): Remove foreign-type checking.

* libguile/deprecated.c (scm_dynamic_args_call): Update accordingly.

* libguile/dynl.c (scm_dynamic_pointer): Remove the TYPE and LEN
  arguments; update callers.  Update to the new foreign API.

* libguile/dynl.h (scm_dynamic_pointer): Update.

* libguile/gsubr.c (create_gsubr): Update to the new foreign API.

* libguile/gsubr.h (SCM_SUBRF, SCM_SUBR_GENERIC): Ditto.

* libguile/snarf.h (SCM_IMMUTABLE_FOREIGN): Ditto.

* libguile/vm-i-system.c (subr_call): Ditto.

* module/system/foreign.scm (null-pointer?): New procedure.

* test-suite/standalone/test-ffi: Update to the new
  `bytevector->foreign' signature.

* test-suite/tests/foreign.test ("null pointer")["null pointer
  identity", "null-pointer? %null-pointer"]: New tests.
  ["foreign-set! other-null-pointer", "foreign->bytevector
  other-null-pointer"]: Remove.
  ("make-pointer", "foreign<->bytevector"): New test prefixes.
2010-07-26 19:38:52 +02:00
..
ice-9 Check for go/scm mtime ordering rather than equality. 2010-07-26 19:38:52 +02:00
language Remove trailing whitespace 2010-07-09 21:22:27 -05:00
oop Update #:procedure method for <applicable-struct> 2010-06-29 11:43:04 +02:00
rnrs Fix argument passing for external hash functions in `(rnrs hashtables)'. 2010-07-14 01:16:19 -04:00
scripts [maint] Remove unused script guile-doc-snarf. 2010-07-22 21:10:38 +02:00
srfi Start rewriting SRFI-1 in Scheme. 2010-07-21 01:07:56 +02:00
sxml sxml-match: Always use the same prompt tag. 2010-07-15 23:12:57 +02:00
system Simplify the (system foreign) API. 2010-07-26 19:38:52 +02:00
texinfo scm_i_program_properties is internal; just use procedure-properties 2010-04-17 15:21:08 +02:00
Makefile.am remove (system vm debug) 2010-07-16 17:35:43 +02:00
rnrs.scm fix rnrs duplicate bindings warnings 2010-06-21 00:07:46 +02:00
statprof.scm statprof bugfixes 2010-01-27 21:52:05 +01:00
texinfo.scm Remove unused top-level variables. 2010-01-11 01:21:14 +01:00