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_section_test.C /main/5 1996/08/21 15:53:20 drk $ */
25 #include "oliasdb/DtMmdb.h"
29 void showSection(DtMmdbInfoRequest* req)
35 if ( req == 0 ) return ;
37 str = DtMmdbSectionGetLongTitle(req, 0);
39 fprintf(stderr, " SectionInfo: LongTitle=%s\n", str);
42 str = DtMmdbSectionGetShortTitle(req, 0);
44 fprintf(stderr, " SectionInfo: ShortTitle=%s\n", str);
47 str = DtMmdbSectionGetData(req, 0);
49 fprintf(stderr, " SectionInfo: data=%s\n", str);
52 size = DtMmdbSectionGetDataSize(req);
53 fprintf(stderr, " SectionInfo: dataSize=%d\n", size);
56 str = DtMmdbSectionGetTocLoc(req);
58 fprintf(stderr, " SectionInfo: TocLoc=%s\n", str);
61 id = DtMmdbSectionGetBookId(req);
63 fprintf(stderr, " SectionInfo: BookId=%s\n", DtMmdbHandleToString(id));
67 id = DtMmdbSectionGetStyleSheetId(req);
69 fprintf(stderr, " SectionInfo: StyleSheetId=%s\n", DtMmdbHandleToString(id));
75 int test2(int argc, char** argv)
79 DtMmdbInfoRequest* req = 0;
84 i = DtMmdbOpenInfoLib(argv[2], argv[3], DtMmdbFalse);
85 j = DtMmdbGetBookCaseByLoc(i, argv[4]);
87 req = newDtMmdbInfoRequestWithLoc(j, argv[4]);
90 DtMmdbFreeInfoRequest(req);
91 DtMmdbCloseInfoLib(i);
96 fprintf(stderr, "invalid arguments\n");
99 fprintf(stderr, "infolib desc=%d\n", i);
104 int test3(int argc, char** argv)
108 DtMmdbInfoRequest* req = 0;
113 i = DtMmdbOpenInfoLib(argv[2], argv[3], DtMmdbFalse);
114 j = DtMmdbGetBookCaseByName(i, argv[3]);
116 req = newDtMmdbInfoRequestWithPrimaryOid(j, argv[4]);
119 DtMmdbFreeInfoRequest(req);
120 DtMmdbCloseInfoLib(i);
125 fprintf(stderr, "invalid arguments\n");
128 fprintf(stderr, "infolib desc=%d\n", i);