+ code for generating code for s48_define_exported_binding()
This commit is contained in:
parent
53b3096a1e
commit
a503da8dee
|
@ -17,6 +17,7 @@
|
|||
make-constant-from-c-name-integer
|
||||
|
||||
generate-c-declarations
|
||||
generate-c-define-exported-bindings-function
|
||||
generate-c-enter-values-function
|
||||
generate-c-gc-protect-globals-function
|
||||
|
||||
|
|
|
@ -55,6 +55,15 @@
|
|||
(constant-c-value-name c)))
|
||||
constant-list)))
|
||||
|
||||
(define (generate-c-define-exported-bindings constant-list)
|
||||
(string-join
|
||||
(map
|
||||
(lambda (c)
|
||||
(format "s48_define_exported_binding(\"~a\", ~a);~%"
|
||||
(constant-c-value-name c)
|
||||
(constant-c-value-name c)))
|
||||
constant-list)))
|
||||
|
||||
(define (generate-c-gc-protect-globals constant-list)
|
||||
(string-join
|
||||
(map
|
||||
|
@ -82,7 +91,7 @@
|
|||
(define (wrap-in-c-function fun-name body)
|
||||
(format
|
||||
(string-append
|
||||
"void ~a(void) {~%"
|
||||
"~%~%void ~a(void) {~%"
|
||||
"~a~%"
|
||||
"}~%~%")
|
||||
fun-name body))
|
||||
|
@ -91,6 +100,10 @@
|
|||
(wrap-in-c-function c-fun-name
|
||||
(generate-c-enter-values constant-list)))
|
||||
|
||||
(define (generate-c-define-exported-bindings-function c-fun-name constant-list)
|
||||
(wrap-in-c-function c-fun-name
|
||||
(generate-c-define-exported-bindings constant-list)))
|
||||
|
||||
(define (generate-c-gc-protect-globals-function c-fun-name constant-list)
|
||||
(wrap-in-c-function c-fun-name
|
||||
(generate-c-gc-protect-globals constant-list)))
|
||||
|
|
Loading…
Reference in New Issue