Blame ares_save_options.3

Packit 514978
.\"
Packit 514978
.\" Copyright 1998 by the Massachusetts Institute of Technology.
Packit 514978
.\"
Packit 514978
.\" Permission to use, copy, modify, and distribute this
Packit 514978
.\" software and its documentation for any purpose and without
Packit 514978
.\" fee is hereby granted, provided that the above copyright
Packit 514978
.\" notice appear in all copies and that both that copyright
Packit 514978
.\" notice and this permission notice appear in supporting
Packit 514978
.\" documentation, and that the name of M.I.T. not be used in
Packit 514978
.\" advertising or publicity pertaining to distribution of the
Packit 514978
.\" software without specific, written prior permission.
Packit 514978
.\" M.I.T. makes no representations about the suitability of
Packit 514978
.\" this software for any purpose.  It is provided "as is"
Packit 514978
.\" without express or implied warranty.
Packit 514978
.\"
Packit 514978
.TH ARES_SAVE_OPTIONS 3 "5 March 2010"
Packit 514978
.SH NAME
Packit 514978
ares_save_options \- Save configuration values obtained from initialized ares_channel
Packit 514978
.SH SYNOPSIS
Packit 514978
.nf
Packit 514978
.B #include <ares.h>
Packit 514978
.PP
Packit 514978
.B int ares_save_options(ares_channel \fIchannel\fP, struct ares_options *\fIoptions\fP, int *\fIoptmask\fP)
Packit 514978
.fi
Packit 514978
.SH DESCRIPTION
Packit 514978
The \fBares_save_options(3)\fP function saves the channel data identified by
Packit 514978
.IR channel ,
Packit 514978
into the options struct identified by
Packit 514978
.IR options ,
Packit 514978
and saves the mask of options which are set to the integer
Packit 514978
pointer (passed by reference) identified by
Packit 514978
.IR optmask .
Packit 514978
Packit 514978
The resultant options and optmask are then able to be
Packit 514978
passed directly to ares_init_options.  When the options
Packit 514978
are no longer needed, ares_destroy_options should be called
Packit 514978
to free any associated memory.
Packit 514978
.SH RETURN VALUES
Packit 514978
.B ares_save_options(3)
Packit 514978
can return any of the following values:
Packit 514978
.TP 15
Packit 514978
.B ARES_SUCCESS
Packit 514978
The channel data was successfully stored
Packit 514978
.TP 15
Packit 514978
.B ARES_ENOMEM
Packit 514978
The memory was exhausted
Packit 514978
.TP 15
Packit 514978
.B ARES_ENODATA
Packit 514978
The channel data identified by 
Packit 514978
.IR channel
Packit 514978
were invalid.
Packit 514978
.SH NOTE
Packit 514978
Since c-ares 1.6.0 the ares_options struct has been "locked" meaning that it
Packit 514978
won't be extended to cover new functions. This function will remain
Packit 514978
functioning, but it can only return config data that can be represented in
Packit 514978
this config struct, which may no longer be the complete set of config
Packit 514978
options. \fBares_dup(3)\fP will not have that restriction.
Packit 514978
Packit 514978
The ares_options struct can not handle potential IPv6 name servers the
Packit 514978
ares_channel might be configured to use. The \fBares_save_options(3)\fP function
Packit 514978
will only return IPv4 servers, if any. In order to retrieve all name servers
Packit 514978
an ares_channel might be using, the \fBares_get_servers(3)\fP function must be
Packit 514978
used instead.
Packit 514978
.SH SEE ALSO
Packit 514978
.BR ares_destroy_options (3),
Packit 514978
.BR ares_init_options (3),
Packit 514978
.BR ares_get_servers (3),
Packit 514978
.BR ares_dup (3)
Packit 514978
.SH AVAILABILITY
Packit 514978
ares_save_options(3) was added in c-ares 1.4.0
Packit 514978
.SH AUTHOR
Packit 514978
Brad House
Packit 514978
.br
Packit 514978
Copyright 1998 by the Massachusetts Institute of Technology.