Skip to Main Content Skip to Search
Product Documentation

registerCPromotableMacroEntry - Create CRL promotable macro entry based on specified parameters and register in CRL table (for abs function replacement only)

Syntax

entry = registerCPromotableMacroEntry(hTable, priority, numInputs, functionName, inputType, implementationName, outputType, headerFile, genCallback, genFileName)

Input Arguments

hTable

Handle to a CRL table previously returned by hTable = RTW.TflTable.

priority

Positive integer specifying the function entry's search priority, 0-100, relative to other entries of the same function name and conceptual argument list within this table. Highest priority is 0, and lowest priority is 100. If the table provides two implementations for a function, the implementation with the higher priority will shadow the one with the lower priority.

numInputs

Positive integer specifying the number of input arguments.

functionName

String specifying the name of the function to be replaced. Specify 'abs'. (This function should be used only for abs function replacement.)

inputType

String specifying the data type of the input arguments, for example, 'double'. (This function requires that all input arguments are of the same type.)

implementationName

String specifying the name of your implementation. For example, assuming functionName is 'abs', implementationName can be 'abs' or a different name of your choosing.

outputType

String specifying the data type of the return argument, for example, 'double'.

headerFile

String specifying the header file in which the implementation function is declared, for example, '<math.h>'.

genCallback

String specifying '' or 'RTW.copyFileToBuildDir'. If you specify 'RTW.copyFileToBuildDir', and if this function entry is matched and used, the function RTW.copyFileToBuildDir will be called after code generation to copy additional header, source, or object files that you have specified for this function entry to the build directory. For more information, see Specify Build Information for Code Replacements in the Embedded Coder documentation.

genFileName

String specifying ''. (This argument is for use only by MathWorks developers.)

Output Arguments

Handle to the created CRL promotable macro entry. Specifying the return argument in the registerCPromotableMacroEntry function call is optional.

Description

The registerCPromotableMacroEntry function creates a CRL promotable macro entry based on specified parameters and registers the entry in the CRL table. A promotable macro entry will promote the output data type based on the target word size.

This function provides a quick way to create and register a CRL promotable macro entry. This function can be used only if your CRL function entry meets the following conditions:

Examples

In the following example, the registerCPromotableMacroEntry function is used to create a function entry for abs in a CRL table.

hLib = RTW.TflTable;

hLib.registerCPromotableMacroEntry(100, 1, 'abs', 'double', 'abs_prime', ...
                                   'double', '<math_prime.h>', '', '');

See Also

registerCFunctionEntry

How To

  


Related Products & Applications

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.

 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS