Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

Concept of a name adapter module in the C runtime system

&pagelevel(3)&pagelevel

One of the problems with regard to C library functions is the fact that these functions are addressed on the source program level with predefined names (e.g. printf, fopen), while BS2000 naming conventions require entry names beginning with the prefix “IC”. Furthermore, C library functions also need to be replaceable by user-defined functions, where entry names can be constructed from the function names without the prefix “IC”.

Up until CRTE Version 1.0B, this problem was solved with the aid of a table that enabled the compiler to recognize the function names and convert them accordingly. Consequently, changes in the C runtime system were always associated with changes in the compiler. For reasons of compatibility, this technique has been retained for the existing C library functions in the C runtime system (functions of the C90 standard and approx. 50 BS2000-specific extensions). For all POSIX functions that were added by name as of CRTE V2.0A and all functions to be added in future, the problem is now solved on a compiler-independent basis by means of name adapter modules. These adapter modules contain the entry names derived from the function name minus the prefix “IC” and call the actual “standard” function with the entry name IC....

The following adapter modules are available for each C library function:

  • An object module (OM) with the function name (possibly abbreviated to 8 characters) as an entry name in which lowercase letters have been converted to uppercase, and the underscore to a dollar character, e.g. FPATHKON for the function fpathkonv.

    This is only relevant when linking object modules generated with the earlier C/C++ compilers (until V2.2). As of C/C++ V3.0 and higher, only modules in LLM format are generated.

  • Up to four LLMs in which the unabbreviated function name is contained as the entry name, but once in lowercase or uppercase, and once with the underscore retained or converted (cf. the LOWER-CASE-NAMES and SPECIAL-CHARACTERS options in the MODIFY-MODULE-PROPERTIES statement).
    For example, two LLMs exist for the fpathkonv function containing the entry names FPATHKONV and fpathkonv, respectively.

Adapter modules belong to the non-preloadable components of the C runtime system and must consequently be linked into the application program. They are contained both in the SYSLNK.CRTE library and in the SYSLNK.CRTE.PARTIAL-BIND library.

If a user-defined function is to be called instead of the standard library function, the corresponding user module must be linked with precedence before the SYSLNK.CRTE or SYSLNK.CRTE.PARTIAL-BIND library. The user module can be either an object module or an LLM (with or without conversion of the lowercase letters and underscores).