| Contents | Index |
setReservedIdentifiers(hTable, ids)
Handle to a CRL table previously returned by hTable = RTW.TflTable.
Structure specifying reserved keywords to be registered in the CRL table. The structure must contain the following:
LibraryName element, a string that specifies a CRL name: 'ANSI', 'ISO','GNU', or a CRL name of your choice.
HeaderInfos element, a structure or cell array of structures containing
HeaderName element, a string that specifies the header file in which the identifiers are declared
ReservedIds element, a cell array of strings that specifies the names of the identifiers to be registered as reserved keywords
For example,
d{1}.LibraryName = 'ANSI';
d{1}.HeaderInfos{1}.HeaderName = 'math.h';
d{1}.HeaderInfos{1}.ReservedIds = {'y0', 'y1'};In a CRL table, each function implementation name defined by a table entry will be registered as a reserved identifier. You can register additional reserved identifiers for the table on a per-header-file basis. Providing additional reserved identifiers can help prevent duplicate symbols and other identifier-related compile and link issues.
The setReservedIdentifiers function allows you to register up to four reserved identifier structures in a CRL table. One set of reserved identifiers can be associated with an arbitrary CRL, while the other three (if present) must be associated with ANSI®[1] , ISO®[2] , or GNU®[3] libraries.
For information about generating a list of reserved identifiers for the CRL that you are using to generate code, see Simulink Coder Code Replacement Library Keywords in the Simulink Coder documentation.
In the following example, setReservedIdentifiers is used to register four reserved identifier structures, for 'ANSI', 'ISO','GNU', and 'My Custom CRL', respectively.
hLib = RTW.TflTable;
% Create and register CRL entries here
.
.
.
% Create and register reserved identifiers
d{1}.LibraryName = 'ANSI';
d{1}.HeaderInfos{1}.HeaderName = 'math.h';
d{1}.HeaderInfos{1}.ReservedIds = {'a', 'b'};
d{1}.HeaderInfos{2}.HeaderName = 'foo.h';
d{1}.HeaderInfos{2}.ReservedIds = {'c', 'd'};
d{2}.LibraryName = 'ISO';
d{2}.HeaderInfos{1}.HeaderName = 'math.h';
d{2}.HeaderInfos{1}.ReservedIds = {'a', 'b'};
d{2}.HeaderInfos{2}.HeaderName = 'foo.h';
d{2}.HeaderInfos{2}.ReservedIds = {'c', 'd'};
d{3}.LibraryName = 'GNU';
d{3}.HeaderInfos{1}.HeaderName = 'math.h';
d{3}.HeaderInfos{1}.ReservedIds = {'a', 'b'};
d{3}.HeaderInfos{2}.HeaderName = 'foo.h';
d{3}.HeaderInfos{2}.ReservedIds = {'c', 'd'};
d{4}.LibraryName = 'My Custom CRL';
d{4}.HeaderInfos{1}.HeaderName = 'my_math_lib.h';
d{4}.HeaderInfos{1}.ReservedIds = {'y1', 'u1'};
d{4}.HeaderInfos{2}.HeaderName = 'my_oper_lib.h';
d{4}.HeaderInfos{2}.ReservedIds = {'foo', 'bar'};
setReservedIdentifiers(hLib, d);[1] ANSI is a registered trademark of the American National Standards Institute, Inc.
[2] ISO is a registered trademark of the International Organization for Standardization.
[3] GNU is a registered trademark of the Free Software Foundation.

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 |