treewide: Replace <name>_cnt by n_<name>s and <name>_cap by allocated_<name>.
[pspp] / src / data / vector.h
index 18ac496719e0e2f69ab26c93cb206536d41e877c..b586421c8273c78f60be32a3fd32c6ce040a5713 100644 (file)
@@ -1,41 +1,40 @@
-/* PSPP - computes sample statistics.
-   Copyright (C) 2006  Free Software Foundation, Inc.
-   Written by Ben Pfaff <blp@gnu.org>.
+/* PSPP - a program for statistical analysis.
+   Copyright (C) 2006, 2010, 2011  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 <http://www.gnu.org/licenses/>. */
 
-#ifndef DATA_VECTOR_H 
+#ifndef DATA_VECTOR_H
 #define DATA_VECTOR_H 1
 
 #include <stddef.h>
-#include <data/variable.h>
+#include "data/variable.h"
 
 struct dictionary;
 
 struct vector *vector_create (const char *name,
-                              struct variable **var, size_t var_cnt);
+                              struct variable **var, size_t n_vars);
 struct vector *vector_clone (const struct vector *old,
                              const struct dictionary *old_dict,
                              const struct dictionary *new_dict);
 void vector_destroy (struct vector *);
 
 const char *vector_get_name (const struct vector *);
-enum var_type vector_get_type (const struct vector *);
+enum val_type vector_get_type (const struct vector *);
 struct variable *vector_get_var (const struct vector *, size_t idx);
-size_t vector_get_var_cnt (const struct vector *);
+size_t vector_get_n_vars (const struct vector *);
+
+bool vector_is_valid_name (const char *name, bool issue_error);
 
 int compare_vector_ptrs_by_name (const void *a_, const void *b_);