# include <stdio.h>
# include <math.h>
# include <malloc.h>
# include <string.h>
# include <stdlib.h>

# include <stdarg.h> 
# include <fitsio.h>

/*
# ifndef ANSI
# include <varargs.h>
# else
# include <stdarg.h> 
# include <cfuncs.h> 
# endif
*/

/********************** internal constants ************/
# ifndef NEWLINE
# define NEWLINE                 10  /* UNIX RETURN character */
# endif /* NEWLINE */

/* general macros which should exist anyway! */
# ifndef ALLOCATE
# define ALLOCATE(X,T,S)  \
  X=(T *)malloc((unsigned) ((S)*sizeof(T)));\
  if(X==NULL) \
    { \
      fprintf(stderr,"failed to malloc %d entries\n", S);\
	exit(0);\
    } 
# define REALLOCATE(X,T,S) \
  X=(T *)realloc(X,(unsigned) ((S)*sizeof(T))); \
  if(X==NULL) \
    { \
       fprintf(stderr,"failed to realloc %d entries\n", S); \
       exit(0); \
    }
# endif /* ALLOCATE */

# ifndef TRUE
# define TRUE                           (1)
# define FALSE                          (0)
# endif  /* TRUE */

# ifdef linux
# define BYTE_SWAP
# endif

# define MIN(X,Y) ((X) < (Y) ? (X) : (Y))
# define MAX(X,Y) ((X) > (Y) ? (X) : (Y))
