Improved BIO API
authorAlessio Vanni <vannilla@firemail.cc>
Thu, 14 May 2020 14:03:10 +0000 (16:03 +0200)
committerChristian Grothoff <christian@grothoff.org>
Tue, 19 May 2020 00:41:47 +0000 (02:41 +0200)
commitf4771fcc1c3fda21a46d0cb85d8b29e012254696
tree012df74ed2cf44cb20605b239e1b88dab6edc645
parent6a52ce5f9bc35a852b215e7073f3a0d2665ca8de
Improved BIO API

BIO now supports reading from and writing to in-memory buffers.

For reading, an allocated buffer (array) and a size is passed as arguments to
the function opening the handle.
For writing, a GNUNET_Buffer is created and used internally. The buffer
contents can be extracted using the relevant function.

There is a new API in addition to the existing read/write: this new API is
more "declarative" in nature and is meant to mimic APIs like GNUNET_SQ.
The read/write operations are defined in an array of specs which are then
"commited" in a single (non-atomic) operation, rather than explicitly
executing multiple function calls and checking their return value.

Also there are small changes to GNUNET_Buffer to account for BIO's new
features.

Signed-off-by: Christian Grothoff <christian@grothoff.org>
14 files changed:
src/fs/fs_api.c
src/fs/fs_namespace.c
src/fs/gnunet-auto-share.c
src/fs/gnunet-service-fs_indexing.c
src/hostlist/gnunet-daemon-hostlist_client.c
src/include/gnunet_bio_lib.h
src/include/gnunet_buffer_lib.h
src/nse/gnunet-service-nse.c
src/statistics/gnunet-service-statistics.c
src/testbed-logger/gnunet-service-testbed-logger.c
src/testbed/gnunet-service-testbed_cpustatus.c
src/util/bio.c
src/util/buffer.c
src/util/test_bio.c