Map files

The map file is a text file.

The format of the map file is:
[server.database.]type_name lib_name entry_point [c++if_major.c++if_minor]
Each line in the map file consists of:
  1. The server type, optionally prefixed with the server and database name.
  2. The name of the shared library. It can be qualified with a specific path. Otherwise the library is located from the environment variable LD_LIBRARY_PATH on Solaris or PATH on Windows™.
  3. The entry point in that library for the factory routine for the object.
  4. Optionally, the version of the C++ library for which an object was built, given in the format major.minor.
Within the lines, entries must be separated by tabs or spaces. For example:
myserver1.mydatabase.Polygon3D /home/myhome/lib3d.so _makePoly3D
Polygon3D lib3d.so _makePoly3D

The library does not attempt to instantiate an object if the major version of the library is different or if the minor version of the C++ library that an object was created for is higher than the minor version of the installed C++ library. Value object authors can use the IT_VERSION macro (defined in itcppop.h) to determine the version of the library an object is being built for. The server and database name can be used to specify the type name.

In the preceding example, the Object Interface for C++ library instantiates an object for Polygon3D by using the library from /home/myhome if the connection is made to myserver.mydatabase; otherwise it uses the second library.

The map file can have any valid file name. On UNIX™, the default map file is $INFORMIXDIR/etc/c++map. On Windows, the default map file is %INFORMIXDIR%\etc\c++map. In addition, you can manually set the INFORMIXCPPMAP environment variable to the fully qualified path of the map file, including the name of the map file itself.

Type names that contain white space characters (or multibyte character strings) must appear in double quotation marks in the type map file. Double quotation marks inside the type names in the type map file must be duplicated.

The entry point is the C function that is called to create a type. Enter qualified type names before unqualified type names. The INFORMIXCPPMAP environment variable can have several map files separated by colons (:) on UNIX or semicolons (;) on Windows. The .so extension on Solaris and .dll on Windows are optional for the library name, and you can omit the file extension so that the same map file can be used in multiple environments.