mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-06 15:17:01 +02:00
[CLEANUP] remove many #include <types/xxx> from C files
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.
This commit is contained in:
parent
284648e079
commit
ec6c5df018
@ -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
|
||||
|
@ -20,10 +20,6 @@
|
||||
|
||||
#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)
|
||||
|
@ -21,11 +21,9 @@
|
||||
#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;
|
||||
|
@ -25,13 +25,7 @@
|
||||
#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>
|
||||
|
@ -32,10 +32,7 @@
|
||||
|
||||
#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>
|
||||
|
@ -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>
|
||||
|
@ -24,15 +24,7 @@
|
||||
#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>
|
||||
|
@ -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>
|
||||
|
||||
/*
|
||||
|
@ -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>
|
||||
|
@ -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)
|
||||
|
@ -27,7 +27,6 @@
|
||||
#include <common/time.h>
|
||||
#include <common/tools.h>
|
||||
|
||||
#include <types/fd.h>
|
||||
#include <types/global.h>
|
||||
|
||||
#include <proto/fd.h>
|
||||
|
@ -20,7 +20,6 @@
|
||||
#include <common/ticks.h>
|
||||
#include <common/time.h>
|
||||
|
||||
#include <types/fd.h>
|
||||
#include <types/global.h>
|
||||
|
||||
#include <proto/fd.h>
|
||||
|
@ -19,7 +19,6 @@
|
||||
#include <common/ticks.h>
|
||||
#include <common/time.h>
|
||||
|
||||
#include <types/fd.h>
|
||||
#include <types/global.h>
|
||||
|
||||
#include <proto/fd.h>
|
||||
|
@ -56,7 +56,6 @@
|
||||
#include <common/time.h>
|
||||
#include <common/tools.h>
|
||||
|
||||
#include <types/fd.h>
|
||||
#include <types/global.h>
|
||||
|
||||
#include <proto/fd.h>
|
||||
|
5
src/fd.c
5
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>
|
||||
|
||||
|
@ -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>
|
||||
|
@ -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>
|
||||
|
||||
|
||||
/*
|
||||
|
@ -26,10 +26,9 @@
|
||||
#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)
|
||||
|
@ -35,13 +35,8 @@
|
||||
#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>
|
||||
|
@ -35,11 +35,7 @@
|
||||
#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>
|
||||
|
@ -36,12 +36,7 @@
|
||||
#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>
|
||||
|
@ -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 */
|
||||
|
@ -26,7 +26,6 @@
|
||||
#include <common/time.h>
|
||||
|
||||
#include <types/global.h>
|
||||
#include <types/polling.h>
|
||||
|
||||
#include <proto/client.h>
|
||||
#include <proto/backend.h>
|
||||
|
@ -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>
|
||||
|
@ -32,11 +32,6 @@
|
||||
#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>
|
||||
|
@ -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) {
|
||||
|
||||
|
@ -16,11 +16,7 @@
|
||||
#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>
|
||||
|
@ -26,10 +26,6 @@
|
||||
#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>
|
||||
|
@ -19,7 +19,6 @@
|
||||
|
||||
#include <proto/proxy.h>
|
||||
#include <proto/task.h>
|
||||
#include <types/task.h>
|
||||
|
||||
struct pool_head *pool2_task;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user