"Fossies" - the Fresh Open Source Software Archive

Member "bind-9.11.23/lib/isccc/lib.c" (7 Sep 2020, 1828 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 "lib.c" see the Fossies "Dox" file reference documentation.

    1 /*
    2  * Portions 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  * Portions Copyright (C) 2001 Nominum, Inc.
   12  *
   13  * Permission to use, copy, modify, and/or distribute this software for any
   14  * purpose with or without fee is hereby granted, provided that the above
   15  * copyright notice and this permission notice appear in all copies.
   16  *
   17  * THE SOFTWARE IS PROVIDED "AS IS" AND ISC AND NOMINUM DISCLAIMS ALL
   18  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
   19  * OF MERCHANTABILITY AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY
   20  * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
   21  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
   22  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
   23  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
   24  */
   25 
   26 
   27 /*! \file */
   28 
   29 #include <config.h>
   30 
   31 #include <stddef.h>
   32 
   33 #include <isc/once.h>
   34 #include <isc/msgcat.h>
   35 #include <isc/util.h>
   36 
   37 #include <isccc/lib.h>
   38 
   39 /***
   40  *** Globals
   41  ***/
   42 
   43 LIBISCCC_EXTERNAL_DATA isc_msgcat_t *       isccc_msgcat = NULL;
   44 
   45 
   46 /***
   47  *** Private
   48  ***/
   49 
   50 static isc_once_t       msgcat_once = ISC_ONCE_INIT;
   51 
   52 
   53 /***
   54  *** Functions
   55  ***/
   56 
   57 static void
   58 open_msgcat(void) {
   59     isc_msgcat_open("libisccc.cat", &isccc_msgcat);
   60 }
   61 
   62 void
   63 isccc_lib_initmsgcat(void) {
   64 
   65     /*
   66      * Initialize the DNS library's message catalog, isccc_msgcat, if it
   67      * has not already been initialized.
   68      */
   69 
   70     RUNTIME_CHECK(isc_once_do(&msgcat_once, open_msgcat) == ISC_R_SUCCESS);
   71 }