4 * This source code is part of
8 * GROningen MAchine for Chemical Simulations
12 * Copyright (c) 1991-2001
13 * BIOSON Research Institute, Dept. of Biophysical Chemistry
14 * University of Groningen, The Netherlands
16 * This program is free software; you can redistribute it and/or
17 * modify it under the terms of the GNU General Public License
18 * as published by the Free Software Foundation; either version 2
19 * of the License, or (at your option) any later version.
21 * If you want to redistribute modifications, please consider that
22 * scientific software is very special. Version control is crucial -
23 * bugs must be traceable. We will be happy to consider code for
24 * inclusion in the official distribution, but derived work must not
25 * be called official GROMACS. Details are found in the README & COPYING
26 * files - if they are missing, get the official version at www.gromacs.org.
28 * To help us fund GROMACS development, we humbly ask that you cite
29 * the papers on the package - you can find them in the top README file.
31 * Do check out http://www.gromacs.org , or mail us at gromacs@gromacs.org .
34 * Giving Russians Opium May Alter Current Situation
40 static char *SRCID_filenm_h = "$Id$";
46 #ident "@(#) filenm.h 1.14 2/2/97"
47 #endif /* HAVE_IDENT */
55 void set_default_file_name(char *name);
56 /* Set the default file name for all file types to name */
58 extern char *ftp2ext(int ftp);
59 /* Return extension for filetype */
61 extern char *ftp2desc(int ftp);
62 /* Return description for file type */
64 extern char *ftp2defnm(int ftp);
65 /* Return default file name for file type */
67 extern char *ftp2ftype(int ftp);
68 /* Return Binary or ASCII depending on file type */
70 extern void pr_def(FILE *fp,int ftp);
71 /* Print definitions for filename ftp */
73 extern void pr_defs(FILE *fp);
74 /* Print definitions for all filename */
76 extern void pr_fns(FILE *fp,int nf,t_filenm tfn[]);
77 /* Print nf file names and types */
79 extern void pr_fopts(FILE *fp,int nf,t_filenm tfn[]);
80 /* prints file options in tcsh 'complete' format */
82 extern void parse_file_args(int *argc,char *argv[],int nf,t_filenm fnm[],
84 /* Parse command line for file names. When bKeep is set args are
85 * not removed from argv.
88 extern char *opt2fn(char *opt,int nfile,t_filenm fnm[]);
89 /* Return the filenm belonging top cmd-line option opt, or NULL when
93 #define opt2FILE(opt,nfile,fnm,mode) ffopen(opt2fn(opt,nfile,fnm),mode)
94 /* Return a file pointer from the filename (see above) */
96 extern int fn2ftp(char *fn);
97 /* Return the filetype corrsponding to filename */
99 extern char *ftp2fn(int ftp,int nfile,t_filenm fnm[]);
100 /* Return the first file name with type ftp, or NULL when none found. */
102 extern char *ftp2filter(int ftp);
103 /* Return a file extension filter for file type */
105 #define ftp2FILE(ftp,nfile,fnm,mode) ffopen(ftp2fn(ftp,nfile,fnm),mode)
106 /* Return a file pointer from the filename (see above) */
108 extern bool ftp2bSet(int ftp,int nfile,t_filenm fnm[]);
109 /* Return TRUE when this file type has been found on the cmd-line */
111 extern bool opt2bSet(char *opt,int nfile,t_filenm fnm[]);
112 /* Return TRUE when this option has been found on the cmd-line */
114 extern char *opt2fn_null(char *opt,int nfile,t_filenm fnm[]);
115 /* Return the filenm belonging top cmd-line option opt, or NULL when
117 * Also return NULL when opt is optional and option is not set.
120 extern char *ftp2fn_null(int ftp,int nfile,t_filenm fnm[]);
121 /* Return the first file name with type ftp, or NULL when none found.
122 * Also return NULL when ftp is optional and option is not set.
125 extern bool is_optional(t_filenm *fnm);
126 /* Return whether or not this filenm is optional */
128 extern bool is_output(t_filenm *fnm);
129 /* Return whether or not this filenm is output */
131 extern bool is_set(t_filenm *fnm);
132 /* Return whether or not this filenm is set */
138 #endif /* _filenm_h */