REORG: include: move pattern.h to haproxy/pattern{,-t}.h

It was moved as-is, except for extern declaration of pattern_reference.
A few C files used to include it but didn't need it anymore after having
been split apart so this was cleaned.
diff --git a/include/haproxy/auth.h b/include/haproxy/auth.h
index 39cc0aa..3eafa41 100644
--- a/include/haproxy/auth.h
+++ b/include/haproxy/auth.h
@@ -16,7 +16,7 @@
 
 #include <haproxy/auth-t.h>
 #include <haproxy/api.h>
-#include <types/pattern.h>
+#include <haproxy/pattern-t.h>
 #include <types/sample.h>
 
 extern struct userlist *userlist;
diff --git a/include/types/pattern.h b/include/haproxy/pattern-t.h
similarity index 96%
rename from include/types/pattern.h
rename to include/haproxy/pattern-t.h
index 0baf3d7..7787ec3 100644
--- a/include/types/pattern.h
+++ b/include/haproxy/pattern-t.h
@@ -1,5 +1,5 @@
 /*
- * include/types/pattern.h
+ * include/haproxy/pattern-t.h
  * This file provides structures and types for ACLs.
  *
  * Copyright (C) 2000-2012 Willy Tarreau - w@1wt.eu
@@ -19,16 +19,18 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#ifndef _TYPES_PATTERN_H
-#define _TYPES_PATTERN_H
+#ifndef _HAPROXY_PATTERN_T_H
+#define _HAPROXY_PATTERN_T_H
 
-#include <haproxy/api-t.h>
+#include <import/ebmbtree.h>
+
 #include <haproxy/list-t.h>
 #include <haproxy/regex-t.h>
+#include <haproxy/thread-t.h>
+#include <haproxy/api-t.h>
 
 #include <types/sample.h>
 
-#include <import/ebmbtree.h>
 
 /* Pattern matching function result.
  *
@@ -217,7 +219,4 @@
 	struct list head; /* This is a list of struct pattern_expr_list. */
 };
 
-/* This is the root of the list of all pattern_ref avalaibles. */
-extern struct list pattern_reference;
-
-#endif /* _TYPES_PATTERN_H */
+#endif /* _HAPROXY_PATTERN_T_H */
diff --git a/include/proto/pattern.h b/include/haproxy/pattern.h
similarity index 97%
rename from include/proto/pattern.h
rename to include/haproxy/pattern.h
index 73c48cc..6be2474 100644
--- a/include/proto/pattern.h
+++ b/include/haproxy/pattern.h
@@ -1,5 +1,5 @@
 /*
- * include/proto/pattern.h
+ * include/haproxy/pattern.h
  * This file provides structures and types for pattern matching.
  *
  * Copyright (C) 2000-2013 Willy Tarreau - w@1wt.eu
@@ -19,22 +19,26 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#ifndef _PROTO_PATTERN_H
-#define _PROTO_PATTERN_H
+#ifndef _HAPROXY_PATTERN_H
+#define _HAPROXY_PATTERN_H
 
 #include <string.h>
 
 #include <haproxy/api.h>
-#include <types/pattern.h>
+#include <haproxy/pattern-t.h>
 
 /* pattern management function arrays */
 extern char *pat_match_names[PAT_MATCH_NUM];
+extern int pat_match_types[PAT_MATCH_NUM];
+
 extern int (*pat_parse_fcts[PAT_MATCH_NUM])(const char *, struct pattern *, int, char **);
 extern int (*pat_index_fcts[PAT_MATCH_NUM])(struct pattern_expr *, struct pattern *, char **);
 extern void (*pat_delete_fcts[PAT_MATCH_NUM])(struct pattern_expr *, struct pat_ref_elt *);
 extern void (*pat_prune_fcts[PAT_MATCH_NUM])(struct pattern_expr *);
 extern struct pattern *(*pat_match_fcts[PAT_MATCH_NUM])(struct sample *, struct pattern_expr *, int);
-extern int pat_match_types[PAT_MATCH_NUM];
+
+/* This is the root of the list of all pattern_ref avalaibles. */
+extern struct list pattern_reference;
 
 int pattern_finalize_config(void);
 
diff --git a/include/types/acl.h b/include/types/acl.h
index 78b2612..d9f4084 100644
--- a/include/types/acl.h
+++ b/include/types/acl.h
@@ -23,11 +23,11 @@
 #define _TYPES_ACL_H
 
 #include <haproxy/auth-t.h>
+#include <haproxy/pattern-t.h>
 #include <haproxy/api-t.h>
 #include <haproxy/list-t.h>
 
 #include <haproxy/arg-t.h>
-#include <types/pattern.h>
 #include <types/proxy.h>
 #include <types/server.h>
 
diff --git a/include/types/map.h b/include/types/map.h
index 750da56..5b59ec0 100644
--- a/include/types/map.h
+++ b/include/types/map.h
@@ -22,7 +22,7 @@
 #ifndef _TYPES_MAP_H
 #define _TYPES_MAP_H
 
-#include <types/pattern.h>
+#include <haproxy/pattern-t.h>
 #include <types/sample.h>
 
 struct map_descriptor {
diff --git a/src/acl.c b/src/acl.c
index 1ecacb1..17a5e10 100644
--- a/src/acl.c
+++ b/src/acl.c
@@ -17,6 +17,7 @@
 #include <haproxy/auth.h>
 #include <haproxy/api.h>
 #include <haproxy/list.h>
+#include <haproxy/pattern.h>
 #include <haproxy/tools.h>
 #include <common/uri_auth.h>
 
@@ -26,7 +27,6 @@
 #include <haproxy/arg.h>
 #include <proto/channel.h>
 #include <proto/log.h>
-#include <proto/pattern.h>
 #include <proto/proxy.h>
 #include <proto/sample.h>
 #include <proto/stick_table.h>
diff --git a/src/auth.c b/src/auth.c
index 30fec83..b28d6dd 100644
--- a/src/auth.c
+++ b/src/auth.c
@@ -29,13 +29,12 @@
 #include <haproxy/api.h>
 #include <types/global.h>
 #include <haproxy/errors.h>
+#include <haproxy/pattern-t.h>
 #include <haproxy/thread.h>
 
 #include <proto/acl.h>
 #include <proto/log.h>
 
-#include <types/pattern.h>
-
 struct userlist *userlist = NULL;    /* list of all existing userlists */
 
 #ifdef USE_LIBCRYPT
diff --git a/src/cli.c b/src/cli.c
index 7eb3bc2..f7cf57c 100644
--- a/src/cli.c
+++ b/src/cli.c
@@ -33,6 +33,7 @@
 #include <haproxy/list.h>
 #include <haproxy/listener.h>
 #include <haproxy/mworker-t.h>
+#include <haproxy/pattern-t.h>
 #include <haproxy/tools.h>
 #include <haproxy/ticks.h>
 #include <haproxy/time.h>
@@ -54,7 +55,6 @@
 #include <haproxy/fd.h>
 #include <haproxy/freq_ctr.h>
 #include <proto/log.h>
-#include <proto/pattern.h>
 #include <haproxy/pipe.h>
 #include <haproxy/protocol.h>
 #include <proto/map.h>
diff --git a/src/haproxy.c b/src/haproxy.c
index ebf9ae3..9e6627c 100644
--- a/src/haproxy.c
+++ b/src/haproxy.c
@@ -97,6 +97,7 @@
 #include <haproxy/namespace.h>
 #include <haproxy/net_helper.h>
 #include <haproxy/openssl-compat.h>
+#include <haproxy/pattern.h>
 #include <haproxy/regex.h>
 #include <haproxy/tools.h>
 #include <haproxy/time.h>
@@ -121,7 +122,6 @@
 #include <haproxy/fd.h>
 #include <proto/filters.h>
 #include <proto/log.h>
-#include <proto/pattern.h>
 #include <haproxy/protocol.h>
 #include <proto/http_ana.h>
 #include <proto/proxy.h>
diff --git a/src/hlua.c b/src/hlua.c
index 3f491bd..594def0 100644
--- a/src/hlua.c
+++ b/src/hlua.c
@@ -34,6 +34,7 @@
 #include <haproxy/hlua_fcn.h>
 #include <haproxy/http_rules.h>
 #include <haproxy/obj_type.h>
+#include <haproxy/pattern.h>
 #include <haproxy/tools.h>
 
 #include <types/cli.h>
@@ -49,7 +50,6 @@
 #include <proto/http_fetch.h>
 #include <proto/map.h>
 #include <proto/queue.h>
-#include <proto/pattern.h>
 #include <proto/payload.h>
 #include <proto/http_ana.h>
 #include <proto/sample.h>
diff --git a/src/http_acl.c b/src/http_acl.c
index fdb5a00..b2de967 100644
--- a/src/http_acl.c
+++ b/src/http_acl.c
@@ -20,6 +20,7 @@
 #include <haproxy/api.h>
 #include <haproxy/chunk.h>
 #include <haproxy/http.h>
+#include <haproxy/pattern.h>
 #include <haproxy/pool.h>
 #include <haproxy/tools.h>
 #include <haproxy/version.h>
@@ -28,7 +29,6 @@
 
 #include <proto/acl.h>
 #include <haproxy/arg.h>
-#include <proto/pattern.h>
 
 
 /* We use the pre-parsed method if it is known, and store its number as an
diff --git a/src/http_act.c b/src/http_act.c
index d2babb1..f2b803e 100644
--- a/src/http_act.c
+++ b/src/http_act.c
@@ -23,6 +23,7 @@
 #include <haproxy/http.h>
 #include <haproxy/http_htx.h>
 #include <haproxy/http_rules.h>
+#include <haproxy/pattern.h>
 #include <haproxy/pool.h>
 #include <haproxy/regex.h>
 #include <haproxy/tools.h>
@@ -36,7 +37,6 @@
 #include <haproxy/arg.h>
 #include <proto/log.h>
 #include <proto/http_ana.h>
-#include <proto/pattern.h>
 #include <proto/stream_interface.h>
 
 /* Release memory allocated by most of HTTP actions. Concretly, it releases
diff --git a/src/map.c b/src/map.c
index df24ed2..b398f03 100644
--- a/src/map.c
+++ b/src/map.c
@@ -13,6 +13,7 @@
 #include <stdio.h>
 
 #include <haproxy/api.h>
+#include <haproxy/pattern.h>
 #include <haproxy/regex.h>
 #include <haproxy/tools.h>
 
@@ -20,7 +21,6 @@
 #include <types/cli.h>
 #include <types/global.h>
 #include <types/map.h>
-#include <types/pattern.h>
 #include <types/stats.h>
 
 #include <proto/applet.h>
@@ -28,7 +28,6 @@
 #include <proto/cli.h>
 #include <proto/log.h>
 #include <proto/map.h>
-#include <proto/pattern.h>
 #include <proto/stream_interface.h>
 #include <proto/sample.h>
 
diff --git a/src/pattern.c b/src/pattern.c
index d4988b1..e6250b3 100644
--- a/src/pattern.c
+++ b/src/pattern.c
@@ -16,14 +16,13 @@
 
 #include <haproxy/api.h>
 #include <haproxy/net_helper.h>
+#include <haproxy/pattern.h>
 #include <haproxy/regex.h>
 #include <haproxy/tools.h>
 
 #include <types/global.h>
-#include <types/pattern.h>
 
 #include <proto/log.h>
-#include <proto/pattern.h>
 #include <proto/sample.h>
 
 #include <import/ebsttree.h>
diff --git a/src/payload.c b/src/payload.c
index f52f987..eaf8f06 100644
--- a/src/payload.c
+++ b/src/payload.c
@@ -15,12 +15,12 @@
 
 #include <haproxy/api.h>
 #include <haproxy/net_helper.h>
+#include <haproxy/pattern.h>
 #include <haproxy/htx.h>
 #include <proto/acl.h>
 #include <haproxy/arg.h>
 #include <proto/channel.h>
 #include <proto/connection.h>
-#include <proto/pattern.h>
 #include <proto/payload.h>
 #include <proto/sample.h>
 #include <proto/http_ana.h>
diff --git a/src/ssl_sock.c b/src/ssl_sock.c
index abfef91..b966308 100644
--- a/src/ssl_sock.c
+++ b/src/ssl_sock.c
@@ -50,6 +50,7 @@
 #include <haproxy/frontend.h>
 #include <haproxy/http_rules.h>
 #include <haproxy/openssl-compat.h>
+#include <haproxy/pattern-t.h>
 #include <haproxy/shctx.h>
 #include <haproxy/ssl_ckch.h>
 #include <haproxy/ssl_crtlist.h>
@@ -75,7 +76,6 @@
 #include <proto/cli.h>
 #include <haproxy/fd.h>
 #include <haproxy/freq_ctr.h>
-#include <proto/pattern.h>
 #include <proto/proto_tcp.h>
 #include <proto/http_ana.h>
 #include <proto/server.h>
diff --git a/src/stats.c b/src/stats.c
index 8f17413..dcde9c1 100644
--- a/src/stats.c
+++ b/src/stats.c
@@ -36,6 +36,7 @@
 #include <haproxy/pool.h>
 #include <haproxy/list.h>
 #include <haproxy/listener.h>
+#include <haproxy/pattern-t.h>
 #include <haproxy/tools.h>
 #include <haproxy/ticks.h>
 #include <haproxy/time.h>
@@ -56,7 +57,6 @@
 #include <haproxy/fd.h>
 #include <haproxy/freq_ctr.h>
 #include <proto/log.h>
-#include <proto/pattern.h>
 #include <haproxy/pipe.h>
 #include <proto/map.h>
 #include <proto/proxy.h>