Commit 5777c44a authored by Ondřej Surý's avatar Ondřej Surý

Reformat using the new rules

parent 654927c8
Pipeline #34033 failed with stages
in 3 minutes and 16 seconds
......@@ -47,12 +47,12 @@ void
DestroySockets(void);
#endif /* ifdef _WIN32 */
extern int debug;
extern const char * journal;
extern bool nomerge;
extern bool docheckmx;
extern bool docheckns;
extern bool dochecksrv;
extern int debug;
extern const char *journal;
extern bool nomerge;
extern bool docheckmx;
extern bool docheckns;
extern bool dochecksrv;
extern dns_zoneopt_t zone_options;
ISC_LANG_ENDDECLS
......
......@@ -56,7 +56,8 @@ isc_log_t *logc = NULL;
} while (0)
/*% usage */
ISC_PLATFORM_NORETURN_PRE static void usage(void) ISC_PLATFORM_NORETURN_POST;
ISC_PLATFORM_NORETURN_PRE static void
usage(void) ISC_PLATFORM_NORETURN_POST;
static void
usage(void) {
......
......@@ -62,7 +62,8 @@ static enum { progmode_check, progmode_compile } progmode;
} \
} while (0)
ISC_PLATFORM_NORETURN_PRE static void usage(void) ISC_PLATFORM_NORETURN_POST;
ISC_PLATFORM_NORETURN_PRE static void
usage(void) ISC_PLATFORM_NORETURN_POST;
static void
usage(void) {
......
......@@ -127,11 +127,11 @@ static char anchortext[] = TRUST_ANCHORS;
/*
* Static function prototypes
*/
static isc_result_t get_reverse(char *reverse, size_t len, char *value,
bool strict);
static isc_result_t
get_reverse(char *reverse, size_t len, char *value, bool strict);
static isc_result_t parse_uint(uint32_t *uip, const char *value, uint32_t max,
const char *desc);
static isc_result_t
parse_uint(uint32_t *uip, const char *value, uint32_t max, const char *desc);
static void
usage(void) {
......@@ -205,7 +205,8 @@ usage(void) {
exit(1);
}
ISC_PLATFORM_NORETURN_PRE static void fatal(const char *format, ...)
ISC_PLATFORM_NORETURN_PRE static void
fatal(const char *format, ...)
ISC_FORMAT_PRINTF(1, 2) ISC_PLATFORM_NORETURN_POST;
static void
......@@ -221,7 +222,8 @@ fatal(const char *format, ...) {
exit(1);
}
static void warn(const char *format, ...) ISC_FORMAT_PRINTF(1, 2);
static void
warn(const char *format, ...) ISC_FORMAT_PRINTF(1, 2);
static void
warn(const char *format, ...) {
......@@ -241,7 +243,8 @@ static isc_logcategory_t categories[] = { { "delv", 0 }, { NULL, 0 } };
static isc_logmodule_t modules[] = { { "delv", 0 }, { NULL, 0 } };
static void delv_log(int level, const char *fmt, ...) ISC_FORMAT_PRINTF(2, 3);
static void
delv_log(int level, const char *fmt, ...) ISC_FORMAT_PRINTF(2, 3);
static void
delv_log(int level, const char *fmt, ...) {
......
......@@ -107,7 +107,8 @@ usage(void) {
fprintf(stderr, "Press <Help> for complete list of options\n");
}
#else /* if TARGET_OS_IPHONE */
ISC_PLATFORM_NORETURN_PRE static void usage(void) ISC_PLATFORM_NORETURN_POST;
ISC_PLATFORM_NORETURN_PRE static void
usage(void) ISC_PLATFORM_NORETURN_POST;
static void
usage(void) {
......
......@@ -122,10 +122,12 @@ int lookup_counter = 0;
static char servercookie[256];
#ifdef HAVE_LIBIDN2
static void idn_locale_to_ace(const char *src, char *dst, size_t dstlen);
static void idn_ace_to_locale(const char *src, char **dst);
static isc_result_t idn_output_filter(isc_buffer_t *buffer,
unsigned int used_org);
static void
idn_locale_to_ace(const char *src, char *dst, size_t dstlen);
static void
idn_ace_to_locale(const char *src, char **dst);
static isc_result_t
idn_output_filter(isc_buffer_t *buffer, unsigned int used_org);
#endif /* HAVE_LIBIDN2 */
isc_socket_t *keep = NULL;
......@@ -227,19 +229,26 @@ void (*dighost_shutdown)(void);
/* forward declarations */
static void cancel_lookup(dig_lookup_t *lookup);
static void
cancel_lookup(dig_lookup_t *lookup);
static void recv_done(isc_task_t *task, isc_event_t *event);
static void
recv_done(isc_task_t *task, isc_event_t *event);
static void send_udp(dig_query_t *query);
static void
send_udp(dig_query_t *query);
static void connect_timeout(isc_task_t *task, isc_event_t *event);
static void
connect_timeout(isc_task_t *task, isc_event_t *event);
static void launch_next_query(dig_query_t *query, bool include_question);
static void
launch_next_query(dig_query_t *query, bool include_question);
static void check_next_lookup(dig_lookup_t *lookup);
static void
check_next_lookup(dig_lookup_t *lookup);
static bool next_origin(dig_lookup_t *oldlookup);
static bool
next_origin(dig_lookup_t *oldlookup);
static int
count_dots(char *string) {
......@@ -2718,7 +2727,8 @@ force_timeout(dig_query_t *query) {
}
}
static void connect_done(isc_task_t *task, isc_event_t *event);
static void
connect_done(isc_task_t *task, isc_event_t *event);
/*%
* Unlike send_udp, this can't be called multiple times with the same
......
......@@ -124,8 +124,10 @@ static const char *rtypetext[] = {
#define N_KNOWN_RRTYPES (sizeof(rtypetext) / sizeof(rtypetext[0]))
static void flush_lookup_list(void);
static void getinput(isc_task_t *task, isc_event_t *event);
static void
flush_lookup_list(void);
static void
getinput(isc_task_t *task, isc_event_t *event);
static char *
rcode_totext(dns_rcode_t rcode) {
......@@ -876,7 +878,8 @@ get_next_command(void) {
isc_mem_free(mctx, buf);
}
ISC_PLATFORM_NORETURN_PRE static void usage(void) ISC_PLATFORM_NORETURN_POST;
ISC_PLATFORM_NORETURN_PRE static void
usage(void) ISC_PLATFORM_NORETURN_POST;
static void
usage(void) {
......
......@@ -121,8 +121,8 @@ typedef struct keyinfo {
} keyinfo_t;
/* A replaceable function that can generate a DS RRset from some input */
typedef isc_result_t ds_maker_func_t(dns_rdatalist_t *dslist, isc_buffer_t *buf,
dns_rdata_t *rdata);
typedef isc_result_t
ds_maker_func_t(dns_rdatalist_t *dslist, isc_buffer_t *buf, dns_rdata_t *rdata);
static dns_rdataset_t cdnskey_set, cdnskey_sig;
static dns_rdataset_t cds_set, cds_sig;
......@@ -1016,7 +1016,8 @@ nsdiff(uint32_t ttl, dns_rdataset_t *oldset, dns_rdataset_t *newset) {
}
}
ISC_PLATFORM_NORETURN_PRE static void usage(void) ISC_PLATFORM_NORETURN_POST;
ISC_PLATFORM_NORETURN_PRE static void
usage(void) ISC_PLATFORM_NORETURN_POST;
static void
usage(void) {
......
......@@ -320,7 +320,8 @@ emits(bool showall, bool cds, dns_rdata_t *rdata) {
}
}
ISC_PLATFORM_NORETURN_PRE static void usage(void) ISC_PLATFORM_NORETURN_POST;
ISC_PLATFORM_NORETURN_PRE static void
usage(void) ISC_PLATFORM_NORETURN_POST;
static void
usage(void) {
......
......@@ -264,7 +264,8 @@ emit(const char *dir, dns_rdata_t *rdata) {
dst_key_free(&key);
}
ISC_PLATFORM_NORETURN_PRE static void usage(void) ISC_PLATFORM_NORETURN_POST;
ISC_PLATFORM_NORETURN_PRE static void
usage(void) ISC_PLATFORM_NORETURN_POST;
static void
usage(void) {
......
......@@ -46,7 +46,8 @@
const char *program = "dnssec-keyfromlabel";
ISC_PLATFORM_NORETURN_PRE static void usage(void) ISC_PLATFORM_NORETURN_POST;
ISC_PLATFORM_NORETURN_PRE static void
usage(void) ISC_PLATFORM_NORETURN_POST;
static void
usage(void) {
......
......@@ -69,9 +69,11 @@ const char *program = "dnssec-keygen";
isc_log_t *lctx = NULL;
ISC_PLATFORM_NORETURN_PRE static void usage(void) ISC_PLATFORM_NORETURN_POST;
ISC_PLATFORM_NORETURN_PRE static void
usage(void) ISC_PLATFORM_NORETURN_POST;
static void progress(int p);
static void
progress(int p);
struct keygen_ctx {
const char *predecessor;
......
......@@ -40,7 +40,8 @@ const char *program = "dnssec-revoke";
static isc_mem_t *mctx = NULL;
ISC_PLATFORM_NORETURN_PRE static void usage(void) ISC_PLATFORM_NORETURN_POST;
ISC_PLATFORM_NORETURN_PRE static void
usage(void) ISC_PLATFORM_NORETURN_POST;
static void
usage(void) {
......
......@@ -43,7 +43,8 @@ const char *program = "dnssec-settime";
static isc_mem_t *mctx = NULL;
ISC_PLATFORM_NORETURN_PRE static void usage(void) ISC_PLATFORM_NORETURN_POST;
ISC_PLATFORM_NORETURN_PRE static void
usage(void) ISC_PLATFORM_NORETURN_POST;
static void
usage(void) {
......
......@@ -186,7 +186,8 @@ static dns_ttl_t maxttl = 0;
UNLOCK(&statslock); \
}
static void sign(isc_task_t *task, isc_event_t *event);
static void
sign(isc_task_t *task, isc_event_t *event);
/*%
* Store a copy of 'name' in 'fzonecut' and return a pointer to that copy.
......@@ -3123,7 +3124,8 @@ print_version(FILE *fp) {
fprintf(fp, "; dnssec_signzone version " VERSION "\n");
}
ISC_PLATFORM_NORETURN_PRE static void usage(void) ISC_PLATFORM_NORETURN_POST;
ISC_PLATFORM_NORETURN_PRE static void
usage(void) ISC_PLATFORM_NORETURN_POST;
static void
usage(void) {
......
......@@ -137,7 +137,8 @@ loadzone(char *file, char *origin, dns_rdataclass_t rdclass, dns_db_t **db) {
}
}
ISC_PLATFORM_NORETURN_PRE static void usage(void) ISC_PLATFORM_NORETURN_POST;
ISC_PLATFORM_NORETURN_PRE static void
usage(void) ISC_PLATFORM_NORETURN_POST;
static void
usage(void) {
......
......@@ -25,7 +25,7 @@
/*! verbosity: set by -v and -q option in each program, defined in dnssectool.c
*/
extern int verbose;
extern int verbose;
extern bool quiet;
/*! program name, statically initialized in each program */
......
......@@ -32,12 +32,18 @@
typedef struct builtin builtin_t;
static isc_result_t do_version_lookup(dns_sdblookup_t *lookup);
static isc_result_t do_hostname_lookup(dns_sdblookup_t *lookup);
static isc_result_t do_authors_lookup(dns_sdblookup_t *lookup);
static isc_result_t do_id_lookup(dns_sdblookup_t *lookup);
static isc_result_t do_empty_lookup(dns_sdblookup_t *lookup);
static isc_result_t do_dns64_lookup(dns_sdblookup_t *lookup);
static isc_result_t
do_version_lookup(dns_sdblookup_t *lookup);
static isc_result_t
do_hostname_lookup(dns_sdblookup_t *lookup);
static isc_result_t
do_authors_lookup(dns_sdblookup_t *lookup);
static isc_result_t
do_id_lookup(dns_sdblookup_t *lookup);
static isc_result_t
do_empty_lookup(dns_sdblookup_t *lookup);
static isc_result_t
do_dns64_lookup(dns_sdblookup_t *lookup);
/*
* We can't use function pointers as the db_data directly
......
......@@ -107,8 +107,10 @@ struct named_controls {
isccc_symtab_t *symtab;
};
static void control_newconn(isc_task_t *task, isc_event_t *event);
static void control_recvmessage(isc_task_t *task, isc_event_t *event);
static void
control_newconn(isc_task_t *task, isc_event_t *event);
static void
control_recvmessage(isc_task_t *task, isc_event_t *event);
#define CLOCKSKEW 300
......
......@@ -302,9 +302,9 @@ library_fatal_error(const char *file, int line, const char *format,
exit(1);
}
static void library_unexpected_error(const char *file, int line,
const char *format, va_list args)
ISC_FORMAT_PRINTF(3, 0);
static void
library_unexpected_error(const char *file, int line, const char *format,
va_list args) ISC_FORMAT_PRINTF(3, 0);
static void
library_unexpected_error(const char *file, int line, const char *format,
......
......@@ -383,74 +383,86 @@ ISC_PLATFORM_NORETURN_PRE static void
fatal(named_server_t *server, const char *msg,
isc_result_t result) ISC_PLATFORM_NORETURN_POST;
static void named_server_reload(isc_task_t *task, isc_event_t *event);
static void
named_server_reload(isc_task_t *task, isc_event_t *event);
static isc_result_t ns_listenelt_fromconfig(const cfg_obj_t *listener,
const cfg_obj_t *config,
cfg_aclconfctx_t *actx,
isc_mem_t *mctx, uint16_t family,
ns_listenelt_t **target);
static isc_result_t ns_listenlist_fromconfig(const cfg_obj_t *listenlist,
const cfg_obj_t *config,
cfg_aclconfctx_t *actx,
isc_mem_t *mctx, uint16_t family,
ns_listenlist_t **target);
static isc_result_t
ns_listenelt_fromconfig(const cfg_obj_t *listener, const cfg_obj_t *config,
cfg_aclconfctx_t *actx, isc_mem_t *mctx,
uint16_t family, ns_listenelt_t **target);
static isc_result_t
ns_listenlist_fromconfig(const cfg_obj_t *listenlist, const cfg_obj_t *config,
cfg_aclconfctx_t *actx, isc_mem_t *mctx,
uint16_t family, ns_listenlist_t **target);
static isc_result_t configure_forward(const cfg_obj_t *config, dns_view_t *view,
const dns_name_t *origin,
const cfg_obj_t *forwarders,
const cfg_obj_t *forwardtype);
static isc_result_t
configure_forward(const cfg_obj_t *config, dns_view_t *view,
const dns_name_t *origin, const cfg_obj_t *forwarders,
const cfg_obj_t *forwardtype);
static isc_result_t configure_alternates(const cfg_obj_t *config,
dns_view_t *view,
const cfg_obj_t *alternates);
static isc_result_t
configure_alternates(const cfg_obj_t *config, dns_view_t *view,
const cfg_obj_t *alternates);
static isc_result_t configure_zone(const cfg_obj_t *config,
const cfg_obj_t *zconfig,
const cfg_obj_t *vconfig, isc_mem_t *mctx,
dns_view_t *view, dns_viewlist_t *viewlist,
dns_kasplist_t *kasplist,
cfg_aclconfctx_t *aclconf, bool added,
bool old_rpz_ok, bool modify);
static isc_result_t
configure_zone(const cfg_obj_t *config, const cfg_obj_t *zconfig,
const cfg_obj_t *vconfig, isc_mem_t *mctx, dns_view_t *view,
dns_viewlist_t *viewlist, dns_kasplist_t *kasplist,
cfg_aclconfctx_t *aclconf, bool added, bool old_rpz_ok,
bool modify);
static isc_result_t configure_newzones(dns_view_t *view, cfg_obj_t *config,
cfg_obj_t *vconfig, isc_mem_t *mctx,
cfg_aclconfctx_t *actx);
static isc_result_t
configure_newzones(dns_view_t *view, cfg_obj_t *config, cfg_obj_t *vconfig,
isc_mem_t *mctx, cfg_aclconfctx_t *actx);
static isc_result_t add_keydata_zone(dns_view_t *view, const char *directory,
isc_mem_t *mctx);
static isc_result_t
add_keydata_zone(dns_view_t *view, const char *directory, isc_mem_t *mctx);
static void end_reserved_dispatches(named_server_t *server, bool all);
static void
end_reserved_dispatches(named_server_t *server, bool all);
static void newzone_cfgctx_destroy(void **cfgp);
static void
newzone_cfgctx_destroy(void **cfgp);
static inline isc_result_t putstr(isc_buffer_t **b, const char *str);
static inline isc_result_t
putstr(isc_buffer_t **b, const char *str);
static isc_result_t putmem(isc_buffer_t **b, const char *str, size_t len);
static isc_result_t
putmem(isc_buffer_t **b, const char *str, size_t len);
static isc_result_t putuint8(isc_buffer_t **b, uint8_t val);
static isc_result_t
putuint8(isc_buffer_t **b, uint8_t val);
static inline isc_result_t putnull(isc_buffer_t **b);
static inline isc_result_t
putnull(isc_buffer_t **b);
static int count_zones(const cfg_obj_t *conf);
static int
count_zones(const cfg_obj_t *conf);
#ifdef HAVE_LMDB
static isc_result_t migrate_nzf(dns_view_t *view);
static isc_result_t
migrate_nzf(dns_view_t *view);
static isc_result_t nzd_writable(dns_view_t *view);
static isc_result_t
nzd_writable(dns_view_t *view);
static isc_result_t nzd_open(dns_view_t *view, unsigned int flags,
MDB_txn **txnp, MDB_dbi *dbi);
static isc_result_t
nzd_open(dns_view_t *view, unsigned int flags, MDB_txn **txnp, MDB_dbi *dbi);
static isc_result_t nzd_env_reopen(dns_view_t *view);
static isc_result_t
nzd_env_reopen(dns_view_t *view);
static void nzd_env_close(dns_view_t *view);
static void
nzd_env_close(dns_view_t *view);
static isc_result_t nzd_close(MDB_txn **txnp, bool commit);
static isc_result_t
nzd_close(MDB_txn **txnp, bool commit);
static isc_result_t nzd_count(dns_view_t *view, int *countp);
static isc_result_t
nzd_count(dns_view_t *view, int *countp);
#else /* ifdef HAVE_LMDB */
static isc_result_t nzf_append(dns_view_t *view, const cfg_obj_t *zconfig);
static isc_result_t
nzf_append(dns_view_t *view, const cfg_obj_t *zconfig);
#endif /* ifdef HAVE_LMDB */
/*%
......
......@@ -18,7 +18,7 @@
#define BIND_SERVICE_NAME "named"
void
ntservice_init();
ntservice_init();
void UpdateSCM(DWORD);
void
ServiceControl(DWORD dwCtrlCode);
......
......@@ -30,8 +30,10 @@ static char ConsoleTitle[128];
/*
* Forward declarations
*/
void ServiceControl(DWORD dwCtrlCode);
int bindmain(int, char *[]); /* From main.c */
void
ServiceControl(DWORD dwCtrlCode);
int
bindmain(int, char *[]); /* From main.c */
/*
* Initialize the Service by registering it.
......
......@@ -181,16 +181,21 @@ typedef struct nsu_requestinfo {
isc_sockaddr_t *addr;
} nsu_requestinfo_t;
static void sendrequest(isc_sockaddr_t *destaddr, dns_message_t *msg,
dns_request_t **request);
static void send_update(dns_name_t *zonename, isc_sockaddr_t *master);
static void
sendrequest(isc_sockaddr_t *destaddr, dns_message_t *msg,
dns_request_t **request);
static void
send_update(dns_name_t *zonename, isc_sockaddr_t *master);
ISC_PLATFORM_NORETURN_PRE static void fatal(const char *format, ...)
ISC_PLATFORM_NORETURN_PRE static void