Apply clang-format to source tree
[alexxy/gromacs.git] / src / gromacs / fileio / xvgr.h
index e95fc543425725953ba987ac80a06606760c7c0f..f443ea14c0a7e424aea040e505c659f3210df591 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) 2010,2014,2015,2017,2018, by the GROMACS development team, led by
+ * Copyright (c) 2010,2014,2015,2017,2018,2019, 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.
@@ -50,27 +50,55 @@ struct gmx_output_env_t;
 /***************************************************
  *            XVGR   DEFINITIONS
  ***************************************************/
-enum {
-    elNone, elSolid, elDotted, elDashed,
-    elLongDashed, elDotDashed, elNR
+enum
+{
+    elNone,
+    elSolid,
+    elDotted,
+    elDashed,
+    elLongDashed,
+    elDotDashed,
+    elNR
 };
 /* xvgr line-styles */
 
-enum {
-    ecWhite, ecFrank, ecBlack = ecFrank,
-    ecRed, ecGreen, ecBlue, ecYellow, ecBrown, ecGray,
-    ecPurple, ecLightBlue, ecViolet, ecHolland, ecLila, ecDarkGray,
-    ecAquamarine, ecOlive, ecNR
+enum
+{
+    ecWhite,
+    ecFrank,
+    ecBlack = ecFrank,
+    ecRed,
+    ecGreen,
+    ecBlue,
+    ecYellow,
+    ecBrown,
+    ecGray,
+    ecPurple,
+    ecLightBlue,
+    ecViolet,
+    ecHolland,
+    ecLila,
+    ecDarkGray,
+    ecAquamarine,
+    ecOlive,
+    ecNR
 };
 /* xvgr line-colors */
 
-enum {
-    eppNone, eppColor, eppPattern, eppNR
+enum
+{
+    eppNone,
+    eppColor,
+    eppPattern,
+    eppNR
 };
 /* xvgr pattern type */
 
-enum {
-    evView, evWorld, evNR
+enum
+{
+    evView,
+    evWorld,
+    evNR
 };
 /* view type */
 
@@ -91,79 +119,90 @@ enum {
  * \4 : (deprecated) end symbol font
  */
 
-gmx_bool output_env_get_print_xvgr_codes(const struct gmx_output_env_t *oenv);
+gmx_bool output_env_get_print_xvgr_codes(const struct gmx_output_env_toenv);
 /* Returns if we should print xmgrace or xmgr codes */
 
-enum {
-    exvggtNONE, exvggtXNY, exvggtXYDY, exvggtXYDYDY, exvggtNR
+enum
+{
+    exvggtNONE,
+    exvggtXNY,
+    exvggtXYDY,
+    exvggtXYDYDY,
+    exvggtNR
 };
 
-void xvgr_header(FILE *fp, const char *title, const std::string &xaxis,
-                 const std::string &yaxis, int exvg_graph_type,
-                 const struct gmx_output_env_t *oenv);
+void xvgr_header(FILE*                          fp,
+                 const char*                    title,
+                 const std::string&             xaxis,
+                 const std::string&             yaxis,
+                 int                            exvg_graph_type,
+                 const struct gmx_output_env_t* oenv);
 /* In most cases you want to use xvgropen_type, which does the same thing
  * but takes a filename and opens it.
  */
 
-FILE *xvgropen_type(const char *fn, const char *title, const std::string &xaxis,
-                    const std::string &yaxis, int exvg_graph_type,
-                    const struct gmx_output_env_t *oenv);
+FILE* xvgropen_type(const char*                    fn,
+                    const char*                    title,
+                    const std::string&             xaxis,
+                    const std::string&             yaxis,
+                    int                            exvg_graph_type,
+                    const struct gmx_output_env_t* oenv);
 /* Open a file, and write a title, and axis-labels in Xvgr format
  * or write nothing when oenv specifies so.
  * The xvgr graph type enum is defined above.
  */
 
-FILE *xvgropen(const char *fn, const char *title, const std::string &xaxis,
-               const std::string &yaxis, const struct gmx_output_env_t *oenv);
+FILE* xvgropen(const char*                    fn,
+               const char*                    title,
+               const std::string&             xaxis,
+               const std::string&             yaxis,
+               const struct gmx_output_env_t* oenv);
 /* Calls xvgropen_type with graph type xvggtXNY. */
 
 /* Close xvgr file, and clean up internal file buffers correctly */
-void xvgrclose(FILE *fp);
+void xvgrclose(FILEfp);
 
-void xvgr_subtitle(FILE *out, const char *subtitle,
-                   const struct gmx_output_env_t *oenv);
+void xvgr_subtitle(FILE* out, const char* subtitle, const struct gmx_output_env_t* oenv);
 /* Set the subtitle in xvgr */
 
-void xvgr_view(FILE *out, real xmin, real ymin, real xmax, real ymax,
-               const struct gmx_output_env_t *oenv);
+void xvgr_view(FILE* out, real xmin, real ymin, real xmax, real ymax, const struct gmx_output_env_t* oenv);
 /* Set the view in xvgr */
 
-void xvgr_world(FILE *out, real xmin, real ymin, real xmax, real ymax,
-                const struct gmx_output_env_t *oenv);
+void xvgr_world(FILE* out, real xmin, real ymin, real xmax, real ymax, const struct gmx_output_env_t* oenv);
 /* Set the world in xvgr */
 
-void xvgrLegend(FILE                           *out,
-                const std::vector<std::string> &setNames,
-                const struct gmx_output_env_t  *oenv);
+void xvgrLegend(FILE* out, const std::vector<std::string>& setNames, const struct gmx_output_env_t* oenv);
 /* Make a legend box, and also modifies the view to make room for the legend */
 
-void xvgr_legend(FILE *out, int nsets, const char*const* setnames,
-                 const struct gmx_output_env_t *oenv);
+void xvgr_legend(FILE* out, int nsets, const char* const* setnames, const struct gmx_output_env_t* oenv);
 /* Make a legend box, and also modifies the view to make room for the legend */
 
-void xvgr_new_dataset(FILE *out,
-                      int nr_first, int nsets, const char **setnames,
-                      const struct gmx_output_env_t *oenv);
+void xvgr_new_dataset(FILE* out, int nr_first, int nsets, const char** setnames, const struct gmx_output_env_t* oenv);
 /* End the previous data set(s) and start new one(s).
     nr_first = the global set number of the first new set (or 0 if no legend)
     nsets = the number of sets (or 0 if no legends)
     setnames = the set names (or NULL if no legends)
  */
 
-void xvgr_line_props(FILE *out, int NrSet, int LineStyle, int LineColor,
-                     const struct gmx_output_env_t *oenv);
+void xvgr_line_props(FILE* out, int NrSet, int LineStyle, int LineColor, const struct gmx_output_env_t* oenv);
 /* Set xvgr line styles and colors */
 
-void xvgr_box(FILE *out,
-              int LocType,
-              real xmin, real ymin, real xmax, real ymax,
-              int LineStyle, int LineWidth, int LineColor,
-              int BoxFill, int BoxColor, int BoxPattern,
-              const struct gmx_output_env_t *oenv);
+void xvgr_box(FILE*                          out,
+              int                            LocType,
+              real                           xmin,
+              real                           ymin,
+              real                           xmax,
+              real                           ymax,
+              int                            LineStyle,
+              int                            LineWidth,
+              int                            LineColor,
+              int                            BoxFill,
+              int                            BoxColor,
+              int                            BoxPattern,
+              const struct gmx_output_env_t* oenv);
 /* Make a box */
 
-int read_xvg_legend(const char *fn, double ***y, int *ny,
-                    char **subtitle, char ***legend);
+int read_xvg_legend(const char* fn, double*** y, int* ny, char** subtitle, char*** legend);
 /* Read an xvg file for post processing. The number of rows is returned
  * fn is the filename, y is a pointer to a 2D array (to be allocated by
  * the routine) ny is the number of columns (including X if appropriate).
@@ -173,11 +212,16 @@ int read_xvg_legend(const char *fn, double ***y, int *ny,
  * 0 is the first y legend, the legend string will be NULL when not present.
  */
 
-int read_xvg(const char *fn, double ***y, int *ny);
+int read_xvg(const char* fn, double*** y, int* ny);
 /* As read_xvg_legend, but does not read legends. */
 
-void write_xvg(const char *fn, const char *title, int nx, int ny, real **y,
-               const char** leg, const struct gmx_output_env_t *oenv);
+void write_xvg(const char*                    fn,
+               const char*                    title,
+               int                            nx,
+               int                            ny,
+               real**                         y,
+               const char**                   leg,
+               const struct gmx_output_env_t* oenv);
 /* Write a two D array (y) of dimensions nx rows times
  * ny columns to a file. If leg != NULL it will be written too.
  */
@@ -186,10 +230,15 @@ void write_xvg(const char *fn, const char *title, int nx, int ny, real **y,
 /* This function reads ascii (xvg) files and extracts the data sets to a
  * two dimensional array which is returned.
  */
-real **read_xvg_time(const char *fn,
-                     gmx_bool bHaveT,
-                     gmx_bool bTB, real tb,
-                     gmx_bool bTE, real te,
-                     int nsets_in, int *nset, int *nval,
-                     real *dt, real **t);
+real** read_xvg_time(const char* fn,
+                     gmx_bool    bHaveT,
+                     gmx_bool    bTB,
+                     real        tb,
+                     gmx_bool    bTE,
+                     real        te,
+                     int         nsets_in,
+                     int*        nset,
+                     int*        nval,
+                     real*       dt,
+                     real**      t);
 #endif