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

cb_param to I/O callbacks #109

Open
vsariola opened this issue Aug 24, 2023 · 0 comments
Open

cb_param to I/O callbacks #109

vsariola opened this issue Aug 24, 2023 · 0 comments

Comments

@vsariola
Copy link

vsariola commented Aug 24, 2023

I'm trying to write LUA bindings of rocket and was not able to expose set_io_cb to the LUA-side for the following reasons:

  1. Why does save_track not use the device io callbacks the same way as the read_track_data? This looks like an oversight and the sync_io_cb should have method write too:

static int save_track(const struct sync_track *t, const char *path)

  1. I would need a way to pass userdata to the io callback (void *). I would need this for making a LUA-bindings of the rocket, as when I make the call back to LUA, I need a pointer to lua_State*, which gives access to the LUA virtual machine instance.

I think it could be even the same cb_param as is passed to the sync_update, but I'm not sure if it would be better to be a separate parameter:

sync_save_tracks(d);

The cb_param would have to be passed to any functions that do I/O.

@vsariola vsariola changed the title cb_param to io_callbacks cb_param to I/O callbacks Aug 24, 2023
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

1 participant