brailcom/speechd

Adding user data context parameter to callbacks

Opened this issue · 1 comments

Is your feature request related to a problem? Please describe.

When a callback is called, it is generally useful to have the context of the callback (e.g. OO container etc.)

Describe the solution you'd like

The callbacks should have an additional pointer parameter that can be decided at callback registration.

Describe alternatives you've considered

Using client_id is possible, but not very convenient.

I was in the progress of writing a Kotlin MultiPlatform library for both Java & Kotlin Native, but without the userdata field, I am unable to continue my work.

I could use client_id, but I fear for memory leaks and other issues that I do not want to introduce to my work.