]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
DOC: minor update to coding style file
authorWilly Tarreau <w@1wt.eu>
Tue, 7 Jul 2020 14:21:19 +0000 (16:21 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 7 Jul 2020 14:23:11 +0000 (16:23 +0200)
It used to still refrence includes/{types,proto,common}/, now turned
to import/ and haproxy/.

doc/coding-style.txt

index 24550f1f5dbd721935d9fd209d573c2d5a37cc89..d60a87675ca539816e3289dd4b2eed58550303d3 100644 (file)
@@ -1,4 +1,4 @@
-2015/09/21 - HAProxy coding style - Willy Tarreau <w@1wt.eu>
+2020/07/07 - HAProxy coding style - Willy Tarreau <w@1wt.eu>
 ------------------------------------------------------------
 
 A number of contributors are often embarrassed with coding style issues, they
@@ -1149,11 +1149,10 @@ is to be used :
 ------------
 
 Includes are as much as possible listed in alphabetically ordered groups :
-  - the libc-standard includes (those without any path component)
   - the includes more or less system-specific (sys/*, netinet/*, ...)
-  - includes from the local "common" subdirectory
-  - includes from the local "types" subdirectory
-  - includes from the local "proto" subdirectory
+  - the libc-standard includes (those without any path component)
+  - includes from the local "import" subdirectory
+  - includes from the local "haproxy" subdirectory
 
 Each section is just visually delimited from the other ones using an empty
 line. The two first ones above may be merged into a single section depending on
@@ -1163,19 +1162,17 @@ hard to find which ones are needed later. Just include what you need and if
 possible in alphabetical order so that when something is missing, it becomes
 obvious where to look for it and where to add it.
 
-All files should include <common/config.h> because this is where build options
+All files should include <haproxy/api.h> because this is where build options
 are prepared.
 
-Header files are split in two directories ("types" and "proto") depending on
-what they provide. Types, structures, enums and #defines must go into the
-"types" directory. Function prototypes and inlined functions must go into the
-"proto" directory. This split is because of inlined functions which
-cross-reference types from other files, which cause a chicken-and-egg problem
-if the functions and types are declared at the same place.
-
-All headers which do not depend on anything currently go to the "common"
-subdirectory, but are equally well placed into the "proto" directory. It is
-possible that one day the "common" directory will disappear.
+Haproxy header files are split in two, those exporting the types only (named
+with a trailing "-t") and those exporting variables, functions and inline
+functions. Types, structures, enums and #defines must go into the types files
+which are the only ones that may be included by othertype files. Function
+prototypes and inlined functions must go into the main files. This split is
+because of inlined functions which cross-reference types from other files,
+which cause a chicken-and-egg problem if the functions and types are declared
+at the same place.
 
 Include files must be protected against multiple inclusion using the common
 #ifndef/#define/#endif trick with a tag derived from the include file and its