/* <chfdef.h>
 *
 *	Condition Handling Facility argument list offsets.
 */
#ifndef _CHFDEF_H
#define _CHFDEF_H
/*
   There are three conditional handling structures: the primary argument
   list, and the signal and mechanism arrays.  All are identified by the
   same block prefix.
 +
   Note:  these structures from Starlet don't match VAX C's <chfdef.h>
	at all.  Those are customized and probably much more useful,
	so duplicated below.
 */

#ifdef _OLD_CHKDEF
struct chfdef {
    unsigned	: 32;			/*primary argument count */
    union {
	unsigned long chf$ha_sigarglst; /*address of signal arguments */
	unsigned long chf$l_sigarglst;	/*address of signal arguments */
    } chf$r_sig_desc;
    union {
	unsigned long chf$ha_mcharglst; /*address of mechanism arguments */
	unsigned long chf$l_mcharglst;	/*address of mechanism arguments */
    } chf$r_mch_desc;
};
struct chfdef1 {
    unsigned long chf$l_sig_args;	/*number of signal arguments */
    unsigned long chf$l_sig_name;	/*signal name */
    unsigned long chf$l_sig_arg1;	/*first signal specific argument */
};
#else	/* from V5.5's Starlet */
struct chfdef {
    unsigned	: 32;			/*primary argument count */
    unsigned long chf$l_sigarglst;	/*address of signal arguments */
    unsigned long chf$l_mcharglst;	/*address of mechanism arguments */
};
struct chfdef1 {
    union {
	long chf$is_sig_args;		/*number of signal arguments */
	unsigned long chf$l_sig_args;	/*number of signal arguments */
    } chf$r_sig_args_desc;
    union {
	unsigned long chf$is_sig_name;	/*signal name */
	unsigned long chf$l_sig_name;	/*signal name */
    } chf$r_sig_name_desc;
    union {
	long chf$is_sig_arg1;		/*first signal specific argument */
	unsigned long chf$l_sig_arg1;	/*first signal specific argument */
    } chf$r_sig_arg1_desc;
};
#endif	/*_OLD_CHFDEF*/
struct chfdef2 {
    union {
	unsigned long chf$hi_mch_args;	/*number of mechanism arguments */
	unsigned long chf$l_mch_args;	/*number of mechanism arguments */
    } chf$r_mch_args_desc;
    union {
	unsigned long chf$ha_mch_frame; /*establisher frame address */
	unsigned long chf$l_mch_frame;	/*establisher frame address */
    } chf$r_mch_frame_desc;
    union {
	unsigned long chf$hi_mch_depth; /*frame depth of establisher */
	unsigned long chf$l_mch_depth;	/*frame depth of establisher */
    } chf$r_mch_depth_desc;
    union {
	unsigned long chf$hi_mch_savr0; /*saved register r0 */
	unsigned long chf$l_mch_savr0;	/*saved register r0 */
    } chf$r_mch_savr0_desc;
    union {
	unsigned long chf$hi_mch_savr1; /*saved register r1 */
	unsigned long chf$l_mch_savr1;	/*saved register r1 */
    } chf$r_mch_savr1_desc;
};



/*
 *
	These are copied from VAX C's (V3.2), for compatability.
 *
 */
#ifndef __CHFDEF_LOADED
#define __CHFDEF_LOADED 1

#include <vms/sfdef.h>	/* stack frame definitions */

struct chf$signal_array {
    long chf$l_sig_args;	/* number of signal array arguments (variable) */
    long chf$l_sig_name;	/* name of condition */
    long chf$l_sig_arg1;	/* first signal specific argument */
 /* note:  Following chf$l_sig_arg1[n] are two longwords containing  */
 /* the values (at the time of the exception) of the program counter */
 /* and processor status longword, respectively.		     */
};

struct chf$mech_array {
    long chf$l_mch_args;	/* number of mechanism array arguments (always 4) */
    struct sf$frame *chf$l_mch_frame;	/* establisher frame address */
    long chf$l_mch_depth;	/* frame depth of establisher */
    long chf$l_mch_savr0;	/* saved register 0 (at time of condition) */
    long chf$l_mch_savr1;	/* saved register 1 (at time of condition) */
};

struct chf$arglist {
    struct chf$signal_array *chf$l_sigarglst;	/* pointer to signal array */
    struct chf$mech_array   *chf$l_mcharglst;	/* pointer to mechanism array */
};

#endif	/*__CHFDEF_LOADED*/

#endif	/*_CHFDEF_H*/