[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
make-c-struct and pointer->string
From: |
David Pirotte |
Subject: |
make-c-struct and pointer->string |
Date: |
Tue, 26 Mar 2019 10:14:47 -0300 |
Hello,
guile 2.2.4.1-cdb19
,use (system foreign)
;; this fails
scheme@(guile-user)> (make-c-struct (list '* '*) (list (string->pointer "hello
") (string->pointer "there!")))
$16 = #<pointer 0x55a3d54d54d0>
scheme@(guile-user)> (parse-c-struct $16 (list '* '*))
$17 = (#<pointer 0x55a3d5d12170> #<pointer 0x55a3d5d0a640>)
scheme@(guile-user)> (map pointer->string $17)
$18 = ("?g?գU" "`!?գU")
;; but this works
scheme@(guile-user)> (map pointer->string (parse-c-struct (make-c-struct (list
'* '*) (list (string->pointer "hello ") (string->pointer "there!"))) (list '*
'*)))
$19 = ("hello " "there!")
David
pgpGvUsYHNgtu.pgp
Description: OpenPGP digital signature
- make-c-struct and pointer->string,
David Pirotte <=
Re: make-c-struct and pointer->string, Mark H Weaver, 2019/03/30