Merge branch '46-just-use-clang-format-to-reformat-sources' into 'master'
Reformat source code with clang-format Closes #46 See merge request isc-projects/bind9!2156 (cherry picked from commit7099e79a9b)4c3b063eImport Linux kernel .clang-format with small modificationsf50b1e06Use clang-format to reformat the source files11341c76Update the definition files for Windowsdf6c1f76Remove tkey_test (which is no-op anyway)
This commit is contained in:
@@ -9,7 +9,6 @@
|
||||
* information regarding copyright ownership.
|
||||
*/
|
||||
|
||||
|
||||
/*! \file */
|
||||
|
||||
#include <errno.h>
|
||||
@@ -21,13 +20,14 @@
|
||||
#include <isc/string.h>
|
||||
#include <isc/util.h>
|
||||
|
||||
#include <dns/log.h>
|
||||
|
||||
#include <isccfg/grammar.h>
|
||||
#include <isccfg/namedconf.h>
|
||||
|
||||
#include <dns/log.h>
|
||||
|
||||
static void
|
||||
check_result(isc_result_t result, const char *format, ...) {
|
||||
check_result(isc_result_t result, const char *format, ...)
|
||||
{
|
||||
va_list args;
|
||||
|
||||
if (result == ISC_R_SUCCESS)
|
||||
@@ -41,34 +41,37 @@ check_result(isc_result_t result, const char *format, ...) {
|
||||
}
|
||||
|
||||
static void
|
||||
output(void *closure, const char *text, int textlen) {
|
||||
output(void *closure, const char *text, int textlen)
|
||||
{
|
||||
UNUSED(closure);
|
||||
(void) fwrite(text, 1, textlen, stdout);
|
||||
(void)fwrite(text, 1, textlen, stdout);
|
||||
}
|
||||
|
||||
static void
|
||||
usage(void) {
|
||||
usage(void)
|
||||
{
|
||||
fprintf(stderr, "usage: cfg_test --rndc|--named "
|
||||
"[--grammar] [--zonegrammar] [--active] "
|
||||
"[--memstats] conffile\n");
|
||||
"[--grammar] [--zonegrammar] [--active] "
|
||||
"[--memstats] conffile\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
int
|
||||
main(int argc, char **argv) {
|
||||
isc_result_t result;
|
||||
isc_mem_t *mctx = NULL;
|
||||
isc_log_t *lctx = NULL;
|
||||
isc_logconfig_t *lcfg = NULL;
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
isc_result_t result;
|
||||
isc_mem_t * mctx = NULL;
|
||||
isc_log_t * lctx = NULL;
|
||||
isc_logconfig_t * lcfg = NULL;
|
||||
isc_logdestination_t destination;
|
||||
cfg_parser_t *pctx = NULL;
|
||||
cfg_obj_t *cfg = NULL;
|
||||
cfg_type_t *type = NULL;
|
||||
bool grammar = false;
|
||||
bool memstats = false;
|
||||
char *filename = NULL;
|
||||
unsigned int zonetype = 0;
|
||||
unsigned int pflags = 0;
|
||||
cfg_parser_t * pctx = NULL;
|
||||
cfg_obj_t * cfg = NULL;
|
||||
cfg_type_t * type = NULL;
|
||||
bool grammar = false;
|
||||
bool memstats = false;
|
||||
char * filename = NULL;
|
||||
unsigned int zonetype = 0;
|
||||
unsigned int pflags = 0;
|
||||
|
||||
isc_mem_create(&mctx);
|
||||
|
||||
@@ -83,10 +86,9 @@ main(int argc, char **argv) {
|
||||
destination.file.name = NULL;
|
||||
destination.file.versions = ISC_LOG_ROLLNEVER;
|
||||
destination.file.maximum_size = 0;
|
||||
result = isc_log_createchannel(lcfg, "_default",
|
||||
ISC_LOG_TOFILEDESC,
|
||||
ISC_LOG_DYNAMIC,
|
||||
&destination, ISC_LOG_PRINTTIME);
|
||||
result = isc_log_createchannel(lcfg, "_default", ISC_LOG_TOFILEDESC,
|
||||
ISC_LOG_DYNAMIC, &destination,
|
||||
ISC_LOG_PRINTTIME);
|
||||
check_result(result, "isc_log_createchannel()");
|
||||
result = isc_log_usechannel(lcfg, "_default", NULL, NULL);
|
||||
check_result(result, "isc_log_usechannel()");
|
||||
@@ -106,16 +108,14 @@ main(int argc, char **argv) {
|
||||
grammar = true;
|
||||
} else if (strcmp(argv[1], "--zonegrammar") == 0) {
|
||||
argv++, argc--;
|
||||
if (argc <= 1) {
|
||||
if (argc <= 1) {
|
||||
usage();
|
||||
}
|
||||
if (strcmp(argv[1], "master") == 0 ||
|
||||
strcmp(argv[1], "primary") == 0)
|
||||
{
|
||||
strcmp(argv[1], "primary") == 0) {
|
||||
zonetype = CFG_ZONE_MASTER;
|
||||
} else if (strcmp(argv[1], "slave") == 0 ||
|
||||
strcmp(argv[1], "seconary") == 0)
|
||||
{
|
||||
strcmp(argv[1], "seconary") == 0) {
|
||||
zonetype = CFG_ZONE_SLAVE;
|
||||
} else if (strcmp(argv[1], "mirror") == 0) {
|
||||
zonetype = CFG_ZONE_MIRROR;
|
||||
|
||||
Reference in New Issue
Block a user