CRE Programmer's Guide

Common Run-Time Environment (CRE) Programmer’s Guide528146-004
2-1
2 CRE Services
This section describes the services and resources managed by the CRE. In this
section, CRE refers to both the TNS environment and native environments. Where
there are differences, TNS CRE and TNS/R native CRE or TNS/E CRE are used.
Your C, COBOL, and FORTRAN routines in the TNS environment, and your C, C++,
COBOL, and pTAL routines in the native environments access most CRE services
transparently to you through their run-time libraries. Each run-time library translates
requests expressed in the syntax of its language into calls to CRE library functions or
system procedures. When you use high-level language constructs to read or write a
standard file, or to call a math or string function, each run-time library calls CRE library
functions that perform the requested operation. Your routines specify the parameters of
each operation using the syntax of the routine’s language; you never need to know the
specifics of the CRE library functions.
Most of the topics described in this section are informational. You must read this
section only if you are writing TAL routines and you want to share access to services
and resources managed by the TNS CRE with routines written in other languages. If
you are writing routines to compile with the C, TNS COBOL, and FORTRAN compilers,
you do not need to know most of the details described in this section.
Use the following table to determine which subsections to read:
Read the Following
Subsection: In order to:
Comparing the CRE in the OSS
and Guardian Environments on
page 2-2
Understand the differences between CRE services in
the OSS and Guardian environments
Writing TAL Routines That Use
the TNS CRE on page 2-6
Write TAL routines that run in the TNS CRE
Writing pTAL Routines That Use
the Native CRE on page 2-8
Write pTAL language routines that run in the native CRE
Program Initialization
on page 2-9 Learn the steps that the CRE initialization function
follows to initialize your program
Program Termination
on
page 2-15
Learn the steps that the CRE termination function
follows to terminate your program
Sharing Standard Files
on
page 2-17
Share access to the standard files (standard input,
standard output, and standard log) among routines
written in different languages
Using $RECEIVE
on page 2-34 Share access to $RECEIVE among routines written in
different languages (now available for both TNS C/C++
and native C/C++)
Using a Spooler Collector
on
page 2-36
Access a spooler collector directly as a standard file
Memory Organization
on
page 2-37
Access the run-time heap from C and TAL routines that
run in the CRE