Preface

This manual describes the DEC C Run-Time Library (RTL). It provides reference information about the RTL functions and macros that perform input/output (I/O) operations, character and string manipulation, mathematical operations, error detection, subprocess creation, system access, and screen management.

It also notes portability concerns between operating systems, where applicable, and describes the DEC C for OpenVMS socket routines used for writing Internet application programs for the DEC TCP/IP Services for OpenVMS (formerly the VMS /ULTRIX Connection) product, or other implementations of the TCP/IP protocol.

The DEC C RTL contains XPG4-compliant internationalization support, providing functions to help you develop software that can run in different languages and cultures.

You can send comments or suggestions regarding this manual or any DEC C document by filling out one of the Reader's Comments forms at the back of this manual or by sending electronic mail to the following Internet address:

decc_docs@bookie.enet.dec.com

Intended Audience

This manual is intended for experienced and novice programmers who need reference information on the functions and macros found in the DEC C RTL.

Document Structure

This manual has the following chapters, reference section, and appendixes:

Associated Documents

The following documents may be useful when programming in DEC C for OpenVMS Systems:

Conventions Used in this Document

Convention  Meaning 
<Return>  The symbol <Return> represents a single stroke of the Return key on a terminal. 
Ctrl/X  The symbol Ctrl/X, where letter X represents a terminal control character, is generated by holding down the Ctrl key while pressing the key of the specified terminal character. 
switch statement int data type fprintf function <stdio.h> header file   Monospace type identifies language keywords and the names of DEC C functions and header files. Monospace type is also used when referring to a specific variable name used in an example. 
arg1  Italic type indicates a placeholder, such as an argument or parameter name, and the introduction of new terms. 
$ RUN CPROG <Return>  Interactive examples show user input in boldface type. 
float x; . . . x = 5;  A vertical ellipsis indicates that not all of the text of a program or program output is illustrated. Only relevant material is shown in the example. 
option, . . .   A horizontal ellipsis indicates that additional parameters, options, or values can be entered. A comma that precedes the ellipsis indicates that successive items must be separated by commas. 
[output- source, . . . ]  Square brackets, in function synopses and a few other contexts, indicate that a syntactic element is optional. Square brackets are not optional, however, when used to delimit a directory name in an OpenVMS file specification or when used to delimit the dimensions of a multidimensional array in DEC C source code. 
sc- specifier ::= auto static extern register  In syntax definitions, items appearing on separate lines are mutually exclusive alternatives. 
[a|b]  Brackets surrounding two or more items separated by a vertical bar (|) indicate a choice; you must choose one of the two syntactic elements. 
  A delta symbol is used in some contexts to indicate a single ASCII space character. 

Platform Labels

A platform is a combination of operating system and hardware that provides a distinct environment. This manual contains information applicable to the OpenVMS operating system on both the VAX and Alpha architectures.

The information in this manual applies to both of these platforms, except when specifically labeled, as follows:
Label  Explanation 
(Alpha only)  Specific to an Alpha processor (Alpha architecture) running the OpenVMS operating system. 
(VAX only)  Specific to a VAX processor running the OpenVMS operating system. 

Summary of New Features

DEC C Version 5.2 for OpenVMS Systems provides new and modified DEC C Run-Time Library functions in support of:

Also new with DEC C Version 5.2 for OpenVMS systems is a new model for implementing date/time support and the use of feature- test macros to control the visibility of symbols in header files according to standards, multiversion support, and compatibility.

This manual now has an appendix containing version-dependency tables that list the DEC C RTL functions supported on different OpenVMS versions. See Appendix B.

The following sections give an overview of these new features.

New Functions for UNIX Compatibility

OpenVMS V7.0 added over 80 new DEC C RTL functions to provide compatibility with UNIX systems and to satisy other requests of application developers. These functions have been implemented on both OpenVMS Alpha V7.0 and OpenVMS VAX V7.0, and are documented in this manual. They are:

basename         index          rewinddir      sigprocmask
bcmp             initstate      rindex         sigsetjmp
bcopy            ioctl          rmdir          sigsuspend
bzero            jrand48        seed48         srand48
closedir         lcong48        seekdir        srandom
confstr          lrand48        setenv         strcasecmp
dirname          memccpy        setitimer      strdup
drand48          mkstemp        tzset          strncasecmp
erand48          mmap           ualarm         strsep
ffs              mprotect       uname          swab
fpathconf        mrand48        setstate       sysconf
ftruncate        msync          sigaction      telldir
ftw              munmap         sigaddset      tempnam
getclock         nrand48        sigdelset      truncate
getdtablesize    opendir        sigemptyset    unlink
getitimer        pathconf       sigfillset     unsetenv
getlogin         pclose         sigismember    usleep
getpagesize      popen          siglongjmp     wait3
getpwnam         putenv         sigmask        wait4
getpwuid         random         sigpending     waitpid
gettimeofday     readdir

For a description of these functions, see the reference section.

New Functions in Support of ISO C Amendment

The following DEC C RTL functions are added for ISO C support (based on the document Programming Language-C, Amendment 1 C: Integrity).

btowc            mbsrtowcs      wcrtomb        wmemcpy
fwide            swprintf       wcsrtombs      wmemmove
fwprintf         swscanf        wcsstr         wmemset
fwscanf          towctrans      wctob          wprintf
mbrlen           vfwprintf      wctrans        wscanf
mbrtowc          vswprintf      wmemchr
mbsinit          vwprintf       wmemcmp

For a description of these functions, see the reference section.

New Functions for 64-Bit Pointers (Alpha only)

OpenVMS Alpha Version 7.0 added support for 64-bit pointers to be passed to the DEC C RTL functions. Some functions have dual implementations: one for 32-bit pointers and one for 64-bit pointers. The following 64-bit specific entry points have been added:

_basename64      _mbsrtowcs64   _strpbrk64     _wcsncat64
_bsearch64       _memccpy64     _strptime64    _wcsncpy64
_calloc64        _memchr64      _strrchr64     _wcspbrk64
_catgets64       _memcpy64      _strsep64      _wcsrchr64
_ctermid64       _memmove64     _strstr64      _wcsrtombs64
_cuserid64       _memset64      _strtod64      _wcsstr64
_dirname64       _mktemp64      _strtok64      _wcstok64
_fgetname64      _mmap64        _strtol64      _wcstol64
_fgets64         _qsort64       _strtoll64     _wcstoul64
_fgetws64        _realloc64     _strtoq64      _wcswcs64
_gcvt64          _rindex64      _strtoul64     _wmemchr64
_getcwd64        _strcat64      _strtoull64    _wmemcpy64
_getname64       _strchr64      _strtouq64     _wmemmove64
_gets64          _strcpy64      _tmpnam64      _wmemset64
_index64         _strdup64      _wcscat64
_longname64      _strncat64     _wcschr64
_malloc64        _strncpy64     _wcscpy64

For more information on DEC C RTL 64-bit pointer support, see Section 1.8.

New 4.4BSD Socket Routines

The following DEC C RTL functions are added for 4.4BSD socket support:

endhostent       gethostent     hstrerror      setprotoent
endnetent        getservent     sethostent     setservent
endprotoent      herror         setnetent      socket_fd
endservent       hostalias

For more information on these and other socket routines, see Appendix A.

New 4.4BSD Curses Functions (Alpha only)

OpenVMS Alpha Version 7.0 reintegrates the BSD Curses package with sources distributed with 4.4BSD. The following functions are added to the list of BSD curses functions. These functions are defined in the <curses.h> header file distributed with DEC C for OpenVMS Systems Version 5.2. The function names of the form _xxx64 are the 64-bit pointer versions of these functions.

baudrate         nl             resetty        touchline
cbreak           nocbreak       savetty        touchoverlap
echo             nodelay        tgetent        tputs
erasechar        noecho         tgetflag       waddnstr
fullname         nonl           tgetnum        wattroff
idlok            noraw          tgetstr        wattron
killchar         raw            tgoto          wattrset

For more information on BSD curses and curses in general, see Chapter 6.

Feature-Test Macros

The DEC C RTL now supports the following feature-test macros:

_XOPEN_SOURCE_EXTENDED     __VMS_VER             _BSD44_CURSES
_XOPEN_SOURCE              __DECC_VER            _VMS_CURSES
_POSIX_C_SOURCE            _DECC_V4_SOURCE        _SOCKADDR_LEN
_POSIX_EXIT                _VMS_V6_SOURCE
_ANSI_C_SOURCE

These feature-test macros provide a means for writing portable programs. They ensure that the symbolic names used by a program do not clash with the symbolic names supplied by the implementation.

When an application is defines a feature-test macro during compilation, the DEC C RTL header files supply the symbols and prototypes defined by that particular feature-test macro and nothing else. If a program does not define such macros, the DEC C RTL header files define symbols without restriction.

For more information on feature-test macros, see Section 1.5.

DEC C RTL DATE and Time Support

As of OpenVMS Version 7.0, the DEC C RTL is changing the model used to implement date/time support from one based on local time to one based on Universal Coordinated Time (UTC).

This allows the DEC C RTL to implement ANSI C/POSIX functionality that previously could not be implemented. A UTC time-based model also makes the DEC C RTL compatible with the behavior of the Digital UNIX and OpenVMS POSIX RTL time functions.

For more information on DEC C RTL date/time functions, see Chapter 11.

Other Enhancements

For additional DEC C RTL enhancements, see the release notes for DEC C Version 5.2, OpenVMS Alpha Version 7.0, and OpenVMS VAX Version 7.0. 1


Previous Page | Next Page | Table of Contents | Index