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