]> git.ipfire.org Git - thirdparty/haproxy.git/commit
REORG: include: split buf.h into haproxy/buf-t.h and haproxy/buf.h
authorWilly Tarreau <w@1wt.eu>
Wed, 27 May 2020 15:22:10 +0000 (17:22 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 11 Jun 2020 08:18:56 +0000 (10:18 +0200)
commit8dabda7497728ecdaadbd21386f40fbf23c2bdbb
treebe31422ad73b8a812a0de3b3e9b1fedfd8eb64fb
parent025beea507890f97419ed36887077e4a720b8a78
REORG: include: split buf.h into haproxy/buf-t.h and haproxy/buf.h

File buf.h is one common cause of pain in the dependencies. Many files in
the code need it to get the struct buffer definition, and a few also need
the inlined functions to manipulate a buffer, but the file used to depend
on a long chain only for BUG_ON() (addressed by last commit).

Now buf.h is split into buf-t.h which only contains the type definitions,
and buf.h for all inlined functions. Callers who don't care can continue
to use buf.h but files in types/ must only use buf-t.h. sys/types.h had
to be added to buf.h to get ssize_t as used by b_move(). It's worth noting
that ssize_t is only supposed to be a size_t supporting -1, so b_move()
ought to be rethought regarding this.

The files were moved to haproxy/ and all their users were updated
accordingly. A dependency issue was addressed on fcgi whose C file didn't
include buf.h.
18 files changed:
include/common/buffer.h
include/common/chunk.h
include/common/fcgi.h
include/common/hpack-enc.h
include/common/http.h
include/common/htx.h
include/common/istbuf.h
include/haproxy/buf-t.h [new file with mode: 0644]
include/haproxy/buf.h [moved from include/common/buf.h with 96% similarity]
include/proto/h1_htx.h
include/proto/http_htx.h
include/types/checks.h
include/types/http_htx.h
include/types/ring.h
include/types/sample.h
src/debug.c
src/fcgi.c
src/ring.c