]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: buffer: add functions to read/write varints from/to buffers
authorWilly Tarreau <w@1wt.eu>
Fri, 23 Aug 2019 15:06:12 +0000 (17:06 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 27 Aug 2019 15:14:19 +0000 (17:14 +0200)
commitb88d2317732f0797f29a745e956bb1c7f23e41f6
tree05deb7a12431e55d16426433f9376c020bba9c03
parent4d589e719ba0f7c2421dbb98208de51c3e1cee1d
MINOR: buffer: add functions to read/write varints from/to buffers

The new functions are :
  __b_put_varint() : inserts a varint when it's known that it fits
  b_put_varint()   : tries to insert a varint at the tail
  b_get_varint()   : tries to get a varint from the head
  b_peek_varint()  : tries to peek a varint at a specific offset

Wrapping is supported so that they are expected to be safe to use to
manipulate varints with buffers anywhere.
include/common/buf.h