dst_lib.c revision 40f53fa8d9c6a4fc38c0014495e7a42b08f52481
38122021242747404f7f3e02ff4428a7cb884b77Evan Hunt/*
38122021242747404f7f3e02ff4428a7cb884b77Evan Hunt * Copyright (C) 1999, 2000 Internet Software Consortium.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews *
38122021242747404f7f3e02ff4428a7cb884b77Evan Hunt * Permission to use, copy, modify, and distribute this software for any
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews * purpose with or without fee is hereby granted, provided that the above
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews * copyright notice and this permission notice appear in all copies.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews *
38122021242747404f7f3e02ff4428a7cb884b77Evan Hunt * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
38122021242747404f7f3e02ff4428a7cb884b77Evan Hunt * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
38122021242747404f7f3e02ff4428a7cb884b77Evan Hunt * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
38122021242747404f7f3e02ff4428a7cb884b77Evan Hunt * INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
38122021242747404f7f3e02ff4428a7cb884b77Evan Hunt * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
38122021242747404f7f3e02ff4428a7cb884b77Evan Hunt * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
38122021242747404f7f3e02ff4428a7cb884b77Evan Hunt * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
38122021242747404f7f3e02ff4428a7cb884b77Evan Hunt * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
38122021242747404f7f3e02ff4428a7cb884b77Evan Hunt */
38122021242747404f7f3e02ff4428a7cb884b77Evan Hunt
38122021242747404f7f3e02ff4428a7cb884b77Evan Hunt/*
38122021242747404f7f3e02ff4428a7cb884b77Evan Hunt * Principal Author: Brian Wellington
38122021242747404f7f3e02ff4428a7cb884b77Evan Hunt * $Id: dst_lib.c,v 1.6 2000/08/01 01:27:48 tale Exp $
38122021242747404f7f3e02ff4428a7cb884b77Evan Hunt */
38122021242747404f7f3e02ff4428a7cb884b77Evan Hunt
38122021242747404f7f3e02ff4428a7cb884b77Evan Hunt#include <config.h>
38122021242747404f7f3e02ff4428a7cb884b77Evan Hunt
38122021242747404f7f3e02ff4428a7cb884b77Evan Hunt#include <isc/once.h>
38122021242747404f7f3e02ff4428a7cb884b77Evan Hunt#include <isc/msgcat.h>
38122021242747404f7f3e02ff4428a7cb884b77Evan Hunt#include <isc/util.h>
38122021242747404f7f3e02ff4428a7cb884b77Evan Hunt
38122021242747404f7f3e02ff4428a7cb884b77Evan Hunt#include <dst/lib.h>
38122021242747404f7f3e02ff4428a7cb884b77Evan Hunt
38122021242747404f7f3e02ff4428a7cb884b77Evan Hunt/***
38122021242747404f7f3e02ff4428a7cb884b77Evan Hunt *** Globals
38122021242747404f7f3e02ff4428a7cb884b77Evan Hunt ***/
38122021242747404f7f3e02ff4428a7cb884b77Evan Hunt
38122021242747404f7f3e02ff4428a7cb884b77Evan Huntisc_msgcat_t * dst_msgcat = NULL;
38122021242747404f7f3e02ff4428a7cb884b77Evan Hunt
38122021242747404f7f3e02ff4428a7cb884b77Evan Hunt
38122021242747404f7f3e02ff4428a7cb884b77Evan Hunt/***
38122021242747404f7f3e02ff4428a7cb884b77Evan Hunt *** Private
38122021242747404f7f3e02ff4428a7cb884b77Evan Hunt ***/
38122021242747404f7f3e02ff4428a7cb884b77Evan Hunt
38122021242747404f7f3e02ff4428a7cb884b77Evan Huntstatic isc_once_t msgcat_once = ISC_ONCE_INIT;
/***
*** Functions
***/
static void
open_msgcat(void) {
isc_msgcat_open("libdst.cat", &dst_msgcat);
}
void
dst_lib_initmsgcat(void) {
/*
* Initialize the DST library's message catalog, dst_msgcat, if it
* has not already been initialized.
*/
RUNTIME_CHECK(isc_once_do(&msgcat_once, open_msgcat) == ISC_R_SUCCESS);
}