]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
REORG: include: move ist.h from common/ to import/
authorWilly Tarreau <w@1wt.eu>
Wed, 27 May 2020 14:21:26 +0000 (16:21 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 11 Jun 2020 08:18:56 +0000 (10:18 +0200)
Fortunately that file wasn't made dependent upon haproxy since it was
integrated, better isolate it before it's too late. Its dependency on
api.h was the result of the change from config.h, which in turn wasn't
correct. It was changed back to stddef.h for size_t and sys/types.h for
ssize_t. The recently added reference to MAX() was changed as it was
placed only to avoid a zero length in the non-free-standing version and
was causing a build warning in the hpack encoder.

34 files changed:
contrib/hpack/gen-enc.c
include/common/buffer.h
include/common/chunk.h
include/common/fcgi.h
include/common/h1.h
include/common/h2.h
include/common/hpack-enc.h
include/common/hpack-tbl.h
include/common/http-hdr.h
include/common/http.h
include/common/htx.h
include/common/istbuf.h
include/import/ist.h [moved from include/common/ist.h with 99% similarity]
include/proto/connection.h
include/proto/h1_htx.h
include/proto/http_htx.h
include/proto/ring.h
include/proto/trace.h
include/types/checks.h
include/types/connection.h
include/types/fcgi-app.h
include/types/fd.h
include/types/http_htx.h
include/types/ring.h
include/types/sink.h
include/types/trace.h
src/debug.c
src/h2.c
src/hpack-dec.c
src/hpack-enc.c
src/hpack-tbl.c
src/mux_fcgi.c
src/sink.c
src/trace.c

index dfe47055e05d6b3a00b10de2387a93b6e86134d8..36b132bd70dbcd0a7653c22de0bdfb9c87c342af 100644 (file)
@@ -14,7 +14,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <common/ist.h>
+#include <import/ist.h>
 #include <common/hpack-tbl.h>
 #include "../../src/hpack-tbl.c"
 
index f7aa2542f9038bff6b63a5534fbe6037935c9b65..d90b94e8be6f5a187aa9183600f6a768ad270d30 100644 (file)
@@ -29,7 +29,7 @@
 #include <haproxy/api.h>
 #include <common/buf.h>
 #include <common/chunk.h>
-#include <common/ist.h>
+#include <import/ist.h>
 #include <common/istbuf.h>
 #include <common/memory.h>
 
index ae7ae853842d9971c04d70867b481468ee03a6f8..d4f9ea23a9fdef4effad75735a5c8af9f8694b40 100644 (file)
@@ -27,7 +27,7 @@
 
 #include <haproxy/api.h>
 #include <common/buf.h>
-#include <common/ist.h>
+#include <import/ist.h>
 #include <common/memory.h>
 
 
index b9a752b92c6b3da73f03d2eceb0d1aaacdf5d5af..6d3c6eb19b6b0a105bb1b7cff8b009e8fe627c6b 100644 (file)
@@ -26,7 +26,7 @@
 #include <haproxy/api.h>
 #include <common/standard.h>
 #include <common/buf.h>
-#include <common/ist.h>
+#include <import/ist.h>
 
 /* FCGI protocol version */
 #define FCGI_VERSION    0x1
index 0bc0f4864b471080f1ed998a6c7afa831214b0b2..f75ee11fbd1d28c2f029c8af346efd2e7be9e654 100644 (file)
@@ -26,7 +26,7 @@
 #include <common/buffer.h>
 #include <common/http.h>
 #include <common/http-hdr.h>
-#include <common/ist.h>
+#include <import/ist.h>
 #include <common/standard.h>
 
 
index 5654a76111bcdac8c48ecc1e6c1587e487c8f6f0..32f02060aefd239de292f662616848899eb35492 100644 (file)
@@ -32,7 +32,7 @@
 #include <haproxy/api.h>
 #include <common/http-hdr.h>
 #include <common/htx.h>
-#include <common/ist.h>
+#include <import/ist.h>
 
 
 /* indexes of most important pseudo headers can be simplified to an almost
index f204853d732684e368234af4fc419ec6a8ce5e3d..f766063ff794ad33e5fadfab9f29da34af81b07c 100644 (file)
@@ -32,7 +32,7 @@
 #include <haproxy/api.h>
 #include <common/buf.h>
 #include <common/http.h>
-#include <common/ist.h>
+#include <import/ist.h>
 
 int hpack_encode_header(struct buffer *out, const struct ist n,
                        const struct ist v);
index cde7114af8bca6ec3117955a14214ea95f3b118d..1d2a8bd5f13463962618c4998f53b6514a38d140 100644 (file)
@@ -30,7 +30,7 @@
 #include <stdlib.h>
 #include <haproxy/api.h>
 #include <common/http-hdr.h>
-#include <common/ist.h>
+#include <import/ist.h>
 #include <common/memory.h>
 
 /* Dynamic Headers Table, usable for tables up to 4GB long and values of 64kB-1.
index ffca828d22c029f3f16077b20b4b500335f4e0cf..77997e33e15e623e1fff42f1f0ca550e0582f940 100644 (file)
@@ -28,7 +28,7 @@
 #define _COMMON_HTTP_HDR_H
 
 #include <inttypes.h>
-#include <common/ist.h>
+#include <import/ist.h>
 
 /* a header field made of a name and a value. Such structure stores 4 longs so
  * it takes 16 bytes on 32-bit systems and 32 bytes on 64-bit systems.
index acf19903fbca661a4fec1e9b926da4df010cc1ff..86cf01536cb48e7e800866edf3af231993841099 100644 (file)
@@ -24,7 +24,7 @@
 #define _COMMON_HTTP_H
 
 #include <common/buf.h>
-#include <common/ist.h>
+#include <import/ist.h>
 
 /*
  * some macros mainly used when parsing header fields.
index 5a13614f344ca3989d4ab77a7fd8ad0ab2992300..1a87cde75bd4d19839686b34394651747f6a70b8 100644 (file)
@@ -25,7 +25,7 @@
 #include <stdio.h>
 #include <haproxy/api.h>
 #include <common/buf.h>
-#include <common/ist.h>
+#include <import/ist.h>
 #include <common/http.h>
 #include <common/http-hdr.h>
 #include <common/standard.h>
index a533c71749ea9eca49a25464bddf6b4c214a1d8d..f9bf0b1f900654256044acdcf9c31deb8ecac6a4 100644 (file)
@@ -30,7 +30,7 @@
 
 #include <inttypes.h>
 #include <common/buf.h>
-#include <common/ist.h>
+#include <import/ist.h>
 
 
 /* b_isteq() : returns > 0 if the first <n> characters of buffer <b> starting
similarity index 99%
rename from include/common/ist.h
rename to include/import/ist.h
index d62924e167fa6d6add24ce43fd14ae4edf241e1b..08e2119382c1069bbb0ce5003ce8209a921cc1f1 100644 (file)
@@ -1,8 +1,8 @@
 /*
- * include/common/ist.h
+ * include/import/ist.h
  * Very simple indirect string manipulation functions.
  *
- * Copyright (C) 2014-2017 Willy Tarreau - w@1wt.eu
+ * Copyright (C) 2014-2020 Willy Tarreau - w@1wt.eu
  *
  * Permission is hereby granted, free of charge, to any person obtaining
  * a copy of this software and associated documentation files (the
  * OTHER DEALINGS IN THE SOFTWARE.
  */
 
-#ifndef _COMMON_IST_H
-#define _COMMON_IST_H
+#ifndef _IMPORT_IST_H
+#define _IMPORT_IST_H
 
+#include <sys/types.h>
 #include <ctype.h>
+#include <stddef.h>
 #include <string.h>
-#include <unistd.h>
 
 #ifndef IST_FREESTANDING
 #include <stdlib.h>
 #endif
 
-#include <haproxy/api.h>
-
 /* ASCII to lower case conversion table */
 #define _IST_LC ((const unsigned char[256]){            \
        0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, \
@@ -658,7 +657,7 @@ static inline const char *ist_find_ctl(const struct ist ist)
        last += sizeof(long);
        if (__builtin_expect(curr < last, 0)) {
                do {
-                       if ((uint8_t)*curr < 0x20)
+                       if ((unsigned char)*curr < 0x20)
                                return curr;
                        curr++;
                } while (curr < last);
@@ -794,7 +793,7 @@ static inline struct ist istdup(const struct ist src)
        /* Allocate at least 1 byte to allow duplicating an empty string with
         * malloc implementations that return NULL for a 0-size allocation.
         */
-       struct ist dst = istalloc(MAX(src_size, 1));
+       struct ist dst = istalloc(src_size ? src_size : 1);
 
        if (isttest(dst)) {
                istcpy(&dst, src, src_size);
index 9b1e3d871c2115d03811764bee0d652750d8c94e..2efd629fca6eb6e8ead97ae2e6d98c2a615a2f8d 100644 (file)
@@ -23,7 +23,7 @@
 #define _PROTO_CONNECTION_H
 
 #include <haproxy/api.h>
-#include <common/ist.h>
+#include <import/ist.h>
 #include <common/memory.h>
 #include <types/connection.h>
 #include <types/listener.h>
index a8fd886751e057788b9d0ff101d2b09c0ea70385..13ba394d54fd9d9d73552427acc0a048ce490007 100644 (file)
@@ -24,7 +24,7 @@
 #define _PROTO_H1_HTX_H
 
 #include <common/buf.h>
-#include <common/ist.h>
+#include <import/ist.h>
 #include <common/h1.h>
 
 int h1_parse_msg_hdrs(struct h1m *h1m, union h1_sl *h1sl, struct htx *dsthtx,
index 557d34f457cf29cdbc1aea6ea2da3da2d0d834e6..edbd8f1bf3aa843df74c8c829a0a41739840f37b 100644 (file)
@@ -24,7 +24,7 @@
 #define _PROTO_HTTP_HTX_H
 
 #include <common/buf.h>
-#include <common/ist.h>
+#include <import/ist.h>
 #include <common/regex.h>
 
 #include <types/http_htx.h>
index 8adbb9c520b5fd801ab9b0bf12dfd1147c5e537b..6f393fe43e84221a53e7560f04a14dd08df0ee59 100644 (file)
@@ -23,7 +23,7 @@
 #define _PROTO_RING_H
 
 #include <stdlib.h>
-#include <common/ist.h>
+#include <import/ist.h>
 #include <types/ring.h>
 
 struct ring *ring_new(size_t size);
index ef88079b185c24cbca8d7db913414cb846f5f0d0..f43faf5a9a7f2326f1384214ee8d1d9adea0e23f 100644 (file)
@@ -24,7 +24,7 @@
 
 #include <haproxy/api.h>
 #include <common/buffer.h>
-#include <common/ist.h>
+#include <import/ist.h>
 #include <common/mini-clist.h>
 #include <types/log.h>
 #include <types/sink.h>
index b2be640c3cc18144f7b17dab9c516c12cf8b2865..4b8177078792901fe4cfc3a8cf5fdf102f8dd23c 100644 (file)
@@ -17,7 +17,7 @@
 #include <import/ebpttree.h>
 
 #include <common/standard.h>
-#include <common/ist.h>
+#include <import/ist.h>
 #include <common/mini-clist.h>
 #include <common/regex.h>
 #include <common/buf.h>
index 7357174dcb1640976c8d692214996cc81f029d45..601e5056c59d75191dc362926def9684bc35ba89 100644 (file)
@@ -26,7 +26,7 @@
 #include <sys/socket.h>
 
 #include <haproxy/api-t.h>
-#include <common/ist.h>
+#include <import/ist.h>
 
 #include <types/listener.h>
 #include <types/obj_type.h>
index f0fcdc7aec1ff9c36154dcf9b380169d71d5839a..7fb20ee6f7efb89dc80bce8c2e03ad5c8430cf11 100644 (file)
@@ -23,7 +23,7 @@
 #define _TYPES_HTTP_FCGI_H
 
 #include <haproxy/api-t.h>
-#include <common/ist.h>
+#include <import/ist.h>
 #include <common/fcgi.h>
 #include <common/mini-clist.h>
 #include <common/regex.h>
index 0041d4d601de4ad3ea17c363bcc743648883b9c5..7ec97bc741c04e8a75076fa64f45903a5b0f6473 100644 (file)
@@ -24,7 +24,7 @@
 
 #include <haproxy/api-t.h>
 #include <common/hathreads.h>
-#include <common/ist.h>
+#include <import/ist.h>
 #include <types/port_range.h>
 
 /* Direction for each FD event update */
index 301034c8f530ea28d4cb38aa65c30c428322953e..02b6b3b4821a421f7126ac307ea8dcfe64b2e1ff 100644 (file)
@@ -28,7 +28,7 @@
 #include <common/buf.h>
 #include <common/http.h>
 #include <common/htx.h>
-#include <common/ist.h>
+#include <import/ist.h>
 
 /* Context used to find/remove an HTTP header. */
 struct http_hdr_ctx {
index ac93c121968035f997b78774775f4b653b2f5c4a..f3b3987a8398f2b23abc519027e047f633246952 100644 (file)
@@ -24,7 +24,7 @@
 
 #include <haproxy/api-t.h>
 #include <common/buf.h>
-#include <common/ist.h>
+#include <import/ist.h>
 
 /* The code below handles circular buffers with single-producer and multiple
  * readers (up to 255). The buffer storage area must remain always allocated.
index 64b0bcaf4d15ff7e02f842655f08662ab1df35d7..b10cb891236247bd15f93a2a8840dc14784e4751 100644 (file)
@@ -24,7 +24,7 @@
 
 #include <haproxy/api-t.h>
 #include <common/buffer.h>
-#include <common/ist.h>
+#include <import/ist.h>
 
 /* A sink may be of 4 distinct types :
  *   - file descriptor (such as stdout)
index cd5e8be15230698d3ffe118a8598bee1e7ba21ab..ad9d7b6a02a0d854b62998b447c53d63503537a1 100644 (file)
@@ -24,7 +24,7 @@
 
 #include <haproxy/api-t.h>
 #include <common/buffer.h>
-#include <common/ist.h>
+#include <import/ist.h>
 #include <common/mini-clist.h>
 #include <types/sink.h>
 
index 7f281f0294f6e716e2f6e36bce0d5814f96fdde4..e1b9070bfd62b732bcece231c30f458e107bd9b1 100644 (file)
@@ -23,7 +23,7 @@
 #include <common/buf.h>
 #include <common/debug.h>
 #include <common/hathreads.h>
-#include <common/ist.h>
+#include <import/ist.h>
 #include <common/net_helper.h>
 #include <common/standard.h>
 
index 891c3e06cd0657e852cd595a2859393595b1bc47..c94ea8e0342d51555f264893dcd3a5d1f2bb452d 100644 (file)
--- a/src/h2.c
+++ b/src/h2.c
@@ -29,7 +29,7 @@
 #include <haproxy/api.h>
 #include <common/h2.h>
 #include <common/http-hdr.h>
-#include <common/ist.h>
+#include <import/ist.h>
 #include <types/global.h>
 
 struct h2_frame_definition h2_frame_definition[H2_FT_ENTRIES] =        {
index fa25ac47537390bbb02e64a468424f246ed819aa..50293d85052b1c7a674fb1220f25e11b517f4741 100644 (file)
@@ -36,7 +36,7 @@
 #include <common/hpack-tbl.h>
 #include <common/chunk.h>
 #include <common/h2.h>
-#include <common/ist.h>
+#include <import/ist.h>
 
 #include <types/global.h>
 
index 1a6fa1cc89b798cab88b447fff0efe05b5cea03a..bf7336b08f5201c2cb0b9878a35adb889d34e447 100644 (file)
@@ -32,7 +32,7 @@
 
 #include <common/hpack-enc.h>
 #include <common/http-hdr.h>
-#include <common/ist.h>
+#include <import/ist.h>
 
 #include <types/global.h>
 
index effe5e01e0c131297bf55137f752a305a0da6421..31c24b21f58cfd1dff6e78ea0967c6da1858e6b6 100644 (file)
@@ -32,7 +32,7 @@
 
 #include <common/hpack-huff.h>
 #include <common/hpack-tbl.h>
-#include <common/ist.h>
+#include <import/ist.h>
 
 #include <types/global.h>
 
index 5ce6f6191ed10cd05bbf46a41202aa4fe74e180b..7ff39328c7ae9418f0c576ac8bf7831a3e342d56 100644 (file)
@@ -15,7 +15,7 @@
 #include <common/fcgi.h>
 #include <common/h1.h>
 #include <common/htx.h>
-#include <common/ist.h>
+#include <import/ist.h>
 #include <common/mini-clist.h>
 #include <common/net_helper.h>
 
index 20d3d79b16fd3e09b610798d504ee8dd664fc777..7eb283fc6796ab32b372d03919a209177891ad0d 100644 (file)
@@ -20,7 +20,7 @@
 
 #include <haproxy/api.h>
 #include <common/cfgparse.h>
-#include <common/ist.h>
+#include <import/ist.h>
 #include <common/mini-clist.h>
 #include <common/time.h>
 #include <proto/cli.h>
index 667cd81cac6f1797c7cc96a22e4ba500e6174a62..3f6ff0543ded92e7edee3daac63250a0b9ea0f20 100644 (file)
@@ -20,7 +20,7 @@
 
 #include <haproxy/api.h>
 #include <common/buffer.h>
-#include <common/ist.h>
+#include <import/ist.h>
 #include <common/mini-clist.h>
 #include <proto/cli.h>
 #include <proto/log.h>