clibpc_h

/*
**	Copyright 1991, Universities Research Association.  All rights reserved.
*/
/******************************************************************************/
/* clib.h
**
**	This is the include file for the CLIB library of routines.
**
**
**	V0.0	B S Hendricks / Accelerator Controls		27-Jan-89
**	Created
**
**	V0.1	B S Hendricks / Accelerator Controls		22-Feb-89
**	Added ckcvhc and cvhc routines and fixed all int conversion
**	routines which had been set up for short ints
*/
/******************************************************************************/

#ifndef CLIB_PC_DEFINED				/* do this only once */
#define	CLIB_PC_DEFINED

/******************************************************************************/
/* 
**	defined constants
*/
/******************************************************************************/

#define	T_PER_S		18.2	/* ticks per second */
#define INT_TIME	0x1A    /* timer interrupt number */

/******************************************************************************/
/*
**	function prototypes
*/
/******************************************************************************/
extern "C" {
#ifndef CLIB_DEFINED
#define	ckcvg	CKCVG
void	CKCVG(char *, short *, short *, float *, short *);
#endif
void	ckcvgc(char *, int, int, float *, short *);
#ifndef CLIB_DEFINED
#define	ckcvg8	CKCVG8
void	CKCVG8(char *, short *, short *, double *, short *);
#endif
#ifndef CLIB_DEFINED
#define	ckcvh	CKCVH
void	CKCVH(char *, short *, short *, short *, short *);	/* convert a hex string to an int */
#endif
void	ckcvhc(char *, int, int, short *, short *);		/* convert a hex string to an int */
#ifndef CLIB_DEFINED
#define	ckcvi	CKCVI
void	CKCVI(char *, short *, short *, short *, short *);	/* convert a string to an int */
#endif
void	ckcvic(char *, int, int, short *, short *);		/* convert a string to an int */
#ifndef CLIB_DEFINED
#define	ckcvn	CKCVN
void	CKCVN(char *, short *, short *, short *, short *, short *);	/* convert a string to an int */
#endif
void	CONOUT(char *);						/* print out a single character */
#ifndef CLIB_DEFINED
#define	cvdi4	CVDI4
void	CVDI4(char *, short *, short *, int *, short *);	/* convert a string to a int */
#endif
void	cvdi4c(char *, int, int, int *, short *);		/* convert a string to a int */
#ifndef CLIB_DEFINED
#define	cve	CVE
void	CVE(float *, short *, char *, short *);
#endif
void	cvec(float, int, char *, int);
#ifndef CLIB_DEFINED
#define	cvg	CVG
void	CVG(float *, short *, char *, short *);
#endif
void	cvgc(float *, int, char *, int);
#ifndef CLIB_DEFINED
#define	cvg8	CVG8
void	CVG8(double *, short *, char *, short *);
#define	cvh	CVH
void	CVH(char *, short *, char *, short *, char *);		/* convert a hex int to a string */
#endif
void	cvhc(char *, int, char *, int, char);			/* convert a hex int to a string */
#ifndef CLIB_DEFINED
#define	cvhi4	CVHI4
void	CVHI4(char *, short *, short *, int *, short *);
#endif
void	cvhi4c(char *, int, int, int *, short *);
#ifndef CLIB_DEFINED
#define	cvi	CVI
void	CVI(short *, short *, char *, short *, char *);		/* convert an int to a string */
#endif
void	cvic(short, int, char *, int, char);			/* CVI for C programmers */
#ifndef CLIB_DEFINED
#define	cvi4d	CVI4D
void	CVI4D(int *, short *, char *, short *, char *);	/* convert a int to a string */
#endif
//void	cvi4dc(long, int, char *, int, char);			/* convert a int to a string */
#ifndef CLIB_DEFINED
#define	cvi4h	CVI4H
void	CVI4H(int *, short *, char *, short *, char *);
#endif
//void	cvi4hc(long, int, char *, int, char);
#ifndef CLIB_DEFINED
#define	cvn	CVN
void	CVN(short *, short *, char *, short *, short *, char *);	/* convert an int to a string */
#define	datime	DATIME
void	DATIME(char *);
#endif
void	DATIMEPC(char *);
#ifndef CLIB_DEFINED
#define	daweek	DAWEEK
void	DAWEEK(short *, short *);
#define	dncase	DNCASE
void	DNCASE(char *, short *);
#define	filli1	FILLI1
void	FILLI1(char *, short *, short *, char *);
#define	filli2	FILLI2
void	FILLI2(short *, short *, short *, short *);
#define	filli4	FILLI4
void	FILLI4(int *, short *, short *, int *);
#endif
void	HEXRD(short *);				/* read a hex integer */
void	HXRD2(int *);				/* read a hex longword */
void	HEXWR(short *);				/* print out a hex integer */
void	HXWR2(int *);				/* print out a hex longword */
#ifndef CLIB_DEFINED
#define	icshft	ICSHFT
int	ICSHFT(short *, short *);		/* rotate a word value */
#endif
int	K18HZ(void);
char	LBIT(short *, short *);			/* test a bit in an integer */
void	LRES(short *, short *);			/* reset a bit in an integer */
void	LSET(short *, short *);			/* set a bit in an integer */
#ifndef CLIB_DEFINED
#define	moveby	MOVEBY
void	MOVEBY(char *, short *, char *, short *, short *);	/* move a set of bytes */
#define	movewd	MOVEWD
void	MOVEWD(short *, short *, short *, short *, short *);	/* move a set of words */
#define	pause	PAUSE
void	PAUSE(short *);				/* wait for n 15ths of a sec */
#endif
void	PAUSEPC(short *);			/* wait for n 15ths of a sec */
float	RAN(unsigned short *);
void	ROTL(short *, short *);			/* rotate an integer left */
void	ROTR(short *, short *);			/* rotate an integer right */
#ifndef CLIB_DEFINED
#define	rstbit	RSTBIT
void	RSTBIT(char *, short *);		/* reset a bit in a byte string */
#define	setbit	SETBIT
void	SETBIT(char *, short *);		/* set a bit in a byte string */
#define	swab	SWAB
void	SWAB(short *, short *);
#endif
int	SYSTIM(void);				/* get system time in ticks */
#ifndef CLIB_DEFINED
#define	tstbit	TSTBIT
char	TSTBIT(char *, short *);		/* test a bit in a byte string */
#define	upcase	UPCASE
void	UPCASE(char *, short *);
#endif
void	Wait(short *);				/* wait for n milliseconds */
void	WAIT_SEC(double);			/* wait for n seconds */

int pclib_set_front_end(int node);
unsigned short pclib_get_front_end(void);
unsigned int CAMIO(short *funcod, short *subadd, int *data,
		   short *q, short *x);
void rdsphc(int row, int column, int passed_num_chars, int minimum,
	    int maximum, short *value, short *status);
void rdspic(int row, int column, int num_chars, int minimum, int maximum,
	    short *value, short *status);
void rdsprc(int row, int column, int num_chars, float *passed_minimum,
	    float *passed_maximum, float *value, short *status);
void SETCS(short *inp_crate, short *inp_slot);
void SETTRY(short *retry);
void SETARB(short *iarb);
unsigned int MCAMIO(short *funcod, short *subadd, int *data,
		    short *q, short *x, short *count);
void copiesc(int icode, int irow, int icol);
int inptxtc(int uprow, int lftcol, char *text, int nchars, char *string,
	    int len);
void meswinc(int uprow, int lfcol, int nrows, int ncols, char *text, int color);
void cvi4hc(int i4val, int nchars, char *ibuf, int istart, char fill);
void cvi4dc(int i4val, int nchars, char *lbuf, int istart, char fill);
void plot190(short crate, short plot_setup);
void rdspi4c(int passed_row, int passed_column, int passed_num_chars,
	     int minimum, int maximum, int *value, short *status);
void timmesc(int uprow, int lftcol, char *text, int color, int delay);
void wrdspic(int uprow, int lftcol, char *text, int nchars, short min,
	     short max, short *ival);
void wrdsphc(int uprow, int lftcol, char *text, int nchars, short min,
	     short max, short *ival);
void RDSPH(short *row, short *column, short *num_chars, short *minimum,
	   short *maximum, short *value, short *status);
}

#endif