Blame lib/isccc/lib.c

Packit Service ae04f2
/*
Packit Service ae04f2
 * Portions Copyright (C) Internet Systems Consortium, Inc. ("ISC")
Packit Service ae04f2
 *
Packit Service ae04f2
 * This Source Code Form is subject to the terms of the Mozilla Public
Packit Service ae04f2
 * License, v. 2.0. If a copy of the MPL was not distributed with this
Packit Service ae04f2
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
Packit Service ae04f2
 *
Packit Service ae04f2
 * See the COPYRIGHT file distributed with this work for additional
Packit Service ae04f2
 * information regarding copyright ownership.
Packit Service ae04f2
 *
Packit Service ae04f2
 * Portions Copyright (C) 2001 Nominum, Inc.
Packit Service ae04f2
 *
Packit Service ae04f2
 * Permission to use, copy, modify, and/or distribute this software for any
Packit Service ae04f2
 * purpose with or without fee is hereby granted, provided that the above
Packit Service ae04f2
 * copyright notice and this permission notice appear in all copies.
Packit Service ae04f2
 *
Packit Service ae04f2
 * THE SOFTWARE IS PROVIDED "AS IS" AND ISC AND NOMINUM DISCLAIMS ALL
Packit Service ae04f2
 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
Packit Service ae04f2
 * OF MERCHANTABILITY AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY
Packit Service ae04f2
 * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
Packit Service ae04f2
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
Packit Service ae04f2
 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
Packit Service ae04f2
 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
Packit Service ae04f2
 */
Packit Service ae04f2
Packit Service ae04f2
Packit Service ae04f2
/*! \file */
Packit Service ae04f2
Packit Service ae04f2
#include <config.h>
Packit Service ae04f2
Packit Service ae04f2
#include <stddef.h>
Packit Service ae04f2
Packit Service ae04f2
#include <isc/once.h>
Packit Service ae04f2
#include <isc/msgcat.h>
Packit Service ae04f2
#include <isc/util.h>
Packit Service ae04f2
Packit Service ae04f2
#include <isccc/lib.h>
Packit Service ae04f2
Packit Service ae04f2
/***
Packit Service ae04f2
 *** Globals
Packit Service ae04f2
 ***/
Packit Service ae04f2
Packit Service ae04f2
LIBISCCC_EXTERNAL_DATA isc_msgcat_t *		isccc_msgcat = NULL;
Packit Service ae04f2
Packit Service ae04f2
Packit Service ae04f2
/***
Packit Service ae04f2
 *** Private
Packit Service ae04f2
 ***/
Packit Service ae04f2
Packit Service ae04f2
static isc_once_t		msgcat_once = ISC_ONCE_INIT;
Packit Service ae04f2
Packit Service ae04f2
Packit Service ae04f2
/***
Packit Service ae04f2
 *** Functions
Packit Service ae04f2
 ***/
Packit Service ae04f2
Packit Service ae04f2
static void
Packit Service ae04f2
open_msgcat(void) {
Packit Service ae04f2
	isc_msgcat_open("libisccc.cat", &isccc_msgcat);
Packit Service ae04f2
}
Packit Service ae04f2
Packit Service ae04f2
void
Packit Service ae04f2
isccc_lib_initmsgcat(void) {
Packit Service ae04f2
Packit Service ae04f2
	/*
Packit Service ae04f2
	 * Initialize the DNS library's message catalog, isccc_msgcat, if it
Packit Service ae04f2
	 * has not already been initialized.
Packit Service ae04f2
	 */
Packit Service ae04f2
Packit Service ae04f2
	RUNTIME_CHECK(isc_once_do(&msgcat_once, open_msgcat) == ISC_R_SUCCESS);
Packit Service ae04f2
}