2001-08-31 14:42:31 +00:00
|
|
|
|
#ifndef SCM_DYNL_H
|
|
|
|
|
|
#define SCM_DYNL_H
|
|
|
|
|
|
|
2018-06-20 19:17:06 +02:00
|
|
|
|
/* Copyright 1996,1998,2000-2001,2006,2008,2010,2018
|
2018-06-20 20:01:49 +02:00
|
|
|
|
Free Software Foundation, Inc.
|
|
|
|
|
|
|
|
|
|
|
|
This file is part of Guile.
|
|
|
|
|
|
|
|
|
|
|
|
Guile is free software: you can redistribute it and/or modify it
|
|
|
|
|
|
under the terms of the GNU Lesser General Public License as published
|
|
|
|
|
|
by the Free Software Foundation, either version 3 of the License, or
|
|
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
|
|
|
|
Guile is distributed in the hope that it will be useful, but WITHOUT
|
|
|
|
|
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
|
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
|
|
|
|
|
|
License for more details.
|
|
|
|
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Lesser General Public
|
|
|
|
|
|
License along with Guile. If not, see
|
|
|
|
|
|
<https://www.gnu.org/licenses/>. */
|
1996-12-08 16:52:38 +00:00
|
|
|
|
|
2001-08-31 14:42:31 +00:00
|
|
|
|
|
1996-12-08 16:52:38 +00:00
|
|
|
|
|
2018-06-20 16:33:05 +02:00
|
|
|
|
#include "libguile/scm.h"
|
1996-12-08 16:52:38 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2001-11-02 00:19:12 +00:00
|
|
|
|
SCM_API SCM scm_dynamic_link (SCM fname);
|
|
|
|
|
|
SCM_API SCM scm_dynamic_unlink (SCM dobj);
|
|
|
|
|
|
SCM_API SCM scm_dynamic_object_p (SCM obj);
|
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 17:44:43 +02:00
|
|
|
|
SCM_API SCM scm_dynamic_pointer (SCM name, SCM dobj);
|
2001-11-02 00:19:12 +00:00
|
|
|
|
SCM_API SCM scm_dynamic_func (SCM symb, SCM dobj);
|
|
|
|
|
|
SCM_API SCM scm_dynamic_call (SCM symb, SCM dobj);
|
1996-12-08 16:52:38 +00:00
|
|
|
|
|
2008-05-14 05:20:47 +02:00
|
|
|
|
SCM_INTERNAL void scm_init_dynamic_linking (void);
|
1996-12-08 16:52:38 +00:00
|
|
|
|
|
2001-08-31 14:42:31 +00:00
|
|
|
|
#endif /* SCM_DYNL_H */
|