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$";
36 #ident "@(#) filenm.h 1.14 2/2/97"
37 #endif /* HAVE_IDENT */
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
[],
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
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
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 */
122 #endif /* _filenm_h */