C/C++ Programmer's Guide (G06.27+, H06.08+, J06.03+)

Implementation-Defined Behavior. Note that the bool type became available at the D45
release, but it is available only with native C++ using the VERSION2 directive.
_cc_status
indicates that a procedure does not return a value but does set a condition code.
struct-or-union-specifier, enum-specifier, and typedef-name
are described in the ISO/ANSI C standard.
Usage Guidelines
If _cc_status is used as the return type for a function declaration, the language specifier,
if used, must be one of _c, _tal, or _unspecified.
The tal.h header contains six macros that interrogate the results of a function declared with
the _cc_status type specifier. These macros are:
For native C and C++:
#define _status_lt(x) ((x) < 0)
#define _status_le(x) ((x) <= 0)
#define _status_eq(x) ((x) == 0)
#define _status_ge(x) ((x) >= 0)
#define _status_gt(x) ((x) > 0)
#define _status_ne(x) ((x) != 0)
For TNS C and C++:
#define CCL 2
#define CCE 1
#define CCG 0
#define _status_lt(x) ((x) == CCL)
#define _status_le(x) ((x) != CCG)
#define _status_eq(x) ((x) == CCE)
#define _status_ge(x) ((x) != CCL)
#define _status_gt(x) ((x) == CCG)
#define _status_ne(x) ((x) != CCE)
The tal.h header for TNS C and C++ still supports the CCL, CCE, and CCG macros. These
macros have these meaning:
Condition-code register less than zeroCCL
Condition-code register equal to zeroCCE
Condition-code register greater than zeroCCG
For more details on using _cc_status, see Chapter 7: Mixed-Language Programming for
TNS Programs, or Chapter 8: Mixed-Language Programming for TNS/R and TNS/E Native
Programs.
Examples
This example shows the difference between using the new macros defined at the D40 release and
those used prior to the D40 release to examine _cc_status.
_tal _extensible _cc_status READX ( ... );
#include <tal.h>
...
_cc_status cc;
cc = READX ( ... );
/* Pre-D40 method */
if (cc == CCL) {
54 C and C++ Extensions