/* <ppl$def.h>
 *
 *	Definitions for RTL Parallel Processing Facility - PPL
 */
#ifndef _PPL$DEF_H
#define _PPL$DEF_H

/* pre-defined event ids */
#define PPL$K_ABNORMAL_EXIT	(-2)	/* abnormal participant termination */
#define PPL$K_NORMAL_EXIT	(-1)	/* normal participant termination */

/* shared memory options flags */
#define PPL$V_NOZERO	0
#define PPL$V_NOWRT	1
#define PPL$V_FLUSH	2
#define PPL$V_NOUNI	3
#define PPL$M_NOZERO	(1<<PPL$V_NOZERO)	/* 0x01 */
#define PPL$M_NOWRT	(1<<PPL$V_NOWRT)	/* 0x02 */
#define PPL$M_FLUSH	(1<<PPL$V_FLUSH)	/* 0x04 */
#define PPL$M_NOUNI	(1<<PPL$V_NOUNI)	/* 0x08 */

struct ppl$mem_options {
    unsigned ppl$v_nozero : 1;		/* not demand-zero */
    unsigned ppl$v_nowrt  : 1;		/* read-only */
    unsigned ppl$v_flush  : 1;		/* write to disk */
    unsigned ppl$v_nouni  : 1;		/* non-unique name not requested */
    unsigned		  : 28;
};

/* processing options flags */
#define PPL$V_INIT_SYNCH	0
#define PPL$V_NODEBUG		1
#define PPL$V_STOP_CHILDREN	2
#define PPL$V_NON_BLOCKING	3
#define PPL$V_NOTIFY_ONE	4
#define PPL$V_SPIN_WAIT		5
#define PPL$V_FORMONLY		6
#define PPL$V_JOINONLY		7
#define PPL$V_PERM		8
#define PPL$V_SYSTEM		9
#define PPL$V_DELETEALL		10
#define PPL$V_TAILFIRST		11
#define PPL$V_ATHEAD		12
#define PPL$V_FROMTAIL		13
#define PPL$V_FORCEDEL		14
#define PPL$V_NOCLISYM		15
#define PPL$V_NOLOGNAM		16
#define PPL$V_NOKEYPAD		17
#define PPL$V_NOTIFY		18
#define PPL$V_NOCONTROL		19
#define PPL$V_CALL_UNIQUE	20
#define PPL$V_PROC_UNIQUE	21
#define PPL$V_SPIN_COUNTED	22
#define PPL$V_NOSAVE_PROC_INFO	23
#define PPL$V_IGNORE_EXITS	24
#define PPL$M_INIT_SYNCH	(1<<PPL$V_INIT_SYNCH)		/* 0x01 */
#define PPL$M_NODEBUG		(1<<PPL$V_NODEBUG)		/* 0x02 */
#define PPL$M_STOP_CHILDREN	(1<<PPL$V_STOP_CHILDREN)	/* 0x04 */
#define PPL$M_NON_BLOCKING	(1<<PPL$V_NON_BLOCKING)		/* 0x08 */
#define PPL$M_NOTIFY_ONE	(1<<PPL$V_NOTIFY_ONE)		/* 0x10 */
#define PPL$M_SPIN_WAIT		(1<<PPL$V_SPIN_WAIT)		/* 0x20 */
#define PPL$M_FORMONLY		(1<<PPL$V_FORMONLY)		/* 0x40 */
#define PPL$M_JOINONLY		(1<<PPL$V_JOINONLY)		/* 0x80 */
#define PPL$M_PERM		(1<<PPL$V_PERM)			/* 0x0100 */
#define PPL$M_SYSTEM		(1<<PPL$V_SYSTEM)		/* 0x0200 */
#define PPL$M_DELETEALL		(1<<PPL$V_DELETEALL)		/* 0x0400 */
#define PPL$M_TAILFIRST		(1<<PPL$V_TAILFIRST)		/* 0x0800 */
#define PPL$M_ATHEAD		(1<<PPL$V_ATHEAD)		/* 0x1000 */
#define PPL$M_FROMTAIL		(1<<PPL$V_FROMTAIL)		/* 0x2000 */
#define PPL$M_FORCEDEL		(1<<PPL$V_FORCEDEL)		/* 0x4000 */
#define PPL$M_NOCLISYM		(1<<PPL$V_NOCLISYM)		/* 0x8000 */
#define PPL$M_NOLOGNAM		(1<<PPL$V_NOLOGNAM)		/* 0x010000 */
#define PPL$M_NOKEYPAD		(1<<PPL$V_NOKEYPAD)		/* 0x020000 */
#define PPL$M_NOTIFY		(1<<PPL$V_NOTIFY)		/* 0x040000 */
#define PPL$M_NOCONTROL		(1<<PPL$V_NOCONTROL)		/* 0x080000 */
#define PPL$M_CALL_UNIQUE	(1<<PPL$V_CALL_UNIQUE)		/* 0x100000 */
#define PPL$M_PROC_UNIQUE	(1<<PPL$V_PROC_UNIQUE)		/* 0x200000 */
#define PPL$M_SPIN_COUNTED	(1<<PPL$V_SPIN_COUNTED)		/* 0x400000 */
#define PPL$M_NOSAVE_PROC_INFO	(1<<PPL$V_NOSAVE_PROC_INFO)	/* 0x00800000 */
#define PPL$M_IGNORE_EXITS	(1<<PPL$V_IGNORE_EXITS)		/* 0x01000000 */

struct ppl$proc_options {
    unsigned ppl$v_init_synch	: 1;	/* parent blocks until children init */
    unsigned ppl$v_nodebug	: 1;	/* disable DEBUG */
    unsigned ppl$v_stop_children: 1;	/* stop children of terminating process */
    unsigned ppl$v_non_blocking : 1;	/* don't block if semaphore unavailable */
    unsigned ppl$v_notify_one	: 1;	/* notify only one enabler for event */
    unsigned ppl$v_spin_wait	: 1;	/* spin rather than $HIBER */
    unsigned ppl$v_formonly	: 1;	/* only form (do not join) a new appl. */
    unsigned ppl$v_joinonly	: 1;	/* only join (do not form) a new appl. */
    unsigned ppl$v_perm		: 1;	/* create a permanent application */
    unsigned ppl$v_system	: 1;	/* create a system-wide application */
    unsigned ppl$v_deleteall	: 1;	/* delete all corresponding work items */
    unsigned ppl$v_tailfirst	: 1;	/* delete from tail of queue */
    unsigned ppl$v_athead	: 1;	/* insert at the head of queue */
    unsigned ppl$v_fromtail	: 1;	/* remove from tail of queue */
    unsigned ppl$v_forcedel	: 1;	/* force deletion of work queue */
    unsigned ppl$v_noclisym	: 1;	/* do not inherit parent's CLI symbols */
    unsigned ppl$v_nolognam	: 1;	/* do not inherit parent's logicals */
    unsigned ppl$v_nokeypad	: 1;	/* inherit parent's keypad state & defs */
    unsigned ppl$v_notify	: 1;	/* broadcast message on child terminate */
    unsigned ppl$v_nocontrol	: 1;	/* no carriage control prefix on prompt */
    unsigned ppl$v_call_unique	: 1;	/* request call unique name */
    unsigned ppl$v_proc_unique	: 1;	/* request process unique name */
    unsigned ppl$v_spin_counted : 1;	/* spin for counted period before hiber */
    unsigned ppl$v_nosave_proc_info : 1;
    unsigned ppl$v_ignore_exits : 1;
    unsigned			: 7;
};

#endif	/*_PPL$DEF_H*/
