Sort all includes in src/gromacs
[alexxy/gromacs.git] / src / gromacs / utility / cstringutil.h
index 6d8f94b4e7472dc27b5d5703360aa278437f75b0..9bd8e3b85e8d0ededf394c8cffbdb95793db4b59 100644 (file)
 #ifndef GMX_UTILITY_CSTRINGUTIL_H
 #define GMX_UTILITY_CSTRINGUTIL_H
 
+#include "gromacs/utility/gmx_header_config.h"
+
 #include <stdio.h>
 #include <time.h>
 
-#include "../legacyheaders/types/simple.h"
-
-#include "gmx_header_config.h"
-
-/* Suppress Cygwin compiler warnings from using newlib version of
- * ctype.h */
-#ifdef GMX_CYGWIN
-#include <ctype.h>
-
-#undef isdigit
-#undef isstring
-#undef isspace
-#undef isalnum
-#undef isalpha
-#undef ispunct
-#undef isxdigit
-#undef isupper
-#undef islower
-#undef toupper
-#undef tolower
-#endif
+#include "gromacs/utility/basedefinitions.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -79,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.
@@ -201,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