/* $Header: /u/jjc/dvitops/RCS/util.h,v 1.2 89/02/01 12:18:22 jjc Rel $  */
 
#include <stdio.h>
#include <ctype.h>
#include <string.h>
#include <math.h>
#include <time.h>
#include <errno.h>
 
#include "config.h"
 
#ifdef STDARG
#include <stdarg.h>
#else
#include <varargs.h>
#endif
#ifndef SEEK_CUR
#define SEEK_CUR 1
#endif
#ifndef SEEK_SET
#define SEEK_SET 0
#endif
#ifndef SEEK_END
#define SEEK_END 2
#endif
#ifdef PROTO
int abs(int);
char *getenv(char *);
int atoi(const char *);
long atol(const char *);
char *calloc(size_t, size_t);
void exit(int);
void free(char *);
char *getenv(char *);
char *malloc(size_t);
void qsort(char *, size_t, size_t, int (*)());
char *realloc(char *, size_t);
double atof(const char *);
int getopt(int argc, char **argv, char *opts);
FILE *xfopen(char *filename, int is_binary, char *area_list,
char *extension);
#else
int abs();
char *getenv();
double atof();
int atoi();
long atol();
char *calloc();
void exit();
void free();
char *getenv();
char *malloc();
void qsort();
char *realloc();
double atof();
long atol();
int getopt();
FILE *xfopen();
#endif

extern int errno;
 
extern int opterr;
extern int optind;
extern int optopt;
extern char *optarg;
 
#define TRUE 1
#define FALSE 0
 
#ifdef BINARY
#define RB "rb"
#else
#define RB "r"
#endif

#define cant_happen() message(FATAL_ERROR, "can't happen: %s, line %d",\
__FILE__, __LINE__);
#define out_of_memory() message(FATAL_ERROR, "out of memory");


enum message_type {INFORMATION = 0, WARNING = 1, ERROR = 2, FATAL_ERROR = 3 };

extern enum message_type history;
extern char *program_name;

#ifdef STDARG
void message(enum message_type, char *,...);
#else
void message();
#endif
