work on docs
[pspp] / src / libpspp / misc.h
index 3b02515709ca9969c8d67eab5c9c2210e4822d1e..1698297dc4cc51a2694f55d831c740d4eb601694 100644 (file)
@@ -17,6 +17,7 @@
 #if !libpspp_misc_h
 #define libpspp_misc_h 1
 
+#include <stddef.h>
 #include <float.h>
 #include <math.h>
 
@@ -77,4 +78,25 @@ maximize (double *dest, double src)
     *dest = src;
 }
 
+
+/* Set *DEST to the lower of *DEST and SRC */
+static inline void
+minimize_int (int *dest, int src)
+{
+  if (src < *dest)
+    *dest = src;
+}
+
+
+/* Set *DEST to the greater of *DEST and SRC */
+static inline void
+maximize_int (int *dest, int src)
+{
+  if (src > *dest)
+    *dest = src;
+}
+
+int c_dtoastr (char *buf, size_t bufsize, int flags, int width, double x);
+
+
 #endif /* libpspp/misc.h */