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_filenm_h = "$Id$";
40 #ident "@(#) filenm.h 1.14 2/2/97"
41 #endif /* HAVE_IDENT */
49 void set_default_file_name(char *name);
50 /* Set the default file name for all file types to name */
52 extern char *ftp2ext(int ftp);
53 /* Return extension for filetype */
55 extern char *ftp2desc(int ftp);
56 /* Return description for file type */
58 extern char *ftp2defnm(int ftp);
59 /* Return default file name for file type */
61 extern char *ftp2ftype(int ftp);
62 /* Return Binary or ASCII depending on file type */
64 extern void pr_def(FILE *fp,int ftp);
65 /* Print definitions for filename ftp */
67 extern void pr_defs(FILE *fp);
68 /* Print definitions for all filename */
70 extern void pr_fns(FILE *fp,int nf,t_filenm tfn[]);
71 /* Print nf file names and types */
73 extern void pr_fopts(FILE *fp,int nf,t_filenm tfn[]);
74 /* prints file options in tcsh 'complete' format */
76 extern void parse_file_args(int *argc,char *argv[],int nf,t_filenm fnm[],
78 /* Parse command line for file names. When bKeep is set args are
79 * not removed from argv.
82 extern char *opt2fn(char *opt,int nfile,t_filenm fnm[]);
83 /* Return the filenm belonging top cmd-line option opt, or NULL when
87 #define opt2FILE(opt,nfile,fnm,mode) ffopen(opt2fn(opt,nfile,fnm),mode)
88 /* Return a file pointer from the filename (see above) */
90 extern int fn2ftp(char *fn);
91 /* Return the filetype corrsponding to filename */
93 extern char *ftp2fn(int ftp,int nfile,t_filenm fnm[]);
94 /* Return the first file name with type ftp, or NULL when none found. */
96 extern char *ftp2filter(int ftp);
97 /* Return a file extension filter for file type */
99 #define ftp2FILE(ftp,nfile,fnm,mode) ffopen(ftp2fn(ftp,nfile,fnm),mode)
100 /* Return a file pointer from the filename (see above) */
102 extern bool ftp2bSet(int ftp,int nfile,t_filenm fnm[]);
103 /* Return TRUE when this file type has been found on the cmd-line */
105 extern bool opt2bSet(char *opt,int nfile,t_filenm fnm[]);
106 /* Return TRUE when this option has been found on the cmd-line */
108 extern char *opt2fn_null(char *opt,int nfile,t_filenm fnm[]);
109 /* Return the filenm belonging top cmd-line option opt, or NULL when
111 * Also return NULL when opt is optional and option is not set.
114 extern char *ftp2fn_null(int ftp,int nfile,t_filenm fnm[]);
115 /* Return the first file name with type ftp, or NULL when none found.
116 * Also return NULL when ftp is optional and option is not set.
119 extern bool is_optional(t_filenm *fnm);
120 /* Return whether or not this filenm is optional */
122 extern bool is_output(t_filenm *fnm);
123 /* Return whether or not this filenm is output */
125 extern bool is_set(t_filenm *fnm);
126 /* Return whether or not this filenm is set */
132 #endif /* _filenm_h */