> > > > I have a c-pointer to a C buf and buf length. Buffer sizes may be large > so I > > cant use the stack. I pass a c-pointer and int length from C to the > > callback. > > If the string is zero-terminated, you can use > > (##sys#peek-c-string POINTER 0) > > If it isn't or may contain zeros, then try this: > > (use lolevel) > > (define (extract-string ptr len) > (let ((buf (make-string len))) > (move-memory! ptr buf len) > buf)) > > >
Thanks move-memory! was what I needed. “The *young man* knows the rules but the *old man* knows the exceptions”. *Oliver Wendell Holmes*
_______________________________________________ Chicken-users mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/chicken-users
