You might want to rename a program or procedure (function) for the following reasons:
You can use the #pragma map directive to map an internal identifier to an OS/400-compliant name (10 characters or less for program names and one or more characters for ILE procedure names) in your program.
The #pragma map directive can appear anywhere in the source file within a single compilation unit. It can appear before any declaration or definition of the named object, function or operator. The identifiers appearing in the directive, including any type names used in the prototype argument list, are resolved as though the directive had appeared at file scope, independent of its actual point of occurrence.
As an example, see Figure 197. In this code, there are two functions named func(). One is a regular function, prototyped int func(int) and the other is a class member function void func(void). To avoid confusion, they are renamed funcname1, and funcname2 using the #pragma map directive.
Figure 197. Example of Using the #pragma map Directive to Rename Functions
|
(C) Copyright IBM Corporation 1992, 2005. All Rights Reserved.