Mmdb.h 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305
  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 libraries 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. #ifndef _MMDB_C_API_H
  34. #define _MMDB_C_API_H
  35. #define DtMmdb_PROTO1(x) (x)
  36. #define DtMmdb_PROTO2(x,y) (x,y)
  37. #define DtMmdb_PROTO3(x,y,z) (x,y,z)
  38. #undef _not_defined
  39. #ifdef _not_defined
  40. #ifdef __cplusplus
  41. #else
  42. #define DtMmdb_PROTO1(x) ()
  43. #define DtMmdb_PROTO2(x,y) ()
  44. #define DtMmdb_PROTO3(x,y,z) ()
  45. #endif
  46. #endif
  47. #ifdef __cplusplus
  48. extern "C" {
  49. #endif
  50. typedef unsigned int DtMmdbBool;
  51. #define DtMmdbTrue 1
  52. #define DtMmdbFalse 0
  53. /*****************************************************/
  54. /* info lib structure */
  55. /*****************************************************/
  56. typedef struct _DtMmdbInfoLibInfo
  57. {
  58. const char* path;
  59. const char* name;
  60. unsigned int num_bookcases;
  61. } DtMmdbInfoLibInfo;
  62. /*****************************************************/
  63. /* basecase structure */
  64. /*****************************************************/
  65. typedef struct _DtMmdbBookCaseInfo
  66. {
  67. const char* name;
  68. unsigned int num_books;
  69. } DtMmdbBookCaseInfo;
  70. /*****************************************************/
  71. /* oid handler structure */
  72. /*****************************************************/
  73. typedef struct _DtMmdbObjectId
  74. {
  75. void* oid_ptr;
  76. } DtMmdbHandle;
  77. extern DtMmdbHandle* DtMmdbGroundId;
  78. /*****************************************************/
  79. /* info request structure */
  80. /*****************************************************/
  81. typedef struct _DtMmdbInfoRequest
  82. {
  83. int bookcase_descriptor;
  84. char* locator_ptr;
  85. DtMmdbHandle* primary_oid;
  86. DtMmdbHandle* secondary_oid;
  87. int sequence_num;
  88. } DtMmdbInfoRequest ;
  89. /*****************************************************/
  90. /* graphic info structure */
  91. /*****************************************************/
  92. typedef struct _DtMmdbGraphicInfo
  93. {
  94. unsigned short type;
  95. unsigned short width;
  96. unsigned short height;
  97. unsigned int llx, lly ;
  98. unsigned int urx, ury ;
  99. char* version;
  100. } DtMmdbGraphicInfo;
  101. /*****************************************************/
  102. /* mmdb */
  103. /*****************************************************/
  104. void DtMmdbInit();
  105. void DtMmdbQuit();
  106. /*****************************************************/
  107. /* Handle space release*/
  108. /*****************************************************/
  109. void DtMmdbFreeHandle(DtMmdbHandle*);
  110. void DtMmdbFreeHandleList(DtMmdbHandle**);
  111. /*****************************************************/
  112. /* infolib */
  113. /*****************************************************/
  114. int DtMmdbOpenInfoLib DtMmdb_PROTO3(
  115. const char* infolib_path,
  116. const char* selected_base_name,
  117. DtMmdbBool delayed_infolib_init
  118. );
  119. void DtMmdbCloseInfoLib DtMmdb_PROTO1(int infolib_descriptor);
  120. DtMmdbInfoLibInfo* DtMmdbInfoLibGetInfo DtMmdb_PROTO1(int infolib_descriptor);
  121. void DtMmdbInfoLibFreeInfo DtMmdb_PROTO1(DtMmdbInfoLibInfo*);
  122. /*****************************************************/
  123. /* bookcase */
  124. /*****************************************************/
  125. int
  126. DtMmdbGetBookCaseByName
  127. DtMmdb_PROTO2(int infolib_descriptor, const char* name);
  128. int
  129. DtMmdbGetBookCaseByIndex DtMmdb_PROTO2(int infolib_descriptor, int index);
  130. int
  131. DtMmdbGetBookCaseByLoc DtMmdb_PROTO2(
  132. int infolib_descriptor,
  133. const char* locator
  134. );
  135. int*
  136. DtMmdbGetBookCaseByLocs DtMmdb_PROTO2(
  137. int infolib_descriptor,
  138. const char** locators
  139. );
  140. DtMmdbBookCaseInfo* DtMmdbBookCaseGetInfo DtMmdb_PROTO1(int bookcase_descriptor);
  141. void DtMmdbBookCaseFreeInfo DtMmdb_PROTO1(DtMmdbBookCaseInfo*);
  142. /*****************************************************/
  143. /* section */
  144. /*****************************************************/
  145. const char* DtMmdbSectionGetLoc DtMmdb_PROTO1(DtMmdbInfoRequest* request);
  146. const char*
  147. DtMmdbSectionGetLongTitle DtMmdb_PROTO2(
  148. DtMmdbInfoRequest* request,
  149. unsigned int* title_length
  150. );
  151. const char*
  152. DtMmdbSectionGetShortTitle DtMmdb_PROTO2(
  153. DtMmdbInfoRequest* request,
  154. unsigned int* title_length
  155. );
  156. const char*
  157. DtMmdbSectionGetData DtMmdb_PROTO2(
  158. DtMmdbInfoRequest* request,
  159. unsigned int* data_length
  160. );
  161. int DtMmdbSectionGetDataSize DtMmdb_PROTO1(DtMmdbInfoRequest* request);
  162. const char* DtMmdbSectionGetTocLoc DtMmdb_PROTO1( DtMmdbInfoRequest* request);
  163. DtMmdbHandle*
  164. DtMmdbSectionGetBookId DtMmdb_PROTO1( DtMmdbInfoRequest* request);
  165. DtMmdbHandle*
  166. DtMmdbSectionGetStyleSheetId DtMmdb_PROTO1(DtMmdbInfoRequest* request);
  167. /*****************************************************/
  168. /* TOC */
  169. /*****************************************************/
  170. DtMmdbHandle*
  171. DtMmdbTocGetParentId DtMmdb_PROTO1(DtMmdbInfoRequest* request);
  172. DtMmdbHandle**
  173. DtMmdbTocGetChildIds DtMmdb_PROTO2(
  174. DtMmdbInfoRequest* request,
  175. unsigned int* list_length
  176. );
  177. int DtMmdbTocGetNumOfChildren DtMmdb_PROTO1( DtMmdbInfoRequest* request);
  178. /*****************************************************/
  179. /* Locator */
  180. /*****************************************************/
  181. const char*
  182. DtMmdbLocatorGetSectionLoc DtMmdb_PROTO1(DtMmdbInfoRequest* request);
  183. DtMmdbHandle*
  184. DtMmdbLocatorGetSectionObjectId DtMmdb_PROTO1(DtMmdbInfoRequest* request);
  185. /*****************************************************/
  186. /* Graphic */
  187. /*****************************************************/
  188. const char*
  189. DtMmdbGraphicGetData DtMmdb_PROTO2(
  190. DtMmdbInfoRequest* request,
  191. unsigned int* data_length
  192. );
  193. DtMmdbGraphicInfo*
  194. DtMmdbGraphicGetInfo DtMmdb_PROTO1(DtMmdbInfoRequest* request);
  195. void DtMmdbFreeGraphicInfo(DtMmdbGraphicInfo*);
  196. /*****************************************************/
  197. /* Stylesheet */
  198. /*****************************************************/
  199. const char*
  200. DtMmdbStylesheetGetName DtMmdb_PROTO1(DtMmdbInfoRequest* request);
  201. const char*
  202. DtMmdbStylesheetGetata DtMmdb_PROTO2(
  203. DtMmdbInfoRequest* request,
  204. unsigned int* data_length
  205. );
  206. /*****************************************************/
  207. /* BOOk */
  208. /*****************************************************/
  209. DtMmdbHandle*
  210. DtMmdbBookGetTocObjectId DtMmdb_PROTO1(DtMmdbInfoRequest* request);
  211. const char*
  212. DtMmdbBookGetShortTitle DtMmdb_PROTO2(
  213. DtMmdbInfoRequest* request,
  214. unsigned int* length
  215. );
  216. const char*
  217. DtMmdbBookGetLongTitle DtMmdb_PROTO2(
  218. DtMmdbInfoRequest* request,
  219. unsigned int* length
  220. );
  221. int DtMmdbBookGetSeqNum DtMmdb_PROTO1(DtMmdbInfoRequest* request);
  222. const char*
  223. DtMmdbBookGetSeqLIcense DtMmdb_PROTO2(
  224. DtMmdbInfoRequest* request,
  225. unsigned int* length
  226. );
  227. DtMmdbHandle** DtMmdbBookGetTabList DtMmdb_PROTO2(
  228. DtMmdbInfoRequest* request, unsigned int* length
  229. );
  230. /*****************************************************/
  231. /* DLP */
  232. /*****************************************************/
  233. DtMmdbHandle*
  234. DtMmdbDlpGetPrevSectionId DtMmdb_PROTO1(DtMmdbInfoRequest* request);
  235. DtMmdbHandle*
  236. DtMmdbDlpGetNextSectionId DtMmdb_PROTO1(DtMmdbInfoRequest* request);
  237. DtMmdbInfoRequest* newDtMmdbInfoRequestWithLoc(int bc_id, char* loc);
  238. DtMmdbInfoRequest* newDtMmdbInfoRequestWithPrimaryOid(int bc_id, char* oid_str);
  239. DtMmdbInfoRequest* newDtMmdbInfoRequestWithSecondaryOid(int bc_id, char* oid_str);
  240. DtMmdbInfoRequest* newDtMmdbInfoRequestWithSeqnum(int bc_id, char* oid_str);
  241. char* DtMmdbHandleToString(DtMmdbHandle* x);
  242. void DtMmdbFreeInfoRequest(DtMmdbInfoRequest*);
  243. #ifdef __cplusplus
  244. }
  245. #endif
  246. #endif