You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
The external dll defines a struct:
typedefstruct {
// data ...
} data_t;
typedefstruct {
void (*initialize)(data_t*data);
constchar* (*get_version)(void);
// other calls ...
} api_t;
__declspec(dllexport) api_tget_api() {
staticapi_tapi= {0};
// initialize the function pointers in api_t structreturn&api;
}
Is there a way to:
call function pointers of the external struct with either the address (offset) or the name?
initialize the data_t struct and pass its pointer to the external function?
Describe the solution you'd like
I'm OK to go with the addresses, since their offsets to the struct head are fixed. But it's even better to convert from struct pointer to a native dictionary.
For initializing a C struct from within arturo, I'm not sure it is able to do so now (not seen in the doc). I'd like to use a dictionary too, or a memory block is also OK.
Thanks again for the great work!
The text was updated successfully, but these errors were encountered:
哪里哪里,谢谢你的鼓励!😉
(I'll continue in English because although I love Mandarin, (a) I'm not that advanced yet, (b) I want to answer... this year lol)
I'm afraid what you're asking about is something which I have no good answer to - yet!
Basically, our current call.external functionality could be considered the groundwork of what is to come, but I personally don't consider this neither sufficient nor complete by any means.
As I have written more than a couple of times, since we now have packages too, having access to external C libraries via Arturo would be a huuuge boost, so it will be one of my priorities, just after we finally manage to release the upcoming 0.9.84 version (not too long left; just ironing out some issues with the documentation mostly! :) ).
And then I'll do my best so that we have proper FFI.
Btw, you are absolutely welcome in our Discord server. It's a place where very interesting discussions take place usually and you can just ask away anything you want!
And again: Thanks a lot for your (very) kind words. That's what keeps me motivated! 🚀
Thanks for creating the awesome language!
Is your feature request related to a problem? Please describe.
The external dll defines a struct:
Is there a way to:
data_t
struct and pass its pointer to the external function?Describe the solution you'd like
I'm OK to go with the addresses, since their offsets to the struct head are fixed. But it's even better to convert from struct pointer to a native dictionary.
For initializing a C struct from within arturo, I'm not sure it is able to do so now (not seen in the doc). I'd like to use a dictionary too, or a memory block is also OK.
Thanks again for the great work!
The text was updated successfully, but these errors were encountered: