Target Language Compiler    

Code Configuration Functions

LibAddToCommonIncludes(incFileName)

Adds items to a unique-ified list of #include/package spec items.

Should be called from block TLC methods to specify generation of #include statements in model_private.h. Specify the names of local files bare, e.g., "myinclude.h", but specify the names of files on the include path files inside angle brackets, e.g., "<sysinclude.h>". Each call to this function adds the specified file to the list only if it is not already there. <math.h> and "math.h" are considered different files for the purpose of uniqueness. The #include statements are placed inside model_private.h.

Example:

See function in matlabroot/rtw/c/tlc/lib/cachelib.tlc.

LibAddToModelSources(newFile)

This function serves two purposes:

For inlined S-functions, LibAddToModelSources is generally called from BlockTypeSetup. This function adds a file name to the list of sources needed to build this model. This functions returns 1 if the filename passed in was a duplicate (i.e. it was already in the sources list) and 0 if it was not a duplicate.

As an S-function author, we recommend using the SFunctionModules block parameter instead of this function. See Writing S-functions.

See function in matlabroot/rtw/c/tlc/lib/utillib.tlc.

LibCacheDefine(buffer)

Each call to this function appends your buffer to the existing cache buffer. For blocks, this function is generally called from BlockTypeSetup.

This functions caches #define statements for inclusion in model.h (or model_private.h). LibCacheDefine should be called from inside BlockTypeSetup to cache a #define statement. Each call to this function appends your buffer to the existing cache buffer. The #define statements are placed inside model.h (or model_private.h).

   Example.   

See function in matlabroot/rtw/c/tlc/lib/cachelib.tlc.

LibCacheExtern(buffer)

LibCacheExtern should be called from inside BlockTypeSetup to cache an extern statement. Each call to this function appends your buffer to the existing cache buffer. The extern statements are placed in model.h.

Example

See function in matlabroot/rtw/c/tlc/lib/cachelib.tlc.

LibCacheFunctionPrototype(buffer)

LibCacheFunctionPrototype should be called from inside BlockTypeSetup to cache a function prototype. Each call to this function appends your buffer to the existing cache buffer. The prototypes are placed inside model.h.

Example

See function in matlabroot/rtw/c/tlc/lib/cachelib.tlc.

LibCacheIncludes(buffer)

LibCacheIncludes should be called from inside BlockTypeSetup to cache #include statements. Each call to this function appends your buffer to the existing cache buffer. The #include statements are placed inside model.h.

Example

See function in matlabroot/rtw/c/tlc/lib/cachelib.tlc.

LibCacheTypedefs(buffer)

LibCacheTypedefs should be called from inside BlockTypeSetup to cache typedef declarations. Each call to this function appends your buffer to the existing cache buffer. The typedef statements are placed inside model.h (or model_common.h).

Example..   

See function in matlabroot/rtw/c/tlc/lib/cachelib.tlc.

LibRegisterGNUMathFcnPrototypes()

Example of registering target-specific math functions. This one registers GNU C math function mappings for a target with a GNU C compiler (e.g., gcc 2.9x.yy+ is compliant).

See function in matlabroot/rtw/c/tlc/lib/mathlib.tlc.

LibRegisterISOCMathFcnPrototypes()

Example of registering target-specific math functions. This function registers ISO C math function mappings for a target with an ISO C 9x compliant compiler (e.g., gcc 2.9x.yy+ is).

See function in matlabroot/rtw/c/tlc/lib/mathlib.tlc.

LibRegisterMathFcnPrototype(RTWName,
RTWType, IsExprOK, IsCplx, NumInputs,
FcnName, FcnType, HdrFile)

Set a specific name and input prototype of a given function for the current target. This overrides the default names. Data types are in string form.

See function in matlabroot/rtw/c/tlc/lib/mathlib.tlc.


  Block Path and Error Reporting Functions Sample Time Functions