mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-17 09:10:22 +02:00
move foreign function interface to its own module
* libguile/foreign.h: * libguile/init.c: Change so that init just registers an extension, later called by foreign.scm. * libguile/foreign.c (scm_init_foreign): Define constants for the various foreign types. * module/Makefile.am: * module/system/foreign.scm: New module, for the foreign function interface.
This commit is contained in:
parent
52fd9639fd
commit
ab4779ffcf
5 changed files with 64 additions and 3 deletions
|
@ -284,6 +284,7 @@ SYSTEM_SOURCES = \
|
|||
system/vm/program.scm \
|
||||
system/vm/trace.scm \
|
||||
system/vm/vm.scm \
|
||||
system/foreign.scm \
|
||||
system/xref.scm \
|
||||
system/repl/repl.scm \
|
||||
system/repl/common.scm \
|
||||
|
|
29
module/system/foreign.scm
Normal file
29
module/system/foreign.scm
Normal file
|
@ -0,0 +1,29 @@
|
|||
;;;; Copyright (C) 2010 Free Software Foundation, Inc.
|
||||
;;;;
|
||||
;;;; This library 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 2.1 of the License, or (at your option) any later version.
|
||||
;;;;
|
||||
;;;; This library 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 this library; if not, write to the Free Software
|
||||
;;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
;;;;
|
||||
|
||||
|
||||
(define-module (system foreign)
|
||||
#:export (void
|
||||
float double
|
||||
int8 uint8
|
||||
uint16 int16
|
||||
uint32 int32
|
||||
uint64 int64
|
||||
|
||||
foreign-ref foreign-set!))
|
||||
|
||||
(load-extension "libguile" "scm_init_foreign")
|
Loading…
Add table
Add a link
Reference in a new issue