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$";
40 #ident "@(#) futil.h 1.1 11/23/92"
41 #endif /* HAVE_IDENT */
49 extern void no_buffers(void);
50 /* Turn off buffering of files (which is default) for debugging purposes */
52 extern bool fexist(char *fname);
53 /* Return TRUE when fname exists, FALSE otherwise */
55 extern bool eof(FILE *fp);
56 /* Return TRUE on end-of-file, FALSE otherwise */
58 extern bool is_pipe(FILE *fp);
59 /* Check whether the file (opened by ffopen) is a pipe */
61 extern char *backup_fn(char *file);
62 /* Return a backup name for file (name with # before and after) */
64 extern FILE *ffopen(char *file,char *mode);
65 /* Return a valid file pointer when succesfull, exits otherwise
66 * If the file is in compressed format, open a pipe which uncompresses
67 * the file! Therefore, files must be closed with ffclose (see below)
70 extern void ffclose(FILE *fp);
71 /* Close files or pipes */
73 #define fclose ffclose
75 extern void frewind(FILE *fp);
76 /* Does not rewind pipes, but does so for normal files */
78 #define rewind frewind
80 bool is_pipe(FILE *fp);
82 extern FILE *uncompress(char *fn,char *mode);
83 extern FILE *gunzip(char *fn,char *mode);
84 /* Open a pipe to uncompress or unzip files. Must be closed with pclose */
86 extern char *libfn(char *file);
88 extern FILE *libopen(char *file);
89 /* Open a library file for reading. This looks in the current directory
90 * first, and then in the library directory. If the file is not found,
91 * it terminates with a fatal_error
94 extern char *low_libfn(char *file,bool bFatal);
96 extern FILE *low_libopen(char *file,bool bFatal);
97 /* The same as the above, but does not terminate if (!bFatal) */
103 #endif /* _futil_h */