Displaying 7 results from an estimated 7 matches for "nbdkit_vector_h".
2020 Apr 15
1
Re: [PATCH nbdkit 1/9] common: Add a generic implementation of vectors.
...in
> + * use-cases we consider: lists of strings (either with a defined
> + * length, or NULL-terminated), and lists of numbers. It is generic
> + * so could be used for lists of anything (eg. structs) where being
> + * able to append easily is important.
> + */
> +
> +#ifndef NBDKIT_VECTOR_H
> +#define NBDKIT_VECTOR_H
> +
> +#include <assert.h>
> +
> +#define DEFINE_VECTOR_TYPE(name, type) \
> + struct name { \
> + type *ptr; /* Pointer to array of ite...
2020 Apr 15
0
[PATCH nbdkit 1/9] common: Add a generic implementation of vectors.
...ppendable vector. There are two main
+ * use-cases we consider: lists of strings (either with a defined
+ * length, or NULL-terminated), and lists of numbers. It is generic
+ * so could be used for lists of anything (eg. structs) where being
+ * able to append easily is important.
+ */
+
+#ifndef NBDKIT_VECTOR_H
+#define NBDKIT_VECTOR_H
+
+#include <assert.h>
+
+#define DEFINE_VECTOR_TYPE(name, type) \
+ struct name { \
+ type *ptr; /* Pointer to array of items. */ \
+ size_t size;...
2020 Oct 27
0
[PATCH libnbd 1/5] common/utils: Copy simple vector library from nbdkit.
...nsively inserted. There are two main use-cases we
+ * consider: lists of strings (either with a defined length, or
+ * NULL-terminated), and lists of numbers. It is generic so could be
+ * used for lists of anything (eg. structs) where being able to append
+ * easily is important.
+ */
+
+#ifndef NBDKIT_VECTOR_H
+#define NBDKIT_VECTOR_H
+
+#include <assert.h>
+#include <string.h>
+
+/* Use of this macro defines a new type called ‘name’ containing an
+ * extensible vector of ‘type’ elements. For example:
+ *
+ * DEFINE_VECTOR_TYPE(string_vector, char *)
+ *
+ * defines a new type called ‘stri...
2020 Apr 19
0
[PATCH nbdkit 2/2] Add insert function and use the new vector library in several places.
...nsively inserted. There are two main use-cases we
+ * consider: lists of strings (either with a defined length, or
+ * NULL-terminated), and lists of numbers. It is generic so could be
+ * used for lists of anything (eg. structs) where being able to append
+ * easily is important.
*/
#ifndef NBDKIT_VECTOR_H
#define NBDKIT_VECTOR_H
#include <assert.h>
+#include <string.h>
#define DEFINE_VECTOR_TYPE(name, type) \
struct name { \
@@ -55,15 +57,23 @@
return generic_vector_extend ((struct gen...
2020 Apr 19
2
[PATCH nbdkit 1/2] vddk: Use new vector library to allocate the argv list.
---
plugins/vddk/vddk.c | 41 +++++++++++++++++++++++++----------------
TODO | 1 -
2 files changed, 25 insertions(+), 17 deletions(-)
diff --git a/plugins/vddk/vddk.c b/plugins/vddk/vddk.c
index 87c0d146..d1a3015f 100644
--- a/plugins/vddk/vddk.c
+++ b/plugins/vddk/vddk.c
@@ -51,6 +51,7 @@
#include "isaligned.h"
#include "minmax.h"
#include
2020 Apr 15
18
[PATCH nbdkit 0/9] Generic vector, and pass $nbdkit_stdio_safe to shell scripts.
This was a rather longer trip around the houses than I anticipated!
The basic purpose of the patch series is to set $nbdkit_stdio_safe to
"0" or "1" in sh and eval plugin scripts.
To do that, I ended up adding a nicer way to manipulate environ lists,
and to do that, I ended up adding a whole generic vector
implementation which is applicable in a lot of different places.
2020 Oct 27
6
[PATCH libnbd 0/5] info: --map: Coalesce adjacent extents of the same type.
This adds coalescing of adjacent extents of the same type, as
mentioned by Eric Blake in the commit message here:
https://github.com/libguestfs/libnbd/commit/46072f6611f80245846a445766da071e457b00cd
The patch series is rather long because it detours through adding the
<vector.h> library from nbdkit into libnbd and replacing ad hoc uses
of realloc, char ** etc in various places.
Rich.