C/C++ Programmer's Guide (G06.25+)

Mixed-Language Programming for TNS Programs
HP C/C++ Programmer’s Guide for NonStop Systems429301-008
7-7
Interfacing to TAL
6. Here are some more examples of interface declarations for calling TAL
procedures:
_tal _variable _cc_status SEGMENT_DEALLOCATE_ (short, short);
_tal _variable _cc_status READ (short, short *, short,
short *, long);
_tal _extensible _cc_status READX (short, char _far *,
short, short *, long);
_tal void c_name = "tal^name" (short *);
Interfacing to TAL
This subsection provides guidelines for writing programs composed of TAL and HP
TNS C modules for NonStop systems. This discussion assumes that you have a
working knowledge of TAL and C and are familiar with the contents of the following
manuals:
TAL Programmer’s Guide
TAL Reference Manual
For information on calling TAL routines from another language, see the manual for
TNS COBOL, FORTRAN, or D-series Pascal.
Using Identifiers
TAL and C identifiers differ as follows:
TAL and C have independent sets of reserved keywords.
TAL identifiers can include circumflexes (^), whereas C identifiers cannot.
The C compiler is case-sensitive; the TAL compiler is not case-sensitive.
To declare variable identifiers that satisfy both compilers:
Avoid using reserved keywords in either language as identifiers.
Specify TAL identifiers without circumflexes.
Specify C identifiers in uppercase.
You can declare TAL-only or C-only routine identifiers and satisfy both compilers by
using the public name option in:
Interface declarations in C
EXTERNAL procedure declarations in TAL
In Inspect sessions:
Use uppercase for TAL identifiers
Use the given case for C identifiers
In Binder sessions, use mode noupshift for lowercase C identifiers.