4 * This source code is part of
8 * GROningen MAchine for Chemical Simulations
12 * Copyright (c) 1991-1999
13 * BIOSON Research Institute, Dept. of Biophysical Chemistry
14 * University of Groningen, The Netherlands
17 * GROMACS: A message-passing parallel molecular dynamics implementation
18 * H.J.C. Berendsen, D. van der Spoel and R. van Drunen
19 * Comp. Phys. Comm. 91, 43-56 (1995)
21 * Also check out our WWW page:
22 * http://md.chem.rug.nl/~gmx
27 * Good ROcking Metal Altar for Chronical Sinners
33 static char *SRCID_futil_h
= "$Id$";
36 #ident "@(#) futil.h 1.1 11/23/92"
37 #endif /* HAVE_IDENT */
45 extern void no_buffers(void);
46 /* Turn off buffering of files (which is default) for debugging purposes */
48 extern bool fexist(char *fname
);
49 /* Return TRUE when fname exists, FALSE otherwise */
51 extern bool eof(FILE *fp
);
52 /* Return TRUE on end-of-file, FALSE otherwise */
54 extern bool is_pipe(FILE *fp
);
55 /* Check whether the file (opened by ffopen) is a pipe */
57 extern char *backup_fn(char *file
);
58 /* Return a backup name for file (name with # before and after) */
60 extern FILE *ffopen(char *file
,char *mode
);
61 /* Return a valid file pointer when succesfull, exits otherwise
62 * If the file is in compressed format, open a pipe which uncompresses
63 * the file! Therefore, files must be closed with ffclose (see below)
66 extern void ffclose(FILE *fp
);
67 /* Close files or pipes */
69 #define fclose ffclose
71 extern void frewind(FILE *fp
);
72 /* Does not rewind pipes, but does so for normal files */
74 #define rewind frewind
76 bool is_pipe(FILE *fp
);
78 extern FILE *uncompress(char *fn
,char *mode
);
79 extern FILE *gunzip(char *fn
,char *mode
);
80 /* Open a pipe to uncompress or unzip files. Must be closed with pclose */
82 extern char *libfn(char *file
);
84 extern FILE *libopen(char *file
);
85 /* Open a library file for reading. This looks in the current directory
86 * first, and then in the library directory. If the file is not found,
87 * it terminates with a fatal_error
90 extern char *low_libfn(char *file
,bool bFatal
);
92 extern FILE *low_libopen(char *file
,bool bFatal
);
93 /* The same as the above, but does not terminate if (!bFatal) */