From 225a90aaec89c13bed73249bc2fda6620fadf1fe Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Thu, 4 Jun 2020 15:06:28 +0200 Subject: [PATCH] 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. --- include/haproxy/auth.h | 2 +- .../{types/pattern.h => haproxy/pattern-t.h} | 17 ++++++++--------- include/{proto => haproxy}/pattern.h | 14 +++++++++----- include/types/acl.h | 2 +- include/types/map.h | 2 +- src/acl.c | 2 +- src/auth.c | 3 +-- src/cli.c | 2 +- src/haproxy.c | 2 +- src/hlua.c | 2 +- src/http_acl.c | 2 +- src/http_act.c | 2 +- src/map.c | 3 +-- src/pattern.c | 3 +-- src/payload.c | 2 +- src/ssl_sock.c | 2 +- src/stats.c | 2 +- 17 files changed, 32 insertions(+), 32 deletions(-) rename include/{types/pattern.h => haproxy/pattern-t.h} (97%) rename include/{proto => haproxy}/pattern.h (97%) diff --git a/include/haproxy/auth.h b/include/haproxy/auth.h index 39cc0aab1..3eafa410e 100644 --- a/include/haproxy/auth.h +++ b/include/haproxy/auth.h @@ -16,7 +16,7 @@ #include #include -#include +#include #include extern struct userlist *userlist; diff --git a/include/types/pattern.h b/include/haproxy/pattern-t.h similarity index 97% rename from include/types/pattern.h rename to include/haproxy/pattern-t.h index 0baf3d795..7787ec30b 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 -#include #include #include +#include +#include #include -#include /* Pattern matching function result. * @@ -217,7 +219,4 @@ struct pattern_head { 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 73c48cc3b..6be2474bb 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 #include -#include +#include /* 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 78b26125c..d9f408435 100644 --- a/include/types/acl.h +++ b/include/types/acl.h @@ -23,11 +23,11 @@ #define _TYPES_ACL_H #include +#include #include #include #include -#include #include #include diff --git a/include/types/map.h b/include/types/map.h index 750da56da..5b59ec0ba 100644 --- a/include/types/map.h +++ b/include/types/map.h @@ -22,7 +22,7 @@ #ifndef _TYPES_MAP_H #define _TYPES_MAP_H -#include +#include #include struct map_descriptor { diff --git a/src/acl.c b/src/acl.c index 1ecacb1d9..17a5e1041 100644 --- a/src/acl.c +++ b/src/acl.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include @@ -26,7 +27,6 @@ #include #include #include -#include #include #include #include diff --git a/src/auth.c b/src/auth.c index 30fec83f5..b28d6dd78 100644 --- a/src/auth.c +++ b/src/auth.c @@ -29,13 +29,12 @@ #include #include #include +#include #include #include #include -#include - struct userlist *userlist = NULL; /* list of all existing userlists */ #ifdef USE_LIBCRYPT diff --git a/src/cli.c b/src/cli.c index 7eb3bc2a8..f7cf57ce1 100644 --- a/src/cli.c +++ b/src/cli.c @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -54,7 +55,6 @@ #include #include #include -#include #include #include #include diff --git a/src/haproxy.c b/src/haproxy.c index ebf9ae39a..9e6627c57 100644 --- a/src/haproxy.c +++ b/src/haproxy.c @@ -97,6 +97,7 @@ #include #include #include +#include #include #include #include @@ -121,7 +122,6 @@ #include #include #include -#include #include #include #include diff --git a/src/hlua.c b/src/hlua.c index 3f491bd92..594def0b0 100644 --- a/src/hlua.c +++ b/src/hlua.c @@ -34,6 +34,7 @@ #include #include #include +#include #include #include @@ -49,7 +50,6 @@ #include #include #include -#include #include #include #include diff --git a/src/http_acl.c b/src/http_acl.c index fdb5a0042..b2de967aa 100644 --- a/src/http_acl.c +++ b/src/http_acl.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -28,7 +29,6 @@ #include #include -#include /* 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 d2babb1bc..f2b803ec3 100644 --- a/src/http_act.c +++ b/src/http_act.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -36,7 +37,6 @@ #include #include #include -#include #include /* Release memory allocated by most of HTTP actions. Concretly, it releases diff --git a/src/map.c b/src/map.c index df24ed2f0..b398f03bb 100644 --- a/src/map.c +++ b/src/map.c @@ -13,6 +13,7 @@ #include #include +#include #include #include @@ -20,7 +21,6 @@ #include #include #include -#include #include #include @@ -28,7 +28,6 @@ #include #include #include -#include #include #include diff --git a/src/pattern.c b/src/pattern.c index d4988b172..e6250b380 100644 --- a/src/pattern.c +++ b/src/pattern.c @@ -16,14 +16,13 @@ #include #include +#include #include #include #include -#include #include -#include #include #include diff --git a/src/payload.c b/src/payload.c index f52f9873c..eaf8f06e5 100644 --- a/src/payload.c +++ b/src/payload.c @@ -15,12 +15,12 @@ #include #include +#include #include #include #include #include #include -#include #include #include #include diff --git a/src/ssl_sock.c b/src/ssl_sock.c index abfef9156..b9663081b 100644 --- a/src/ssl_sock.c +++ b/src/ssl_sock.c @@ -50,6 +50,7 @@ #include #include #include +#include #include #include #include @@ -75,7 +76,6 @@ #include #include #include -#include #include #include #include diff --git a/src/stats.c b/src/stats.c index 8f174135c..dcde9c154 100644 --- a/src/stats.c +++ b/src/stats.c @@ -36,6 +36,7 @@ #include #include #include +#include #include #include #include @@ -56,7 +57,6 @@ #include #include #include -#include #include #include #include