/****************************************************************** 
 *
 * util.h --
 *
 *     Shared utility functions interface.
 *
 *
 * Author : Dan Gunter
 * Created: 9 June 1998
 *
 ****************************************************************** 
 */

#include <tcl.h>
#include <pthread.h>
#include "structs.h"
#include "errclass.h"

/*
 *---------------------------------------------------------------------- 
 *
 * Split -- Split the input string on whitespace and return an array
 *          of character pointers to new field values.
 *          The input string is not modified.
 *
 * Input: 
 *       str -- String to split
 *       num -- Return: # of fields
 *       arr -- Return: arr of char* to fields
 *
 *----------------------------------------------------------------------
 */
int   Nlv_Split( char *str,    
		 int *num,     
		 char ***arr );
char *Nlv_RightStr( char *str, int n );
int   Nlv_MatchField( Nlv_Fields *f, char *matchme );
char *Nlv_IpStr2HostName(char *ipstr);
int Nlv_ParseMultiList( int numtok,
			char **tok, 
			int  **num, 
			char ****arr );
char * Nlv_CopySkipChars( char *in, char *skip );
char * Nlv_Fields2String( Nlv_Fields* flds );
void strupper( char *s );
int fdread1line( int fd,    /* descriptor to read from */
		 char *buf, /* buffer to put data in */
		 char **pos,/* position to read from */
		 int  *len, /* length of line read, if any */
		 int blk ); /* block size */
void select_sleep( int sec, int usec );
char *chchar( char *s, char c1, char c2 );
double stopwatch( int n  ); 


