Add GNU LGPL headers to all .c .C and .h files
[oweals/cde.git] / cde / lib / DtHelp / Obsolete.c
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: Obsolete.c /main/4 1996/05/09 03:44:04 drk $ */
24 /************************************<+>*************************************
25  ****************************************************************************
26  **
27  **   File:        Obsolete.c
28  **
29  **   Project:     Run Time Project File Access
30  **
31  **   Description: This module is for backwards compatibility only.
32  **                These internal routines are used by dthelpview,
33  **                dthelpgen and dthelpprint.
34  **
35  **
36  **  (c) Copyright 1987, 1988, 1989, 1990, 1991, 1992 Hewlett-Packard Company
37  **
38  **  (c) Copyright 1993, 1994 Hewlett-Packard Company
39  **  (c) Copyright 1993, 1994 International Business Machines Corp.
40  **  (c) Copyright 1993, 1994 Sun Microsystems, Inc.
41  **  (c) Copyright 1993, 1994 Novell, Inc.
42  **
43  **
44  ****************************************************************************
45  ************************************<+>*************************************/
46
47 /*
48  * system includes
49  */
50 #include <stdlib.h>
51
52 /*
53  * Canvas Engine
54  */
55 #include "CanvasP.h"
56
57 /*
58  * private includes
59  */
60 #include "ObsoleteP.h"
61 #include "Access.h"
62
63 #ifdef NLS16
64 #endif
65
66 /********    Private Defines      ********/
67 /********    End Private Defines  ********/
68
69 /********    Private Function Declarations    ********/
70 /********    End Private Function Declarations    ********/
71 /********    Private Macro Declarations        ********/
72 /********    End Private Macro Declarations    ********/
73
74 /******************************************************************************
75 *
76 * Private variables used within this file.
77 *
78 *******************************************************************************/
79 /******************************************************************************
80  *                             Private Functions
81  ******************************************************************************/
82 /******************************************************************************
83  *                          Semi-Public Functions
84  ******************************************************************************/
85 /******************************************************************************
86  * Function:    int _DtHelpCeOpenVolume (char *volFile, _DtHelpVolume *retVol);
87  *
88  * Parameters:  volFile         Specifies the name of the Help Volume file
89  *                              to load.
90  *
91  *              retVol          Returns the handle to the loaded volume.
92  *                              If a volume is opened several times, the
93  *                              same handle will be returned each time.
94  *
95  * Return Value:                0 if successful, -1 if a failure occurred.
96  *
97  * Purpose:     This function must be called to open a Help Volume file
98  *              before any of the information in the volume can be
99  *              accessed. 
100  *
101  * Used by:     dthelpgen 1.0
102  *
103  ******************************************************************************/
104 int 
105 _DtHelpCeOpenVolume (
106     CanvasHandle canvas_handle,
107     char        *volFile, 
108     VolumeHandle  *retVol)
109 {
110     return (_DtHelpOpenVolume(volFile, retVol));
111 }
112
113 /******************************************************************************
114  * Function:    int _DtHelpCeCloseVolume (VolumeHandle vol);
115  *
116  * Parameters:  vol     Specifies the loaded volume.
117  *
118  * Return Value: 0 if successful, -1 if a failure occurs
119  *
120  * Purpose:     When the volume is no longer needed, it should be
121  *              closed with this call.  If the volume has been opened
122  *              several times, closing it will just decrement the
123  *              reference count.  When it has been closed as many times
124  *              as it was opened, the memory it is using will be freed
125  *              and any handles to the volume will be invalid.
126  *
127  * Used by:     dthelpgen 1.0
128  *
129  ******************************************************************************/
130 int
131 _DtHelpCeCloseVolume (
132      CanvasHandle       canvas,
133      VolumeHandle       volume)
134 {
135     return(_DtHelpCloseVolume(volume));
136 }
137
138 /*****************************************************************************
139  * Function: int _DtHelpCeGetTopicTitle (CanvasHandle canvas_handle,
140  *                                      VolumeHandle volume,
141  *                                      char *id, char **ret_title)
142  *
143  * Parameters:  volume          Specifies the volume containing the id.
144  *              id              Specifies the id for the topic desired.
145  *              ret_title       Returns a null terminated string containing
146  *                              the title.
147  *
148  * Memory own by caller:
149  *              ret_title
150  *
151  * Returns:     0 if successful, -2 if didn't find the id,
152  *              otherwise -1.
153  *
154  * Purpose:     Get the title of a topic.
155  *
156  *****************************************************************************/
157 int
158 _DtHelpCeGetTopicTitle (
159     CanvasHandle          canvas,
160     VolumeHandle          volume,
161     char                 *id,
162     char                **ret_title)
163 {
164     return(_DtHelpGetTopicTitle(volume, id, ret_title));
165 }
166
167 /*****************************************************************************
168  * Function:    void _DtHelpCeDestroyCanvas (CanvasHandle canvas);
169  *
170  * Parameters:
171  *              canvas          Specifies the handle for the canvas.
172  *
173  * Returns:     A handle to the canvas or NULL if an error occurs.
174  *
175  * Purpose:     Create a canvas and attach the appropriate virtual functions
176  *              to the canvas.
177  *****************************************************************************/
178 void
179 _DtHelpCeDestroyCanvas (CanvasHandle canvas)
180 {
181     _DtCanvasDestroy(canvas);
182 }
183
184 /*****************************************************************************
185  * Function: char * _DtHelpCeGetVolumeLocale (_DtHelpVolume vol)
186  *
187  * Parameters:  vol             Specifies the loaded volume
188  *
189  * Returns:     The pointer to the locale string if successful. Otherwise
190  *              NULL.
191  *
192  * Purpose:     Get the locale of the specified volume.
193  *              Returns the locale in a unix specific format
194  *              - locale[_ter][.charset] - This memory is owned by
195  *              the caller.
196  *
197  *****************************************************************************/
198 char *
199 _DtHelpCeGetVolumeLocale (
200         VolumeHandle    volume)
201 {
202     return (_DtHelpGetVolumeLocale(volume));
203
204 }  /* End _DtHelpCeGetVolumeLocale */