Commit b0998367 authored by David Lawrence's avatar David Lawrence

145. [cleanup] Added <isc/lang.h> and ISC_LANG_BEGINDECLS/

                        ISC_LANG_ENDDECLS to header files that had function
                        prototypes, and removed it from those that did not.
parent d086365f
145. [cleanup] Added <isc/lang.h> and ISC_LANG_BEGINDECLS/
ISC_LANG_ENDDECLS to header files that had function
prototypes, and removed it from those that did not.
144. [cleanup] libdns header files too numerous to name were made
to conform to the same style for multiple inclusion
protection.
......
......@@ -18,6 +18,8 @@
#ifndef DNS_ACLCONF_H
#define DNS_ACLCONF_H 1
#include <isc/lang.h>
#include <dns/acl.h>
#include <dns/confacl.h>
#include <dns/confctx.h>
......@@ -33,9 +35,11 @@ typedef struct {
ISC_LANG_BEGINDECLS
void dns_aclconfctx_init(dns_aclconfctx_t *ctx);
void
dns_aclconfctx_init(dns_aclconfctx_t *ctx);
void dns_aclconfctx_destroy(dns_aclconfctx_t *ctx);
void
dns_aclconfctx_destroy(dns_aclconfctx_t *ctx);
isc_result_t
dns_acl_fromconfig(dns_c_ipmatchlist_t *caml,
......
......@@ -34,6 +34,7 @@
#include <unistd.h>
#include <isc/boolean.h>
#include <isc/lang.h>
#define isc_commandline_parse getopt
#define isc_commandline_argument optarg
......@@ -43,6 +44,8 @@ typedef struct {
char *filename;
} isc_dir_t;
ISC_LANG_BEGINDECLS
static isc_boolean_t
start_directory(const char *path, isc_dir_t *dir) {
dir->handle = opendir(path);
......@@ -80,4 +83,6 @@ end_directory(isc_dir_t *dir) {
dir->handle = NULL;
}
ISC_LANG_ENDDECLS
#endif /* DNS_GEN_UNIX_H */
......@@ -48,7 +48,7 @@
* SUCH DAMAGE.
*/
/* $Id: gen-win32.h,v 1.3 2000/04/29 02:01:07 tale Exp $ */
/* $Id: gen-win32.h,v 1.4 2000/05/01 17:59:02 tale Exp $ */
/*
* Principal Authors: Computer Systems Research Group at UC Berkeley
......@@ -83,6 +83,7 @@
#include <isc/assertions.h>
#include <isc/boolean.h>
#include <isc/commandline.h>
#include <isc/lang.h>
int isc_commandline_index = 1; /* Index into parent argv vector. */
int isc_commandline_option; /* Character checked for validity. */
......@@ -97,6 +98,8 @@ isc_boolean_t isc_commandline_reset = ISC_TRUE; /* Reset processing. */
#define BADARG ':'
#define ENDOPT ""
ISC_LANG_BEGINDECLS
/*
* getopt --
* Parse argc/argv argument vector.
......@@ -284,4 +287,6 @@ end_directory(isc_dir_t *dir) {
FindClose(dir->handle);
}
ISC_LANG_ENDDECLS
#endif /* DNS_GEN_WIN32_H */
......@@ -30,9 +30,11 @@
*** Imports
***/
#include <isc/lang.h>
#include <isc/netaddr.h>
#include <dns/types.h>
#include <dns/name.h>
#include <isc/netaddr.h>
/***
*** Types
......@@ -86,41 +88,51 @@ struct dns_aclenv {
ISC_LANG_BEGINDECLS
isc_result_t dns_acl_create(isc_mem_t *mctx, int n, dns_acl_t **target);
isc_result_t
dns_acl_create(isc_mem_t *mctx, int n, dns_acl_t **target);
/*
* Create a new ACL with room for 'n' elements.
* The elements are uninitialized and the length is 0.
*/
isc_result_t dns_acl_appendelement(dns_acl_t *acl, dns_aclelement_t *elt);
isc_result_t
dns_acl_appendelement(dns_acl_t *acl, dns_aclelement_t *elt);
/*
* Append an element to an existing ACL.
*/
isc_result_t dns_acl_any(isc_mem_t *mctx, dns_acl_t **target);
isc_result_t
dns_acl_any(isc_mem_t *mctx, dns_acl_t **target);
/*
* Create a new ACL that matches everything.
*/
isc_result_t dns_acl_none(isc_mem_t *mctx, dns_acl_t **target);
isc_result_t
dns_acl_none(isc_mem_t *mctx, dns_acl_t **target);
/*
* Create a new ACL that matches nothing.
*/
void dns_acl_attach(dns_acl_t *source, dns_acl_t **target);
void
dns_acl_attach(dns_acl_t *source, dns_acl_t **target);
void dns_acl_detach(dns_acl_t **aclp);
void
dns_acl_detach(dns_acl_t **aclp);
isc_boolean_t
dns_aclelement_equal(dns_aclelement_t *ea, dns_aclelement_t *eb);
isc_boolean_t dns_acl_equal(dns_acl_t *a, dns_acl_t *b);
isc_boolean_t
dns_acl_equal(dns_acl_t *a, dns_acl_t *b);
isc_result_t dns_aclenv_init(isc_mem_t *mctx, dns_aclenv_t *env);
isc_result_t
dns_aclenv_init(isc_mem_t *mctx, dns_aclenv_t *env);
void dns_aclenv_copy(dns_aclenv_t *t, dns_aclenv_t *s);
void
dns_aclenv_copy(dns_aclenv_t *t, dns_aclenv_t *s);
void dns_aclenv_destroy(dns_aclenv_t *env);
void
dns_aclenv_destroy(dns_aclenv_t *env);
isc_result_t
dns_acl_match(isc_netaddr_t *reqaddr,
......
......@@ -18,6 +18,8 @@
#ifndef DNS_ACLCONF_H
#define DNS_ACLCONF_H 1
#include <isc/lang.h>
#include <dns/acl.h>
#include <dns/confacl.h>
#include <dns/confctx.h>
......@@ -33,9 +35,11 @@ typedef struct {
ISC_LANG_BEGINDECLS
void dns_aclconfctx_init(dns_aclconfctx_t *ctx);
void
dns_aclconfctx_init(dns_aclconfctx_t *ctx);
void dns_aclconfctx_destroy(dns_aclconfctx_t *ctx);
void
dns_aclconfctx_destroy(dns_aclconfctx_t *ctx);
isc_result_t
dns_acl_fromconfig(dns_c_ipmatchlist_t *caml,
......
......@@ -56,6 +56,7 @@
*** Imports
***/
#include <isc/lang.h>
#include <isc/list.h>
#include <isc/mem.h>
......@@ -108,9 +109,10 @@ struct dns_c_acl_table
*** Functions
***/
isc_result_t dns_c_acltable_new(isc_mem_t *mem,
dns_c_acltable_t **newtable);
ISC_LANG_BEGINDECLS
isc_result_t
dns_c_acltable_new(isc_mem_t *mem, dns_c_acltable_t **newtable);
/*
* Creates a new ACL table. Returns pointer to the new table through
* NEWTABLE paramater. The memory is allocated from the MEM memory pool.
......@@ -127,8 +129,8 @@ isc_result_t dns_c_acltable_new(isc_mem_t *mem,
*/
isc_result_t dns_c_acltable_delete(dns_c_acltable_t **table);
isc_result_t
dns_c_acltable_delete(dns_c_acltable_t **table);
/*
* Destroys the table pointed to by *TABLE and all the ACLs in it. The
* value of *TABLE can be NULL.
......@@ -143,10 +145,9 @@ isc_result_t dns_c_acltable_delete(dns_c_acltable_t **table);
*/
isc_result_t dns_c_acltable_getacl(dns_c_acltable_t *table,
const char *aclname,
dns_c_acl_t **retval);
isc_result_t
dns_c_acltable_getacl(dns_c_acltable_t *table, const char *aclname,
dns_c_acl_t **retval);
/*
* Looks up an ACL by name in the given table. The result is returned
* through the parameter RETVAL. The returned ACL must not be modified.
......@@ -160,9 +161,8 @@ isc_result_t dns_c_acltable_getacl(dns_c_acltable_t *table,
*
*/
isc_result_t dns_c_acltable_removeacl(dns_c_acltable_t *table,
const char *aclname);
isc_result_t
dns_c_acltable_removeacl(dns_c_acltable_t *table, const char *aclname);
/*
* Removes an acl from a table. The acl is looked up by name.
*
......@@ -176,8 +176,8 @@ isc_result_t dns_c_acltable_removeacl(dns_c_acltable_t *table,
*
*/
void dns_c_acltable_print(FILE *fp, int indent,
dns_c_acltable_t *table);
void
dns_c_acltable_print(FILE *fp, int indent, dns_c_acltable_t *table);
/*
* Prints the ACL table and the ACLs in it to the give stdio stream.
* indent is the indentation level (number of tabs) printed before
......@@ -188,11 +188,10 @@ void dns_c_acltable_print(FILE *fp, int indent,
* indent be a non-negative number
* table be a valid acl table.
*
*/
isc_result_t dns_c_acltable_clear(dns_c_acltable_t *table);
*/
isc_result_t
dns_c_acltable_clear(dns_c_acltable_t *table);
/*
* Deletes all the acls from the table.
*
......@@ -204,12 +203,9 @@ isc_result_t dns_c_acltable_clear(dns_c_acltable_t *table);
*
*/
isc_result_t dns_c_acl_new(dns_c_acltable_t *table,
const char *aclname,
isc_boolean_t isspecial,
dns_c_acl_t **newacl);
isc_result_t
dns_c_acl_new(dns_c_acltable_t *table, const char *aclname,
isc_boolean_t isspecial, dns_c_acl_t **newacl);
/*
* Creates a new ACL. The acl is placed in the given table. If isspecial is
* true then the acl is not printed by dns_c_acl_print. The new acl is
......@@ -227,8 +223,8 @@ isc_result_t dns_c_acl_new(dns_c_acltable_t *table,
*/
void dns_c_acl_print(FILE *fp, int indent,
dns_c_acl_t *acl);
void
dns_c_acl_print(FILE *fp, int indent, dns_c_acl_t *acl);
/*
* Prints out the acl to the stdio stream. The outupt is indented by INDENT
* tabs.
......@@ -240,11 +236,9 @@ void dns_c_acl_print(FILE *fp, int indent,
*
*/
isc_result_t dns_c_acl_setipml(dns_c_acl_t *acl,
dns_c_ipmatchlist_t *ipml,
isc_boolean_t deepcopy);
isc_result_t
dns_c_acl_setipml(dns_c_acl_t *acl, dns_c_ipmatchlist_t *ipml,
isc_boolean_t deepcopy);
/*
* Sets the ipmatch list of the ACL to the IPML. If DEEPCOPY is true, then
* a full copy of IPML is made using the MEM memory pool. In which case the
......@@ -264,10 +258,9 @@ isc_result_t dns_c_acl_setipml(dns_c_acl_t *acl,
*
*/
isc_result_t dns_c_acl_getipmlexpanded(isc_mem_t *mem, dns_c_acl_t *acl,
dns_c_ipmatchlist_t **retval);
isc_result_t
dns_c_acl_getipmlexpanded(isc_mem_t *mem, dns_c_acl_t *acl,
dns_c_ipmatchlist_t **retval);
/*
* Retuns a copy through the RETVAL parameter (the caller is responsible
* for deleting the returned value) of the given ACLs ipmatch list. Any
......@@ -287,11 +280,8 @@ isc_result_t dns_c_acl_getipmlexpanded(isc_mem_t *mem, dns_c_acl_t *acl,
*
*/
isc_result_t dns_c_acl_expandacls(dns_c_acltable_t *table,
dns_c_ipmatchlist_t *list);
isc_result_t
dns_c_acl_expandacls(dns_c_acltable_t *table, dns_c_ipmatchlist_t *list);
/*
* Goes through all the entires (direct and indirect) of LIST and
* expands all references to ACLs using the definitions in TABLE
......@@ -304,4 +294,7 @@ isc_result_t dns_c_acl_expandacls(dns_c_acltable_t *table,
* ISC_R_SUCCESS -- all is well
* ISC_R_FAILURE -- some acl(s) couldn't be resolved.
*/
ISC_LANG_ENDDECLS
#endif /* DNS_CONFACL_H */
......@@ -50,6 +50,7 @@
*** Imports
***/
#include <isc/lang.h>
#include <isc/types.h>
......@@ -66,14 +67,14 @@ struct dns_c_cache
/* XXX need this fleshed out */
};
/***
*** Functions
***/
isc_result_t dns_c_cache_new(isc_mem_t *mem, dns_c_cache_t **cfgres);
ISC_LANG_BEGINDECLS
isc_result_t
dns_c_cache_new(isc_mem_t *mem, dns_c_cache_t **cfgres);
/*
* Creates a new cache-config object.
*
......@@ -87,7 +88,8 @@ isc_result_t dns_c_cache_new(isc_mem_t *mem, dns_c_cache_t **cfgres);
*
*/
isc_result_t dns_c_cache_delete(dns_c_cache_t **cfgres);
isc_result_t
dns_c_cache_delete(dns_c_cache_t **cfgres);
/*
* Deletes the config-cache object and its contents.
*
......@@ -100,5 +102,6 @@ isc_result_t dns_c_cache_delete(dns_c_cache_t **cfgres);
*
*/
ISC_LANG_ENDDECLS
#endif /* DNS_CONFCACHE_H */
......@@ -61,15 +61,18 @@
#include <limits.h>
#include <isc/int.h>
#include <isc/result.h>
#include <isc/types.h>
#include <isc/lang.h>
#include <isc/net.h>
#include <isc/result.h>
#include <isc/sockaddr.h>
#include <isc/types.h>
#include <dns/types.h>
/* Constants used in the defintions of default logging channels and
categories */
/*
* Constants used in the defintions of default logging channels and
* categories.
*/
#define DNS_C_DEFAULT_SYSLOG "default_syslog"
#define DNS_C_DEFAULT_DEBUG "default_debug"
#define DNS_C_DEFAULT_DEBUG_PATH "named.run"
......@@ -253,6 +256,8 @@ extern FILE *debug_mem_print_stream; /* NULL means stderr */
*** Functions
***/
ISC_LANG_BEGINDECLS
/* The following dns_c_xxx2string() functions convert the first argument into
* a string value and returns that value. If the first argument is not a
* legal value, then NULL is returned, unless PRINTABLE is true, in which
......@@ -263,20 +268,26 @@ extern FILE *debug_mem_print_stream; /* NULL means stderr */
* dns_c_ordering2string((dns_c_ordering_t)0xffff,ISC_TRUE) returns the
* value "UNKNOWN_ORDERING"
*/
const char * dns_c_ordering2string(dns_c_ordering_t ordering,
isc_boolean_t printable);
const char * dns_c_logseverity2string(dns_c_logseverity_t level,
isc_boolean_t printable);
const char * dns_c_facility2string(int facility,
isc_boolean_t printable);
const char * dns_c_transformat2string(dns_transfer_format_t tform,
isc_boolean_t printable);
const char * dns_c_transport2string(dns_c_trans_t transport,
isc_boolean_t printable);
const char * dns_c_nameseverity2string(dns_severity_t severity,
isc_boolean_t printable);
const char * dns_c_forward2string(dns_c_forw_t forw,
isc_boolean_t printable);
const char *
dns_c_ordering2string(dns_c_ordering_t ordering, isc_boolean_t printable);
const char *
dns_c_logseverity2string(dns_c_logseverity_t level, isc_boolean_t printable);
const char *
dns_c_facility2string(int facility, isc_boolean_t printable);
const char *
dns_c_transformat2string(dns_transfer_format_t tform, isc_boolean_t printable);
const char *
dns_c_transport2string(dns_c_trans_t transport, isc_boolean_t printable);
const char *
dns_c_nameseverity2string(dns_severity_t severity, isc_boolean_t printable);
const char *
dns_c_forward2string(dns_c_forw_t forw, isc_boolean_t printable);
/*
* The following dns_c_string2xxx() functions will look up the string
......@@ -284,43 +295,59 @@ const char * dns_c_forward2string(dns_c_forw_t forw,
* through the second argument and ISC_R_SUCCESS is returned. If the string
* doesn't match a valid value then ISC_R_FAILURE is returned.
*/
isc_result_t dns_c_string2ordering(char *name,
dns_c_ordering_t *ordering);
isc_result_t dns_c_string2logseverity(const char *string,
dns_c_logseverity_t *result);
isc_result_t dns_c_string2facility(const char *string, int *res);
isc_result_t
dns_c_string2ordering(char *name, dns_c_ordering_t *ordering);
isc_result_t
dns_c_string2logseverity(const char *string, dns_c_logseverity_t *result);
isc_result_t
dns_c_string2facility(const char *string, int *res);
int
dns_c_isanyaddr(isc_sockaddr_t *inaddr);
void
dns_c_print_ipaddr(FILE *fp, isc_sockaddr_t *addr);
isc_boolean_t
dns_c_need_quote(const char *string);
void
dns_c_printtabs(FILE *fp, int count);
void
dns_c_printinunits(FILE *fp, isc_uint32_t val);
void
dns_c_dataclass_tostream(FILE *fp, dns_rdataclass_t rclass);
int dns_c_isanyaddr(isc_sockaddr_t *inaddr);
void dns_c_print_ipaddr(FILE *fp, isc_sockaddr_t *addr);
isc_boolean_t dns_c_need_quote(const char *string);
void
dns_c_datatype_tostream(FILE *fp, dns_rdatatype_t rtype);
void dns_c_printtabs(FILE *fp, int count);
void dns_c_printinunits(FILE *fp, isc_uint32_t val);
isc_boolean_t
dns_c_netaddrisanyaddr(isc_netaddr_t *inaddr);
void dns_c_dataclass_tostream(FILE *fp,
dns_rdataclass_t rclass);
void dns_c_datatype_tostream(FILE *fp,
dns_rdatatype_t rtype);
void
dns_c_netaddrprint(FILE *fp, isc_netaddr_t *inaddr);
isc_result_t
dns_c_charptoname(isc_mem_t *mem, const char *keyval, dns_name_t **name);
isc_boolean_t dns_c_netaddrisanyaddr(isc_netaddr_t *inaddr);
void dns_c_netaddrprint(FILE *fp, isc_netaddr_t *inaddr);
isc_result_t dns_c_charptoname(isc_mem_t *mem, const char *keyval,
dns_name_t **name);
void dns_c_peer_print(FILE *fp, int indent,
dns_peer_t *peer);
void dns_c_peerlist_print(FILE *fp, int indent,
dns_peerlist_t *peers);
void dns_c_ssutable_print(FILE *fp, int indent,
dns_ssutable_t *ssutable);
void
dns_c_peer_print(FILE *fp, int indent, dns_peer_t *peer);
void
dns_c_peerlist_print(FILE *fp, int indent, dns_peerlist_t *peers);
void
dns_c_ssutable_print(FILE *fp, int indent, dns_ssutable_t *ssutable);
isc_result_t dns_c_checkcategory(const char *name);
isc_result_t dns_c_checkmodule(const char *name);
isc_result_t
dns_c_checkcategory(const char *name);
isc_result_t
dns_c_checkmodule(const char *name);
/*
* Checks the argument is a known category or module name.
*
......@@ -329,5 +356,6 @@ isc_result_t dns_c_checkmodule(const char *name);
* ISC_R_FAILURE if it isn't.
*/
ISC_LANG_ENDDECLS
#endif /* DNS_CONFCOMMON_H */
......@@ -57,12 +57,12 @@
#include <sys/types.h>
#include <isc/lang.h>
#include <isc/mem.h>
#include <isc/net.h>
#include <dns/confip.h>
#define DNS_C_CONFCTL_MAGIC 0x4363746cU
#define DNS_C_CONFCTLLIST_MAGIC 0x4354424cU
......@@ -71,8 +71,6 @@
#define DNS_C_CONFCTL_VALID(ptr) \
ISC_MAGIC_VALID(ptr, DNS_C_CONFCTL_MAGIC)
/***
*** Types
***/
......@@ -80,8 +78,7 @@
typedef struct dns_c_ctrl dns_c_ctrl_t;
typedef struct dns_c_ctrl_list dns_c_ctrllist_t;
struct dns_c_ctrl
{
struct dns_c_ctrl {
isc_uint32_t magic;
isc_mem_t *mem; /* where it's memory came from */
......@@ -104,25 +101,23 @@ struct dns_c_ctrl
};
struct dns_c_ctrl_list
{
struct dns_c_ctrl_list {
isc_uint32_t magic;
isc_mem_t *mem;
ISC_LIST(dns_c_ctrl_t) elements;
};
/***
*** Functions
***/
ISC_LANG_BEGINDECLS
isc_result_t dns_c_ctrlinet_new(isc_mem_t *mem, dns_c_ctrl_t **control,
isc_sockaddr_t addr, in_port_t port,
dns_c_ipmatchlist_t *iml,
isc_boolean_t copy);
isc_result_t
dns_c_ctrlinet_new(isc_mem_t *mem, dns_c_ctrl_t **control,
isc_sockaddr_t addr, in_port_t port,
dns_c_ipmatchlist_t *iml, isc_boolean_t copy);
/*
* Creates a new INET control object. If COPY is true then a deep copy is
* made of IML, otherwise the value of IML is stored directly in the new
......@@ -137,10 +132,9 @@ isc_result_t dns_c_ctrlinet_new(isc_mem_t *mem, dns_c_ctrl_t **control,
* ISC_R_NOMEMORY -- insufficient memory available
*/
isc_result_t dns_c_ctrlunix_new(isc_mem_t *mem, dns_c_ctrl_t **control,
const char *path,
int perm, uid_t uid, gid_t gid);
isc_result_t
dns_c_ctrlunix_new(isc_mem_t *mem, dns_c_ctrl_t **control, const char *path,
int perm, uid_t uid, gid_t gid);
/*
* Creates a new UNIX control object. A copy is made of the PATH argument.
*
......@@ -154,8 +148,8 @@ isc_result_t dns_c_ctrlunix_new(isc_mem_t *mem, dns_c_ctrl_t **control,
*
*/
isc_result_t dns_c_ctrl_delete(dns_c_ctrl_t **control);
isc_result_t
dns_c_ctrl_delete(dns_c_ctrl_t **control);
/*
* Deletes the object pointed to by *CONTROL. *CONTROL may be NULL.
*
......@@ -166,8 +160,8 @@ isc_result_t dns_c_ctrl_delete(dns_c_ctrl_t **control);
* ISC_R_SUCCESS
*/
void dns_c_ctrl_print(FILE *fp, int indent, dns_c_ctrl_t *ctl);
void
dns_c_ctrl_print(FILE *fp, int indent, dns_c_ctrl_t *ctl);
/*
* Prints the control object ctl in standard named.conf format. The output
* is indented by indent number of tabs.
......@@ -178,8 +172,8 @@ void dns_c_ctrl_print(FILE *fp, int indent, dns_c_ctrl_t *ctl);
*
*/
isc_result_t dns_c_ctrllist_new(isc_mem_t *mem, dns_c_ctrllist_t **newlist);
isc_result_t
dns_c_ctrllist_new(isc_mem_t *mem, dns_c_ctrllist_t **newlist);
/*
* Creates a new control object list using the MEM memory manager.
*
......@@ -192,8 +186,8 @@ isc_result_t dns_c_ctrllist_new(isc_mem_t *mem, dns_c_ctrllist_t **newlist);
* ISC_R_NOMEMORY -- insufficient memory available.