Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

cenaco - define contingency routine (BS2000)

&pagelevel(4)&pagelevel

Syntax

#include <cont.h>

void cenaco(struct enacop *enacopar);

Description

cenaco() defines a contingency routine (TU or P1) and can thus be used to assign a

routine written by the user as a contingency routine. For more detailed information on contingency routines, refer to section “Contingency and STXIT routines” and the manual "Executive Macros" [10 (Related publications)].

The structure enacop is defined in cont.h as follows:

struct enacop
{
  char resrv1 [7];        /* reserved for int. use   */
  char coname [54];       /* name of cont. routine   */
  char resrv2 [15];       /* reserved for int. use   */
  char level;             /* priority of cont.rout.  */
  int  (*econt)();        /* start adr of cont.rout. */
  int  comess;            /* contingency message     */
  char coidret [4];       /* contingency identifier  */
  errcod secind;          /* secondary indicator     */
  char resrv3 [2];        /* reserved for int. use   */
  errcod rcode1;          /* return code             */
};
#define errcod     char
#define _norm      0      /* normterm                */
#define _abnorm    4      /* abnormend               */
#define _enabled   4      /* codefenabled            */
#define _preven    12     /* coprevenabled           */
#define _parerr    16     /* coparerror              */
#define _maxexc    24     /* comaxexceed             */

Some entries for the structure components can or must be supplied by the user before the call to cenaco(); others are used by cenaco() to store information during the run.

Entries supplied by the user:

coname

Name of the contingency process. The name can have a maximum length of
54 bytes (without the null byte), must be in uppercase, and must be end with
at least one blank (a null byte immediately after the actual name is not
recognized as an end criterion by the system). The strfill() function, for
example, is suitable for supplying coname This input is mandatory.

level

Priority level of the contingency process. This input is mandatory.
Values from 1 - 126 are legal.

econt

Start address of the contingency routine. This input is mandatory.

comess

Contingency message. This input is optional. The value is passed to the
contingency routine as a parameter.

Entries supplied by cenaco():

coidret

Short ID of the contingency process. This short ID must be used in further
macros (e.g. SOLSIG) for the identification of the contingency process.

secind

"Secondary Indicator", as stored in the most significant byte of register 15
(values 4 or 20) after execution of the ENACO macro.

rcode1

"Return Code", as stored in the least significant byte of register 15 (value 0
or 4) after execution of the ENACO macro.

Notes

See also

A maximum of 255 contingency routines can be defined.

cdisco(), cstxit(), signal(), alarm(), raise(), sleep().