Skip to content

Commit

Permalink
simplify header inclusion
Browse files Browse the repository at this point in the history
  • Loading branch information
bradh352 committed Jun 23, 2024
1 parent ef186fe commit 0ec8ec5
Show file tree
Hide file tree
Showing 94 changed files with 365 additions and 797 deletions.
1 change: 0 additions & 1 deletion src/lib/Makefile.inc
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,5 @@ HHEADERS = ares__buf.h \
ares_str.h \
ares_strsplit.h \
ares_setup.h \
setup_once.h \
thirdparty/apple/dnsinfo.h

4 changes: 1 addition & 3 deletions src/lib/ares__addrinfo2hostent.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
* SPDX-License-Identifier: MIT
*/

#include "ares_setup.h"
#include "ares_private.h"

#ifdef HAVE_NETINET_IN_H
# include <netinet/in.h>
Expand All @@ -47,8 +47,6 @@
# include <limits.h>
#endif

#include "ares.h"
#include "ares_private.h"

ares_status_t ares__addrinfo2hostent(const struct ares_addrinfo *ai, int family,
struct hostent **host)
Expand Down
6 changes: 1 addition & 5 deletions src/lib/ares__addrinfo_localhost.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
* SPDX-License-Identifier: MIT
*/

#include "ares_setup.h"
#include "ares_private.h"

#ifdef HAVE_NETINET_IN_H
# include <netinet/in.h>
Expand All @@ -49,10 +49,6 @@
# endif
#endif

#include "ares.h"
#include "ares_inet_net_pton.h"
#include "ares_private.h"

ares_status_t ares_append_ai_node(int aftype, unsigned short port,
unsigned int ttl, const void *adata,
struct ares_addrinfo_node **nodes)
Expand Down
2 changes: 0 additions & 2 deletions src/lib/ares__buf.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
*
* SPDX-License-Identifier: MIT
*/
#include "ares_setup.h"
#include "ares.h"
#include "ares_private.h"
#include "ares__buf.h"
#include <limits.h>
Expand Down
3 changes: 0 additions & 3 deletions src/lib/ares__close_sockets.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@
* SPDX-License-Identifier: MIT
*/

#include "ares_setup.h"

#include "ares.h"
#include "ares_private.h"
#include <assert.h>

Expand Down
2 changes: 0 additions & 2 deletions src/lib/ares__hosts_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
*
* SPDX-License-Identifier: MIT
*/
#include "ares_setup.h"
#include "ares.h"
#include "ares_private.h"
#ifdef HAVE_SYS_TYPES_H
# include <sys/types.h>
Expand Down
2 changes: 0 additions & 2 deletions src/lib/ares__htable.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
*
* SPDX-License-Identifier: MIT
*/
#include "ares_setup.h"
#include "ares.h"
#include "ares_private.h"
#include "ares__llist.h"
#include "ares__htable.h"
Expand Down
2 changes: 0 additions & 2 deletions src/lib/ares__htable_asvp.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
*
* SPDX-License-Identifier: MIT
*/
#include "ares_setup.h"
#include "ares.h"
#include "ares_private.h"
#include "ares__htable.h"
#include "ares__htable_asvp.h"
Expand Down
2 changes: 0 additions & 2 deletions src/lib/ares__htable_strvp.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
*
* SPDX-License-Identifier: MIT
*/
#include "ares_setup.h"
#include "ares.h"
#include "ares_private.h"
#include "ares__htable.h"
#include "ares__htable_strvp.h"
Expand Down
2 changes: 0 additions & 2 deletions src/lib/ares__htable_szvp.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
*
* SPDX-License-Identifier: MIT
*/
#include "ares_setup.h"
#include "ares.h"
#include "ares_private.h"
#include "ares__htable.h"
#include "ares__htable_szvp.h"
Expand Down
2 changes: 0 additions & 2 deletions src/lib/ares__htable_vpvp.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
*
* SPDX-License-Identifier: MIT
*/
#include "ares_setup.h"
#include "ares.h"
#include "ares_private.h"
#include "ares__htable.h"
#include "ares__htable_vpvp.h"
Expand Down
5 changes: 1 addition & 4 deletions src/lib/ares__iface_ips.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@
*
* SPDX-License-Identifier: MIT
*/
#include "ares_setup.h"

#include "ares_private.h"

#ifdef USE_WINSOCK
# include <winsock2.h>
Expand Down Expand Up @@ -59,8 +58,6 @@
# include <netdb.h>
#endif

#include "ares.h"
#include "ares_private.h"

static ares_status_t ares__iface_ips_enumerate(ares__iface_ips_t *ips,
const char *name);
Expand Down
2 changes: 0 additions & 2 deletions src/lib/ares__llist.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
*
* SPDX-License-Identifier: MIT
*/
#include "ares_setup.h"
#include "ares.h"
#include "ares_private.h"
#include "ares__llist.h"

Expand Down
4 changes: 1 addition & 3 deletions src/lib/ares__parse_into_addrinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
*
* SPDX-License-Identifier: MIT
*/
#include "ares_setup.h"
#include "ares_private.h"

#ifdef HAVE_NETINET_IN_H
# include <netinet/in.h>
Expand All @@ -44,8 +44,6 @@
# include <limits.h>
#endif

#include "ares.h"
#include "ares_private.h"

ares_status_t ares__parse_into_addrinfo(const ares_dns_record_t *dnsrec,
ares_bool_t cname_only_is_enodata,
Expand Down
2 changes: 0 additions & 2 deletions src/lib/ares__slist.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
*
* SPDX-License-Identifier: MIT
*/
#include "ares_setup.h"
#include "ares.h"
#include "ares_private.h"
#include "ares__slist.h"

Expand Down
4 changes: 1 addition & 3 deletions src/lib/ares__socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
*
* SPDX-License-Identifier: MIT
*/
#include "ares_setup.h"
#include "ares_private.h"

#ifdef HAVE_SYS_UIO_H
# include <sys/uio.h>
Expand Down Expand Up @@ -56,8 +56,6 @@
#include <fcntl.h>
#include <limits.h>

#include "ares.h"
#include "ares_private.h"

ares_ssize_t ares__socket_recvfrom(ares_channel_t *channel, ares_socket_t s,
void *data, size_t data_len, int flags,
Expand Down
4 changes: 1 addition & 3 deletions src/lib/ares__sortaddrinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
* SPDX-License-Identifier: BSD-3-Clause
*/

#include "ares_setup.h"
#include "ares_private.h"

#ifdef HAVE_NETINET_IN_H
# include <netinet/in.h>
Expand All @@ -51,8 +51,6 @@
#include <assert.h>
#include <limits.h>

#include "ares.h"
#include "ares_private.h"

struct addrinfo_sort_elem {
struct ares_addrinfo_node *ai;
Expand Down
2 changes: 0 additions & 2 deletions src/lib/ares__threads.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
*
* SPDX-License-Identifier: MIT
*/
#include "ares_setup.h"
#include "ares.h"
#include "ares_private.h"

#ifdef CARES_THREADS
Expand Down
2 changes: 0 additions & 2 deletions src/lib/ares__timeval.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
* SPDX-License-Identifier: MIT
*/

#include "ares_setup.h"
#include "ares.h"
#include "ares_private.h"

#if defined(_WIN32) && !defined(MSDOS)
Expand Down
7 changes: 1 addition & 6 deletions src/lib/ares_android.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,8 @@
* SPDX-License-Identifier: MIT
*/
#if defined(ANDROID) || defined(__ANDROID__)

# include <jni.h>

# include "ares_setup.h"
# include "ares.h"
# include "ares_android.h"
# include "ares_private.h"
# include <jni.h>

static JavaVM *android_jvm = NULL;
static jobject android_connectivity_manager = NULL;
Expand Down
4 changes: 0 additions & 4 deletions src/lib/ares_cancel.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@
* SPDX-License-Identifier: MIT
*/

#include "ares_setup.h"
#include <assert.h>

#include "ares.h"
#include "ares_private.h"

/*
Expand Down
2 changes: 0 additions & 2 deletions src/lib/ares_create_query.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
* SPDX-License-Identifier: MIT
*/

#include "ares_setup.h"
#include "ares.h"
#include "ares_private.h"

static int ares_create_query_int(const char *name, int dnsclass, int type,
Expand Down
8 changes: 2 additions & 6 deletions src/lib/ares_data.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,10 @@
* SPDX-License-Identifier: MIT
*/


#include "ares_setup.h"

#include "ares_private.h"
#include <stddef.h>

#include "ares.h"
#include <assert.h>
#include "ares_data.h"
#include "ares_private.h"

/*
** ares_free_data() - c-ares external API function.
Expand Down
6 changes: 1 addition & 5 deletions src/lib/ares_destroy.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,9 @@
* SPDX-License-Identifier: MIT
*/

#include "ares_setup.h"

#include <assert.h>

#include "ares.h"
#include "ares_private.h"
#include "ares_event.h"
#include <assert.h>

void ares_destroy(ares_channel_t *channel)
{
Expand Down
2 changes: 0 additions & 2 deletions src/lib/ares_dns_mapping.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
*
* SPDX-License-Identifier: MIT
*/
#include "ares_setup.h"
#include "ares.h"
#include "ares_private.h"

ares_bool_t ares_dns_opcode_isvalid(ares_dns_opcode_t opcode)
Expand Down
2 changes: 0 additions & 2 deletions src/lib/ares_dns_name.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
*
* SPDX-License-Identifier: MIT
*/
#include "ares_setup.h"
#include "ares.h"
#include "ares_private.h"

typedef struct {
Expand Down
2 changes: 0 additions & 2 deletions src/lib/ares_dns_parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
*
* SPDX-License-Identifier: MIT
*/
#include "ares_setup.h"
#include "ares.h"
#include "ares_private.h"
#include <limits.h>
#ifdef HAVE_STDINT_H
Expand Down
2 changes: 0 additions & 2 deletions src/lib/ares_dns_record.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
*
* SPDX-License-Identifier: MIT
*/
#include "ares_setup.h"
#include "ares.h"
#include "ares_private.h"
#include <limits.h>
#ifdef HAVE_STDINT_H
Expand Down
2 changes: 0 additions & 2 deletions src/lib/ares_dns_write.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
*
* SPDX-License-Identifier: MIT
*/
#include "ares_setup.h"
#include "ares.h"
#include "ares_private.h"
#include <limits.h>
#ifdef HAVE_STDINT_H
Expand Down
2 changes: 0 additions & 2 deletions src/lib/ares_event.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@
#ifndef __ARES__EVENT_H
#define __ARES__EVENT_H

#include "ares_setup.h"

struct ares_event;
typedef struct ares_event ares_event_t;

Expand Down
2 changes: 0 additions & 2 deletions src/lib/ares_event_configchg.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
*
* SPDX-License-Identifier: MIT
*/
#include "ares_setup.h"
#include "ares.h"
#include "ares_private.h"
#include "ares_event.h"

Expand Down
2 changes: 0 additions & 2 deletions src/lib/ares_event_epoll.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
*
* SPDX-License-Identifier: MIT
*/
#include "ares_setup.h"
#include "ares.h"
#include "ares_private.h"
#include "ares_event.h"

Expand Down
2 changes: 0 additions & 2 deletions src/lib/ares_event_kqueue.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
*
* SPDX-License-Identifier: MIT
*/
#include "ares_setup.h"
#include "ares.h"
#include "ares_private.h"
#include "ares_event.h"

Expand Down
2 changes: 0 additions & 2 deletions src/lib/ares_event_poll.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
*
* SPDX-License-Identifier: MIT
*/
#include "ares_setup.h"
#include "ares.h"
#include "ares_private.h"
#include "ares_event.h"
#ifdef HAVE_POLL_H
Expand Down
2 changes: 0 additions & 2 deletions src/lib/ares_event_select.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@
* anyhow */
#define FD_SETSIZE 4096

#include "ares_setup.h"
#include "ares.h"
#include "ares_private.h"
#include "ares_event.h"
#ifdef HAVE_SYS_SELECT_H
Expand Down
Loading

0 comments on commit 0ec8ec5

Please sign in to comment.