TAL Programmer's Guide
CRE Guidelines for TAL
Mixed-Language Programming
096254 Tandem Computers Incorporated 17–51
Example 17-2. D-Series CRE Sample Program (Page 2 of 2)
C Code
#pragma symbols, inspect
#include <stdioh> nolist
/*file name: csrc */
void C_ROUTINE () /* C routine called by TAL */
{
short result;
short stderror = 2;
short error = 0;
result = fopen_std_file(stderror, error);
if ((result == 0) || (result == 1))
fprintf(stderr, "Hello from C\n");
}
After you compile the TAL and C source files, you must bind the object files and the
TAL and C run-time libraries into a new object file. The resulting object file can then
run in the CRE, if the object file meets the requirements of the CRE.
For example, to bind object files named TALOBJ and COBJ and run-time library files
named TALLIB and CLARGE into a new object file named EXAMPLE, issue the
following Binder commands:
CLEAR
ADD * FROM talobj
ADD * FROM cobj
SELECT SEARCH $SYSTEM.SYSTEM.TALLIB
SELECT SEARCH $SYSTEM.SYSTEM.CLARGE
SELECT LIST * OFF
BUILD example!