registerCPromotableMacroEntry

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

Syntax

TflCFunctionEntry* registerCPromotableMacroEntry(hTable, priority,
                                   numInputs, functionName,
                                   inputType, implementationName,
                                   outputType, headerFile,
                                   genCallback, genFileName)

Arguments

hTable

Handle to a TFL 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 Specifying Build Information for Function Replacements in the Real-Time Workshop® Embedded Coder™ documentation.

genFileName

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

Returns

Handle to the created TFL promotable macro entry.

Description

The registerCPromotableMacroEntry function creates a TFL promotable macro entry based on specified parameters and registers the entry in the TFL 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 TFL promotable macro entry. This function can be used only if your TFL function entry meets the following conditions:

Example

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

hLib = RTW.TflTable;

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

See Also

registerCFunctionEntry

Alternative Method for Creating Function Entries in the Real-Time Workshop Embedded Coder documentation

Creating Function Replacement Tables in the Real-Time Workshop Embedded Coder documentation

Target Function Libraries in the Real-Time Workshop Embedded Coder documentation

  


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