/*++++++++++++++
.IDENTIFICATION filutil.h
.LANGUAGE       C
.AUTHOR         Francois Ochsenbein [CDS]
.ENVIRONMENT    Unix, CDS Catalogues
.KEYWORDS       Description of a Table
.VERSION  1.0   19-Dec-2007: Extract from catstd.h
.VERSION  1.1   20-Aug-2008: fcleaner
.COMMENTS       Interpretation of the "ReadMe" file of Catalogues
---------------*/
#ifndef FILUTIL_DEF	/* To avoid recursive inclusions   */
#define FILUTIL_DEF	0

#include <stdio.h>	/* FILE definitions	     */

#ifndef _ARGS
#ifdef __STDC__
#define _ARGS(A)	A       /* ANSI */
#else
#define _ARGS(A)	()      /* Traditional */
#define const
#endif
#endif

			/* Definitions of default / maximal values:   	*/
#define LRECL          512      /* Default Record Length (Lrecl)      	*/

#ifdef __MSDOS__	/*----------------Turbo-C-----------------------*/
#define MAXBYTES    0xffff		/* Maximal allocation		*/
#define BUFb	      8192		/* Default Buffer Size 		*/
#define MakeFITS	"makefits.bat"	/* Shell file for FITS buildup	*/
#define MakePAR		"makepar.bat"	/* Shell file for PAR buildup	*/
#define dirsep		'\\'		/* Separator for directories	*/
#define RMODE		"rb"		/* Binary option in open 	*/
#define WMODE		"wb"		/* Binary option in open 	*/
#else			/*------Assume a standard Unix workstation------*/
#define MAXBYTES 0xffffff		/* Maximal allocation		*/
#define BUFb	28800			/* Default Buffer Size 		*/
#define MakeFITS	".MakeFITS"	/* Shell file for FITS buildup	*/
#define MakePAR		".MakePAR"	/* Shell file for FITS buildup	*/
#define dirsep		'/'		/* Separator for directories	*/
#define RMODE		"r"		/* Read Mode in Unix		*/
#define WMODE		"w"		/* Binary option in open 	*/
#endif

/* from "filutil.c", utilities for file namagement */
  int     filutil  _ARGS((int option));  /* Verbosity option */
int     wait_pipe _ARGS((int unused));
int     open_pipe _ARGS((char **argv, int mode, int *child));
int        is_dir _ARGS((char *name));
int     copy_file _ARGS((char *name, int output_handle));
char     *comfile _ARGS((char *name));	/* Complete filename with ext */
char   *load_file _ARGS((char *name, int show_error));
char *load_stream _ARGS((FILE *stream)); 
char      *fxload _ARGS((char *name, int show_error));
FILE      *fxopen _ARGS((char *name));	/* Execute file if executable */
FILE      *fzopen _ARGS((char *name));
FILE     *fzopen3 _ARGS((char *name, int to_skip, int blocksize));
int       fzclose _ARGS((FILE *file));
char      *fzinfo _ARGS((FILE *file));	/* Get details of file */
int       fxclose _ARGS((FILE *file));
int      fcleaner _ARGS((char *file_radix, int age_in_sec));
char    *filename _ARGS((char *dirname, char *basename, char *ext));
int       fprintq _ARGS((FILE *file, char *string));	/* Print Quoted */
#endif
