From 5914e40c2ff7fcf346c90705785f3fb7650a9fdc Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Mon, 29 Jan 2018 13:27:52 -0800 Subject: Expose scatter/gather I/O vectors; we will use for HTTP API. --- src/core/defs.h | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'src/core/defs.h') diff --git a/src/core/defs.h b/src/core/defs.h index cecb4825..fbf074b4 100644 --- a/src/core/defs.h +++ b/src/core/defs.h @@ -1,5 +1,6 @@ // -// Copyright 2017 Garrett D'Amore +// Copyright 2018 Staysail Systems, Inc. +// Copyright 2018 Capitar IT Group BV // // This software is supplied under the terms of the MIT License, a // copy of which should be located in the distribution where this @@ -34,6 +35,7 @@ typedef struct nng_sockaddr nni_sockaddr; typedef struct nng_event nni_event; typedef struct nng_notify nni_notify; typedef struct nng_url nni_url; +typedef struct nng_iov nni_iov; // These are our own names. typedef struct nni_socket nni_sock; @@ -64,12 +66,6 @@ typedef struct nni_aio nni_aio; typedef void (*nni_cb)(void *); -// Used by transports for scatter gather I/O. -typedef struct { - uint8_t *iov_buf; - size_t iov_len; -} nni_iov; - // Notify descriptor. typedef struct { int sn_wfd; // written to in order to flag an event @@ -134,6 +130,9 @@ typedef struct { (((uint64_t)((uint8_t)(ptr)[6])) << 8) + \ (((uint64_t)(uint8_t)(ptr)[7])) +// This increments a pointer a fixed number of byte cells. +#define NNI_INCPTR(ptr, n) ((ptr) = (void *) ((char *) (ptr) + (n))) + // A few assorted other items. #define NNI_FLAG_IPV4ONLY 1 -- cgit v1.2.3-70-g09d2