Improve VECTOR implementation.
[pspp-builds.git] / src / data / dictionary.c
index 0dadb959d371d5d0624f4dca21ff5d7c54d0a4ed..ca1a286c4d135ad20345fabe11484242bac3d9af 100644 (file)
@@ -1137,6 +1137,18 @@ dict_create_vector (struct dictionary *d,
     return false;
 }
 
+/* Creates in D a vector named NAME that contains the CNT
+   variables in VAR.  A vector named NAME must not already exist
+   in D. */
+void
+dict_create_vector_assert (struct dictionary *d,
+                           const char *name,
+                           struct variable **var, size_t cnt)
+{
+  assert (dict_lookup_vector (d, name) == NULL);
+  dict_create_vector (d, name, var, cnt);
+}
+
 /* Returns the vector in D with index IDX, which must be less
    than dict_get_vector_cnt (D). */
 const struct vector *