United States |
|
|
||
New FunctionsThe Compaq C RTL includes the following new or modified functions for OpenVMS Version 7.3-1:
New and Changed Features - Compaq C Version 6.4The following C RTL enhancements were included in Compaq C Version 6.4 and OpenVMS Version 7.3:
The strptime function was made XPG5-compliantThe strptime function has been modified to be compliant with X/Open CAE Specification System Interfaces and Headers Issue 5 (commonly known as XPG5). The change for XPG5 is in how the strptime function processes the "%y" directive for a two-digit year within the century if no century is specified. When a century is not otherwise specified, XPG5 requires that values for the "%y" directive in the range 69-99 refer to years in the twentieth century (1969 to 1999 inclusive), while values in the range 00-68 refer to years in the twenty-first century (2000 to 2068 inclusive). Essentially, for the "%y" directive, strptime became a "pivoting" function, with 69 being a pivoting year. Before this change, the strptime function interpreted a two-digit year with no century as a year within twentieth century. With OpenVMS Version 7.3, XPG5-compliant strptime becomes a default strptime function in the Compaq C RTL. However, the previous non-pivoting XPG4-compliant strptime function is retained for compatibility. The pivoting is controlled by the DECC$XPG4_STRPTIME logical name. To use the non-pivoting version of strptime , either:
The limitation of eight nested directory levels was lifted (ALPHA ONLY)The Compaq C RTL I/O subsystem was enhanced to remove the restriction of eight nested directory levels for an ODS-5 device. This affects Compaq C RTL functions such as access , mkdir , opendir , rmdir , and stat . Improved Support for Extended File Specifications (ALPHA ONLY)The following sections describe improved Compaq C RTL support for extended file specifications. The Compaq C RTL supports case preservation in file names (ALPHA ONLY)Programs linked against the Compaq C Run-time library DECC$SHR can now preserve the case of file names on ODS level 5 disks. This applies when creating or reporting file names. By default, this feature is disabled. To enable this feature enter the following command:
If file names are all in upper case, use the following command to convert the names into lower case when reporting the name in UNIX style:
If file names are not all in upper case, the preceding command preserves case. The commands to disable the preceding logical-name settings are:
The setting for the DECC$EFS_CASE_SPECIAL logical name, if not set to DISABLE, supersedes any setting for the DECC$EFS_CASE_PRESERVE logical name. The DECC$EFS_CASE_PRESERVE and DECC$EFS_CASE_SPECIAL logicals are checked only once per image activation, not on a file-by-file basis. Most C RTL functions now accept long OpenVMS-style file names as arguments (ALPHA ONLY)For OpenVMS Alpha Version 7.2, some basic Compaq C RTL I/O functions ( creat , stat , and the functions from the open family of functions) were enhanced to accept long OpenVMS-style file names for an ODS-5 device. For OpenVMS Alpha Version 7.3, all other Compaq C RTL functions, except chdir and the functions from the exec family of functions, were also enhanced to accept long OpenVMS-style file names for an ODS-5 device. All C RTL functions that accept or report full file specifications will process file specifications up to 4095 bytes long, subject to the rules defined for the media format. For file specifications in OpenVMS format, there are no special restrictions. In situations where a full file specification cannot be reported because the buffer is too short, the function attempts to report the abbreviated name. UNIX file names have the following restrictions:
The Compaq C RTL supports exact-case argv arguments (ALPHA ONLY)Nonquoted command-line arguments passed to C and C++ programs (argv arguments) can now optionally have their case preserved, rather than being lowercased as in previous versions. By default, this feature is disabled. To enable this case preservation feature, define the logical name DECC$ARGV_PARSE_STYLE to "ENABLE" and set the process-level DCL parse style flag to "EXTENDED" in the process running the program:
Enabling this feature also ensures that the image name returned in argv[0] is also case-preserved. To disable this feature, use any one of the following commands:
or
or
The value of the DECC$ARGV_PARSE_STYLE logical is case-insensitive. The Compaq C RTL can implicitly open files for shared accessThe Compaq C RTL was enhanced to open all files for shared access as if the "shr=del,get,put,upd" option was specified in the open* or creat call. To enable this feature, define the logical name DECC$FILE_SHARING to "ENABLE". The value is case-insensitive. DECC$FILE_SHARING is checked only once per image activation, not on a file-by-file basis. Alternative way of translating UNIX file specsThe Compaq C RTL was enhanced to allow interpreting the leading part of a UNIX-style file spec as either a subdirectory name or a device name. As with previous releases, the default translation of foo/bar (UNIX-style name) is FOO:BAR (OpenVMS-style device name). To request translation of foo/bar (UNIX-style name) to [.FOO]BAR (OpenVMS-style subdirectory name), define the logical name DECC$DISABLE_TO_VMS_LOGNAME_TRANSLATION to any value. DECC$DISABLE_TO_VMS_LOGNAME_TRANSLATION is checked only once per image activation, not on a file-by-file basis. New FunctionsThe Compaq C RTL has added the following functions in OpenVMS Version 7.3:
Chapter 1
|
#include <stdlib.h> |
Each header file contains function prototypes for a set of related functions, and defines any types and macros needed for their use.
To list the header files on OpenVMS Alpha systems, use the following commands:
$ LIBRARY/LIST ALPHA$LIBRARY:SYS$STARLET_C.TLB (ALPHA ONLY) $ LIBRARY/LIST ALPHA$LIBRARY:DECC$RTLDEF.TLB (ALPHA ONLY) $ DIR SYS$COMMON:[DECC$LIB.REFERENCE.DECC$RTLDEF]*.H; (ALPHA ONLY) $ DIR ALPHA$LIBRARY:*.H; (ALPHA ONLY) |
The first command lists the text module form of the header files for the OpenVMS system interfaces. The second lists the text module form of the header files for the Compaq C language interface. The third lists *.h header files for the Compaq C language interfaces. The fourth lists *.h header files for layered products and other applications.
The SYS$COMMON:[DECC$LIB.REFERENCE.DECC$RTLDEF] directory is only a reference area for your viewing. The compiler still looks in the *.TLB files for #include file searches. |
To list the header files on OpenVMS VAX systems, use one of the following command:
$ DIR 'F$TRNLMN("DECC$LIBRARY_INCLUDE")'*.H; (VAX ONLY) $ DIR DECC$LIBRARY_INCLUDE:*.H; (VAX ONLY) |
On OpenVMS VAX systems, the following command might also find additional or duplicate header files:
$ DIR SYS$LIBRARY:*.H; (VAX ONLY) |
However, duplicate files (such as <stdio.h> ) found in SYS$LIBRARY probably support the VAX C Version 3.2 environment and should not be used with Compaq C.
Function definitions themselves are not included in the header files, but are contained in the Compaq C Run-Time Library (RTL) shipped with the OpenVMS operating system. Before using the Compaq C RTL, you must be familiar with the following topics:
A knowledge of all these topics is necessary to effectively use the Compaq C RTL. This chapter shows the connections between these topics and the Compaq C RTL. Read this chapter before any of the other chapters in this manual.
The primary purpose of the Compaq C RTL is to provide a means for C programs to perform I/O operations; the C language itself has no facilities for reading and writing information. In addition to I/O support, the Compaq C RTL also provides a means to perform many other tasks.
Chapters 2 through 11 describe the various tasks supported by the
Compaq C RTL. The Reference Section alphabetically lists and describes
all the functions and macros available to perform these tasks.
1.1 Using the Compaq C Run-Time Library
When working with the Compaq C RTL, you must be aware of some implementation specifics.
First, if you plan to use Compaq C RTL functions in your C programs, make sure that a function named main or a function that uses the main_program option exists in your program. For more information, see the Compaq C Language Reference Manual or the Compaq C User's Guide for OpenVMS Systems.
Second, the Compaq C RTL functions are executed at run time, but references to these functions are resolved at link time. When you link your program, the OpenVMS Linker resolves all references to Compaq C RTL functions by searching any shareable code libraries or object code libraries specified on the LINK command line.
You can use the Compaq C RTL as a shareable image or you can use the Compaq C RTL object libraries.
When you use the Compaq C RTL as a shareable image, the code for the RTL resides in an image file in SYS$SHARE and is shared by all Compaq C programs. After execution, control returns to your program. This process has a number of advantages:
When linking to the Compaq C RTL, you do not need to define any LNK$LIBRARY logicals. In fact, you should deassign LNK$LIBRARY because linking with the shareable image is more convenient than linking with the Compaq C RTL object libraries.
See your OpenVMS, Compaq C, or Compaq C++ release
notes for any supplemental information about linking with the
Compaq C RTL.
1.2 RTL Linking Options on Alpha Systems (ALPHA ONLY)
The following sections describe several ways of linking Compaq C
and Compaq C++ programs with the Compaq C RTL on OpenVMS
Alpha systems.
1.2.1 Linking with the Shareable Image
Most linking needs should be satisfied by using the Compaq C RTL shareable image DECC$SHR.EXE in the ALPHA$LIBRARY directory.
The shareable images VAXCRTL.EXE and VAXCRTLG.EXE do not exist on OpenVMS Alpha systems. The only C RTL shareable image is ALPHA$LIBRARY:DECC$SHR.EXE, which the linker automatically finds through IMAGELIB.OLB.
The fact that VAXCRTL*.EXE does not exist on Alpha systems has the following ramifications:
To link against the shareable image, use the LINK command. For example:
$ LINK PROG1 |
The linker automatically searches IMAGELIB.OLB to find DECC$SHR.EXE, and resolves all C RTL references.
In OpenVMS Alpha Version 7.0, the Compaq C Run-Time Library functions whose names are of the form decc$fmath_2, are defined in STARLET, but are not universal symbols in the DECC$SHR image. When these functions are referenced by an application, linking the image results in inclusion of the DECC$SHR image from IMAGELIB and the specific C math modules from STARLET. If neither the DPML$SHR image or the CMA$TIS_SHR image were already brought in during the IMAGELIB phase, the object form is included from STARLET because references to these symbols appear in the STARLET phase. In OpenVMS Version 7.0, this resulted in the undefined symbols: CMA$TIS_ERRNO_SET_VALUE In OpenVMS Alpha Version 7.1, the decc$fmath_2 symbols have been added to the DECC$SHR image so that both the DPML$SHR and CMA$TIS_SHR references are now resolved using shareable images found in IMAGELIB. |
The Compaq C RTL object libraries are used solely for linking programs compiled without /PREFIX=ALL.
On OpenVMS Alpha systems, the Compaq C RTL provides the following object libraries in the ALPHA$LIBRARY directory:
The object library VAXCCURSE.OLB, which provides access to the curses functions, contains unprefixed entry points that vector to the appropriate prefixed entry points.
The object libraries VAXCRTL.OLB, VAXCRTLD.OLB, VAXCRTLT.OLB, VAXCRTLX.OLB, VAXCRTLDX.OLB, and VAXCRTLTX.OLB also contain unprefixed entry points that vector to the appropriate prefixed entry points, depending on the floating-point type specified by the object library used:
/L_DOUBLE_SIZE=128 is the default.
On the LINK command, specify only one of the VAXCRTL*.OLB libraries and, if needed, the VAXCCURSE.OLB library.
In the default mode of the compiler (/STANDARD=RELAXED_ANSI89) and also in strict ANSI C mode, all calls to ANSI C standard library routines are automatically prefixed with DECC$. With the /[NO]PREFIX_LIBRARY_ENTRIES qualifier, you can change this to prefix all Compaq C RTL names with DECC$, or to not prefix any Compaq C RTL names. Other options are also available for this qualifer. See the /[NO]PREFIX_LIBRARY_ENTRIES qualifier in this chapter for more information.
When linking with /NOSYSSHR, if calls to the Compaq C RTL routines are prefixed with DECC$, then the modules in STARLET.OLB are the only ones you need to link against. Since STARLET.OLB is automatically searched by the linker (unless the link qualifier /NOSYSLIB is used), all prefixed RTL external names are automatically resolved.
If any calls to the Compaq C RTL routines are not prefixed, then you
need to explicitly link against VAXCRTL.OLB, VAXCRTLD.OLB, VAXCRTLT.OLB
(or VAXCRTLX.OLB, VAXCRTLDX.OLB, or VAXCRTLDX.OLB), or VAXCCURSE.OLB,
depending on which floating-point types you need, or if you want curses
functions. If you are linking with /NOSYSSHR, prefixed Compaq C RTL
entry points are resolved in STARLET.OLB. If you are linking with
/SYSSHR (the default), prefixed Compaq C RTL entry points are resolved
in DECC$SHR.EXE.
1.2.3 Examples
The following examples show several different ways you might want to link with the Compaq C RTL. See Figure 1-1 for a graphical summary of these examples.
$ CC/PREFIX_LIBRARY_ENTRIES=ALL_ENTRIES PROG1 $ LINK PROG1 |
$ CC/PREFIX_LIBRARY_ENTRIES=ALL_ENTRIES PROG1 $ LINK/NOSYSSHR PROG1 |
|
$ CC/NOPREFIX_LIBRARY_ENTRIES PROG1 $ LINK PROG1, MYLIB/LIBRARY, ALPHA$LIBRARY:VAXCRTLX.OLB/LIBRARY |
$ CC/NOPREFIX_LIBRARY_ENTRIES/FLOAT=IEEE_FLOAT PROG1 $ LINK PROG1, MYLIB/LIBRARY, ALPHA$LIBRARY:VAXCRTLTX.OLB/LIBRARY |
$ CC/NOPREFIX_LIBRARY_ENTRIES PROG1 $ LINK/NOSYSSHR PROG1, MYLIB/LIBRARY, ALPHA$LIBRARY:VAXCRTLX.OLB/LIBRARY |
Figure 1-1 Linking with the Compaq C RTL on OpenVMS Alpha Systems
Previous | Next | Contents | Index |
privacy statement and legal notices |