Fixed std. error of estimated R-square
[pspp-builds.git] / src / case.h
index 7312aa9458942e9b6780e47b78476c56887ad46b..541a3e2ebdc9c2c677a67fdfcc301e2e4f9f61ce 100644 (file)
 
    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., 59 Temple Place - Suite 330, Boston, MA
-   02111-1307, USA. */
+   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+   02110-1301, USA. */
 
 #ifndef HEADER_CASE
 #define HEADER_CASE
 
 #include <stddef.h>
+#include <stdbool.h>
 #include "val.h"
 
 /* Opaque structure that represents a case.  Use accessor
@@ -56,6 +57,9 @@ CASE_INLINE void case_clone (struct ccase *, const struct ccase *);
 CASE_INLINE void case_move (struct ccase *, struct ccase *);
 CASE_INLINE void case_destroy (struct ccase *);
 
+void case_resize (struct ccase *, size_t old_cnt, size_t new_cnt);
+void case_swap (struct ccase *, struct ccase *);
+
 int case_try_create (struct ccase *, size_t value_cnt);
 int case_try_clone (struct ccase *, const struct ccase *);
 
@@ -69,10 +73,17 @@ CASE_INLINE void case_from_values (struct ccase *,
 
 CASE_INLINE const union value *case_data (const struct ccase *, size_t idx);
 CASE_INLINE double case_num (const struct ccase *, size_t idx);
-CASE_INLINE const char *case_str (const struct ccase *, size_t idx);
+CASE_INLINE const unsigned char *case_str (const struct ccase *, size_t idx);
 
 CASE_INLINE union value *case_data_rw (struct ccase *, size_t idx);
 
+struct variable;
+int case_compare (const struct ccase *, const struct ccase *,
+                  struct variable *const *, size_t var_cnt);
+int case_compare_2dict (const struct ccase *, const struct ccase *,
+                        struct variable *const *, struct variable *const *,
+                        size_t var_cnt);
+
 const union value *case_data_all (const struct ccase *);
 union value *case_data_all_rw (struct ccase *);
 
@@ -131,10 +142,10 @@ case_copy (struct ccase *dst, size_t dst_idx,
 
 static inline void
 case_to_values (const struct ccase *c, union value *output,
-                size_t output_size UNUSED
+                size_t output_size ) 
 {
   memcpy (output, c->case_data->values,
-          c->case_data->value_cnt * sizeof *output);
+          output_size * sizeof *output);
 }
 
 static inline void
@@ -159,7 +170,7 @@ case_num (const struct ccase *c, size_t idx)
   return c->case_data->values[idx].f;
 }
 
-static inline const char *
+static inline const unsigned char *
 case_str (const struct ccase *c, size_t idx)
 {
   return c->case_data->values[idx].s;