X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fdata%2Fvalue.h;h=118e6cd815fe012665392eeabc0b704560b52529;hb=ce16a4a594e7ddfc277afc4abb7faaeb1a03d233;hp=d3754d6c9875147c4adbc34c650f2f7e813afcae;hpb=480a0746507ce73d26f528b56dc3ed80195096e0;p=pspp
diff --git a/src/data/value.h b/src/data/value.h
index d3754d6c98..118e6cd815 100644
--- a/src/data/value.h
+++ b/src/data/value.h
@@ -1,20 +1,18 @@
-/* PSPP - computes sample statistics.
+/* PSPP - a program for statistical analysis.
Copyright (C) 1997-9, 2000 Free Software Foundation, Inc.
- This program is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License as
- published by the Free Software Foundation; either version 2 of the
- License, or (at your option) any later version.
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
- This program is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- 02110-1301, USA. */
+ along with this program. If not, see . */
#if !value_h
#define value_h 1
@@ -22,6 +20,7 @@
#include
#include
#include "minmax.h"
+#include
/* Values. */
@@ -37,6 +36,14 @@
#define LOWEST second_lowest_value
#define HIGHEST DBL_MAX
+/* Number of "union value"s required for a variable of the given
+ WIDTH. */
+static inline size_t
+value_cnt_from_width (int width)
+{
+ return width == 0 ? 1 : DIV_RND_UP (width, MAX_SHORT_STRING);
+}
+
/* A numeric or short string value.
Multiple consecutive values represent a long string. */
union value
@@ -46,7 +53,12 @@ union value
};
union value *value_dup (const union value *, int width);
+union value *value_create (int width);
+
int compare_values (const union value *, const union value *, int width);
unsigned hash_value (const union value *, int width);
+void value_copy (union value *, const union value *, int width);
+void value_set_missing (union value *, int width);
+
#endif /* !value.h */