Your Browser is not longer supported

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

{{viewport.spaceProperty.prod}}

cstxit - define STXIT routine (BS2000)

&pagelevel(4)&pagelevel

Syntax

#include <stxit.h>

void cstxit(struct stxitp stxitpar);

Description

Description cstxit() defines an STXIT routine and can thus be used to assign a routine written by the user as an STXIT routine.

Detailed information on the programming of STXIT routines can be found in the section“Contingency and STXIT routines” and in the manual "Executive Macros" [10 (Related publications)].

The structure of stxit is defined in stxit.h as follows:

struct stxitp
{
  addr     bufadr;      /* Adresse der Mitteilung an das Programm (OPINT) */
  enum err_set retcode; /* Returncode */
  struct cont contp;    /* Adresse der STXIT-Routinen */
  struct nest nestp;    /* max. Schachtelungstiefe */
  struct stx  stxp;     /* Steuerung des cstxit-Aufrufs */
  struct diag diagp;    /* Diagnosesteuerung */
  struct type typep;    /* Parameterübergabe-Modus */
};
struct cont             /* Adresse der STXIT-Routine für */
{                       /* die jeweilige Ereignisklasse */
  int  (*prchk) ();
  int  (*timer) ();
  int  (*opint) ();
  int  (*error) ();
  int  (*runout) ();
  int  (*brkpt) ();
  int  (*abend) ();
  int  (*pterm) ();
  int  (*rtimer) ();
};
struct nest             /* max. Schachtelungstiefe für */
{                       /* die jeweilige Ereignisklasse */
  char prchk;
  char timer;
  char opint;
  char error;
  char runout;
  char brkpt;
  char abend;
  char pterm;
  char rtimer;
  char filler;
};
struct stx              /* Steuerung des cstxit-Aufrufs für */
{                       /* die jeweilige Ereignisklasse */
  stx_set prchk;
  stx_set timer;
  stx_set opint;
  stx_set error;
  stx_set runout;
  stx_set brkpt;
  stx_set abend;
  stx_set pterm;
  stx_set rtimer;
  stx_set filler;
};
struct diag             /* Diagnosesteuerung für die */
{                       /* jeweilige Ereignisklasse */
  diag_set prchk;
  diag_set timer;
  diag_set opint;
  diag_set error;
  diag_set runout;
  diag_set brkpt;
  diag_set abend;
  diag_set pterm;
  diag_set rtimer;
  diag_set filler;
};
struct type             /* Parameterübergabe-Modus für */
{                       /* jeweilige Ereignisklasse */
  type_set prchk;
  type_set timer;
  type_set opint;
  type_set error;
  type_set runout;
  type_set brkpt;
  type_set abend;
  type_set pterm;
  type_set rtimer;
  type_set filler;
};
#define stx_set      char
#define old_stx      0
#define new_stx      4
#define del_stx      8
#define diag_set     char
#define ful_diag     0
#define min_diag     4
#define no_diag      8
#define err_set      char
#define no_err       0
#define par_err      4
#define stx_err      8
#define mem_err      12
#define type_set     char
#define par_opt      0
#define par_std      4

Control of the cstxit call:

This information is used to control the execution of the cstxit call. It defines which actions are to be performed for the particular event class. .

old_stx

No change is required for the corresponding event class. A previously assigned STXIT routine is retained. The remaining data for that event class is not evaluated.

new_stx

A new STXIT routine is assigned for the corresponding event class. The remaining data for the event class is evaluated in this case. The address of the routine, in particular, must be present in the corresponding entry of contp.

del_stx

The STXIT routine that was assigned to this point is deleted for the corresponding event class. The remaining data for the event class is not evaluated.

Diagnostic control:

ful_diag

Diagnostic control parameters are accepted syntactically for compatibility reasons, but are no longer evaluated since the conversion to ILCS. The routine is activated without a preceding diagnostic message

min_diag

no_diag

Parameter transfer mode:

par_opt

The parameters are passed in registers 1-4.

par_std

The parameters are passed in a parameter list. This is the only value permitted in C.

Return code:

no_err

The STXIT routine was defined correctly.

par_err

The parameter structure stxitpar was incorrectly supplied.

stx_err

Error on activating the STXIT routine.

mem_err

Error in the memory space request (when activating the STXIT routine).

Notes

The parameter structure stxitpar must be supplied by the user.

To standardize initialization, a defined prototype (stxit_pr) is provided in the stxit.h header. This prototype can be copied into any user-defined structure of type stxitp, so that only the fields for the event classes for which the assignment of an STXIT routine is to be changed need to be set.

For event class INTR, the address (stxitpar.bufadr) at which the information for the program is to be provided must also be supplied. The STXIT contingency routine can then fetch the message from the given address and evaluate it.

See also

alarm(), cenaco(), raise(), signal(), sleep().