unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* make-c-struct and pointer->string
@ 2019-03-26 13:14 David Pirotte
  2019-03-28 15:15 ` Amirouche Boubekki
  2019-03-30 20:26 ` Mark H Weaver
  0 siblings, 2 replies; 12+ messages in thread
From: David Pirotte @ 2019-03-26 13:14 UTC (permalink / raw)
  To: guile-devel

[-- Attachment #1: Type: text/plain, Size: 638 bytes --]

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

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2019-04-02 18:03 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-03-26 13:14 make-c-struct and pointer->string David Pirotte
2019-03-28 15:15 ` Amirouche Boubekki
2019-03-28 15:42   ` Neil Jerram
2019-03-29  8:48     ` David Pirotte
2019-03-29  9:46       ` David Pirotte
2019-03-29 19:08         ` Neil Jerram
2019-03-28 15:48   ` David Pirotte
2019-03-30 20:26 ` Mark H Weaver
2019-03-31 10:38   ` David Pirotte
2019-04-01  6:23     ` Mark H Weaver
2019-04-01  8:50     ` Mark H Weaver
2019-04-02 18:03       ` David Pirotte

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).