/* <jpidef.h>
 *
 *	Get Job Process Information Data Identifier Definitions
 */
#ifndef _JPIDEF_H
#define _JPIDEF_H

/* define table numbers */
#define JPI$C_ADRTYPE	1	/* item is address of data */
#define JPI$C_CTLTYPE	2	/* item is in control region */
#define JPI$C_PCBTYPE	3	/* item in PCB */
#define JPI$C_PHDTYPE	4	/* item in PHD */
#define JPI$C_PCBFLDTYPE 5	/* item is bit field */
#define JPI$C_PHDFLDTYPE 6	/* item is bit field */
#define JPI$C_JIBTYPE	7	/* item in JIB (subtype) */
#define JPI$C_ARBTYPE	8	/* item in ARB (subtype) */
#define JPI$C_MAXSTRUC	6	/* total of 6 tables */
#define JPI$C_LISTEND	0	/* define itmlst terminator */
#define JPI$_CHAIN			(-1)	/* chain indicator */
#define JPI$_GETJPI_CONTROL_FLAGS	(-2)	/* special control items */

#define JPI$V_NO_TARGET_INSWAP		0
#define JPI$V_NO_TARGET_AST		1
#define JPI$V_IGNORE_TARGET_STATUS	2
#define JPI$M_NO_TARGET_INSWAP		(1<<JPI$V_NO_TARGET_INSWAP)	/* 0x01 */
#define JPI$M_NO_TARGET_AST		(1<<JPI$V_NO_TARGET_AST)	/* 0x02 */
#define JPI$M_IGNORE_TARGET_STATUS	(1<<JPI$V_IGNORE_TARGET_STATUS) /* 0x04 */
struct jpictldef {
    union {
	unsigned long jpi$l_jpictlflgs; /* Control item flags */
	struct {
	    unsigned jpi$v_no_target_inswap	: 1; /* do not inswap the target process, (do deliver ASTs if it is resident) */
	    unsigned jpi$v_no_target_ast	: 1; /* do not send AST to target */
	    unsigned jpi$v_ignore_target_status : 1; /* don't check target state */
	    unsigned				: 5;
	} jpi$r_jpictlflgs_bits;
    } jpi$r_jpictlflgs_overlay;
};
/* NOTE: the following constants must match values in $JIBDEF! */
#define JPI$K_OTHER	0	/* JPI$_Mode values */
#define JPI$K_NETWORK	1	/* JPI$_Mode values */
#define JPI$K_BATCH	2	/* JPI$_Mode values */
#define JPI$K_INTERACTIVE 3	/* JPI$_Mode values */
#define JPI$K_DETACHED	0	/* JPI$_JOBTYPE values */
#define JPI$K_LOCAL	3	/* JPI$_JOBTYPE values */
#define JPI$K_DIALUP	4	/* JPI$_JOBTYPE values */
#define JPI$K_REMOTE	5	/* JPI$_JOBTYPE values */
/* (also BATCH & INTERACTIVE) */

#define JPI$V_NEW_MAIL_AT_LOGIN 0
#define JPI$V_PASSWORD_CHANGED	1
#define JPI$V_PASSWORD_EXPIRED	2
#define JPI$V_PASSWORD_WARNING	3
#define JPI$V_PASSWORD2_CHANGED 4
#define JPI$V_PASSWORD2_EXPIRED 5
#define JPI$V_PASSWORD2_WARNING 6
#define JPI$M_NEW_MAIL_AT_LOGIN (1<<JPI$V_NEW_MAIL_AT_LOGIN)	/* 0x01 */
#define JPI$M_PASSWORD_CHANGED	(1<<JPI$V_PASSWORD_CHANGED)	/* 0x02 */
#define JPI$M_PASSWORD_EXPIRED	(1<<JPI$V_PASSWORD_EXPIRED)	/* 0x04 */
#define JPI$M_PASSWORD_WARNING	(1<<JPI$V_PASSWORD_WARNING)	/* 0x08 */
#define JPI$M_PASSWORD2_CHANGED (1<<JPI$V_PASSWORD2_CHANGED)	/* 0x10 */
#define JPI$M_PASSWORD2_EXPIRED (1<<JPI$V_PASSWORD2_EXPIRED)	/* 0x20 */
#define JPI$M_PASSWORD2_WARNING (1<<JPI$V_PASSWORD2_WARNING)	/* 0x40 */
struct jpilgidef {
    union {
	unsigned long jpi$l_jpilgiflgs; /* Miscellaneous LOGIN flags */
	struct {
	    unsigned jpi$v_new_mail_at_login : 1; /* user had new MAIL message(s) */
	    unsigned jpi$v_password_changed  : 1; /* primary password changed */
	    unsigned jpi$v_password_expired  : 1; /* primary password expired on login */
	    unsigned jpi$v_password_warning  : 1; /* primary password expiration imminent */
	    unsigned jpi$v_password2_changed : 1; /* secondary password changed */
	    unsigned jpi$v_password2_expired : 1; /* secondary password expired on login */
	    unsigned jpi$v_password2_warning : 1; /* secondary password expiration imminent */
	    unsigned			     : 1;
	} jpi$r_jpilgiflgs_bits;
    } jpi$r_jpilgiflgs_overlay;
};

/* item identifiers for PCB */
#define JPI$_ASTACT	768	/* access modes with active ASTs */
#define JPI$_ASTEN	769	/* access modes with ASTs enabled */
#define JPI$_PRI	770	/* current process priority */
#define JPI$_OWNER	771	/* PID of creator process */
#define JPI$_UIC	772	/* UIC of process */
#define JPI$_STS	773	/* process status */
#define JPI$_STATE	774	/* process state */
#define JPI$_MEM	775	/* member field of UIC */
#define JPI$_GRP	776	/* group field of UIC */
#define JPI$_PRIB	777	/* process base priority */
#define JPI$_APTCNT	778	/* active page table count */
#define JPI$_TMBU	779	/* termination mailbox unit */
#define JPI$_GPGCNT	780	/* global page count in working set */
#define JPI$_PPGCNT	781	/* process page count in working set */
#define JPI$_ASTCNT	782	/* AST count remaining */
#define JPI$_BIOCNT	783	/* buffered I/O count remaining */
#define JPI$_BIOLM	784	/* buffered I/O limit */
#define JPI$_BYTCNT	785	/* byte count remaining for buffered I/O */
#define JPI$_DIOCNT	786	/* direct I/O count remaining */
#define JPI$_DIOLM	787	/* direct I/O count limit */
#define JPI$_FILCNT	788	/* count remaining of open files */
#define JPI$_TQCNT	789	/* count remaining of timer queue entries */
#define JPI$_EFWM	790	/* event flag wait mask */
#define JPI$_EFCS	791	/* local event flags 0-31 */
#define JPI$_EFCU	792	/* local event flags 32-63 */
#define JPI$_PID	793	/* process identification */
#define JPI$_BYTLM	794	/* buffered I/O byte count limit */
#define JPI$_PRCCNT	795	/* subprocess count */
#define JPI$_PRCNAM	796	/* process name */
#define JPI$_TERMINAL	797	/* login terminal name */
#define JPI$_JOBPRCCNT	798	/* total count of subprocesses in a job */
#define JPI$_ENQCNT	799	/* enqueue count remaining */
#define JPI$_ENQLM	800	/* enqueue count limit */
#define JPI$_SWPFILLOC	801	/* swap file backing store address */
#define JPI$_MODE	802	/* mode value (from STS) - defined above */
#define JPI$_JOBTYPE	803	/* job type code */
#define JPI$_PROC_INDEX 804	/* process index */
#define JPI$_MASTER_PID 805	/* master process PID */
#define JPI$_RIGHTSLIST 806	/* process rightslist */
#define JPI$_CPU_ID	807	/* CPU ID */
#define JPI$_STS2	808	/* second process status longword */
#define JPI$_NODENAME	809	/* name of node on which process is running */
#define JPI$_NODE_CSID	810	/* CSID of node on which process is running */
#define JPI$_NODE_VERSION	811	/* VMS version of node on which process is running */
#define JPI$_TT_PHYDEVNAM	812	/* physical device name of terminal */
#define JPI$_TT_ACCPORNAM	813	/* access port name of terminal */
#define JPI$_PROCESS_RIGHTS	814	/* process rights */
#define JPI$_SYSTEM_RIGHTS	815	/* system rights */
#define JPI$_IMAGE_RIGHTS	816	/* image (protected sub-system) rights */
#define JPI$_RIGHTS_SIZE	817	/* approximate size (in bytes) of all rights lists */
#ifndef NO_VMS_V6
#define JPI$_CLASSIFICATION	818	/* current process classification */
#define JPI$_LASTPCB	820
#else
#define JPI$_LASTPCB	818	/* max index in PCB table */
#endif

/* item identifiers for PHD */
#define JPI$_CURPRIV	1024	/* current process privilege mask */
#define JPI$_WSAUTH	1025	/* authorized working set size */
#define JPI$_WSQUOTA	1026	/* quota on working set size */
#define JPI$_DFWSCNT	1027	/* default working set size */
#define JPI$_FREP0VA	1028	/* first free virtual addr. at end of P0 space */
#define JPI$_FREP1VA	1029	/* first free addr. at end of P1 space */
#define JPI$_DFPFC	1030	/* default page fault cluster */
#define JPI$_CPUTIM	1031	/* accumulated cpu time */
#define JPI$_PRCLM	1032	/* subprocess quota */
#define JPI$_ASTLM	1033	/* AST limit */
#define JPI$_PAGEFLTS	1034	/* count of page faults */
#define JPI$_DIRIO	1035	/* process direct I/O operations */
#define JPI$_BUFIO	1036	/* process buffered I/O operations */
#define JPI$_CPULIM	1037	/* limit on cputim for process */
#define JPI$_PGFLQUOTA	1038	/* max. virtual page count */
#define JPI$_FILLM	1039	/* open file limit */
#define JPI$_TQLM	1040	/* timer queue limit */
#define JPI$_WSSIZE	1041	/* current working set size */
#define JPI$_AUTHPRIV	1042	/* authorized privilege mask */
#define JPI$_IMAGPRIV	1043	/* installed image privilege mask */
#define JPI$_PAGFILCNT	1044	/* pages charged to page file quota */
#define JPI$_FREPTECNT	1045	/* room for expansion of P0 or P1 space */
#define JPI$_WSEXTENT	1046	/* extent of working set size */
#define JPI$_WSAUTHEXT	1047	/* max extent of working set size */
#define JPI$_AUTHPRI	1048	/* authorized priority for $SETPRI */
#define JPI$_PAGFILLOC	1049	/* page file backing store address */
#define JPI$_IMAGECOUNT 1050	/* image counter (clocked by rundown) */
#define JPI$_PHDFLAGS	1051	/* process header flags word */
#define JPI$_VP_CPUTIM	1052	/* vector CPU time */
#define JPI$_VP_CONSUMER 1053	/* flag -- is this process a vector consumer? */
#define JPI$_LASTPHD	1054	/* max index in process header */

/* item identifiers for control region */
#define JPI$_VIRTPEAK	512	/* peak virtual size */
#define JPI$_WSPEAK	513	/* peak working set size */
#define JPI$_USERNAME	514	/* username string */
#define JPI$_ACCOUNT	515	/* account name string */
#define JPI$_PROCPRIV	516	/* process privilege mask */
#define JPI$_VOLUMES	517	/* volumes mounted */
#define JPI$_LOGINTIM	518	/* time of login or process creation */
#define JPI$_IMAGNAME	519	/* current image file name */
#define JPI$_SITESPEC	520	/* per-process site-specific cell */
#define JPI$_MSGMASK	521	/* process default message flags */
#define JPI$_CLINAME	522	/* command language interpreter name */
#define JPI$_TABLENAME	523	/* command language interpreter table name */
#define JPI$_CREPRC_FLAGS 524	/* $CREPRC flags used to create this process */
#define JPI$_UAF_FLAGS	525	/* flags from uaf record */
#define JPI$_MAXDETACH	526	/* maximum detached processes for single user */
#define JPI$_MAXJOBS	527	/* maximum active processes for single user */
#define JPI$_SHRFILLM	528	/* maximum open shared files */
#define JPI$_FAST_VP_SWITCH	529	/* number of fast vector context switches */
#define JPI$_SLOW_VP_SWITCH	530	/* number of slow vector context switches */
#define JPI$_LAST_LOGIN_I	531	/* last interactive login */
#define JPI$_LAST_LOGIN_N	532	/* last non-interactive login */
#define JPI$_LOGIN_FAILURES	533	/* number of login failures at login */
#define JPI$_LOGIN_FLAGS	534	/* miscellaneous login flags */
#ifndef NO_VMS_V6
#define JPI$_RMS_DFMBC		535	/* RMS default: multi-block count */
#define JPI$_RMS_DFMBFSDK	536	/* " " multi-buffer count for disk (SEQ) */
#define JPI$_RMS_DFMBFSMT	537	/* " " multi-buffer count for tape */
#define JPI$_RMS_DFMBFSUR	538	/* " " multi-buffer count for unit record */
#define JPI$_RMS_DFMBFREL	539	/* " " multi-buffer count for REL files */
#define JPI$_RMS_DFMBFIDX	540	/* " " multi-buffer count for ISAM files */
#define JPI$_RMS_PROLOGUE	541	/* " " prolog */
#define JPI$_RMS_EXTEND_SIZE	542	/* " " file extend quantity */
#define JPI$_RMS_FILEPROT	543	/* " " file protection */
#define JPI$_RMS_DFNBC		544	/* " " network block count */
#define JPI$_LASTCTL	545
#else
#define JPI$_LASTCTL	535	/* max index in control region */
#endif

/* item identifiers for address data */
#define JPI$_EXCVEC	256	/* address of "exception vector" vector */
#define JPI$_FINALEXC	257	/* address of last chance exception vectors */
#define JPI$_LASTADR	258	/* max index in address table */

/* item identifiers for PCBFLD */
#define JPI$_LASTPCBFLD 1280	/* max index in PCBFLD table */

/* item identifiers for PHDFLD */
#define JPI$_LASTPHDFLD 1536	/* max index in PHDFLD table */

#endif	/*_JPIDEF_H*/
