User`s guide
File and Function Splitting
3-39
You must turn off the TLC variable ShowEliminatedStatements for file
splitting to work. This is required because the
#if ... #endif constructs that
surround eliminated statements do not cross file boundaries. Files will only be
split at function boundaries. If a source file contains a few long functions, file
splitting by itself may not be effective. In this case, you can choose to use both
function and file splitting. Function splitting will produce smaller functions;
file splitting can then split at the function boundaries to produce smaller files.
A Perl scripts performs file splitting by text-based post-processing of the
generated source code.
To illustrate how the source code splits, assume the model’s output section is
being generated when the file size threshold is exceeded:
Inside
model.c:
Inside
model1.c
The file model1.c includes model.h, but not model.prm.
Note that if
model1.c (or any of the other split files) already exists, it will be
overwritten without warning.
void MdlOutputs(int_T tid)
{
:
:
/* File size threshold exceeded. Splitting outputs into
source file model1.c */
{
extern void MdlOutputs_split1(int_T tid);
MdlOutputs_split1(tid);
}
}
/* EOF model.c */
void MdlOutputs_split1(int_T tid)
{
:
: continues where model.c left off
:
}
:
: