AccessSDLP.h 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313
  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: AccessSDLP.h /main/7 1995/12/18 16:30:11 cde-hp $ */
  24. /************************************<+>*************************************
  25. ****************************************************************************
  26. **
  27. ** File: AccessSDLP.h
  28. **
  29. ** Project: Run Time Project File Access
  30. **
  31. ** Description: Header file for Access.h
  32. **
  33. ** (c) Copyright 1987, 1988, 1989, 1990, 1991, 1992 Hewlett-Packard Company
  34. **
  35. ** (c) Copyright 1993, 1994 Hewlett-Packard Company
  36. ** (c) Copyright 1993, 1994 International Business Machines Corp.
  37. ** (c) Copyright 1993, 1994 Sun Microsystems, Inc.
  38. ** (c) Copyright 1993, 1994 Novell, Inc.
  39. **
  40. **
  41. ****************************************************************************
  42. ************************************<+>*************************************/
  43. #ifndef _DtHelpAccessSDLP_h
  44. #define _DtHelpAccessSDLP_h
  45. #include "CanvasSegP.h"
  46. #include "SDLI.h"
  47. /****************************************************************************
  48. * Private Structure
  49. ****************************************************************************/
  50. /*
  51. * The following structure holds the sdl document specific information
  52. */
  53. typedef struct _sdlDocInfo {
  54. char *language;
  55. char *char_set;
  56. char *first_pg;
  57. char *doc_id;
  58. char *timestamp;
  59. char *sdldtd;
  60. } SDLDocInfo;
  61. /*
  62. * The following structure holds the id specific information
  63. */
  64. typedef struct _sdlIdInfo {
  65. SdlOption type;
  66. char *rssi;
  67. int rlevel;
  68. int offset;
  69. } SDLIdInfo;
  70. /*
  71. * The following structure holds the toss style specific information
  72. */
  73. typedef struct _sdlTossInfo {
  74. unsigned long enum_values;
  75. unsigned long num_values;
  76. unsigned long str1_values;
  77. unsigned long str2_values;
  78. enum SdlElement el_type;
  79. SdlOption clan;
  80. char *ssi;
  81. union
  82. {
  83. char *str;
  84. char *colj;
  85. char *enter;
  86. } str1;
  87. union
  88. {
  89. char *str;
  90. char *colw;
  91. char *exit;
  92. } str2;
  93. int rlevel;
  94. _DtHelpFontHints font_specs;
  95. } SDLTossInfo;
  96. /*
  97. * The following structure holds the entry or index specific strings
  98. */
  99. typedef struct _sdlEntryInfo {
  100. char *main;
  101. char *locs;
  102. char *syns;
  103. char *sort;
  104. } SDLEntryInfo;
  105. /*
  106. * The following structure holds loaded volumes. The fields of this
  107. * structure should not be accessed by any code outside of the volume
  108. * module.
  109. */
  110. typedef struct _sdlVolume {
  111. SDLDocInfo *sdl_info; /* A pointer to the SDL doc info */
  112. _DtCvSegment *toss; /* A pointer to the Table of Styles */
  113. /* and Semantics withing the volume */
  114. _DtCvSegment *loids; /* A pointer to the List of Ids */
  115. _DtCvSegment *index; /* A pointer to the List of Keywords */
  116. _DtCvSegment *title; /* A pointer to the document head */
  117. _DtCvSegment *snb; /* A pointer to the document's snb */
  118. _DtCvPointer client_data; /* data that must be used to free the title
  119. and snb */
  120. void (*destroy_region)(); /* The destroy region routine specified
  121. when the title was read */
  122. short minor_no; /* The minor number of the sdl version */
  123. short title_processed; /* If the title has already been searched for */
  124. } CESDLVolume;
  125. /****************************************************************************
  126. * Private Macros
  127. ****************************************************************************/
  128. /*********************/
  129. /* SDLDocInfo macros */
  130. /*********************/
  131. #ifndef _SdlDocInfoPtrCharSet
  132. #define _SdlDocInfoPtrCharSet(x) ((x)->char_set)
  133. #endif
  134. #ifndef _SdlDocInfoPtrDocId
  135. #define _SdlDocInfoPtrDocId(x) ((x)->doc_id)
  136. #endif
  137. #ifndef _SdlDocInfoPtrFirstPg
  138. #define _SdlDocInfoPtrFirstPg(x) ((x)->first_pg)
  139. #endif
  140. #ifndef _SdlDocInfoPtrLanguage
  141. #define _SdlDocInfoPtrLanguage(x) ((x)->language)
  142. #endif
  143. #ifndef _SdlDocInfoPtrSdlDtd
  144. #define _SdlDocInfoPtrSdlDtd(x) ((x)->sdldtd)
  145. #endif
  146. #ifndef _SdlDocInfoPtrStamp
  147. #define _SdlDocInfoPtrStamp(x) ((x)->timestamp)
  148. #endif
  149. /***********************/
  150. /* SDLEntryInfo macros */
  151. /***********************/
  152. #ifndef _SdlSegEntryInfo
  153. #define _SdlSegEntryInfo(x) ((FrmtPrivInfoPtr(x))->entry)
  154. #endif
  155. #ifndef _SdlSegToSdlEntryInfo
  156. #define _SdlSegToSdlEntryInfo(x) ((SDLEntryInfo *) _SdlSegEntryInfo(x))
  157. #endif
  158. /********************/
  159. /* SDLIdInfo macros */
  160. /********************/
  161. #ifndef _SdlIdInfoPtrOffset
  162. #define _SdlIdInfoPtrOffset(x) ((x)->offset)
  163. #endif
  164. #ifndef _SdlIdInfoPtrRlevel
  165. #define _SdlIdInfoPtrRlevel(x) ((x)->rlevel)
  166. #endif
  167. #ifndef _SdlIdInfoPtrRssi
  168. #define _SdlIdInfoPtrRssi(x) ((x)->rssi)
  169. #endif
  170. #ifndef _SdlIdInfoPtrType
  171. #define _SdlIdInfoPtrType(x) ((x)->type)
  172. #endif
  173. #ifndef _SdlSegToSdlIdInfoPtr
  174. #define _SdlSegToSdlIdInfoPtr(x) \
  175. ((SDLIdInfo *)((FrmtPrivInfoPtr(x))->id_info))
  176. #endif
  177. #ifndef _SdlSegToSdlIdInfoRssi
  178. #define _SdlSegToSdlIdInfoRssi(x) \
  179. (((SDLIdInfo *)((FrmtPrivInfoPtr(x))->id_info))->rssi)
  180. #endif
  181. #ifndef _SdlSegToSdlIdInfoType
  182. #define _SdlSegToSdlIdInfoType(x) \
  183. (((SDLIdInfo *)((FrmtPrivInfoPtr(x))->id_info))->type)
  184. #endif
  185. #ifndef _SdlSegToSdlIdInfoLevel
  186. #define _SdlSegToSdlIdInfoLevel(x) \
  187. (((SDLIdInfo *)((FrmtPrivInfoPtr(x))->id_info))->rlevel)
  188. #endif
  189. /**********************/
  190. /* SDLTossInfo macros */
  191. /**********************/
  192. #ifndef _SdlTossInfoPtrFlag1
  193. #define _SdlTossInfoPtrFlag1(x) ((x)->enum_values)
  194. #endif
  195. #ifndef _SdlTossInfoPtrFlag2
  196. #define _SdlTossInfoPtrFlag2(x) ((x)->num_values)
  197. #endif
  198. #ifndef _SdlTossInfoPtrFlag3
  199. #define _SdlTossInfoPtrFlag3(x) ((x)->str1_values)
  200. #endif
  201. #ifndef _SdlTossInfoPtrFlag4
  202. #define _SdlTossInfoPtrFlag4(x) ((x)->str2_values)
  203. #endif
  204. #ifndef _SdlTossInfoPtrEnter
  205. #define _SdlTossInfoPtrEnter(x) ((x)->str1.enter)
  206. #endif
  207. #ifndef _SdlTossInfoPtrExit
  208. #define _SdlTossInfoPtrExit(x) ((x)->str2.exit)
  209. #endif
  210. #ifndef _SdlTossInfoPtrColJ
  211. #define _SdlTossInfoPtrColJ(x) ((x)->str1.colj)
  212. #endif
  213. #ifndef _SdlTossInfoPtrColW
  214. #define _SdlTossInfoPtrColW(x) ((x)->str2.colw)
  215. #endif
  216. #ifndef _SdlTossInfoPtrRlevel
  217. #define _SdlTossInfoPtrRlevel(x) ((x)->rlevel)
  218. #endif
  219. #ifndef _SdlTossInfoPtrStr1
  220. #define _SdlTossInfoPtrStr1(x) ((x)->str1.str)
  221. #endif
  222. #ifndef _SdlTossInfoPtrStr2
  223. #define _SdlTossInfoPtrStr2(x) ((x)->str2.str)
  224. #endif
  225. #ifndef _SdlTossInfoPtrSsi
  226. #define _SdlTossInfoPtrSsi(x) ((x)->ssi)
  227. #endif
  228. #ifndef _SdlTossInfoPtrFontSpecs
  229. #define _SdlTossInfoPtrFontSpecs(x) ((x)->font_specs)
  230. #endif
  231. #ifndef _SdlTossInfoPtrClan
  232. #define _SdlTossInfoPtrClan(x) ((x)->clan)
  233. #endif
  234. #ifndef _SdlTossInfoPtrType
  235. #define _SdlTossInfoPtrType(x) ((x)->el_type)
  236. #endif
  237. #ifndef _SdlSegTossInfo
  238. #define _SdlSegTossInfo(x) ((FrmtPrivInfoPtr(x))->toss)
  239. #endif
  240. #ifndef _SdlSegPtrToTossInfo
  241. #define _SdlSegPtrToTossInfo(x) ((SDLTossInfo *) _SdlSegTossInfo(x))
  242. #endif
  243. #ifndef _SdlSegPtrToTossType
  244. #define _SdlSegPtrToTossType(x) ((_SdlSegPtrToTossInfo(x))->el_type)
  245. #endif
  246. /*****************/
  247. /* Volume macros */
  248. /*****************/
  249. #ifndef _SdlVolumeMinorNumber
  250. #define _SdlVolumeMinorNumber(x) ((x)->minor_no)
  251. #endif
  252. /*******************/
  253. /* Language macros */
  254. /*******************/
  255. #ifndef _SdlSegLangChar
  256. #define _SdlSegLangChar(x) ((FrmtPrivInfoPtr(x))->lang_char)
  257. #endif
  258. #ifndef _SdlSegPtrToLangChar
  259. #define _SdlSegPtrToLangChar(x) ((char **)_SdlSegLangChar(x))
  260. #endif
  261. #endif /* _DtHelpAccessSDLP_h */