author | Lars Hjemli <hjemli@gmail.com> | 2011-02-19 13:00:56 (UTC) |
---|---|---|
committer | Lars Hjemli <hjemli@gmail.com> | 2011-02-19 13:00:59 (UTC) |
commit | e66a16cebcdac53b63e77876acef1ca9e4877038 (patch) (unidiff) | |
tree | 839123e66853c4a80c305a3a1c13295fe5e6acc9 /vector.h | |
parent | 286c4c0a1d7085afdc8d9ddba86da4ed9f2f7400 (diff) | |
parent | c2680325f68192368d32f26458fea9cfb50df6e5 (diff) | |
download | cgit-e66a16cebcdac53b63e77876acef1ca9e4877038.zip cgit-e66a16cebcdac53b63e77876acef1ca9e4877038.tar.gz cgit-e66a16cebcdac53b63e77876acef1ca9e4877038.tar.bz2 |
Merge branch 'lh/improve-range-search'
* lh/improve-range-search:
html.c: use '+' to escape spaces in urls
ui-log.c: improve handling of range-search argument
Add vector utility functions
-rw-r--r-- | vector.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/vector.h b/vector.h new file mode 100644 index 0000000..c64eb1f --- a/dev/null +++ b/vector.h | |||
@@ -0,0 +1,17 @@ | |||
1 | #ifndef CGIT_VECTOR_H | ||
2 | #define CGIT_VECTOR_H | ||
3 | |||
4 | #include <stdlib.h> | ||
5 | |||
6 | struct vector { | ||
7 | size_t size; | ||
8 | size_t count; | ||
9 | size_t alloc; | ||
10 | void *data; | ||
11 | }; | ||
12 | |||
13 | #define VECTOR_INIT(type) {sizeof(type), 0, 0, NULL} | ||
14 | |||
15 | int vector_push(struct vector *vec, const void *data, int gently); | ||
16 | |||
17 | #endif /* CGIT_VECTOR_H */ | ||