X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fdata%2Fvec.h;fp=src%2Fdata%2Fvec.h;h=501a11f4038cfb153a5609e58cb722391992a98b;hb=52c54183e360053b1845e46cb96cd44a0cf96040;hp=0000000000000000000000000000000000000000;hpb=2ca3267c1110bbff675c560b19d02defb96ee2f9;p=pspp diff --git a/src/data/vec.h b/src/data/vec.h new file mode 100644 index 0000000000..501a11f403 --- /dev/null +++ b/src/data/vec.h @@ -0,0 +1,47 @@ +/* PSPP - a program for statistical analysis. + Copyright (C) 2013 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 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. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#ifndef DATA_VEC_H +#define DATA_VEC_H 1 + +struct vec; + +struct vec *vec_new (int width); + +struct vec *vec_ref (const struct vec *); +void vec_unref (struct vec *); + +int vec_width (const struct vec *); +casenumber vec_count (const struct vec *); + +void vec_get (const struct vec *, casenumber, union value *); + +struct vec *vec_put (struct vec *, casenumber, const union value *); +struct vec *vec_insert (struct vec *, casenumber before, + const union value *); +struct vec *vec_delete (struct vec *, casenumber start, casenumber n); + +struct vec *vec_head (struct vec *, casenumber n); +struct vec *vec_tail (struct vec *, casenumber n); + +struct vec *vec_delete_head (struct vec *, casenumber n); +struct vec *vec_delete_tail (struct vec *, casenumber n); +struct vec *vec_range (struct vec *, casenumber first, casenumber last); + +struct pxd_object *vec_save (const struct vec *, struct pxd *); +struct vec *vec_load (struct pxd_object *, const struct pxd *); + +#endif /* data/vec.h */