strbuf: clarify API boundary

strbuf, as a generic and widely used structure across the codebase, should be limited as a library to only interact with primitives. Add documentation so future functions can appropriately be placed. Older functions that do not follow this boundary should eventually be moved or refactored. Signed-off-by: Calvin Wan <calvinwan@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Calvin Wan committed Jun 6, 2023 at 19:48 UTC 4557779660924843a3645694e5295a71a07a7fe2
1 file changed +8
strbuf.h
+8
@@ -1,6 +1,14 @@
1 #ifndef STRBUF_H
2 #define STRBUF_H
3
4 +/*
5 + * NOTE FOR STRBUF DEVELOPERS
6 + *
7 + * strbuf is a low-level primitive; as such it should interact only
8 + * with other low-level primitives. Do not introduce new functions
9 + * which interact with higher-level APIs.
10 + */
11 +
12 struct string_list;
13
14 /**