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 /* $XConsortium: c_api_infolib.cc /main/5 1996/07/18 16:01:28 drk $ */
25 #include "oliasdb/c_api_common.h"
27 //extern void_ptr_array* infolib_array;
28 extern void_ptr_array* bookcase_array;
29 extern OLIAS_DB* mmdb_ptr;
31 //extern olias_server* oserver_ptr;
33 void _assign_bookcase_index_id(info_lib* x)
35 long ind = x -> first();
40 // no duplication check yet
41 int i = bookcase_array -> no_elmts();
42 bookcase_array -> insert(base, i);
43 bookcase_array -> reset_elmts(i+1);
45 base -> set_index_id(i);
52 const char* infolib_path,
53 const char* selected_base_name,
54 DtMmdbBool delayed_infolib_init
59 mmdb_ptr = new OLIAS_DB;
60 info_lib* x = mmdb_ptr -> openInfoLib(infolib_path, selected_base_name);
63 int i = x -> descriptor();
65 int i = infolib_array -> no_elmts();
66 infolib_array -> insert(x, i);
67 infolib_array -> reset_elmts(i+1);
70 _assign_bookcase_index_id(x);
75 mcatch (mmdbException &,e)
83 void DtMmdbCloseInfoLib(int infolib_descriptor)
88 //infolib_array -> reset_vptr(0);
93 DtMmdbInfoLibGetInfo(int infolib_descriptor)
96 info_lib* x = mmdb_ptr -> getInfoLib(infolib_descriptor);
98 if ( x == 0 ) return 0;
100 DtMmdbInfoLibInfo *y =
101 (DtMmdbInfoLibInfo*)malloc(sizeof(DtMmdbInfoLibInfo));
103 if ( y == 0 ) return 0;
105 y -> path = x -> get_info_lib_path();
106 y -> name = x -> get_info_lib_name();
107 y -> num_bookcases = x -> num_of_bases();
112 mcatch (mmdbException &,e)
120 void DtMmdbInfoLibFreeInfo(DtMmdbInfoLibInfo* x)