#include "ul_cnscom_all.h"
**	Copyright 1991-2018, Fermi Research Alliance, LLC.  All rights reserved.


   Modification history:

        V00.00  Jim Smedinghoff / Kevin Cahill      ?

    	V0.11	J. Smedinghoff		12-Jun-1990
	- Added XSERVER structure.

    	V0.12	K. Cahill		25-Jul-1990
	- Added DACSTAT structures for dacnet statistics.

    	V0.13	K. Cahill		25-Jul-1990
	- Added dacnet flag to misc area for task start clearing flag.

    	V0.14	J. Smedinghoff		24-Sep-90
	- Started modifying for multiple consoles per CPU.

    	V0.21	K. Cahill		7-Oct-1991
	- Added cns_stuff classes and setting classes for security.

	V0.24	J. Smedinghoff		10-Feb-1992
	- Add clock history stuff.

	V0.25	J. Smedinghoff		 4-Feb-1993
	- Add clock_source to clock history stuff.
	- Reserve spare space in CNS_STUFF.

	V0.26	J. Smedinghoff		21-Jul-1993
	- Add username to CNS_STUFF.

	V0.27	J. Smedinghoff		15-Jun-1995
	- Added support for fake clock playback.
	V0.28	K. Cahill		13-Jul-1995
	- Deleted old settings stuff

	V0.29	J. Smedinghoff		15-Apr-1996
	- Add new TCLK event and history areas.

#ifndef CNS_MISC_DEFINED		/* do this only once */

#include "vaxtypes.h"
#include <pthread.h>
#include <sys/time.h>
#include <unistd.h>
#include <stdio.h>
#include <X11/Xlib.h>
#include <time.h>
#include "cnsparam.h" /* for clib_time_t and colors */

#define MAX_CONSOLES		4	/* max consoles per CPU */
#define CONSOLE_OFFSET		100	/* offset between console numbers */
    					/* on the same CPU */
#define TASK_NAME_OFFSET	5	/* offset of 2nd letter of task name */
    					/* between consoles */
#define CMD_LIN_SIZ		1024	/* size of CHGPGM command line  */

/* Define colors */

//#define NUM_CNS_COLORS	16	/* defined in ul_cnscom_all.h */
#define MAX_PLD_SLOTS	13		/* also defined in cnsparam.h */
#define MAX_CACHE	5000
#define MAX_XSERVER	4

#define PLD_WAKE_FIFO "/usr/local/xaps/scratch/dpm/pldWake"


#define MAX_CLK_TYPES	(4)	/* # of clock types TCLK, MIBS, RRBS, TVBS */
#define CLK_TYPE_TCLK	(0)
#define CLK_TYPE_MIBS	(1)
#define CLK_TYPE_RRBS	(2)
#define CLK_TYPE_TVBS	(3)

/* Function prototypes (ANSI C) */
#ifdef __cplusplus
extern "C" {
void set_console_instance(int instance);
void task_slot (char *slot, char *state, int *genr50, int *netr50, char
*script = NULL);
#ifdef __cplusplus