/**********************************************************************
*  Author:      Shawn Stoffer
*  File:        aux.h
*  Description: Auxiliary functions used many places in my code.
*  Arguments:   None
*  Systems:     SunOS, Solaris, but should be able to work on any system.
**********************************************************************/

#ifndef __AUX_H__
#define __AUX_H__

/* Will read upto the first newline from the source file stream, and 
 * should the line have ended with a '\' character, than this function
 * will chop the '\' character off of the back of the string and return
 * 1 as this is meant to signal a line continuation.
 */
int get_line(char* line, int size, FILE* source);

/* Will read until a '\n' is encountered, eof is reached, or end is
 * reached, from fl.   This function returns 1 unless eof is reached, 
 * in which case it returns 0.
 */
int getline(char* line, int end, FILE* fl);

/* Will read from the input array until either end is reached, or the number
 * characters given is reached.
 */
int putline(char*, FILE*);

/* This function will read a text string from a binary file. It returns the
 * number of characters read from the file.
 */
int bgetline(char* buf, int Ssize, FILE* fl);

/* This function will write a text string to a binary file. It returns the
 * number of characters written to the file.
 */
int bputline(char*, FILE*);

/*
 * This function will read from the input specified (or stdin if no input
 * specified) and will output the specified specified string, on out (or 
 * stdout if no out is specified), will output the the specified specified 
 * string, on out (or stdout if no out is specified), will output 
 * the string specified, and will return if the user entered a yes.  
 * (returns 1(yes) or 0(no))
 */
int confirm(char* confirmString, FILE* in, FILE* out);

#ifndef isspace
/* This function checks whether or not a character is an unprintable character,
 * or whitespace.
 */
int isspace(unsigned char);
#endif

/*
 * Skip the leading whitespace in a string, and return a pointer to the 
 * first non-whitespace character in the string.
 */
char * skip_whitespace(char * buf);
#endif /* __AUX_H__ */

