+ 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
|
make-constant-from-c-name-integer
|
||||||
|
|
||||||
generate-c-declarations
|
generate-c-declarations
|
||||||
|
generate-c-define-exported-bindings-function
|
||||||
generate-c-enter-values-function
|
generate-c-enter-values-function
|
||||||
generate-c-gc-protect-globals-function
|
generate-c-gc-protect-globals-function
|
||||||
|
|
||||||
|
|
|
@ -54,6 +54,15 @@
|
||||||
(format "static s48_value ~a = S48_FALSE;~%"
|
(format "static s48_value ~a = S48_FALSE;~%"
|
||||||
(constant-c-value-name c)))
|
(constant-c-value-name c)))
|
||||||
constant-list)))
|
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)
|
(define (generate-c-gc-protect-globals constant-list)
|
||||||
(string-join
|
(string-join
|
||||||
|
@ -82,7 +91,7 @@
|
||||||
(define (wrap-in-c-function fun-name body)
|
(define (wrap-in-c-function fun-name body)
|
||||||
(format
|
(format
|
||||||
(string-append
|
(string-append
|
||||||
"void ~a(void) {~%"
|
"~%~%void ~a(void) {~%"
|
||||||
"~a~%"
|
"~a~%"
|
||||||
"}~%~%")
|
"}~%~%")
|
||||||
fun-name body))
|
fun-name body))
|
||||||
|
@ -91,6 +100,10 @@
|
||||||
(wrap-in-c-function c-fun-name
|
(wrap-in-c-function c-fun-name
|
||||||
(generate-c-enter-values constant-list)))
|
(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)
|
(define (generate-c-gc-protect-globals-function c-fun-name constant-list)
|
||||||
(wrap-in-c-function c-fun-name
|
(wrap-in-c-function c-fun-name
|
||||||
(generate-c-gc-protect-globals constant-list)))
|
(generate-c-gc-protect-globals constant-list)))
|
||||||
|
|
Loading…
Reference in New Issue