From 45be7ae8c61093d190d3356f41ea473d476c07ab Mon Sep 17 00:00:00 2001 From: retropikzel Date: Sat, 15 Mar 2025 06:46:19 +0200 Subject: [PATCH] Bring in the shared pointer->string and string->pointer implementation --- retropikzel/pffi/ypsilon.scm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/retropikzel/pffi/ypsilon.scm b/retropikzel/pffi/ypsilon.scm index c598969..0f28fd7 100644 --- a/retropikzel/pffi/ypsilon.scm +++ b/retropikzel/pffi/ypsilon.scm @@ -53,13 +53,13 @@ (and (pffi-pointer? pointer) (= (pffi-pointer-address pointer) 0)))) -(define pffi-pointer->string +#;(define pffi-pointer->string (lambda (pointer) (c-string-ref pointer))) -(define c-memset(c-function int memset (void* int int))) -(define c-snprintf (c-function int snprintf (void* size_t void*) (long double))) -(define pffi-string->pointer +;(define c-memset(c-function int memset (void* int int))) +;(define c-snprintf (c-function int snprintf (void* size_t void*) (long double))) +#;(define pffi-string->pointer (lambda (string-content) (let* ((c-string (make-c-string string-content)) (c-string-length (bytevector-length c-string))