2
0

Obsolete.c 7.0 KB

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