
	/* structures used by the routines that perform data I/O on the
	   pseudo-FITS format files */

typedef int pf_handle;

#define PF_NUM_HANDLE   16	/* max number of files open at once */

#define TRUE             1	/* boolean value for true */
#define FALSE            0	/*  ditto false */

#define SKIP_CHAR      '#'	/* skip any line that begins with this character */
#define COMMENT_CHAR   '/'  /* comment character - ignore part of line which */
                         	/*   occurs to the right of it */
#define QUOTE_CHAR     '\''	/* quote character, indicates a string value */
#define DELIM_CHAR     '='	/* delimiter between keyword and value */

#define PF_ERROR        -1	/* returned when something goes wrong */
#define PF_LEN          80	/* maximum length of header lines */

#define PF_EXIST         1	/* open a file/header which already exists */
#define PF_CREATE        2	/* create a new file/header */

#define PF_BOOLEAN       1
#define PF_INTEGER       2
#define PF_DOUBLE        3
#define PF_STRING        4

	/* returns the number of headers in a file */
int pf_headers( /* char *filename */ );					

	/* attempts to open a pseudo-FITS header file */
pf_handle pf_open( /* char *filename, int num_header, int status */);

	/* close the file with the given pf handle */
int pf_close( /* pf_handle handle */ );				

	/* gets the entire string which contains the value of a header line */
char *pf_getval( /* pf_handle handle, char *keyword, char *value */ );			

	/* puts a line containing the (keyword, val) pair specified into file, 
	   or replace old val */
char *pf_putval( /* pf_handle handle, char *keyword, char *value */ );

	/* allow copying of COMMENT lines to/from files */
char *pf_getcomment( /* pf_handle handle, char *line */ );
char *pf_putcomment( /* pf_handle handle, char *line */ );

	/* the following functions all convert to/from a value field (which is
	   a string) returned by pf_getval() or used by pf_putval(). */

	/*  these return 0 if the conversion succeeded, -1 if problem */
int pf_valtobool(  /* char *val, int *bool  */ ); /* converts val -> boolean */
int pf_valtostr(   /* char *val, char *str  */ ); /* converts val -> string */
int pf_valtoint(   /* char *val, int *inum  */ ); /* converts val -> integer */
int pf_valtodouble(/* char *val, double *dp */ ); /* converts val -> double */

	/* these don't return anything */
void pf_booltoval(  /* int bool, char *val */ );  /* converts boolean -> val */
void pf_strtoval(   /* char *str, char *val */ ); /* converts string -> val */
void pf_inttoval(   /* int inum, char *val */ );  /* converts integer -> val */
void pf_doubletoval(/* double d, char *val */ );  /* converts double -> val */

	/* this function returns the type of its string argument */
int  pf_valtype( /* char *val */ );

	/* this function copies the 'value' part of a line into its second
	   argument, or the string "" (i.e. a single '\0' char) if no value */
void pf_copyvalue( /* char *line, *value */ );
