I would like to use sfunctions to create function calls to a external c functions. I don't want to build the actual legacy code when I try to build the model, but I would rather just create stub functions. What is the best way to accomplish this?
I have created stub.h./stub.c files with empty function calls (with the actual function call names), and then generated the sfunctions with the legacy code tool, but of course the autocoder includes stub.h. Rather than stub.h, I would rather include the actual .h file that is the true header file.
Thank you for and advice.
I think the right way to do what you want to achieve is to create a DLL for your external C-functions and load it dynamically from the S-function. Note that the interface to the functions still needs to be fully specified in the header file and if changed needs the S-function to be re-compiled. However, using a DLL allows you to compile/maintain your external C code independently from the S-function.