I don't know what the "proper" way to do this is, but here's a quick-and-dirty way that I can think of:
%openfile tmpBuf
void interruptFunction()
{
/* do something here */
}
%closefile tmpBuf
%assign modelSrc = LibGetModelDotCFile()
%<LibSetSourceFileSection(modelSrc,"Functions",tmpBuf)>
You can also add a declaration to model.h if you like:
%openfile tmpBuf
void interruptFunction();
%closefile tmpBuf
%assign modelH = LibGetModelDotHFile()
%<LibSetSourceFileSection(modelH,"FcnPrototypes",tmpBuf)>
You should be able to use this in any part of your TLC file (since you are reaching into specific portions of the generated code), I don't think it should matter whether you call it from Start or Output or any other method.
I haven't tried this out, so please post back if you run into issues with this solution. Typically this type of thing can be done in the custom file processing template, but my guess is that you can do it from an S-function TLC as well.
