dtcalc: change from obsoleted MAXFLOAT to FLT_MAX from std C
[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 #include <unistd.h>
52
53 /*
54  * Canvas Engine
55  */
56 #include "CanvasP.h"
57
58 /*
59  * private includes
60  */
61 #include "ObsoleteP.h"
62 #include "bufioI.h"
63 #include "Access.h"
64 #include "AccessI.h"
65
66 #ifdef NLS16
67 #endif
68
69 /********    Private Defines      ********/
70 /********    End Private Defines  ********/
71
72 /********    Private Function Declarations    ********/
73 /********    End Private Function Declarations    ********/
74 /********    Private Macro Declarations        ********/
75 /********    End Private Macro Declarations    ********/
76
77 /******************************************************************************
78 *
79 * Private variables used within this file.
80 *
81 *******************************************************************************/
82 /******************************************************************************
83  *                             Private Functions
84  ******************************************************************************/
85 /******************************************************************************
86  *                          Semi-Public Functions
87  ******************************************************************************/
88 /******************************************************************************
89  * Function:    int _DtHelpCeOpenVolume (char *volFile, _DtHelpVolume *retVol);
90  *
91  * Parameters:  volFile         Specifies the name of the Help Volume file
92  *                              to load.
93  *
94  *              retVol          Returns the handle to the loaded volume.
95  *                              If a volume is opened several times, the
96  *                              same handle will be returned each time.
97  *
98  * Return Value:                0 if successful, -1 if a failure occurred.
99  *
100  * Purpose:     This function must be called to open a Help Volume file
101  *              before any of the information in the volume can be
102  *              accessed. 
103  *
104  * Used by:     dthelpgen 1.0
105  *
106  ******************************************************************************/
107 int 
108 _DtHelpCeOpenVolume (
109     CanvasHandle canvas_handle,
110     char        *volFile, 
111     VolumeHandle  *retVol)
112 {
113     return (_DtHelpOpenVolume(volFile, retVol));
114 }
115
116 /******************************************************************************
117  * Function:    int _DtHelpCeCloseVolume (VolumeHandle vol);
118  *
119  * Parameters:  vol     Specifies the loaded volume.
120  *
121  * Return Value: 0 if successful, -1 if a failure occurs
122  *
123  * Purpose:     When the volume is no longer needed, it should be
124  *              closed with this call.  If the volume has been opened
125  *              several times, closing it will just decrement the
126  *              reference count.  When it has been closed as many times
127  *              as it was opened, the memory it is using will be freed
128  *              and any handles to the volume will be invalid.
129  *
130  * Used by:     dthelpgen 1.0
131  *
132  ******************************************************************************/
133 int
134 _DtHelpCeCloseVolume (
135      CanvasHandle       canvas,
136      VolumeHandle       volume)
137 {
138     return(_DtHelpCloseVolume(volume));
139 }
140
141 /*****************************************************************************
142  * Function: int _DtHelpCeGetTopicTitle (CanvasHandle canvas_handle,
143  *                                      VolumeHandle volume,
144  *                                      char *id, char **ret_title)
145  *
146  * Parameters:  volume          Specifies the volume containing the id.
147  *              id              Specifies the id for the topic desired.
148  *              ret_title       Returns a null terminated string containing
149  *                              the title.
150  *
151  * Memory own by caller:
152  *              ret_title
153  *
154  * Returns:     0 if successful, -2 if didn't find the id,
155  *              otherwise -1.
156  *
157  * Purpose:     Get the title of a topic.
158  *
159  *****************************************************************************/
160 int
161 _DtHelpCeGetTopicTitle (
162     CanvasHandle          canvas,
163     VolumeHandle          volume,
164     char                 *id,
165     char                **ret_title)
166 {
167     return(_DtHelpGetTopicTitle(volume, id, ret_title));
168 }
169
170 /*****************************************************************************
171  * Function:    void _DtHelpCeDestroyCanvas (CanvasHandle canvas);
172  *
173  * Parameters:
174  *              canvas          Specifies the handle for the canvas.
175  *
176  * Returns:     A handle to the canvas or NULL if an error occurs.
177  *
178  * Purpose:     Create a canvas and attach the appropriate virtual functions
179  *              to the canvas.
180  *****************************************************************************/
181 void
182 _DtHelpCeDestroyCanvas (CanvasHandle canvas)
183 {
184     _DtCanvasDestroy(canvas);
185 }
186
187 /*****************************************************************************
188  * Function: char * _DtHelpCeGetVolumeLocale (_DtHelpVolume vol)
189  *
190  * Parameters:  vol             Specifies the loaded volume
191  *
192  * Returns:     The pointer to the locale string if successful. Otherwise
193  *              NULL.
194  *
195  * Purpose:     Get the locale of the specified volume.
196  *              Returns the locale in a unix specific format
197  *              - locale[_ter][.charset] - This memory is owned by
198  *              the caller.
199  *
200  *****************************************************************************/
201 char *
202 _DtHelpCeGetVolumeLocale (
203         VolumeHandle    volume)
204 {
205     return (_DtHelpGetVolumeLocale(volume));
206
207 }  /* End _DtHelpCeGetVolumeLocale */