I have a C function that accepts a function pointer. This function may be called multiple times. The function pointer of each call will be recorded and may be used in the future.
How do I pass a java function as a function pointer to this C function? Or other available methods.
I am trying to write a C function to call a Java function and then pass this function as a function pointer. However, this is not working because I may need to pass in multiple Java functions, and it’s not feasible to write a separate C function for each one. I can’t disrupt the previously passed functions, such as by modifying global variables, because they might be called in the future.
It is difficult to change the existing C function.
1