Skip to content

Commit 4510ce2

Browse files
committed
CDRIVER-1032 move host-list fns to private header
1 parent c3f15ee commit 4510ce2

File tree

5 files changed

+13
-15
lines changed

5 files changed

+13
-15
lines changed

src/mongoc/mongoc-host-list-private.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ BSON_BEGIN_DECLS
3030
bool _mongoc_host_list_from_string (mongoc_host_list_t *host_list,
3131
const char *host_and_port);
3232

33+
bool _mongoc_host_list_equal (const mongoc_host_list_t *host_a,
34+
const mongoc_host_list_t *host_b);
35+
36+
void _mongoc_host_list_destroy_all (mongoc_host_list_t *host);
3337

3438
BSON_END_DECLS
3539

src/mongoc/mongoc-host-list.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,13 @@
1414
* limitations under the License.
1515
*/
1616

17-
#include "mongoc-host-list.h"
18-
#include "mongoc-util-private.h"
17+
#include "mongoc-host-list-private.h"
1918

2019

2120
/*
2221
*--------------------------------------------------------------------------
2322
*
24-
* mongoc_host_list_equal --
23+
* _mongoc_host_list_equal --
2524
*
2625
* Check two hosts have the same domain (case-insensitive), port,
2726
* and address family.
@@ -32,8 +31,8 @@
3231
*--------------------------------------------------------------------------
3332
*/
3433
bool
35-
mongoc_host_list_equal (const mongoc_host_list_t *host_a,
36-
const mongoc_host_list_t *host_b)
34+
_mongoc_host_list_equal (const mongoc_host_list_t *host_a,
35+
const mongoc_host_list_t *host_b)
3736
{
3837
return (!strcasecmp (host_a->host_and_port, host_b->host_and_port)
3938
&& host_a->family == host_b->family);
@@ -43,14 +42,14 @@ mongoc_host_list_equal (const mongoc_host_list_t *host_a,
4342
/*
4443
*--------------------------------------------------------------------------
4544
*
46-
* mongoc_host_list_destroy_all --
45+
* _mongoc_host_list_destroy_all --
4746
*
4847
* Destroy whole linked list of hosts.
4948
*
5049
*--------------------------------------------------------------------------
5150
*/
5251
void
53-
mongoc_host_list_destroy_all (mongoc_host_list_t *host)
52+
_mongoc_host_list_destroy_all (mongoc_host_list_t *host)
5453
{
5554
mongoc_host_list_t *tmp;
5655

src/mongoc/mongoc-host-list.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,6 @@ struct _mongoc_host_list_t
5151
void *padding [4];
5252
};
5353

54-
bool mongoc_host_list_equal (const mongoc_host_list_t *host_a,
55-
const mongoc_host_list_t *host_b);
56-
57-
void mongoc_host_list_destroy_all (mongoc_host_list_t *host);
58-
5954
BSON_END_DECLS
6055

6156

src/mongoc/mongoc-topology-scanner.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#include "mongoc-counters-private.h"
2929
#include "utlist.h"
3030
#include "mongoc-topology-private.h"
31+
#include "mongoc-host-list-private.h"
3132

3233
#undef MONGOC_LOG_DOMAIN
3334
#define MONGOC_LOG_DOMAIN "topology_scanner"
@@ -230,7 +231,7 @@ mongoc_topology_scanner_has_node_for_host (mongoc_topology_scanner_t *ts,
230231

231232
DL_FOREACH_SAFE (ts->nodes, ele, tmp)
232233
{
233-
if (mongoc_host_list_equal (&ele->host, host)) {
234+
if (_mongoc_host_list_equal (&ele->host, host)) {
234235
return true;
235236
}
236237
}

src/mongoc/mongoc-uri.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
#include "mongoc-uri-private.h"
2929
#include "mongoc-read-concern-private.h"
3030
#include "mongoc-write-concern-private.h"
31-
#include "mongoc-util-private.h"
3231

3332

3433
struct _mongoc_uri_t
@@ -1112,7 +1111,7 @@ void
11121111
mongoc_uri_destroy (mongoc_uri_t *uri)
11131112
{
11141113
if (uri) {
1115-
mongoc_host_list_destroy_all (uri->hosts);
1114+
_mongoc_host_list_destroy_all (uri->hosts);
11161115
bson_free(uri->str);
11171116
bson_free(uri->database);
11181117
bson_free(uri->username);

0 commit comments

Comments
 (0)