/************************************************************************/
/* Copyright 2003 MBARI													*/
/************************************************************************/
/* Summary	: Definitions for Utility library for OASIS					*/
/* Filename : utils.h													*/
/* Author	: Robert Herlien (rah)										*/
/* Project	: OASIS Mooring Replacement (OASIS3)						*/
/* Revision: 0.1														*/
/* Created	: 01/07/2003												*/
/*																			*/
/* MBARI provides this documentation and code "as is", with no warranty,	*/
/* express or implied, of its quality or consistency. It is provided without*/
/* support and without obligation on the part of the Monterey Bay Aquarium	*/
/* Research Institute to assist in its use, correction, modification, or	*/
/* enhancement. This information should not be published or distributed to	*/
/* third parties without specific written permission from MBARI.			*/
/*																			*/
/************************************************************************/
/* Modification History:												*/
/* 07jan2003 rah - created												*/
/************************************************************************/

#ifndef INCutilsh
#define INCutilsh		1

#define PRINTBUF_SIZE	256

#define find_str(src, tgt)		strstr(src, tgt)
//#define random()				rand()


/****************************************/
/* Function Declarations				*/
/****************************************/

Void	doputc(Int16 c);
Void	xputc(Int16 c);
Void	newline(Void);
Int16	xgetc_tmout(Nat16 tmout);
Int16	xgetc(Void);
Void	xputs(const char *s);
Void	xputn(const char *s, Int16 len);
Int16	xgetn_tmout(char *s, Int16 len, Nat16 tmout);
Int16	xgets_tmout_flg(char *s, Int16 len, Nat16 tmout, Word flags);
Int16	xgets_tmout(char *s, Int16 len, Nat16 tmout);
Int16	xgets(char *s, Int16 len);
Void	xflush_ser(Nat16 timeout);
Void	xdrain_ser(Nat16 tmout);
Void	xser_break(Int16 breakTicks);
MBool	delimit(Reg char c);
char	*cmp_ulc(const char *s, const char *cs);
char	*stristr( char *src, char *tgt );
char	*skipField(Reg char *p, Nat16 nfields);
Int16	getByte(char *p, Nat16 radix);
MBool	getnum(char **s, Int16 *result, Nat16 radix);
MBool	getFixedPt(char **s, Int16 *resultPtr, Nat16 decDigits);
int		xprintf(const char *format, ...);
Nat16	bitsOn(Nat16 num);
#ifndef NOASM
asm		Nat16 swapWord(Nat16 wrd):__d0;
asm		Nat32 swapLong(Nat32 lng):__d0;
asm		Nat16 getSwapWord(Nat16 *p:__a0):__d0;
asm		Nat32 getSwapLong(Nat32 *p:__a0):__d0;
#endif

#endif	/* INCutilsh */
