Merge release-5-0 into master
[alexxy/gromacs.git] / src / gromacs / utility / cstringutil.h
index 8cba1a370ba72e093654ecad493318788812a77b..a8b7460e4a7f5a39d08e19bdaced6b33c2a84f73 100644 (file)
@@ -46,7 +46,7 @@
 #include <stdio.h>
 #include <time.h>
 
-#include "../legacyheaders/types/simple.h"
+#include "basedefinitions.h"
 
 #include "gmx_header_config.h"
 
@@ -61,6 +61,8 @@ extern "C" {
 #define CONTINUE    '\\'
 /** Comment sign to use. */
 #define COMMENTSIGN ';'
+/** Standard size for char* string buffers. */
+#define STRLEN 4096
 
 /*! \brief
  * Strip trailing spaces and if s ends with a ::CONTINUE remove that too.
@@ -183,6 +185,18 @@ char *wrap_lines(const char *buf, int line_width, int indent,
  */
 gmx_int64_t str_to_int64_t(const char *str, char **endptr);
 
+/** Minimum size of buffer to pass to gmx_step_str(). */
+#define STEPSTRSIZE 22
+
+/*! \brief
+ * Prints a gmx_int64_t value in buf and returns the pointer to buf.
+ *
+ * buf should be large enough to contain i: STEPSTRSIZE (22) chars.
+ * When multiple gmx_int64_t values are printed in the same printf call,
+ * be sure to call gmx_step_str with different buffers.
+ */
+char *gmx_step_str(gmx_int64_t i, char *buf);
+
 #ifdef GMX_NATIVE_WINDOWS
 #define snprintf _snprintf
 #endif