"Fossies" - the Fresh Open Source Software Archive

Member "bind-9.11.23/bin/confgen/util.c" (7 Sep 2020, 958 Bytes) of package /linux/misc/dns/bind9/9.11.23/bind-9.11.23.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "util.c" see the Fossies "Dox" file reference documentation.

    1 /*
    2  * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
    3  *
    4  * This Source Code Form is subject to the terms of the Mozilla Public
    5  * License, v. 2.0. If a copy of the MPL was not distributed with this
    6  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
    7  *
    8  * See the COPYRIGHT file distributed with this work for additional
    9  * information regarding copyright ownership.
   10  */
   11 
   12 
   13 /*! \file */
   14 
   15 #include <config.h>
   16 
   17 #include <stdarg.h>
   18 #include <stdbool.h>
   19 #include <stdlib.h>
   20 #include <stdio.h>
   21 
   22 #include <isc/print.h>
   23 
   24 #include "util.h"
   25 
   26 extern bool verbose;
   27 extern const char *progname;
   28 
   29 void
   30 notify(const char *fmt, ...) {
   31     va_list ap;
   32 
   33     if (verbose) {
   34         va_start(ap, fmt);
   35         vfprintf(stderr, fmt, ap);
   36         va_end(ap);
   37         fputs("\n", stderr);
   38     }
   39 }
   40 
   41 void
   42 fatal(const char *format, ...) {
   43     va_list args;
   44 
   45     fprintf(stderr, "%s: ", progname);
   46     va_start(args, format);
   47     vfprintf(stderr, format, args);
   48     va_end(args);
   49     fprintf(stderr, "\n");
   50     exit(1);
   51 }