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