2009-01-09 02:53:39 -05:00
|
|
|
;;; Ikarus Scheme -- A compiler for R6RS Scheme.
|
|
|
|
;;; Copyright (C) 2008,2009 Abdulaziz Ghuloum
|
|
|
|
;;;
|
|
|
|
;;; This program is free software: you can redistribute it and/or modify
|
|
|
|
;;; it under the terms of the GNU General Public License version 3 as
|
|
|
|
;;; published by the Free Software Foundation.
|
|
|
|
;;;
|
|
|
|
;;; This program 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
|
|
|
|
;;; General Public License for more details.
|
|
|
|
;;;
|
|
|
|
;;; You should have received a copy of the GNU General Public License
|
|
|
|
;;; along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
2008-10-06 01:19:27 -04:00
|
|
|
|
|
|
|
(library (ikarus foreign)
|
2008-10-12 02:06:25 -04:00
|
|
|
(export
|
|
|
|
pointer-set-c-char!
|
|
|
|
pointer-set-c-short!
|
|
|
|
pointer-set-c-int!
|
|
|
|
pointer-set-c-long!
|
2008-12-05 02:09:50 -05:00
|
|
|
pointer-set-c-long-long!
|
2008-10-12 02:06:25 -04:00
|
|
|
pointer-set-c-pointer!
|
|
|
|
pointer-set-c-float!
|
|
|
|
pointer-set-c-double!
|
|
|
|
pointer-ref-c-signed-char
|
|
|
|
pointer-ref-c-signed-short
|
|
|
|
pointer-ref-c-signed-int
|
|
|
|
pointer-ref-c-signed-long
|
2008-11-21 05:56:51 -05:00
|
|
|
pointer-ref-c-signed-long-long
|
2008-10-12 02:06:25 -04:00
|
|
|
pointer-ref-c-unsigned-char
|
|
|
|
pointer-ref-c-unsigned-short
|
|
|
|
pointer-ref-c-unsigned-int
|
|
|
|
pointer-ref-c-unsigned-long
|
2008-11-21 05:56:51 -05:00
|
|
|
pointer-ref-c-unsigned-long-long
|
2008-10-12 02:06:25 -04:00
|
|
|
pointer-ref-c-pointer
|
|
|
|
pointer-ref-c-float
|
|
|
|
pointer-ref-c-double
|
2009-04-30 05:35:49 -04:00
|
|
|
malloc free memcpy
|
2008-10-06 01:19:27 -04:00
|
|
|
pointer->integer integer->pointer pointer? dlopen dlsym
|
|
|
|
dlclose dlerror
|
2008-11-21 06:00:28 -05:00
|
|
|
make-c-callout make-c-callback
|
2008-11-25 22:52:26 -05:00
|
|
|
pointer-size
|
|
|
|
errno)
|
2008-11-21 06:00:28 -05:00
|
|
|
|
2008-11-23 15:26:12 -05:00
|
|
|
(import (ikarus) (ikarus system $foreign))
|
2008-10-06 01:19:27 -04:00
|
|
|
|
2008-11-21 06:00:28 -05:00
|
|
|
(define (pointer-size)
|
|
|
|
(cond
|
|
|
|
[(<= (fixnum-width) 32) 4]
|
|
|
|
[else 8]))
|
|
|
|
)
|
2008-10-06 01:19:27 -04:00
|
|
|
|