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