/*-------------------------------------------------------------------------*/ /** @file pafs.h @author N. Devillard @date Feb 1999 @version $Revision: 1.13 $ @brief PAF format I/O. This module contains various routines related to PAF file I/O. */ /*--------------------------------------------------------------------------*/ /* $Id: pafs.h,v 1.13 2001/12/03 13:11:33 ndevilla Exp $ $Author: ndevilla $ $Date: 2001/12/03 13:11:33 $ $Revision: 1.13 $ */ #ifndef _PAFS_H_ #define _PAFS_H_ /*--------------------------------------------------------------------------- Includes ---------------------------------------------------------------------------*/ #include #include #include #include #include "static_sz.h" /*--------------------------------------------------------------------------- Function prototypes ---------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------*/ /** @brief Open a new PAF file, output a default header. @param filename Name of the file to create. @param paf_id PAF identificator. @param paf_desc PAF description. @return Opened file pointer. This function creates a new PAF file with the requested file name. If another file already exists with the same name, it will be overwritten (if the file access rights allow it). A default header is produced according to the VLT DICB standard. You need to provide an identificator (paf_id) of the producer of the file. Typically, something like "ISAAC/zero_point". The PAF description (paf_desc) is meant for humans. Typically, something like "Zero point computation results". This function returns an opened file pointer, ready to receive more data through fprintf's. The caller is responsible for fclose()ing the file. */ /*--------------------------------------------------------------------------*/ FILE * paf_print_header(char * filename, char * paf_id, char * paf_desc); /*-------------------------------------------------------------------------*/ /** @brief Query a PAF file for a value. @param filename Name of the PAF to query. @param key Name of the key to query. @return 1 pointer to statically allocated string, or NULL. This function parses a PAF file and returns the value associated to a given key, as a pointer to an internal statically allocated string. Do not try to free or modify the contents of the returned string! If the key is not found, this function returns NULL. */ /*--------------------------------------------------------------------------*/ char * paf_query(char * filename, char * key); /*-------------------------------------------------------------------------*/ /** @name is_paf_file @memo returns 1 if file is in PAF format, 0 else @param filename name of the file to check @return int 0, 1, or -1 @doc Returns 1 if the file name corresponds to a valid PAF file. Returns 0 else. If the file does not exist, returns -1. Validity of the PAF file is checked with the presence of PAF.HDR.START at the beginning */ /*--------------------------------------------------------------------------*/ int is_paf_file(char *filename); #endif