Skip to content

Commit

Permalink
Merge pull request #306 from jajik/limit-includes
Browse files Browse the repository at this point in the history
Rearrange all the header includes
  • Loading branch information
jajik authored Dec 6, 2024
2 parents 07aac7b + 4d2dade commit 195dda7
Show file tree
Hide file tree
Showing 15 changed files with 14 additions and 160 deletions.
21 changes: 0 additions & 21 deletions native/advertise/mod_advertise.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,38 +18,17 @@

#define CORE_PRIVATE

#include "apr_hooks.h"
#include "apr.h"
#include "apr_lib.h"
#include "apr_strings.h"
#include "apr_buckets.h"
#include "apr_md5.h"
#include "apr_network_io.h"
#include "apr_pools.h"
#include "apr_strings.h"
#include "apr_uri.h"
#include "apr_date.h"
#include "apr_uuid.h"
#include "apr_version.h"
#include "apr_atomic.h"

#define APR_WANT_STRFUNC
#include "apr_want.h"

#include "httpd.h"
#include "http_config.h"
#include "http_core.h"
#include "http_protocol.h"
#include "http_request.h"
#include "http_vhost.h"
#include "http_main.h"
#include "http_log.h"
#include "http_connection.h"
#include "util_filter.h"
#include "util_ebcdic.h"
#include "util_time.h"
#include "ap_provider.h"
#include "ap_mpm.h"

#if APR_HAVE_NETINET_IN_H
#include <netinet/in.h>
Expand Down
14 changes: 0 additions & 14 deletions native/balancers/mod_lbmethod_cluster.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,9 @@
* SPDX-License-Identifier: Apache-2.0
*/

#include "mod_proxy.h"
#include "mod_watchdog.h"
#include "scoreboard.h"
#include "ap_mpm.h"
#include "apr_version.h"
#include "ap_hooks.h"

#include "ap_slotmem.h"

#include "node.h"
#include "host.h"
#include "context.h"
#include "balancer.h"

#include "common.h"

#include "mod_proxy_cluster.h"

#define LB_CLUSTER_WATHCHDOG_NAME ("_lb_cluster_")
static ap_watchdog_t *watchdog;
Expand Down
18 changes: 0 additions & 18 deletions native/common/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,6 @@

#include "common.h"

#include "httpd.h"
#include "http_config.h"
#include "http_log.h"
#include "http_main.h"
#include "http_request.h"
#include "mod_proxy.h"

#include "ap_slotmem.h"

#include "domain.h"
#include "node.h"
#include "host.h"
#include "context.h"
#include "balancer.h"

#include "mod_proxy_cluster.h"


proxy_vhost_table *read_vhost_table(apr_pool_t *pool, struct host_storage_method *host_storage, int for_cache)
{
proxy_vhost_table *vhost_table = apr_palloc(pool, sizeof(proxy_vhost_table));
Expand Down
8 changes: 0 additions & 8 deletions native/include/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,7 @@
* Common routines
*/

#include "mod_proxy.h"

#include "ap_slotmem.h"

#include "domain.h"
#include "node.h"
#include "host.h"
#include "node.h"
#include "context.h"
#include "mod_proxy_cluster.h"


Expand Down
3 changes: 3 additions & 0 deletions native/include/mod_proxy_cluster.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
*/

#include "balancer.h"
#include "node.h"
#include "context.h"
#include "host.h"

#define MOD_CLUSTER_EXPOSED_VERSION "mod_cluster/2.0.0.Alpha1-SNAPSHOT"

Expand Down
2 changes: 0 additions & 2 deletions native/include/node.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ typedef struct mem mem_t;

#include "mod_clustersize.h"

#include "ap_mmn.h"

/**
* Configuration of the node received from jboss cluster
*/
Expand Down
9 changes: 0 additions & 9 deletions native/mod_manager/balancer.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,6 @@
* @{
*/

#include "apr.h"
#include "apr_strings.h"
#include "apr_pools.h"
#include "apr_time.h"

#include "ap_slotmem.h"
#include "balancer.h"

#include "common.h"

#include "mod_manager.h"

Expand Down
10 changes: 0 additions & 10 deletions native/mod_manager/context.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,8 @@
* @{
*/

#include "apr.h"
#include "apr_strings.h"
#include "apr_pools.h"
#include "apr_time.h"

#include "ap_slotmem.h"
#include "context.h"

#include "mod_manager.h"

#include "common.h"


static mem_t *create_attach_mem_context(char *string, unsigned *num, int type, int create, apr_pool_t *p,
slotmem_storage_method *storage)
Expand Down
11 changes: 1 addition & 10 deletions native/mod_manager/domain.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,8 @@
* @{
*/

#include "apr.h"
#include "apr_strings.h"
#include "apr_pools.h"
#include "apr_time.h"

#include "ap_slotmem.h"
#include "domain.h"

#include "common.h"

#include "mod_manager.h"
#include "domain.h"

static mem_t *create_attach_mem_domain(char *string, unsigned *num, int type, int create, apr_pool_t *p,
slotmem_storage_method *storage)
Expand Down
9 changes: 1 addition & 8 deletions native/mod_manager/host.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,9 @@
* @{
*/

#include "apr.h"
#include "apr_strings.h"
#include "apr_pools.h"
#include "apr_time.h"

#include "ap_slotmem.h"
#include "mod_manager.h"
#include "host.h"

#include "mod_manager.h"
#include "common.h"

static mem_t *create_attach_mem_host(char *string, unsigned *num, int type, int create, apr_pool_t *p,
slotmem_storage_method *storage)
Expand Down
23 changes: 3 additions & 20 deletions native/mod_manager/mod_manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,34 +7,17 @@
* @author Jean-Frederic Clere
*/

#include "apr_strings.h"
#include "domain.h"
#include "common.h"

#include "apr_lib.h"
#include "apr_uuid.h"

#define CORE_PRIVATE
#include "httpd.h"
#include "http_config.h"
#include "http_log.h"
#include "http_main.h"
#include "http_request.h"
#include "http_protocol.h"
#include "http_core.h"
#include "scoreboard.h"
#include "mod_proxy.h"
#include "ap_mpm.h"

#include "ap_slotmem.h"

#include "node.h"
#include "host.h"
#include "context.h"
#include "balancer.h"
#include "sessionid.h"
#include "domain.h"

#include "common.h"

#include "mod_proxy_cluster.h"

#define DEFMAXCONTEXT 100
#define DEFMAXNODE 20
Expand Down
2 changes: 2 additions & 0 deletions native/mod_manager/mod_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
* @{
*/

#include "common.h"

struct mem
{
ap_slotmem_instance_t *slotmem;
Expand Down
14 changes: 1 addition & 13 deletions native/mod_manager/node.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,9 @@
* @{
*/

#include "apr.h"
#include "apr_strings.h"
#include "apr_pools.h"
#include "apr_time.h"

/* for debug */
#include "httpd.h"
#include "http_main.h"

#include "ap_slotmem.h"
#include "node.h"

#include "mod_manager.h"
#include "node.h"

#include "common.h"

static mem_t *create_attach_mem_node(char *string, unsigned *num, int type, int create, apr_pool_t *p,
slotmem_storage_method *storage)
Expand Down
10 changes: 1 addition & 9 deletions native/mod_manager/sessionid.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,9 @@
* @{
*/

#include "apr.h"
#include "apr_strings.h"
#include "apr_pools.h"
#include "apr_time.h"

#include "ap_slotmem.h"
#include "mod_manager.h"
#include "sessionid.h"

#include "common.h"

#include "mod_manager.h"

static mem_t *create_attach_mem_sessionid(char *string, unsigned *num, int type, int create, apr_pool_t *p,
slotmem_storage_method *storage)
Expand Down
20 changes: 2 additions & 18 deletions native/mod_proxy_cluster/mod_proxy_cluster.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,31 +7,15 @@
* @author Jean-Frederic Clere
*/

#include "httpd.h"
#include "http_config.h"
#include "http_log.h"
#include "http_main.h"
#include "http_request.h"
#include "http_protocol.h"
#include "http_core.h"
#include "scoreboard.h"
#include "ap_mpm.h"
#include "mod_proxy_cluster.h"

#include "mpm_common.h"
#include "mod_proxy.h"
#include "mod_watchdog.h"

#include "ap_slotmem.h"

#include "node.h"
#include "host.h"
#include "context.h"
#include "balancer.h"
#include "sessionid.h"
#include "domain.h"

#include "common.h"

#include "mod_proxy_cluster.h"

#if APR_HAVE_UNISTD_H
/* for getpid() */
Expand Down

0 comments on commit 195dda7

Please sign in to comment.