Synopsis
PDX_MSGT map_LoadMapFile(long option, char *map_file, MAP_TABLE *table)
Purpose
Load an external mapping file.
Description
The contents of the mapping file map_file will be read and the corresponding actions performed against table. The mapping file consists of free format statements which are delimited by semi-colons. Anything following a pound sign (#) on a line will be ignored. The mapping file may also include multi-line comments using the standard C comment delimiters. There is no required ordering of statements within a mapping file except that mapping lists must be defined before they are enabled. Multiple mapping files can be loaded into the same table by calling this function with the same table argument. In cases of parameter defaults being multiply defined, the last encountered value will be used.
Three types of actions may be performed in a mapping file:
Setting A Parameter Default
Parameter defaults are set using the syntax:
.nf <PARAMETER> = <PARAMETER_VALUE>; .fi
Where PARAMETER_VALUE is either a #define, integer, or double value for corresponding to the MAP_DEFINE, MAP_LONG, and MAP_DOUBLE parameter types. MAP_BOOLEAN values are specified as either "true"/"false" (without the quotes) or numeric 1/0.
Defining A Mapping List
New mapping lists may be defined using the syntax:
.nf <MAPPING_LIST_NAME> = <MAPPING_1>, <MAPPING_2>, ... <MAPPING_N>; .fi
Where the MAPPING_LIST_NAME and following mappings are enclosed in double quotes (the mappings names which define the mapping list may also be specified using single quotes).
Enabling A Mapping
A previously defined mapping or mapping list may be enabled using the syntax:
.nf <MAPPING_NAME>, <ADDITIONAL_ARGS>; .fi
Where MAPPING_NAME is enclosed in double quotes and ADDITIONAL_ARGS conforms to the syntax described in map_EnableMapping for the MAP_STRING_ARGS option.
If the MAP_CLEAR_DTF option is specified in option it will be passed to map_EnableMapping for each mapping enabled in map_file.
A Sample Mapping File
Portions of a sample mapping file are shown below:
.nf # Define Parameter Defaults
GMP_TOLER = .01; GMP_WARNINGS = true;
# Define Mapping Lists
"CAD arc -> CAD polyline" = "CAD arc -> gdx_arc", "gdx_arc -> gdx_polyline", "gdx_polyline -> CAD polyline";
# Enable Mappings
"CAD arc -> CAD polyline", MODEL, 'out_model', PARAM, GMP_TOLER, .001, COMMIT;
# End of mapping file .fi
Input
option
MAP_CLEAR_DTF
Clears all mappings already enabled for the DTF associated with name
map_file
Name of mapping file to load into table
table
Mapping table to load @map_file into
Return
MAP error code