changed reading hint
[gromacs/adressmacs.git] / include / filenm.h
blob98192c7a0797f415f4d1c4930301b1984e7ad42e
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 _filenm_h
31 #define _filenm_h
33 static char *SRCID_filenm_h = "$Id$";
35 #ifdef HAVE_IDENT
36 #ident "@(#) filenm.h 1.14 2/2/97"
37 #endif /* HAVE_IDENT */
39 #ifdef CPLUSPLUS
40 extern "C" {
41 #endif
43 #include "futil.h"
45 void set_default_file_name(char *name);
46 /* Set the default file name for all file types to name */
48 extern char *ftp2ext(int ftp);
49 /* Return extension for filetype */
51 extern char *ftp2desc(int ftp);
52 /* Return description for file type */
54 extern char *ftp2defnm(int ftp);
55 /* Return default file name for file type */
57 extern char *ftp2ftype(int ftp);
58 /* Return Binary or ASCII depending on file type */
60 extern void pr_def(FILE *fp,int ftp);
61 /* Print definitions for filename ftp */
63 extern void pr_defs(FILE *fp);
64 /* Print definitions for all filename */
66 extern void pr_fns(FILE *fp,int nf,t_filenm tfn[]);
67 /* Print nf file names and types */
69 extern void pr_fopts(FILE *fp,int nf,t_filenm tfn[]);
70 /* prints file options in tcsh 'complete' format */
72 extern void parse_file_args(int *argc,char *argv[],int nf,t_filenm fnm[],
73 bool bKeep);
74 /* Parse command line for file names. When bKeep is set args are
75 * not removed from argv.
78 extern char *opt2fn(char *opt,int nfile,t_filenm fnm[]);
79 /* Return the filenm belonging top cmd-line option opt, or NULL when
80 * no such option.
83 #define opt2FILE(opt,nfile,fnm,mode) ffopen(opt2fn(opt,nfile,fnm),mode)
84 /* Return a file pointer from the filename (see above) */
86 extern int fn2ftp(char *fn);
87 /* Return the filetype corrsponding to filename */
89 extern char *ftp2fn(int ftp,int nfile,t_filenm fnm[]);
90 /* Return the first file name with type ftp, or NULL when none found. */
92 extern char *ftp2filter(int ftp);
93 /* Return a file extension filter for file type */
95 #define ftp2FILE(ftp,nfile,fnm,mode) ffopen(ftp2fn(ftp,nfile,fnm),mode)
96 /* Return a file pointer from the filename (see above) */
98 extern bool ftp2bSet(int ftp,int nfile,t_filenm fnm[]);
99 /* Return TRUE when this file type has been found on the cmd-line */
101 extern bool opt2bSet(char *opt,int nfile,t_filenm fnm[]);
102 /* Return TRUE when this option has been found on the cmd-line */
104 extern char *opt2fn_null(char *opt,int nfile,t_filenm fnm[]);
105 /* Return the filenm belonging top cmd-line option opt, or NULL when
106 * no such option.
107 * Also return NULL when opt is optional and option is not set.
110 extern char *ftp2fn_null(int ftp,int nfile,t_filenm fnm[]);
111 /* Return the first file name with type ftp, or NULL when none found.
112 * Also return NULL when ftp is optional and option is not set.
115 extern bool is_optional(t_filenm *fnm);
116 /* Return whether or not this filenm is optional */
118 #ifdef CPLUSPLUS
120 #endif
122 #endif /* _filenm_h */