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

[feature request] function declaration #59

Open
Mis012 opened this issue Oct 7, 2023 · 1 comment
Open

[feature request] function declaration #59

Mis012 opened this issue Oct 7, 2023 · 1 comment

Comments

@Mis012
Copy link

Mis012 commented Oct 7, 2023

dlcall -n window -r pointer gtk_application_window_new $app requires specifying the return type.
Is there anything preventing the implementation of a declare_function builtin, such that
declare_function gtk_application_window_new pointer pointer would inform ctypes.sh
about the return type (and the types of the parameters for where this changes the ABI),
and such that a later dlcall with no type specified for a function with that name would
use this information?

additionally, this would make it possible to ship the equivalent of header files for libc,
so that calling functions from the standard library never requires specifying the type.

@taviso
Copy link
Owner

taviso commented Oct 7, 2023

Hmm, I see your point, but I wonder if we can just do it in pure bash.. e.g.

function gtk_application_window_new()
{
    dlcall -r pointer gtk_application_window_new $1
}

Although I guess that means you can't pass other options to dlcall... hmm, maybe we do need a helper.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants