[API 0.375] Const on appropriate function params

This commit is contained in:
Willem Toorop 2014-01-14 15:37:33 +01:00
parent 2bf8709265
commit 6886962e0d
5 changed files with 56 additions and 56 deletions

Binary file not shown.

BIN
spec/getdns-0.375.tgz Normal file

Binary file not shown.

View File

@ -148,40 +148,40 @@ getdns_free_sync_request_memory(
) )
{ UNUSED_PARAM(response); } { UNUSED_PARAM(response); }
getdns_return_t getdns_list_get_length(struct getdns_list *this_list, size_t *answer) getdns_return_t getdns_list_get_length(const struct getdns_list *this_list, size_t *answer)
{ UNUSED_PARAM(this_list); UNUSED_PARAM(answer); return GETDNS_RETURN_GOOD; } { UNUSED_PARAM(this_list); UNUSED_PARAM(answer); return GETDNS_RETURN_GOOD; }
getdns_return_t getdns_list_get_data_type(struct getdns_list *this_list, size_t index, getdns_data_type *answer) getdns_return_t getdns_list_get_data_type(const struct getdns_list *this_list, size_t index, getdns_data_type *answer)
{ UNUSED_PARAM(this_list); UNUSED_PARAM(index); UNUSED_PARAM(answer); return GETDNS_RETURN_GOOD; } { UNUSED_PARAM(this_list); UNUSED_PARAM(index); UNUSED_PARAM(answer); return GETDNS_RETURN_GOOD; }
getdns_return_t getdns_list_get_dict(struct getdns_list *this_list, size_t index, struct getdns_dict **answer) getdns_return_t getdns_list_get_dict(const struct getdns_list *this_list, size_t index, struct getdns_dict **answer)
{ UNUSED_PARAM(this_list); UNUSED_PARAM(index); UNUSED_PARAM(answer); return GETDNS_RETURN_GOOD; } { UNUSED_PARAM(this_list); UNUSED_PARAM(index); UNUSED_PARAM(answer); return GETDNS_RETURN_GOOD; }
getdns_return_t getdns_list_get_list(struct getdns_list *this_list, size_t index, struct getdns_list **answer) getdns_return_t getdns_list_get_list(const struct getdns_list *this_list, size_t index, struct getdns_list **answer)
{ UNUSED_PARAM(this_list); UNUSED_PARAM(index); UNUSED_PARAM(answer); return GETDNS_RETURN_GOOD; } { UNUSED_PARAM(this_list); UNUSED_PARAM(index); UNUSED_PARAM(answer); return GETDNS_RETURN_GOOD; }
getdns_return_t getdns_list_get_bindata(struct getdns_list *this_list, size_t index, struct getdns_bindata **answer) getdns_return_t getdns_list_get_bindata(const struct getdns_list *this_list, size_t index, struct getdns_bindata **answer)
{ UNUSED_PARAM(this_list); UNUSED_PARAM(index); UNUSED_PARAM(answer); return GETDNS_RETURN_GOOD; } { UNUSED_PARAM(this_list); UNUSED_PARAM(index); UNUSED_PARAM(answer); return GETDNS_RETURN_GOOD; }
getdns_return_t getdns_list_get_int(struct getdns_list *this_list, size_t index, uint32_t *answer) getdns_return_t getdns_list_get_int(const struct getdns_list *this_list, size_t index, uint32_t *answer)
{ UNUSED_PARAM(this_list); UNUSED_PARAM(index); UNUSED_PARAM(answer); return GETDNS_RETURN_GOOD; } { UNUSED_PARAM(this_list); UNUSED_PARAM(index); UNUSED_PARAM(answer); return GETDNS_RETURN_GOOD; }
getdns_return_t getdns_dict_get_names(struct getdns_dict *this_dict, struct getdns_list **answer) getdns_return_t getdns_dict_get_names(const struct getdns_dict *this_dict, struct getdns_list **answer)
{ UNUSED_PARAM(this_dict); UNUSED_PARAM(answer); return GETDNS_RETURN_GOOD; } { UNUSED_PARAM(this_dict); UNUSED_PARAM(answer); return GETDNS_RETURN_GOOD; }
getdns_return_t getdns_dict_get_data_type(struct getdns_dict *this_dict, char *name, getdns_data_type *answer) getdns_return_t getdns_dict_get_data_type(const struct getdns_dict *this_dict, const char *name, getdns_data_type *answer)
{ UNUSED_PARAM(this_dict); UNUSED_PARAM(name); UNUSED_PARAM(answer); return GETDNS_RETURN_GOOD; } { UNUSED_PARAM(this_dict); UNUSED_PARAM(name); UNUSED_PARAM(answer); return GETDNS_RETURN_GOOD; }
getdns_return_t getdns_dict_get_dict(struct getdns_dict *this_dict, char *name, struct getdns_dict **answer) getdns_return_t getdns_dict_get_dict(const struct getdns_dict *this_dict, const char *name, struct getdns_dict **answer)
{ UNUSED_PARAM(this_dict); UNUSED_PARAM(name); UNUSED_PARAM(answer); return GETDNS_RETURN_GOOD; } { UNUSED_PARAM(this_dict); UNUSED_PARAM(name); UNUSED_PARAM(answer); return GETDNS_RETURN_GOOD; }
getdns_return_t getdns_dict_get_list(struct getdns_dict *this_dict, char *name, struct getdns_list **answer) getdns_return_t getdns_dict_get_list(const struct getdns_dict *this_dict, const char *name, struct getdns_list **answer)
{ UNUSED_PARAM(this_dict); UNUSED_PARAM(name); UNUSED_PARAM(answer); return GETDNS_RETURN_GOOD; } { UNUSED_PARAM(this_dict); UNUSED_PARAM(name); UNUSED_PARAM(answer); return GETDNS_RETURN_GOOD; }
getdns_return_t getdns_dict_get_bindata(struct getdns_dict *this_dict, char *name, struct getdns_bindata **answer) getdns_return_t getdns_dict_get_bindata(const struct getdns_dict *this_dict, const char *name, struct getdns_bindata **answer)
{ UNUSED_PARAM(this_dict); UNUSED_PARAM(name); UNUSED_PARAM(answer); return GETDNS_RETURN_GOOD; } { UNUSED_PARAM(this_dict); UNUSED_PARAM(name); UNUSED_PARAM(answer); return GETDNS_RETURN_GOOD; }
getdns_return_t getdns_dict_get_int(struct getdns_dict *this_dict, char *name, uint32_t *answer) getdns_return_t getdns_dict_get_int(const struct getdns_dict *this_dict, const char *name, uint32_t *answer)
{ UNUSED_PARAM(this_dict); UNUSED_PARAM(name); UNUSED_PARAM(answer); return GETDNS_RETURN_GOOD; } { UNUSED_PARAM(this_dict); UNUSED_PARAM(name); UNUSED_PARAM(answer); return GETDNS_RETURN_GOOD; }
struct getdns_list * getdns_list_create() struct getdns_list * getdns_list_create()
@ -271,25 +271,25 @@ getdns_return_t getdns_dict_remove_name(struct getdns_dict *this_dict, char *nam
char * char *
getdns_convert_dns_name_to_fqdn( getdns_convert_dns_name_to_fqdn(
char *name_from_dns_response const char *name_from_dns_response
) )
{ UNUSED_PARAM(name_from_dns_response); return NULL; } { UNUSED_PARAM(name_from_dns_response); return NULL; }
char * char *
getdns_convert_fqdn_to_dns_name( getdns_convert_fqdn_to_dns_name(
char *fqdn_as_string const char *fqdn_as_string
) )
{ UNUSED_PARAM(fqdn_as_string); return NULL; } { UNUSED_PARAM(fqdn_as_string); return NULL; }
char * char *
getdns_convert_ulabel_to_alabel( getdns_convert_ulabel_to_alabel(
char *ulabel const char *ulabel
) )
{ UNUSED_PARAM(ulabel); return NULL; } { UNUSED_PARAM(ulabel); return NULL; }
char * char *
getdns_convert_alabel_to_ulabel( getdns_convert_alabel_to_ulabel(
char *alabel const char *alabel
) )
{ UNUSED_PARAM(alabel); return NULL; } { UNUSED_PARAM(alabel); return NULL; }
@ -305,13 +305,13 @@ return GETDNS_RETURN_GOOD; }
char * char *
getdns_pretty_print_dict( getdns_pretty_print_dict(
struct getdns_dict *some_dict const struct getdns_dict *some_dict
) )
{ UNUSED_PARAM(some_dict); return NULL; } { UNUSED_PARAM(some_dict); return NULL; }
char * char *
getdns_display_ip_address( getdns_display_ip_address(
struct getdns_bindata *bindata_of_ipv4_or_ipv6_address const struct getdns_bindata *bindata_of_ipv4_or_ipv6_address
) )
{ UNUSED_PARAM(bindata_of_ipv4_or_ipv6_address); return NULL; } { UNUSED_PARAM(bindata_of_ipv4_or_ipv6_address); return NULL; }

View File

@ -1,4 +1,4 @@
/* Created at 2014-01-14-15-20-05*/ /* Created at 2014-01-14-15-35-55*/
#ifndef GETDNS_H #ifndef GETDNS_H
#define GETDNS_H #define GETDNS_H
@ -260,21 +260,21 @@ struct getdns_list;
/* Lists: get the length, get the data_type of the value at a given /* Lists: get the length, get the data_type of the value at a given
position, and get the data at a given position */ position, and get the data at a given position */
getdns_return_t getdns_list_get_length(struct getdns_list *this_list, size_t *answer); getdns_return_t getdns_list_get_length(const struct getdns_list *this_list, size_t *answer);
getdns_return_t getdns_list_get_data_type(struct getdns_list *this_list, size_t index, getdns_data_type *answer); getdns_return_t getdns_list_get_data_type(const struct getdns_list *this_list, size_t index, getdns_data_type *answer);
getdns_return_t getdns_list_get_dict(struct getdns_list *this_list, size_t index, struct getdns_dict **answer); getdns_return_t getdns_list_get_dict(const struct getdns_list *this_list, size_t index, struct getdns_dict **answer);
getdns_return_t getdns_list_get_list(struct getdns_list *this_list, size_t index, struct getdns_list **answer); getdns_return_t getdns_list_get_list(const struct getdns_list *this_list, size_t index, struct getdns_list **answer);
getdns_return_t getdns_list_get_bindata(struct getdns_list *this_list, size_t index, struct getdns_bindata **answer); getdns_return_t getdns_list_get_bindata(const struct getdns_list *this_list, size_t index, struct getdns_bindata **answer);
getdns_return_t getdns_list_get_int(struct getdns_list *this_list, size_t index, uint32_t *answer); getdns_return_t getdns_list_get_int(const struct getdns_list *this_list, size_t index, uint32_t *answer);
/* Dicts: get the list of names, get the data_type of the /* Dicts: get the list of names, get the data_type of the
value at a given name, and get the data at a given name */ value at a given name, and get the data at a given name */
getdns_return_t getdns_dict_get_names(struct getdns_dict *this_dict, struct getdns_list **answer); getdns_return_t getdns_dict_get_names(const struct getdns_dict *this_dict, struct getdns_list **answer);
getdns_return_t getdns_dict_get_data_type(struct getdns_dict *this_dict, char *name, getdns_data_type *answer); getdns_return_t getdns_dict_get_data_type(const struct getdns_dict *this_dict, const char *name, getdns_data_type *answer);
getdns_return_t getdns_dict_get_dict(struct getdns_dict *this_dict, char *name, struct getdns_dict **answer); getdns_return_t getdns_dict_get_dict(const struct getdns_dict *this_dict, const char *name, struct getdns_dict **answer);
getdns_return_t getdns_dict_get_list(struct getdns_dict *this_dict, char *name, struct getdns_list **answer); getdns_return_t getdns_dict_get_list(const struct getdns_dict *this_dict, const char *name, struct getdns_list **answer);
getdns_return_t getdns_dict_get_bindata(struct getdns_dict *this_dict, char *name, struct getdns_bindata **answer); getdns_return_t getdns_dict_get_bindata(const struct getdns_dict *this_dict, const char *name, struct getdns_bindata **answer);
getdns_return_t getdns_dict_get_int(struct getdns_dict *this_dict, char *name, uint32_t *answer); getdns_return_t getdns_dict_get_int(const struct getdns_dict *this_dict, const char *name, uint32_t *answer);
/* Lists: create, destroy, and set the data at a given position */ /* Lists: create, destroy, and set the data at a given position */
@ -440,22 +440,22 @@ getdns_service_sync(
char * char *
getdns_convert_dns_name_to_fqdn( getdns_convert_dns_name_to_fqdn(
char *name_from_dns_response const char *name_from_dns_response
); );
char * char *
getdns_convert_fqdn_to_dns_name( getdns_convert_fqdn_to_dns_name(
char *fqdn_as_string const char *fqdn_as_string
); );
char * char *
getdns_convert_ulabel_to_alabel( getdns_convert_ulabel_to_alabel(
char *ulabel const char *ulabel
); );
char * char *
getdns_convert_alabel_to_ulabel( getdns_convert_alabel_to_ulabel(
char *alabel const char *alabel
); );
getdns_return_t getdns_return_t
@ -467,12 +467,12 @@ getdns_validate_dnssec(
char * char *
getdns_pretty_print_dict( getdns_pretty_print_dict(
struct getdns_dict *some_dict const struct getdns_dict *some_dict
); );
char * char *
getdns_display_ip_address( getdns_display_ip_address(
struct getdns_bindata *bindata_of_ipv4_or_ipv6_address const struct getdns_bindata *bindata_of_ipv4_or_ipv6_address
); );
getdns_return_t getdns_return_t

View File

@ -524,21 +524,21 @@ name-value pairs in a dict is not important.</li>
<div class=forh id="datagetters"> <div class=forh id="datagetters">
/* Lists: get the length, get the data_type of the value at a given /* Lists: get the length, get the data_type of the value at a given
position, and get the data at a given position */ position, and get the data at a given position */
getdns_return_t getdns_list_get_length(struct getdns_list *this_list, size_t *answer); getdns_return_t getdns_list_get_length(const struct getdns_list *this_list, size_t *answer);
getdns_return_t getdns_list_get_data_type(struct getdns_list *this_list, size_t index, getdns_data_type *answer); getdns_return_t getdns_list_get_data_type(const struct getdns_list *this_list, size_t index, getdns_data_type *answer);
getdns_return_t getdns_list_get_dict(struct getdns_list *this_list, size_t index, struct getdns_dict **answer); getdns_return_t getdns_list_get_dict(const struct getdns_list *this_list, size_t index, struct getdns_dict **answer);
getdns_return_t getdns_list_get_list(struct getdns_list *this_list, size_t index, struct getdns_list **answer); getdns_return_t getdns_list_get_list(const struct getdns_list *this_list, size_t index, struct getdns_list **answer);
getdns_return_t getdns_list_get_bindata(struct getdns_list *this_list, size_t index, struct getdns_bindata **answer); getdns_return_t getdns_list_get_bindata(const struct getdns_list *this_list, size_t index, struct getdns_bindata **answer);
getdns_return_t getdns_list_get_int(struct getdns_list *this_list, size_t index, uint32_t *answer); getdns_return_t getdns_list_get_int(const struct getdns_list *this_list, size_t index, uint32_t *answer);
/* Dicts: get the list of names, get the data_type of the /* Dicts: get the list of names, get the data_type of the
value at a given name, and get the data at a given name */ value at a given name, and get the data at a given name */
getdns_return_t getdns_dict_get_names(struct getdns_dict *this_dict, struct getdns_list **answer); getdns_return_t getdns_dict_get_names(const struct getdns_dict *this_dict, struct getdns_list **answer);
getdns_return_t getdns_dict_get_data_type(struct getdns_dict *this_dict, char *name, getdns_data_type *answer); getdns_return_t getdns_dict_get_data_type(const struct getdns_dict *this_dict, const char *name, getdns_data_type *answer);
getdns_return_t getdns_dict_get_dict(struct getdns_dict *this_dict, char *name, struct getdns_dict **answer); getdns_return_t getdns_dict_get_dict(const struct getdns_dict *this_dict, const char *name, struct getdns_dict **answer);
getdns_return_t getdns_dict_get_list(struct getdns_dict *this_dict, char *name, struct getdns_list **answer); getdns_return_t getdns_dict_get_list(const struct getdns_dict *this_dict, const char *name, struct getdns_list **answer);
getdns_return_t getdns_dict_get_bindata(struct getdns_dict *this_dict, char *name, struct getdns_bindata **answer); getdns_return_t getdns_dict_get_bindata(const struct getdns_dict *this_dict, const char *name, struct getdns_bindata **answer);
getdns_return_t getdns_dict_get_int(struct getdns_dict *this_dict, char *name, uint32_t *answer); getdns_return_t getdns_dict_get_int(const struct getdns_dict *this_dict, const char *name, uint32_t *answer);
</div> </div>
<p>All of these helper getter functions return <code>GETDNS_RETURN_GOOD</code> if the call is successful. <p>All of these helper getter functions return <code>GETDNS_RETURN_GOOD</code> if the call is successful.
@ -1052,12 +1052,12 @@ string in FQDN format to bytes in DNS format.</p>
<div class=forh> <div class=forh>
char * char *
getdns_convert_dns_name_to_fqdn( getdns_convert_dns_name_to_fqdn(
char *name_from_dns_response const char *name_from_dns_response
); );
char * char *
getdns_convert_fqdn_to_dns_name( getdns_convert_fqdn_to_dns_name(
char *fqdn_as_string const char *fqdn_as_string
); );
</div> </div>
@ -1804,12 +1804,12 @@ encoding and their ASCII encoding. They follow the rules for IDNA 2008 described
RFC 5890-5892.</p> RFC 5890-5892.</p>
<div class=forh>char * <div class=forh>char *
getdns_convert_ulabel_to_alabel( getdns_convert_ulabel_to_alabel(
char *ulabel const char *ulabel
); );
</div> </div>
<div class=forh>char * <div class=forh>char *
getdns_convert_alabel_to_ulabel( getdns_convert_alabel_to_ulabel(
char *alabel const char *alabel
); );
</div> </div>
@ -1833,7 +1833,7 @@ will use the resource records in <code>bundle_of_support_records</code> and the
<div class=forh> <div class=forh>
char * char *
getdns_pretty_print_dict( getdns_pretty_print_dict(
struct getdns_dict *some_dict const struct getdns_dict *some_dict
); );
</div> </div>
<p class=cont>This returns a string that is the nicely-formatted version <p class=cont>This returns a string that is the nicely-formatted version
@ -1842,7 +1842,7 @@ of the dict and all of the named elements in it.</p>
<div class=forh> <div class=forh>
char * char *
getdns_display_ip_address( getdns_display_ip_address(
struct getdns_bindata *bindata_of_ipv4_or_ipv6_address const struct getdns_bindata *bindata_of_ipv4_or_ipv6_address
); );
</div> </div>
<p class=cont>This returns a string that is the nicely-formatted version <p class=cont>This returns a string that is the nicely-formatted version
@ -2210,7 +2210,7 @@ The response dicts inherit the custom memory management functions and the value
<h1>9. The Generated Files</h1> <h1>9. The Generated Files</h1>
<p>There is <a href="getdns-0.374.tgz">a tarball</a> that includes the .h files, <p>There is <a href="getdns-0.375.tgz">a tarball</a> that includes the .h files,
the examples, and so on. The examples all make, even though there is no API implementation, based the examples, and so on. The examples all make, even though there is no API implementation, based
on a pseudo-implementation in the tarball; see make-examples-PLATFORM.sh. Note that this currently builds fine on a pseudo-implementation in the tarball; see make-examples-PLATFORM.sh. Note that this currently builds fine
on the Macintosh and Ubuntu; help is definitely appreciated on making the build process on the Macintosh and Ubuntu; help is definitely appreciated on making the build process