https://github.com/nyuichi/xvect
super tiny vector library
https://github.com/nyuichi/xvect
Last synced: about 2 months ago
JSON representation
super tiny vector library
- Host: GitHub
- URL: https://github.com/nyuichi/xvect
- Owner: nyuichi
- License: bsd-2-clause
- Created: 2014-03-20T13:49:06.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2014-09-26T03:25:48.000Z (over 10 years ago)
- Last Synced: 2025-01-30T13:24:10.196Z (4 months ago)
- Language: C
- Homepage:
- Size: 211 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# xvect - super tiny extensible (and polymorphic) vector [](https://travis-ci.org/wasabiz/xvect)
- implemented as a ring buffer
- ok to locate an element by nagative number
- written in pure C99
- all components are in single header file# Usage
```c
typedef struct xvect xvect;static inline void xv_init(xvect *, size_t);
static inline void xv_destroy(xvect *);static inline size_t xv_size(xvect *);
static inline void xv_reserve(xvect *, size_t);
static inline void xv_shrink(xvect *, size_t);static inline void *xv_get(xvect *, size_t);
static inline void xv_set(xvect *, size_t, void *);static inline void xv_push(xvect *, void *);
static inline void *xv_pop(xvect *);static inline void *xv_shift(xvect *);
static inline void xv_unshift(xvect *, void *);static inline void xv_splice(xvect *, size_t, ptrdiff_t);
static inline void xv_insert(xvect *, size_t, void *);
```# License
This software is licensed under the 2-clause BSD license. See LICENSE for details.
# Auther
Yuichi Nishiwaki ([email protected])