Guardian Programmer's Guide

Table Of Contents
Fault-Tolerant Programming in C
Guardian Programmer’s Guide 421922-014
27 - 54
Program Declarations
#include <crtlnsh> nolist
/* Note: Include the pragmas "ansistreams," "runnamed,"
*/
/* and 'search "$system.system.crtlns"' in the compiler
*/
/* command line for native programs.
*/
#else
/* for TNS and accelerated programs only /*
#pragma ansistreams
#pragma wide /* Use wide-data (32-bit integer) model */
#pragma runnamed /* A process pair should be named. */
#pragma search "$system.system.cnonstop"
#include <nonstoph> nolist
#endif
#include <stringh> nolist
#include <stdioh> nolist
#include <cextdecs (FILE_GETRECEIVEINFO_,\
FILE_OPEN_,\
MONITORCPUS,\
PROCESS_GETINFO_,\
PROCESS_GETPAIRINFO_,\
PROCESS_SETINFO_,\
PROCESS_STOP_,\
PROCESSHANDLE_COMPARE_,\
PROCESSHANDLE_DECOMPOSE_,\
READUPDATEX,\
REPLYX,\
WRITEX)> nolist
#include (stdlibh) nolist
#pragma search "$system.system.cnonstop" for TNS and accelerated
programs, or search "$system.system.crtlns" in the compiler command line
for TNS/R native programs, causes the library containing the C functions for fault-
tolerant support to be bound into the program.
#pragma wide specifies the wide-data model (TNS and accelerated programs only).
nonstoph for TNS and accelerated programs, or crtlnsh for native programs,
provides declarations required by the C functions for active backup programming.
stringh and stdioh are standard header files. cextdecs includes declarations for
the following Guardian procedures required by the program:
FILE_GETRECEIVEINFO_, which is called by the backup process to get
information about messages it receives.
FILE_OPEN_, which is called by the primary process to open the backup process,
and by the backup process to open $RECEIVE.