REORG: rename "pattern" files

They're now called "sample" everywhere to match their description.
diff --git a/Makefile b/Makefile
index c832338..8a96dd7 100644
--- a/Makefile
+++ b/Makefile
@@ -516,7 +516,7 @@
        src/lb_chash.o src/lb_fwlc.o src/lb_fwrr.o src/lb_map.o src/lb_fas.o \
        src/stream_interface.o src/dumpstats.o src/proto_tcp.o \
        src/session.o src/hdr_idx.o src/ev_select.o src/signal.o \
-       src/acl.o src/pattern.o src/memory.o src/freq_ctr.o src/auth.o
+       src/acl.o src/sample.o src/memory.o src/freq_ctr.o src/auth.o
 
 EBTREE_OBJS = $(EBTREE_DIR)/ebtree.o \
               $(EBTREE_DIR)/eb32tree.o $(EBTREE_DIR)/eb64tree.o \
diff --git a/Makefile.bsd b/Makefile.bsd
index 14dafac..9b0e514 100644
--- a/Makefile.bsd
+++ b/Makefile.bsd
@@ -115,7 +115,7 @@
        src/lb_chash.o src/lb_fwlc.o src/lb_fwrr.o src/lb_map.o src/lb_fas.o \
        src/ev_poll.o src/ev_kqueue.o \
        src/arg.o src/acl.o src/memory.o src/freq_ctr.o \
-       src/auth.o src/stick_table.o src/pattern.o
+       src/auth.o src/stick_table.o src/sample.o
 
 EBTREE_OBJS = $(EBTREE_DIR)/ebtree.o \
               $(EBTREE_DIR)/eb32tree.o $(EBTREE_DIR)/eb64tree.o \
diff --git a/Makefile.osx b/Makefile.osx
index a4389ef..ffd9a61 100644
--- a/Makefile.osx
+++ b/Makefile.osx
@@ -112,7 +112,7 @@
        src/lb_chash.o src/lb_fwlc.o src/lb_fwrr.o src/lb_map.o src/lb_fas.o \
        src/ev_poll.o \
        src/arg.o src/acl.o src/memory.o src/freq_ctr.o \
-       src/auth.o src/stick_table.o src/pattern.o
+       src/auth.o src/stick_table.o src/sample.o
 
 EBTREE_OBJS = $(EBTREE_DIR)/ebtree.o \
               $(EBTREE_DIR)/eb32tree.o $(EBTREE_DIR)/eb64tree.o \
diff --git a/include/proto/acl.h b/include/proto/acl.h
index c60b914..d514076 100644
--- a/include/proto/acl.h
+++ b/include/proto/acl.h
@@ -24,7 +24,7 @@
 
 #include <common/config.h>
 #include <types/acl.h>
-#include <proto/pattern.h>
+#include <proto/sample.h>
 
 /*
  * FIXME: we need destructor functions too !
diff --git a/include/proto/pattern.h b/include/proto/sample.h
similarity index 84%
rename from include/proto/pattern.h
rename to include/proto/sample.h
index c595ed6..471eb5f 100644
--- a/include/proto/pattern.h
+++ b/include/proto/sample.h
@@ -1,8 +1,9 @@
 /*
- * include/proto/pattern.h
- * Functions for patterns management.
+ * include/proto/sample.h
+ * Functions for samples management.
  *
  * Copyright (C) 2009-2010 EXCELIANCE, Emeric Brun <ebrun@exceliance.fr>
+ * Copyright (C) 2012 Willy Tarreau <w@1wt.eu>
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -19,10 +20,10 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#ifndef _PROTO_PATTERN_H
-#define _PROTO_PATTERN_H
+#ifndef _PROTO_SAMPLE_H
+#define _PROTO_SAMPLE_H
 
-#include <types/pattern.h>
+#include <types/sample.h>
 #include <types/stick_table.h>
 
 struct sample_expr *sample_parse_expr(char **str, int *idx, char *err, int err_size);
@@ -31,4 +32,5 @@
                                struct sample *p);
 void sample_register_fetches(struct sample_fetch_kw_list *psl);
 void sample_register_convs(struct sample_conv_kw_list *psl);
-#endif
+
+#endif /* _PROTO_SAMPLE_H */
diff --git a/include/types/acl.h b/include/types/acl.h
index 9e560cf..ed8582b 100644
--- a/include/types/acl.h
+++ b/include/types/acl.h
@@ -28,8 +28,8 @@
 
 #include <types/arg.h>
 #include <types/auth.h>
-#include <types/pattern.h>
 #include <types/proxy.h>
+#include <types/sample.h>
 #include <types/server.h>
 #include <types/session.h>
 
diff --git a/include/types/proxy.h b/include/types/proxy.h
index e18bb7a..4766e13 100644
--- a/include/types/proxy.h
+++ b/include/types/proxy.h
@@ -36,7 +36,6 @@
 #include <eb32tree.h>
 
 #include <types/acl.h>
-#include <types/pattern.h>
 #include <types/backend.h>
 #include <types/buffers.h>
 #include <types/counters.h>
@@ -44,6 +43,7 @@
 #include <types/log.h>
 #include <types/protocols.h>
 #include <types/proto_http.h>
+#include <types/sample.h>
 #include <types/session.h>
 #include <types/server.h>
 #include <types/stick_table.h>
diff --git a/include/types/pattern.h b/include/types/sample.h
similarity index 96%
rename from include/types/pattern.h
rename to include/types/sample.h
index 314bdda..b806a12 100644
--- a/include/types/pattern.h
+++ b/include/types/sample.h
@@ -1,8 +1,9 @@
 /*
- * include/types/pattern.h
- * Macros, variables and structures for patterns management.
+ * include/types/sample.h
+ * Macros, variables and structures for sample management.
  *
  * Copyright (C) 2009-2010 EXCELIANCE, Emeric Brun <ebrun@exceliance.fr>
+ * Copyright (C) 2012 Willy Tarreau <w@1wt.eu>
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -19,8 +20,8 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#ifndef _TYPES_PATTERN_H
-#define _TYPES_PATTERN_H
+#ifndef _TYPES_SAMPLE_H
+#define _TYPES_SAMPLE_H
 
 #include <sys/socket.h>
 #include <netinet/in.h>
@@ -161,4 +162,4 @@
 	struct sample_conv kw[VAR_ARRAY];         /* array of sample conversion descriptors */
 };
 
-#endif /* _TYPES_PATTERN_H */
+#endif /* _TYPES_SAMPLE_H */
diff --git a/src/cfgparse.c b/src/cfgparse.c
index 1fd5fe1..8bfa4b2 100644
--- a/src/cfgparse.c
+++ b/src/cfgparse.c
@@ -51,7 +51,6 @@
 #include <proto/lb_fwrr.h>
 #include <proto/lb_map.h>
 #include <proto/log.h>
-#include <proto/pattern.h>
 #include <proto/port_range.h>
 #include <proto/protocols.h>
 #include <proto/proto_tcp.h>
@@ -59,6 +58,7 @@
 #include <proto/proto_http.h>
 #include <proto/proxy.h>
 #include <proto/peers.h>
+#include <proto/sample.h>
 #include <proto/server.h>
 #include <proto/session.h>
 #include <proto/task.h>
diff --git a/src/peers.c b/src/peers.c
index 3d2fd01..ab6f7ed 100644
--- a/src/peers.c
+++ b/src/peers.c
@@ -32,7 +32,6 @@
 #include <proto/fd.h>
 #include <proto/log.h>
 #include <proto/hdr_idx.h>
-#include <proto/pattern.h>
 #include <proto/protocols.h>
 #include <proto/proto_tcp.h>
 #include <proto/proto_http.h>
diff --git a/src/proto_http.c b/src/proto_http.c
index 1cc3cc7..0fffad4 100644
--- a/src/proto_http.c
+++ b/src/proto_http.c
@@ -52,11 +52,11 @@
 #include <proto/frontend.h>
 #include <proto/log.h>
 #include <proto/hdr_idx.h>
-#include <proto/pattern.h>
 #include <proto/proto_tcp.h>
 #include <proto/proto_http.h>
 #include <proto/proxy.h>
 #include <proto/queue.h>
+#include <proto/sample.h>
 #include <proto/server.h>
 #include <proto/session.h>
 #include <proto/stream_interface.h>
diff --git a/src/proto_tcp.c b/src/proto_tcp.c
index 2cb4b27..1f0d6dc 100644
--- a/src/proto_tcp.c
+++ b/src/proto_tcp.c
@@ -42,11 +42,11 @@
 #include <proto/buffers.h>
 #include <proto/frontend.h>
 #include <proto/log.h>
-#include <proto/pattern.h>
 #include <proto/port_range.h>
 #include <proto/protocols.h>
 #include <proto/proto_tcp.h>
 #include <proto/proxy.h>
+#include <proto/sample.h>
 #include <proto/session.h>
 #include <proto/stick_table.h>
 #include <proto/stream_sock.h>
diff --git a/src/pattern.c b/src/sample.c
similarity index 98%
rename from src/pattern.c
rename to src/sample.c
index 5ecc0d1..f14b99b 100644
--- a/src/pattern.c
+++ b/src/sample.c
@@ -1,7 +1,8 @@
 /*
- * Patterns management functions.
+ * Sample management functions.
  *
  * Copyright 2009-2010 EXCELIANCE, Emeric Brun <ebrun@exceliance.fr>
+ * Copyright (C) 2012 Willy Tarreau <w@1wt.eu>
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
@@ -13,10 +14,11 @@
 #include <string.h>
 #include <arpa/inet.h>
 
+#include <common/standard.h>
+
 #include <proto/arg.h>
-#include <proto/pattern.h>
 #include <proto/buffers.h>
-#include <common/standard.h>
+#include <proto/sample.h>
 
 /* static sample used in sample_process() when <p> is NULL */
 static struct sample temp_smp;
diff --git a/src/session.c b/src/session.c
index 8ea2a3c..f8b6516 100644
--- a/src/session.c
+++ b/src/session.c
@@ -39,6 +39,7 @@
 #include <proto/proxy.h>
 #include <proto/queue.h>
 #include <proto/server.h>
+#include <proto/sample.h>
 #include <proto/stick_table.h>
 #include <proto/stream_interface.h>
 #include <proto/stream_sock.h>
diff --git a/src/stick_table.c b/src/stick_table.c
index d2ce3e3..52ea7cf 100644
--- a/src/stick_table.c
+++ b/src/stick_table.c
@@ -22,8 +22,8 @@
 #include <ebmbtree.h>
 #include <ebsttree.h>
 
-#include <proto/pattern.h>
 #include <proto/proxy.h>
+#include <proto/sample.h>
 #include <proto/session.h>
 #include <proto/stick_table.h>
 #include <proto/task.h>