#include <string.h>
#include "xalloc.h"
\f
+/* Maximum length of a "short" string, that is represented in
+ "union value" without a separate pointer.
+
+ This is an implementation detail of the "union value" code.
+ There is little reason for client code to use it. */
#define MAX_SHORT_STRING 8
/* A numeric or string value.
void value_set_missing (union value *, int width);
int value_compare_3way (const union value *, const union value *, int width);
bool value_equal (const union value *, const union value *, int width);
-size_t value_hash (const union value *, int width, unsigned int basis);
+unsigned int value_hash (const union value *, int width, unsigned int basis);
bool value_is_resizable (const union value *, int old_width, int new_width);
bool value_needs_resize (int old_width, int new_width);
void value_resize (union value *, int old_width, int new_width);
+static inline void value_swap (union value *, union value *);
+
struct pool;
void value_init_pool (struct pool *, union value *, int width);
void value_resize_pool (struct pool *, union value *,
memcpy (dst->long_string, src->long_string, width);
}
+/* Exchanges the contents of A and B. */
+static inline void
+value_swap (union value *a, union value *b)
+{
+ union value tmp = *a;
+ *a = *b;
+ *b = tmp;
+}
+
#endif /* data/value.h */