OpenIndiana and Solaris port
[oweals/cde.git] / cde / programs / dtinfo / DtMmdb / oliasdb / DtMmdb.h
1 /*
2  * CDE - Common Desktop Environment
3  *
4  * Copyright (c) 1993-2012, The Open Group. All rights reserved.
5  *
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)
10  * any later version.
11  *
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
16  * details.
17  *
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
22  */
23 /* $XConsortium: Mmdb.h /main/4 1996/05/29 13:01:24 rcs $ */
24 /*
25  * (c) Copyright 1996 Digital Equipment Corporation.
26  * (c) Copyright 1996 Hewlett-Packard Company.
27  * (c) Copyright 1996 International Business Machines Corp.
28  * (c) Copyright 1996 Sun Microsystems, Inc.
29  * (c) Copyright 1996 Novell, Inc.
30  * (c) Copyright 1994, 1995, 1996 FUJITSU LIMITED.
31  * (c) Copyright 1996 Hitachi.
32  */
33
34 #ifndef _MMDB_C_API_H
35 #define _MMDB_C_API_H
36
37
38
39 #define DtMmdb_PROTO1(x) (x)
40 #define DtMmdb_PROTO2(x,y) (x,y)
41 #define DtMmdb_PROTO3(x,y,z) (x,y,z)
42
43 #undef _not_defined
44 #ifdef _not_defined
45 #ifdef __cplusplus
46 #else
47 #define DtMmdb_PROTO1(x) ()
48 #define DtMmdb_PROTO2(x,y) ()
49 #define DtMmdb_PROTO3(x,y,z) ()
50 #endif
51 #endif
52
53 #ifdef __cplusplus
54 extern "C" {
55 #endif
56
57 typedef unsigned int DtMmdbBool;
58 #define DtMmdbTrue 1
59 #define DtMmdbFalse 0
60
61 /*****************************************************/
62 /* info lib structure */
63 /*****************************************************/
64 typedef struct _DtMmdbInfoLibInfo 
65 {
66    const char* path; 
67    const char* name; 
68    unsigned int num_bookcases;
69 } DtMmdbInfoLibInfo;
70
71 /*****************************************************/
72 /* basecase structure */
73 /*****************************************************/
74 typedef struct _DtMmdbBookCaseInfo 
75 {
76    const char* name; 
77    unsigned int num_books;
78 } DtMmdbBookCaseInfo;
79
80 /*****************************************************/
81 /* oid handler structure */
82 /*****************************************************/
83 typedef struct _DtMmdbObjectId 
84 {
85    void* oid_ptr;
86 } DtMmdbHandle;
87
88 extern DtMmdbHandle* DtMmdbGroundId;
89
90 /*****************************************************/
91 /* info request structure */
92 /*****************************************************/
93 typedef struct _DtMmdbInfoRequest 
94 {
95    int bookcase_descriptor;
96    char* locator_ptr;
97    DtMmdbHandle* primary_oid;
98    DtMmdbHandle* secondary_oid;
99    int sequence_num;
100 } DtMmdbInfoRequest ;
101
102
103 /*****************************************************/
104 /* graphic info structure */
105 /*****************************************************/
106 typedef struct _DtMmdbGraphicInfo 
107 {
108    unsigned short type;
109    unsigned short width;
110    unsigned short height;
111    unsigned int llx, lly ;
112    unsigned int urx, ury ;
113    char* version;
114 } DtMmdbGraphicInfo;
115
116
117 /*****************************************************/
118 /* mmdb */
119 /*****************************************************/
120 void DtMmdbInit();
121 void DtMmdbQuit();
122
123 /*****************************************************/
124 /* Handle space release*/
125 /*****************************************************/
126 void DtMmdbFreeHandle(DtMmdbHandle*);
127 void DtMmdbFreeHandleList(DtMmdbHandle**);
128
129 /*****************************************************/
130 /* infolib */
131 /*****************************************************/
132 int DtMmdbOpenInfoLib DtMmdb_PROTO3(
133                 const char* infolib_path, 
134                 const char* selected_base_name,
135                 DtMmdbBool delayed_infolib_init
136                );
137
138 void DtMmdbCloseInfoLib DtMmdb_PROTO1(int infolib_descriptor);
139
140 DtMmdbInfoLibInfo* DtMmdbInfoLibGetInfo DtMmdb_PROTO1(int infolib_descriptor);
141
142 void DtMmdbInfoLibFreeInfo DtMmdb_PROTO1(DtMmdbInfoLibInfo*);
143
144
145 /*****************************************************/
146 /* bookcase */
147 /*****************************************************/
148 int 
149 DtMmdbGetBookCaseByName 
150 DtMmdb_PROTO2(int infolib_descriptor, const char* name);
151
152 int 
153 DtMmdbGetBookCaseByIndex DtMmdb_PROTO2(int infolib_descriptor, int index);
154
155 int 
156 DtMmdbGetBookCaseByLoc DtMmdb_PROTO2(
157         int infolib_descriptor, 
158         const char* locator
159         );
160
161 int* 
162 DtMmdbGetBookCaseByLocs DtMmdb_PROTO2(
163         int infolib_descriptor, 
164         const char** locators
165         );
166
167 DtMmdbBookCaseInfo* DtMmdbBookCaseGetInfo DtMmdb_PROTO1(int bookcase_descriptor);
168 void DtMmdbBookCaseFreeInfo DtMmdb_PROTO1(DtMmdbBookCaseInfo*);
169
170 /*****************************************************/
171 /* section  */
172 /*****************************************************/
173 const char* DtMmdbSectionGetLoc DtMmdb_PROTO1(DtMmdbInfoRequest* request);
174
175 const char* 
176 DtMmdbSectionGetLongTitle DtMmdb_PROTO2(
177         DtMmdbInfoRequest* request,
178         unsigned int* title_length
179         );
180
181 const char* 
182 DtMmdbSectionGetShortTitle DtMmdb_PROTO2(
183         DtMmdbInfoRequest* request,
184         unsigned int* title_length
185         );
186
187 const char* 
188 DtMmdbSectionGetData  DtMmdb_PROTO2(
189         DtMmdbInfoRequest* request,
190         unsigned int* data_length
191         );
192
193 int DtMmdbSectionGetDataSize DtMmdb_PROTO1(DtMmdbInfoRequest* request);
194         
195 const char* DtMmdbSectionGetTocLoc DtMmdb_PROTO1( DtMmdbInfoRequest* request);
196
197 DtMmdbHandle* 
198 DtMmdbSectionGetBookId DtMmdb_PROTO1( DtMmdbInfoRequest* request);
199
200 DtMmdbHandle* 
201 DtMmdbSectionGetStyleSheetId DtMmdb_PROTO1(DtMmdbInfoRequest* request);
202
203 /*****************************************************/
204 /* TOC */
205 /*****************************************************/
206 DtMmdbHandle* 
207 DtMmdbTocGetParentId DtMmdb_PROTO1(DtMmdbInfoRequest* request);
208
209 DtMmdbHandle** 
210 DtMmdbTocGetChildIds DtMmdb_PROTO2(
211         DtMmdbInfoRequest* request, 
212         unsigned int* list_length
213         );
214
215 int DtMmdbTocGetNumOfChildren DtMmdb_PROTO1( DtMmdbInfoRequest* request);
216
217 /*****************************************************/
218 /* Locator */
219 /*****************************************************/
220 const char* 
221 DtMmdbLocatorGetSectionLoc DtMmdb_PROTO1(DtMmdbInfoRequest* request);
222
223 DtMmdbHandle* 
224 DtMmdbLocatorGetSectionObjectId DtMmdb_PROTO1(DtMmdbInfoRequest* request);
225
226 /*****************************************************/
227 /* Graphic */
228 /*****************************************************/
229 const char* 
230 DtMmdbGraphicGetData DtMmdb_PROTO2(
231         DtMmdbInfoRequest* request, 
232         unsigned int* data_length
233         );
234
235 DtMmdbGraphicInfo* 
236 DtMmdbGraphicGetInfo DtMmdb_PROTO1(DtMmdbInfoRequest* request);
237 void DtMmdbFreeGraphicInfo(DtMmdbGraphicInfo*);
238
239
240 /*****************************************************/
241 /* Stylesheet */
242 /*****************************************************/
243 const char* 
244 DtMmdbStylesheetGetName DtMmdb_PROTO1(DtMmdbInfoRequest* request);
245
246 const char* 
247 DtMmdbStylesheetGetata DtMmdb_PROTO2(
248         DtMmdbInfoRequest* request, 
249         unsigned int* data_length
250         );
251
252 /*****************************************************/
253 /* BOOk  */
254 /*****************************************************/
255 DtMmdbHandle* 
256 DtMmdbBookGetTocObjectId DtMmdb_PROTO1(DtMmdbInfoRequest* request);
257
258 const char* 
259 DtMmdbBookGetShortTitle DtMmdb_PROTO2(
260         DtMmdbInfoRequest* request, 
261         unsigned int* length
262         );
263
264 const char* 
265 DtMmdbBookGetLongTitle DtMmdb_PROTO2(
266         DtMmdbInfoRequest* request, 
267         unsigned int* length
268         );
269
270 int DtMmdbBookGetSeqNum DtMmdb_PROTO1(DtMmdbInfoRequest* request);
271
272 const char* 
273 DtMmdbBookGetSeqLIcense DtMmdb_PROTO2(
274         DtMmdbInfoRequest* request, 
275         unsigned int* length
276         );
277
278 DtMmdbHandle** DtMmdbBookGetTabList DtMmdb_PROTO2(
279         DtMmdbInfoRequest* request, unsigned int* length
280         );
281
282 /*****************************************************/
283 /* DLP */
284 /*****************************************************/
285 DtMmdbHandle* 
286 DtMmdbDlpGetPrevSectionId  DtMmdb_PROTO1(DtMmdbInfoRequest* request);
287
288 DtMmdbHandle* 
289 DtMmdbDlpGetNextSectionId  DtMmdb_PROTO1(DtMmdbInfoRequest* request);
290
291 DtMmdbInfoRequest* newDtMmdbInfoRequestWithLoc(int bc_id, char* loc);
292 DtMmdbInfoRequest* newDtMmdbInfoRequestWithPrimaryOid(int bc_id, char* oid_str);
293 DtMmdbInfoRequest* newDtMmdbInfoRequestWithSecondaryOid(int bc_id, char* oid_str);
294 DtMmdbInfoRequest* newDtMmdbInfoRequestWithSeqnum(int bc_id, char* oid_str);
295 char* DtMmdbHandleToString(DtMmdbHandle* x);
296 void DtMmdbFreeInfoRequest(DtMmdbInfoRequest*);
297
298 #ifdef __cplusplus
299 }
300 #endif
301
302
303
304 #endif 
305