#include <string.h>
#include <haproxy/api.h>
-#include <common/buf.h>
+#include <haproxy/buf.h>
#include <common/chunk.h>
#include <import/ist.h>
#include <common/istbuf.h>
#include <string.h>
#include <haproxy/api.h>
-#include <common/buf.h>
+#include <haproxy/buf-t.h>
#include <import/ist.h>
#include <common/memory.h>
#include <stdio.h>
#include <haproxy/api.h>
#include <common/standard.h>
-#include <common/buf.h>
+#include <haproxy/buf-t.h>
#include <import/ist.h>
/* FCGI protocol version */
#include <string.h>
#include <haproxy/api.h>
-#include <common/buf.h>
+#include <haproxy/buf-t.h>
#include <common/http.h>
#include <import/ist.h>
#ifndef _COMMON_HTTP_H
#define _COMMON_HTTP_H
-#include <common/buf.h>
+#include <haproxy/buf-t.h>
#include <import/ist.h>
/*
#include <stdio.h>
#include <haproxy/api.h>
-#include <common/buf.h>
+#include <haproxy/buf.h>
#include <import/ist.h>
#include <common/http.h>
#include <common/http-hdr.h>
#define _COMMON_ISTBUF_H
#include <inttypes.h>
-#include <common/buf.h>
+#include <haproxy/buf.h>
#include <import/ist.h>
--- /dev/null
+/*
+ * include/haproxy/buf-t.h
+ * Simple buffer handling - types definitions.
+ *
+ * Copyright (C) 2000-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
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#ifndef _HAPROXY_BUF_T_H
+#define _HAPROXY_BUF_T_H
+
+#include <stddef.h>
+
+/* Structure defining a buffer's head */
+struct buffer {
+ size_t size; /* buffer size in bytes */
+ char *area; /* points to <size> bytes */
+ size_t data; /* amount of data after head including wrapping */
+ size_t head; /* start offset of remaining data relative to area */
+};
+
+/* A buffer may be in 3 different states :
+ * - unallocated : size == 0, area == 0 (b_is_null() is true)
+ * - waiting : size == 0, area != 0 (b_is_null() is true)
+ * - allocated : size > 0, area > 0 (b_is_null() is false)
+ */
+
+/* initializers for certain buffer states. It is important that the NULL buffer
+ * remains the one with all fields initialized to zero so that a calloc() or a
+ * memset() on a struct automatically sets a NULL buffer.
+ */
+#define BUF_NULL ((struct buffer){ })
+#define BUF_WANTED ((struct buffer){ .area = (char *)1 })
+#define BUF_RING ((struct buffer){ .area = (char *)2 })
+
+#endif /* _HAPROXY_BUF_T_H */
+
+/*
+ * Local variables:
+ * c-indent-level: 8
+ * c-basic-offset: 8
+ * End:
+ */
/*
- * include/common/buf.h
- * Simple buffer handling.
+ * include/haproxy/buf.h
+ * Simple buffer handling - functions definitions.
*
- * Copyright (C) 2000-2018 Willy Tarreau - w@1wt.eu
+ * Copyright (C) 2000-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_BUF_H
-#define _COMMON_BUF_H
+#ifndef _HAPROXY_BUF_H
+#define _HAPROXY_BUF_H
+#include <sys/types.h>
#include <string.h>
-#include <unistd.h>
#include <haproxy/api.h>
-
-/* Structure defining a buffer's head */
-struct buffer {
- size_t size; /* buffer size in bytes */
- char *area; /* points to <size> bytes */
- size_t data; /* amount of data after head including wrapping */
- size_t head; /* start offset of remaining data relative to area */
-};
-
-/* A buffer may be in 3 different states :
- * - unallocated : size == 0, area == 0 (b_is_null() is true)
- * - waiting : size == 0, area != 0 (b_is_null() is true)
- * - allocated : size > 0, area > 0 (b_is_null() is false)
- */
-
-/* initializers for certain buffer states. It is important that the NULL buffer
- * remains the one with all fields initialized to zero so that a calloc() or a
- * memset() on a struct automatically sets a NULL buffer.
- */
-#define BUF_NULL ((struct buffer){ })
-#define BUF_WANTED ((struct buffer){ .area = (char *)1 })
-#define BUF_RING ((struct buffer){ .area = (char *)2 })
-
+#include <haproxy/buf-t.h>
/***************************************************************************/
/* Functions used to compute offsets and pointers. Most of them exist in */
return br_head(r);
}
-#endif /* _COMMON_BUF_H */
+#endif /* _HAPROXY_BUF_H */
/*
* Local variables:
#ifndef _PROTO_H1_HTX_H
#define _PROTO_H1_HTX_H
-#include <common/buf.h>
+#include <haproxy/buf.h>
#include <import/ist.h>
#include <common/h1.h>
#ifndef _PROTO_HTTP_HTX_H
#define _PROTO_HTTP_HTX_H
-#include <common/buf.h>
+#include <haproxy/buf.h>
#include <import/ist.h>
#include <common/regex.h>
#include <import/ist.h>
#include <common/mini-clist.h>
#include <common/regex.h>
-#include <common/buf.h>
+#include <haproxy/buf-t.h>
#include <types/connection.h>
#include <types/obj_type.h>
#include <import/ebistree.h>
-#include <common/buf.h>
+#include <haproxy/buf-t.h>
#include <common/http.h>
#include <common/htx.h>
#include <import/ist.h>
#define _TYPES_RING_H
#include <haproxy/api-t.h>
-#include <common/buf.h>
+#include <haproxy/buf-t.h>
#include <import/ist.h>
/* The code below handles circular buffers with single-producer and multiple
#include <sys/socket.h>
#include <netinet/in.h>
-#include <common/buf.h>
+#include <haproxy/buf-t.h>
#include <common/http.h>
#include <common/mini-clist.h>
#include <sys/wait.h>
#include <haproxy/api.h>
-#include <common/buf.h>
+#include <haproxy/buf.h>
#include <haproxy/debug.h>
#include <common/hathreads.h>
#include <import/ist.h>
*/
#include <common/fcgi.h>
-
+#include <haproxy/buf.h>
/* Encodes header of a FCGI record into the chunk <out>. It returns non-zero on
* success and 0 on failure (buffer full). <out> is a chunk, so the wrapping is
#include <stdlib.h>
#include <haproxy/api.h>
-#include <common/buf.h>
+#include <haproxy/buf.h>
#include <common/hathreads.h>
#include <types/applet.h>
#include <proto/cli.h>