+
+
+/* Resize the cases in the casefile, by inserting N_VALUES into every
+ one of them at the position immediately preceeding WHERE.
+*/
+gboolean
+psppire_case_file_insert_values (PsppireCaseFile *cf,
+ gint n_values, gint where)
+{
+ g_return_val_if_fail (cf, FALSE);
+ g_return_val_if_fail (cf->accessible, FALSE);
+
+ if ( n_values == 0 )
+ return FALSE;
+
+ g_assert (n_values > 0);
+
+ if ( ! cf->datasheet )
+ cf->datasheet = datasheet_create (NULL);
+
+ {
+ union value *values = xcalloc (n_values, sizeof *values);
+ datasheet_insert_columns (cf->datasheet, values, n_values, where);
+ free (values);
+ }
+
+ return TRUE;
+}
+
+
+/* Fills C with the CASENUMth case.
+ Returns true on success, false otherwise.
+ */
+gboolean
+psppire_case_file_get_case (const PsppireCaseFile *cf, casenumber casenum,
+ struct ccase *c)
+{
+ g_return_val_if_fail (cf, FALSE);
+ g_return_val_if_fail (cf->datasheet, FALSE);
+
+ return datasheet_get_row (cf->datasheet, casenum, c);
+}
+
+
+
+struct casereader *
+psppire_case_file_make_reader (PsppireCaseFile *cf)
+{
+ struct casereader *r = datasheet_make_reader (cf->datasheet);
+ cf->accessible = FALSE;
+ return r;
+}
+