Make dictionary compacting functions a little more general.
[pspp] / src / data / value.h
index 1c2a19cdb8977d3bbf911bd1d7289978a25bced8..17f60bbd01bc40dd908dd2114fa3a6c983439968 100644 (file)
 /* Values. */
 
 /* Max length of a short string value, generally 8 chars. */
-#define MAX_SHORT_STRING ((SIZEOF_DOUBLE)>=8 ? ((SIZEOF_DOUBLE)+1)/2*2 : 8)
-#define MIN_LONG_STRING (MAX_SHORT_STRING+1)
+#define MAX_SHORT_STRING ( (SIZEOF_DOUBLE)>=8 ? (SIZEOF_DOUBLE + 1)/2 * 2 : 8 )
+
+#define MIN_LONG_STRING (MAX_SHORT_STRING + 1)
 
 /* Max string length. */
-#define MAX_STRING 255
-
-/* FYI: It is a bad situation if sizeof(flt64) < MAX_SHORT_STRING:
-   then short string missing values can be truncated in system files
-   because there's only room for as many characters as can fit in a
-   flt64. */
-#if MAX_SHORT_STRING > SHORT_NAME_LEN
-#error MAX_SHORT_STRING must be less than or equal to SHORT_NAME_LEN.
-#endif
+#define MAX_LONG_STRING 255
+
+/* This nonsense is required for SPSS compatibility */
+#define EFFECTIVE_LONG_STRING_LENGTH (MAX_LONG_STRING - 3)
+
+#define MAX_VERY_LONG_STRING 32767
+
+#define MAX_STRING MAX_VERY_LONG_STRING
+
 
 /* Special values. */
 #define SYSMIS (-DBL_MAX)