Skip to content
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

suggestion: ability to read C string for FFI #12752

Closed
DjDeveloperr opened this issue Nov 13, 2021 · 1 comment
Closed

suggestion: ability to read C string for FFI #12752

DjDeveloperr opened this issue Nov 13, 2021 · 1 comment
Labels
FFI Related to Foreign Function Interface APIs suggestion suggestions for new features (yet to be agreed)

Comments

@DjDeveloperr
Copy link
Contributor

Suggestion

A readCString or similar function in maybe Deno.DynamicLibrary that accepts a pointer (as BigInt) and returns the C String.

Why?

When working with FFI, it's pretty common to use C strings. But in case of Deno FFI it's not possible to do that without a helper function. Right now I'm interacting with a native library directly using Deno FFI (without wrapping it) and I have to make such helper function by making another native library.

Why function and not a string return type?

Only being able to read C strings returned from some function is limiting in my case. In the dylib I'm using, some functions write a C String pointer to a char** instead.

@bartlomieju bartlomieju added FFI Related to Foreign Function Interface APIs suggestion suggestions for new features (yet to be agreed) labels Nov 30, 2021
@DjDeveloperr
Copy link
Contributor Author

Implemented by #12828

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FFI Related to Foreign Function Interface APIs suggestion suggestions for new features (yet to be agreed)
Projects
None yet
Development

No branches or pull requests

2 participants