2 * CDE - Common Desktop Environment
4 * Copyright (c) 1993-2012, The Open Group. All rights reserved.
6 * These libraries and programs are free software; you can
7 * redistribute them and/or modify them under the terms of the GNU
8 * Lesser General Public License as published by the Free Software
9 * Foundation; either version 2 of the License, or (at your option)
12 * These libraries and programs are distributed in the hope that
13 * they will be useful, but WITHOUT ANY WARRANTY; without even the
14 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU Lesser General Public License for more
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with these librararies and programs; if not, write
20 * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21 * Floor, Boston, MA 02110-1301 USA
23 // $TOG: MMDB.C /main/8 1998/04/17 11:42:22 mgreess $
26 #include "UAS_Exceptions.hh"
27 #include "UAS_Buffer.hh"
28 #include "UAS_Common.hh"
29 #include "UAS_Msgs.hh"
30 #include "MMDB_Factory.hh"
32 #include "Managers/CatMgr.hh"
33 #include "Registration.hh"
35 MMDB::MMDB(const UAS_String &infolibPath)
36 : f_initialized (0), fInfoLibPath (infolibPath)
38 f_oliasDB = &MMDB_Factory::olias_db();
39 f_infoLib = f_oliasDB->openInfoLib((char *) infolibPath, 0,
40 MMDB_Factory::genInfolibName());
46 //f_oliasDB->closeInfoLib (f_infoLib->get_info_lib_name());
47 f_oliasDB->closeInfoLib (f_infoLib->get_info_lib_uid());
53 MMDB::infoLibPath () {
60 return UAS_String(f_infoLib->get_info_lib_uid());
69 info_lib *lib = f_infoLib;
70 int bad_count = lib->bad_infobases();
76 (char*)UAS_String(CATGETS(Set_UAS_MMDB, 1, "The following bookcases are not valid:"));
77 buf.write (x, sizeof(char), strlen(x));
78 for (int i = 1; i <= bad_count; i++)
80 buf.write ("\n", sizeof(char), 1);
81 x = lib->get_bad_infobase_path(i);
82 buf.write (x, sizeof(char), strlen(x));
83 buf.write ("/", sizeof(char), 1);
84 x = lib->get_bad_infobase_name(i);
85 buf.write (x, sizeof(char), strlen(x));
87 buf.write ("\0", sizeof(char), 1);
88 msg.fErrorMsg = buf.data();
89 UAS_Common::send_message (msg);
96 MMDB::infobase (const char *locator)
98 info_base *ib = f_infoLib->getInfobaseByComponent((const char *)locator,
101 throw (CASTEXCEPT Exception());