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_test.C /main/5 1996/08/21 15:53:07 drk $ */
25 #include "oliasdb/DtMmdb.h"
29 extern "C" void showBookCaseInfo(int i);
32 int showInfoLibInfo(int i)
35 DtMmdbInfoLibInfo* info = DtMmdbInfoLibGetInfo(i);
38 fprintf(stderr, "infolibInfo: path= %s\n", info -> path);
40 fprintf(stderr, "infolibInfo: name= %s\n", info -> name);
41 fprintf(stderr, "infolibInfo: num_bookcases= %d\n", info -> num_bookcases);
43 n = info -> num_bookcases;
45 DtMmdbInfoLibFreeInfo(info);
47 fprintf(stderr, "no infolibInfo\n");
53 int test0(int argc, char** argv)
60 i = DtMmdbOpenInfoLib(argv[2], argv[3], DtMmdbFalse);
61 n = showInfoLibInfo(i);
63 showBookCaseInfo(DtMmdbGetBookCaseByIndex(i, j));
66 i = DtMmdbOpenInfoLib(argv[2], 0, DtMmdbFalse);
68 n = showInfoLibInfo(i);
70 showBookCaseInfo(DtMmdbGetBookCaseByIndex(i, j));
73 fprintf(stderr, "bad argment list\n");
76 fprintf(stderr, "infolib desc=%d\n", i);
81 int test1(int argc, char** argv)
88 i = DtMmdbOpenInfoLib(argv[2], argv[3], DtMmdbFalse);
89 n = showInfoLibInfo(i);
91 showBookCaseInfo(DtMmdbGetBookCaseByLoc(i, argv[4]));
94 fprintf(stderr, "bad argment list\n");
97 fprintf(stderr, "infolib desc=%d\n", i);