changed reading hint
[gromacs/adressmacs.git] / include / futil.h
blob9b820272559ca71d2bb57a5a499cfe0b313cc641
1 /*
2 * $Id$
3 *
4 * This source code is part of
5 *
6 * G R O M A C S
7 *
8 * GROningen MAchine for Chemical Simulations
9 *
10 * VERSION 2.0
12 * Copyright (c) 1991-1999
13 * BIOSON Research Institute, Dept. of Biophysical Chemistry
14 * University of Groningen, The Netherlands
16 * Please refer to:
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
23 * or e-mail to:
24 * gromacs@chem.rug.nl
26 * And Hey:
27 * Good ROcking Metal Altar for Chronical Sinners
30 #ifndef _futil_h
31 #define _futil_h
33 static char *SRCID_futil_h = "$Id$";
35 #ifdef HAVE_IDENT
36 #ident "@(#) futil.h 1.1 11/23/92"
37 #endif /* HAVE_IDENT */
38 #include <stdio.h>
39 #include "typedefs.h"
41 #ifdef CPLUSPLUS
42 extern "C" {
43 #endif
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) */
95 #ifdef CPLUSPLUS
97 #endif
99 #endif /* _futil_h */