]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: ncbuf: extract common types
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Tue, 14 Oct 2025 09:35:21 +0000 (11:35 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Fri, 17 Oct 2025 07:29:01 +0000 (09:29 +0200)
include/haproxy/ncbuf-t.h
include/haproxy/ncbuf_common-t.h [new file with mode: 0644]

index 0dd958fbc1f994c5c44efbc00896d65184dfaaf8..ce3201d80cfabb5616a6bea50ea59c1d36b41b2d 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef _HAPROXY_NCBUF_T_H
 #define _HAPROXY_NCBUF_T_H
 
+#include <haproxy/ncbuf_common-t.h>
+
 /* **** public documentation ****
  *
  * <ncbuf> stands for non-contiguous circular buffer. This type can be used to
@@ -87,18 +89,4 @@ struct ncbuf {
        ncb_sz_t head;
 };
 
-enum ncb_ret {
-       NCB_RET_OK = 0,   /* no error */
-
-       NCB_RET_GAP_SIZE, /* operation would create a too small gap */
-       NCB_RET_DATA_REJ, /* operation would overwrite data with different one */
-};
-
-/* Define how insert is conducted in regards with already stored data. */
-enum ncb_add_mode {
-       NCB_ADD_PRESERVE, /* keep the already stored data and only insert in gaps */
-       NCB_ADD_OVERWRT,  /* overwrite old data with new ones */
-       NCB_ADD_COMPARE,  /* compare before insert : if new data are different do not proceed */
-};
-
 #endif /* _HAPROXY_NCBUF_T_H */
diff --git a/include/haproxy/ncbuf_common-t.h b/include/haproxy/ncbuf_common-t.h
new file mode 100644 (file)
index 0000000..25ec5e6
--- /dev/null
@@ -0,0 +1,18 @@
+#ifndef _HAPROXY_NCBUF_COMMON_T_H
+#define _HAPROXY_NCBUF_COMMON_T_H
+
+enum ncb_ret {
+       NCB_RET_OK = 0,   /* no error */
+
+       NCB_RET_GAP_SIZE, /* operation would create a too small gap */
+       NCB_RET_DATA_REJ, /* operation would overwrite data with different one */
+};
+
+/* Define how insert is conducted in regards with already stored data. */
+enum ncb_add_mode {
+       NCB_ADD_PRESERVE, /* keep the already stored data and only insert in gaps */
+       NCB_ADD_OVERWRT,  /* overwrite old data with new ones */
+       NCB_ADD_COMPARE,  /* compare before insert : if new data are different do not proceed */
+};
+
+#endif /* _HAPROXY_NCBUF_COMMON_T_H */