Mark a couple of parameters as const in the public API

pull/603/head
Brad House 1 year ago
parent fb43c04bae
commit 9037340ef6
  1. 2
      docs/ares_init_options.3
  2. 4
      docs/ares_set_servers.3
  3. 9
      include/ares.h
  4. 4
      src/lib/ares_init.c
  5. 7
      src/lib/ares_update_servers.c

@ -48,7 +48,7 @@ struct ares_options {
};
int ares_init_options(ares_channel_t **\fIchannelptr\fP,
struct ares_options *\fIoptions\fP,
const struct ares_options *\fIoptions\fP,
int \fIoptmask\fP)
.fi
.SH DESCRIPTION

@ -24,10 +24,10 @@ for an ares channel.
#include <ares.h>
int ares_set_servers(ares_channel_t *\fIchannel\fP,
struct ares_addr_node *\fIservers\fP)
const struct ares_addr_node *\fIservers\fP)
int ares_set_servers_ports(ares_channel_t *\fIchannel\fP,
struct ares_addr_port_node *\fIservers\fP)
const struct ares_addr_port_node *\fIservers\fP)
.fi
.SH DESCRIPTION
The \fBares_set_servers(3)\fP function initializes name servers configuration

@ -360,7 +360,8 @@ CARES_EXTERN const char *ares_version(int *version);
CARES_EXTERN int ares_init(ares_channel_t **channelptr);
CARES_EXTERN int ares_init_options(ares_channel_t **channelptr,
struct ares_options *options, int optmask);
const struct ares_options *options,
int optmask);
CARES_EXTERN int ares_save_options(ares_channel_t *channel,
struct ares_options *options, int *optmask);
@ -702,10 +703,10 @@ struct ares_addr_port_node {
int tcp_port;
};
CARES_EXTERN int ares_set_servers(ares_channel_t *channel,
struct ares_addr_node *servers);
CARES_EXTERN int ares_set_servers(ares_channel_t *channel,
const struct ares_addr_node *servers);
CARES_EXTERN int ares_set_servers_ports(ares_channel_t *channel,
struct ares_addr_port_node *servers);
const struct ares_addr_port_node *servers);
/* Incomming string format: host[:port][,host[:port]]... */
CARES_EXTERN int ares_set_servers_csv(ares_channel_t *channel,

@ -286,8 +286,8 @@ error:
return rc;
}
int ares_init_options(ares_channel_t **channelptr, struct ares_options *options,
int optmask)
int ares_init_options(ares_channel_t **channelptr,
const struct ares_options *options, int optmask)
{
ares_channel_t *channel;
ares_status_t status = ARES_SUCCESS;

@ -832,7 +832,8 @@ int ares_get_servers_ports(ares_channel_t *channel,
return (int)status;
}
int ares_set_servers(ares_channel_t *channel, struct ares_addr_node *servers)
int ares_set_servers(ares_channel_t *channel,
const struct ares_addr_node *servers)
{
ares__llist_t *slist;
ares_status_t status;
@ -853,8 +854,8 @@ int ares_set_servers(ares_channel_t *channel, struct ares_addr_node *servers)
return (int)status;
}
int ares_set_servers_ports(ares_channel_t *channel,
struct ares_addr_port_node *servers)
int ares_set_servers_ports(ares_channel_t *channel,
const struct ares_addr_port_node *servers)
{
ares__llist_t *slist;
ares_status_t status;

Loading…
Cancel
Save