Merge branch release-5-1 into release-2016
[alexxy/gromacs.git] / src / gromacs / commandline / filenm.cpp
index b7f7d8b5a06e8e6c962ab8f69dbfe422880f96f4..f8b5e55282807846ec925b42e2ab0150194ee19b 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 #define IS_SET(fn) ((fn.flag &ffSET) != 0)
 #define IS_OPT(fn) ((fn.flag &ffOPT) != 0)
 
+const t_filenm *getFilenm(const char *opt, int nfile, const t_filenm fnm[])
+{
+    int i;
+
+    for (i = 0; (i < nfile); i++)
+    {
+        if (strcmp(opt, fnm[i].opt) == 0)
+        {
+            return &fnm[i];
+        }
+    }
+
+    return NULL;
+}
+
 const char *opt2fn(const char *opt, int nfile, const t_filenm fnm[])
 {
     int i;