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

Add predicates to work with struct pointers #2120

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

aarroyoc
Copy link
Contributor

Some libraries like SDL require you to pass a struct that they fill. This was nearly impossible to do right now with our FFI interface, so three more predicates have been added.

SDL_Event event;
SDL_PollEvents(&event)

can be expressed as:

alloc_struct_ptr(sdl_event, Ptr),
ffi:'SDL_PollEvent'(Ptr, _),
unfold_struct_ptr(sdl_event, Ptr, [sdl_event, 512, ...]),
dealloc_struct_ptr(sdl_event, Ptr)

@mthom mthom force-pushed the master branch 4 times, most recently from 0666b56 to dff2e73 Compare October 15, 2023 23:43
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

Successfully merging this pull request may close these issues.

1 participant