*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, 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.
}
}
+static void done_includes()
+{
+ int i;
+ for (i = 0; (i < nincl); i++)
+ {
+ sfree(incl[i]);
+ }
+ sfree(incl);
+ incl = NULL;
+ nincl = 0;
+}
+
static void add_define(const char *name, const char *value)
{
int i;
}
}
+static void done_defines()
+{
+ int i;
+ for (i = 0; (i < ndef); i++)
+ {
+ sfree(defs[i].name);
+ sfree(defs[i].def);
+ }
+ sfree(defs);
+ defs = NULL;
+ ndef = 0;
+}
+
/* Open the file to be processed. The handle variable holds internal
info for the cpp emulator. Return integer status */
int cpp_open_file(const char *filenm, gmx_cpp_t *handle, char **cppopts)
return eCPP_OK;
}
+void cpp_done()
+{
+ done_includes();
+ done_defines();
+}
+
/* Return a string containing the error message coresponding to status
variable */
char *cpp_error(gmx_cpp_t *handlep, int status)
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2008, The GROMACS development team.
- * Copyright (c) 2012, by the GROMACS development team, led by
+ * Copyright (c) 2012,2014, 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.
*/
int cpp_close_file(gmx_cpp_t *handlep);
+/* Clean up file static data structures
+
+ NOT THREAD SAFE
+ */
+void cpp_done();
+
/* Return a string containing the error message coresponding to status
variable.