]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
[CLEANUP] remove many #include <types/xxx> from C files
authorWilly Tarreau <w@1wt.eu>
Mon, 14 Jul 2008 22:22:45 +0000 (00:22 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 16 Jul 2008 08:30:42 +0000 (10:30 +0200)
It should be stated as a rule that a C file should never
include types/xxx.h when proto/xxx.h exists, as it gives
less exposure to declaration conflicts (one of which was
caught and fixed here) and it complicates the file headers
for nothing.

Only types/global.h, types/capture.h and types/polling.h
have been found to be valid includes from C files.

29 files changed:
include/proto/log.h
src/acl.c
src/appsession.c
src/backend.c
src/cfgparse.c
src/checks.c
src/client.c
src/cttproxy.c
src/dumpstats.c
src/ev_epoll.c
src/ev_kqueue.c
src/ev_poll.c
src/ev_select.c
src/ev_sepoll.c
src/fd.c
src/haproxy.c
src/hdr_idx.c
src/log.c
src/proto_http.c
src/proto_tcp.c
src/proto_uxst.c
src/protocols.c
src/proxy.c
src/queue.c
src/senddata.c
src/server.c
src/session.c
src/stream_sock.c
src/task.c

index 1a02ec12205469f9f236a5c16c41d48148108e19..4f6eed7f0af4e402cf3118642bf242623dc99715 100644 (file)
@@ -3,7 +3,7 @@
   This file contains definitions of log-related functions, structures,
   and macros.
 
-  Copyright (C) 2000-2006 Willy Tarreau - w@1wt.eu
+  Copyright (C) 2000-2008 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
@@ -38,17 +38,17 @@ extern struct pool_head *pool2_requri;
  * Displays the message on stderr with the date and pid. Overrides the quiet
  * mode during startup.
  */
-void Alert(char *fmt, ...);
+void Alert(const char *fmt, ...);
 
 /*
  * Displays the message on stderr with the date and pid.
  */
-void Warning(char *fmt, ...);
+void Warning(const char *fmt, ...);
 
 /*
  * Displays the message on <out> only if quiet mode is not set.
  */
-void qfprintf(FILE *out, char *fmt, ...);
+void qfprintf(FILE *out, const char *fmt, ...);
 
 /*
  * This function sends a syslog message to both log servers of a proxy,
@@ -56,7 +56,7 @@ void qfprintf(FILE *out, char *fmt, ...);
  * It also tries not to waste too much time computing the message header.
  * It doesn't care about errors nor does it report them.
  */
-void send_log(struct proxy *p, int level, char *message, ...);
+void send_log(struct proxy *p, int level, const char *message, ...);
 
 /*
  * send a log for the session when we have enough info about it
index e5639f7795f26fe3488e267ebfc4f6eefdfea8fc..6385c6fd4036407c222b48e4aaba82126ef87a0b 100644 (file)
--- a/src/acl.c
+++ b/src/acl.c
 
 #include <proto/acl.h>
 
-#include <types/acl.h>
-#include <types/proxy.h>
-#include <types/session.h>
-
 /* List head of all known ACL keywords */
 static struct acl_kw_list acl_keywords = {
        .list = LIST_HEAD_INIT(acl_keywords.list)
index 10b4df07058b249c1b42e6eaf5f93b3c1586e59e..b3f2c76a4937a7dd20553adf3ee6fe69ceb9224e 100644 (file)
 #include <common/ticks.h>
 #include <common/time.h>
 
-#include <types/buffers.h>
 #include <types/global.h>
-#include <types/proxy.h>
-#include <types/server.h>
 
+#include <proto/proxy.h>
 #include <proto/task.h>
 
 static struct task *appsess_refresh = NULL;
index 7116965f8f3a7b039bdd90fc453eb3cbe476def1..ddedfd9823ad8b18163cbd613d08a2595a3974ba 100644 (file)
 #include <common/ticks.h>
 #include <common/time.h>
 
-#include <types/acl.h>
-#include <types/buffers.h>
 #include <types/global.h>
-#include <types/polling.h>
-#include <types/proxy.h>
-#include <types/server.h>
-#include <types/session.h>
 
 #include <proto/acl.h>
 #include <proto/backend.h>
index a492a932eddbc26d007ca619f89438921b63cb27..9aac0eb81c195525e377b89460d19f9d9674cd86 100644 (file)
 
 #include <types/capture.h>
 #include <types/global.h>
-#include <types/httperr.h>
 #include <types/polling.h>
-#include <types/proxy.h>
-#include <types/queue.h>
 
 #include <proto/acl.h>
 #include <proto/backend.h>
index 2dc1d601992c3dc9f7d1318eb24bf488868a5d19..5e3c19d7e0b8a9315ec26a935428d59dbd925b23 100644 (file)
@@ -30,9 +30,6 @@
 #include <common/time.h>
 
 #include <types/global.h>
-#include <types/polling.h>
-#include <types/proxy.h>
-#include <types/session.h>
 
 #include <proto/backend.h>
 #include <proto/buffers.h>
index e76a74109f0b7621631579f08d69359cea8a5c72..f3081c1d198f2f3b1772923e36360d48b6381594 100644 (file)
 #include <common/config.h>
 #include <common/time.h>
 
-#include <types/acl.h>
-#include <types/backend.h>
-#include <types/buffers.h>
 #include <types/global.h>
-#include <types/httperr.h>
-#include <types/polling.h>
-#include <types/proxy.h>
-#include <types/server.h>
-#include <types/session.h>
 
 #include <proto/acl.h>
 #include <proto/buffers.h>
index 04c3df2304e897f701fd76ba0d1a41219b03312c..9faed881e546c84838e12749a5cf8489fa28fd54 100644 (file)
@@ -2,7 +2,7 @@
  * Functions for managing transparent proxying with CTTPROXY.
  * This file should be compiled only if CTTPROXY is enabled.
  *
- * Copyright 2000-2007 Willy Tarreau <w@1wt.eu>
+ * Copyright 2000-2008 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
@@ -25,8 +25,6 @@
 #include <common/config.h>
 #include <common/time.h>
 
-#include <types/global.h>
-
 #include <import/ip_tproxy.h>
 
 /*
index 3517a995210c169d54705bfd6672b555ba036177..01ddd7129d1fa1fe18aaf1360e9cc08cd1233fc0 100644 (file)
@@ -36,9 +36,6 @@
 #include <common/version.h>
 
 #include <types/global.h>
-#include <types/polling.h>
-#include <types/proxy.h>
-#include <types/server.h>
 
 #include <proto/backend.h>
 #include <proto/buffers.h>
index 1c4e4370e33724a205479ffa5869ac735cc63854..30862cabcb006cd6e746c64981d4257d2d4aabcb 100644 (file)
@@ -24,7 +24,6 @@
 #include <types/fd.h>
 #include <types/global.h>
 
-#include <proto/fd.h>
 #include <proto/task.h>
 
 #if defined(USE_MY_EPOLL)
index 604340b831f31f06e9e86821d9b57e5c1f108aae..1e10b427f572044be65afc32e3702c22c4dfabf3 100644 (file)
@@ -27,7 +27,6 @@
 #include <common/time.h>
 #include <common/tools.h>
 
-#include <types/fd.h>
 #include <types/global.h>
 
 #include <proto/fd.h>
index 0a0f23d2c521f4128cf7de6d9d3fb3dce487dfb7..5f0a2c49b94f696db8fbbdf52382de57e9f3df5b 100644 (file)
@@ -20,7 +20,6 @@
 #include <common/ticks.h>
 #include <common/time.h>
 
-#include <types/fd.h>
 #include <types/global.h>
 
 #include <proto/fd.h>
index ecdd8709e372cfb7145bacbd9d9c69b577919f48..95663ffef8c533a569984414568bbe933b908e3b 100644 (file)
@@ -19,7 +19,6 @@
 #include <common/ticks.h>
 #include <common/time.h>
 
-#include <types/fd.h>
 #include <types/global.h>
 
 #include <proto/fd.h>
index 2419b684a66b5101b0e1e4b2d0e7b71efe49869a..70b10655d1f98cca004dcf5590d11169dc4de8dd 100644 (file)
@@ -56,7 +56,6 @@
 #include <common/time.h>
 #include <common/tools.h>
 
-#include <types/fd.h>
 #include <types/global.h>
 
 #include <proto/fd.h>
index eaaaabf50b34322ecfa71b5e184d509559afd307..0ee6a723edafb3fa35011117f2f05677b34ec98f 100644 (file)
--- a/src/fd.c
+++ b/src/fd.c
@@ -1,7 +1,7 @@
 /*
  * File descriptors management functions.
  *
- * Copyright 2000-2007 Willy Tarreau <w@1wt.eu>
+ * Copyright 2000-2008 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
@@ -18,8 +18,7 @@
 #include <common/compat.h>
 #include <common/config.h>
 
-#include <types/fd.h>
-#include <types/global.h>
+//#include <types/global.h>
 
 #include <proto/fd.h>
 
index 0c8bbb07adfa028fff7c652484e98a4cc18826f1..1d3089a58710374a515ef4822775a25d8657e667 100644 (file)
@@ -75,9 +75,7 @@
 
 #include <types/capture.h>
 #include <types/global.h>
-#include <types/httperr.h>
 #include <types/polling.h>
-#include <types/proto_http.h>
 
 #include <proto/acl.h>
 #include <proto/backend.h>
index aceaeb13ce1ff146360d688c901a2deec69ecc29..a8c595d0e67e913fa2557a036bc00fe4e82b0782 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Header indexation functions.
  *
- * Copyright 2000-2006 Willy Tarreau <w@1wt.eu>
+ * Copyright 2000-2008 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
@@ -11,7 +11,7 @@
  */
 
 #include <common/config.h>
-#include <types/hdr_idx.h>
+#include <proto/hdr_idx.h>
 
 
 /*
index d08ad16d6e4bf4b6a248656ed11f9bff35a36432..fc04232f8baf9cbc0e7a0479f0dc1b380e123de6 100644 (file)
--- a/src/log.c
+++ b/src/log.c
 #include <common/standard.h>
 #include <common/time.h>
 
-#include <types/backend.h>
 #include <types/global.h>
-#include <types/log.h>
-#include <types/session.h>
+
+#include <proto/log.h>
 
 #ifndef MSG_NOSIGNAL
 #define MSG_NOSIGNAL   (0)
index 6a662d42ee22007f7debd51b0119927811381533..5b1221f1cd457d2e77bce35097914f2909e786b2 100644 (file)
 #include <common/uri_auth.h>
 #include <common/version.h>
 
-#include <types/acl.h>
 #include <types/capture.h>
 #include <types/global.h>
-#include <types/httperr.h>
-#include <types/polling.h>
-#include <types/proxy.h>
-#include <types/server.h>
 
 #include <proto/acl.h>
 #include <proto/backend.h>
index cc7e50c0e8480f3890f953f6a30f0cea65648f8b..d06b76a7a46df3c292364bc8d5c69f4f041f9567 100644 (file)
 #include <common/time.h>
 #include <common/version.h>
 
-#include <types/acl.h>
 #include <types/global.h>
-#include <types/polling.h>
-#include <types/proxy.h>
-#include <types/server.h>
 
 #include <proto/acl.h>
 #include <proto/backend.h>
index dece8597178de3bfb067ac33b3a3e791f94974bf..d00b499cb1471251d4b60687b81eb014ec583bd5 100644 (file)
 #include <common/time.h>
 #include <common/version.h>
 
-#include <types/acl.h>
-#include <types/capture.h>
 #include <types/global.h>
-#include <types/polling.h>
-#include <types/proxy.h>
-#include <types/server.h>
 
 #include <proto/acl.h>
 #include <proto/backend.h>
index 70d04de4caae153408995ccdda4e44a20f0c9a8c..735c38443c2a62900af68e45afb233af65750836 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Protocol registration functions.
  *
- * Copyright 2000-2007 Willy Tarreau <w@1wt.eu>
+ * Copyright 2000-2008 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
@@ -18,8 +18,6 @@
 #include <common/mini-clist.h>
 #include <common/standard.h>
 
-#include <types/protocols.h>
-
 #include <proto/fd.h>
 
 /* List head of all registered protocols */
index f9589ecea40a2c24323b98c775e426b2a2164a2e..17728f5ac0d5474f6d19b55180c59203e3e13372 100644 (file)
@@ -26,7 +26,6 @@
 #include <common/time.h>
 
 #include <types/global.h>
-#include <types/polling.h>
 
 #include <proto/client.h>
 #include <proto/backend.h>
index 178f1877c23b18a3c3084332d5701f2789a59be0..3b7fd4ba3b4113219f5d986e8b7e72f197ddee0c 100644 (file)
@@ -14,9 +14,6 @@
 #include <common/memory.h>
 #include <common/time.h>
 
-#include <types/proxy.h>
-#include <types/session.h>
-
 #include <proto/queue.h>
 #include <proto/server.h>
 #include <proto/task.h>
index 18bb3e2ac1bbd2721193d5b71a995f248dcd8302..5d6174ce03c8354b5945b6bb5cdd5364b710384f 100644 (file)
 #include <common/time.h>
 #include <common/version.h>
 
-#include <types/global.h>
-#include <types/polling.h>
-#include <types/proxy.h>
-#include <types/server.h>
-
 #include <proto/backend.h>
 #include <proto/buffers.h>
 #include <proto/fd.h>
index bf29d2537d00905d9de696f3411d83fb5269e1f8..0016c802890b6c7984acaab5ac229ecebba3a109 100644 (file)
@@ -14,9 +14,7 @@
 #include <common/config.h>
 #include <common/time.h>
 
-#include <types/backend.h>
-#include <types/proxy.h>
-#include <types/server.h>
+#include <proto/server.h>
 
 int srv_downtime(struct server *s) {
 
index e3a736d2bcca7cd4a95ab564807b6952ac9fec54..c27ef75790b1f0ba0b265cc1747d0c8e3ccbeb40 100644 (file)
 #include <common/debug.h>
 #include <common/memory.h>
 
-#include <types/backend.h>
 #include <types/capture.h>
-#include <types/log.h>
-#include <types/proxy.h>
-#include <types/server.h>
 
 #include <proto/buffers.h>
 #include <proto/hdr_idx.h>
index aa45bdd10300185d0738c3cb14039675b5dc771a..84bc2dbf505da687d6af4e1b86f9ad8183d1ac13 100644 (file)
 #include <common/ticks.h>
 #include <common/time.h>
 
-#include <types/buffers.h>
-#include <types/global.h>
-#include <types/polling.h>
-
 #include <proto/client.h>
 #include <proto/fd.h>
 #include <proto/stream_sock.h>
index 5a9a2c2ef00bcd5e707fb95b45d54935226ed936..15539c234b78f90440e5ea6d5a3eef88a894e879 100644 (file)
@@ -19,7 +19,6 @@
 
 #include <proto/proxy.h>
 #include <proto/task.h>
-#include <types/task.h>
 
 struct pool_head *pool2_task;