MINOR: buffer: implement a new file for low-level buffer manipulation functions
authorWilly Tarreau <w@1wt.eu>
Wed, 11 Jul 2018 07:39:05 +0000 (09:39 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 19 Jul 2018 14:23:39 +0000 (16:23 +0200)
commit41806d1c5233962f4e2e13c5cdf9f81484f94d3f
tree1a0ccad6da032345e887e3b912688e5d9585014b
parent9ddaf794a8c1e34b5be767dbb6159dfc037c6560
MINOR: buffer: implement a new file for low-level buffer manipulation functions

The buffer code currently depends on pools and other stuff and is not
really autonomous anymore. The rewrite of the new API is an opportunity
to clean this up. This patch creates a new file (buf.h) which does not
depend on other elements and which will only contain what is needed to
perform the most basic buffer operations. The new API will be introduced
in this file and the conversion will be finished once buffer.h is empty.

The definition of struct buffer was moved to this new file, using more
explicity stdint types for the sizes and offsets.

Most new functions will be implemented in two variants :

  __b_something() : unchecked variant, no wrapping is expected
  b_something() : wrapping-checked variant

This way callers will be able to select which one to use depending on
the use cases.
include/common/buf.h [new file with mode: 0644]
include/common/buffer.h