Added dummy2 parameters generation routine.
[gromacs.git] / include / futil.h
blobdbc617859d9d93ac6aee3f1ec73af3d849b29c7a
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 3.1
11 * Copyright (c) 1991-2001, University of Groningen, The Netherlands
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
17 * If you want to redistribute modifications, please consider that
18 * scientific software is very special. Version control is crucial -
19 * bugs must be traceable. We will be happy to consider code for
20 * inclusion in the official distribution, but derived work must not
21 * be called official GROMACS. Details are found in the README & COPYING
22 * files - if they are missing, get the official version at www.gromacs.org.
24 * To help us fund GROMACS development, we humbly ask that you cite
25 * the papers on the package - you can find them in the top README file.
27 * For more info, check our website at http://www.gromacs.org
29 * And Hey:
30 * Grunge ROck MAChoS
33 #ifndef _futil_h
34 #define _futil_h
36 static char *SRCID_futil_h = "$Id$";
37 #ifdef HAVE_CONFIG_H
38 #include <config.h>
39 #endif
41 #ifdef HAVE_IDENT
42 #ident "@(#) futil.h 1.1 11/23/92"
43 #endif /* HAVE_IDENT */
44 #include <stdio.h>
45 #include "typedefs.h"
47 #ifdef CPLUSPLUS
48 extern "C" {
49 #endif
51 extern void no_buffers(void);
52 /* Turn off buffering of files (which is default) for debugging purposes */
54 extern bool fexist(char *fname);
55 /* Return TRUE when fname exists, FALSE otherwise */
57 extern bool eof(FILE *fp);
58 /* Return TRUE on end-of-file, FALSE otherwise */
60 extern bool is_pipe(FILE *fp);
61 /* Check whether the file (opened by ffopen) is a pipe */
63 extern char *backup_fn(char *file);
64 /* Return a backup name for file (name with # before and after) */
66 extern FILE *ffopen(char *file,char *mode);
67 /* Return a valid file pointer when succesfull, exits otherwise
68 * If the file is in compressed format, open a pipe which uncompresses
69 * the file! Therefore, files must be closed with ffclose (see below)
72 extern void ffclose(FILE *fp);
73 /* Close files or pipes */
75 #define fclose ffclose
77 extern void frewind(FILE *fp);
78 /* Does not rewind pipes, but does so for normal files */
80 #define rewind frewind
82 bool is_pipe(FILE *fp);
84 extern FILE *uncompress(char *fn,char *mode);
85 extern FILE *gunzip(char *fn,char *mode);
86 /* Open a pipe to uncompress or unzip files. Must be closed with pclose */
88 extern char *libfn(char *file);
90 extern FILE *libopen(char *file);
91 /* Open a library file for reading. This looks in the current directory
92 * first, and then in the library directory. If the file is not found,
93 * it terminates with a fatal_error
96 extern bool get_libdir(char *libdir);
98 extern char *low_libfn(char *file,bool bFatal);
100 extern FILE *low_libopen(char *file,bool bFatal);
101 /* The same as the above, but does not terminate if (!bFatal) */
103 /* Create unique name for temp file (wrapper around mkstemp).
104 * Buf should be at least 7 bytes long
106 extern void gmx_tmpnam(char *buf);
108 #ifdef CPLUSPLUS
110 #endif
112 #endif /* _futil_h */