-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
memsync with pointers to pointers [R-style strings with STRSXP & CHARSXP] #42
Comments
Looking at your example, it appears that you're passing a pointer to an array of pointers to null-terminated strings, right? Or is there length information somewhere given as an integer for every individual string in the array? The short answer is that I have not implemented it yet. However, it should be reasonably easy to add. I'll see what I can do. In the meantime, you still need some information on the length of the array of pointers - i.e. how many strings are contained in your array? Somewhere in the |
Yes, eventually there's a null-terminated string, but there's only one of them. It's a strange interface, but I think it's because the library is designed to interface with R using R's C interface functions which specify that strings get passed as |
Ok, this makes (some) sense. I'll look into it and try to come up with a working example (calling into the project's demo DLL file based on your use case). |
I started a new branch and added a test case based on your example. As expected, it passes with Additional documentation:
CHARSXPs are null-terminated. STRSXPs should be null-terminated as well, though I can not find any explicit information about it. As an intermediate step, I can assume that STRSXPs have a fixed length of 1 - which should be sufficient for your use case. Based on that, I can figure out how to support a null-terminated array of pointers. |
I'm trying to wrap a windows dll file designed to be used with R, where any strings are being passed to the dll as
char**
, i.e. a pointer to a pointer tochar
s. I can make things work ok on windows/wine-python, but can't get memsync to synchronise the right memory when I use zugbruecke.Minimal example:
C code:
Python:
Is this something that is currently possible?
The text was updated successfully, but these errors were encountered: