XlationSvc.h 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  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: XlationSvc.h /main/6 1996/08/22 09:07:18 rswiston $ */
  24. /************************************<+>*************************************
  25. ****************************************************************************
  26. **
  27. ** File: XlationSvc.h
  28. **
  29. ** Project: DtXlate
  30. **
  31. ** Description: table-based translation services
  32. **
  33. ** (c) Copyright 1993, 1994 Hewlett-Packard Company
  34. ** (c) Copyright 1993, 1994 International Business Machines Corp.
  35. ** (c) Copyright 1993, 1994 Sun Microsystems, Inc.
  36. ** (c) Copyright 1993, 1994 Unix System Labs, Inc., a subsidiary of Novell, Inc.
  37. **
  38. ****************************************************************************
  39. ************************************<+>*************************************/
  40. #ifndef _DtXLATE_XLATION_SVC_I
  41. #define _DtXLATE_XLATION_SVC_I
  42. #include <sys/utsname.h> /* for UTSLEN, SYS_NMLN */
  43. #ifdef __cplusplus
  44. extern "C" {
  45. #endif
  46. /*=================================================================
  47. $SHAREDBEG$: This header appears in all appropriate DtXlate topics
  48. $INCLUDE$
  49. #include <XlationSvc.h>
  50. =$END$==========================================================*/
  51. #if DOC
  52. /*========================================================*/
  53. $TYPEBEG$: _DtXlateDb
  54. $1LINER$: An opaque object used to represent translation dbs
  55. $SUMMARY$:
  56. _DtXlateDb is the type of a translation database object.
  57. The database object must be opened before use and closed
  58. after use. The definition of the object is opaque to users.
  59. $ARGS$:
  60. /*================================================$SKIP$==*/
  61. #endif
  62. /*$DEF$*/
  63. typedef struct __DtXlateDbRec * _DtXlateDb;
  64. /*$END$*/
  65. #if DOC
  66. /*========================================================*/
  67. $CONSTBEG$: _DtXLATE_OPER_xxx
  68. $1LINER$: Constants for specifying operations
  69. $SUMMARY$:
  70. The _DtXLATE_OPER_xxx are constants that produce strings
  71. used in the translation specifications when specifying
  72. the operation of a translation.
  73. The operation string name must be identical both in the
  74. source code and in the translation table.
  75. These constants should be used whenever referencing
  76. operations as part of a translation.
  77. /*================================================$SKIP$==*/
  78. #endif
  79. /* $DEF$, Operation constants */
  80. #define _DtXLATE_OPER_VERSION "version"
  81. /*$END$*/
  82. #if DOC
  83. /*========================================================*/
  84. $CONSTBEG$: _DtPLATFORM_xxx
  85. $1LINER$: Constants for specifying platforms strings
  86. $SUMMARY$:
  87. The _DtPLATFORM_xxx are constants that produce strings
  88. used in the translation specifications and when performing
  89. a translation using the API. Recall that the platform name must
  90. be an exact match if specified as translation criteria.
  91. These names are the same strings returned by 'uname(1) -s'
  92. and uname(2):utsname.sysname.
  93. The operation string name must be identical both in the
  94. source code and in the translation table.
  95. These constants should be used whenever referencing
  96. platforms as part of a translation.
  97. /*================================================$SKIP$==*/
  98. #endif
  99. /* $DEF$, Platform constants */
  100. #if defined(SVR4) || defined(_AIX) || defined(SYS_NMLN)
  101. #define _DtPLATFORM_MAX_LEN SYS_NMLN
  102. #elif defined(UTSLEN)
  103. #define _DtPLATFORM_MAX_LEN UTSLEN
  104. #else
  105. /* POSIX guarantees that hostnames are limited to 255 bytes,
  106. * but SVR4 platforms commonly allow for 256.
  107. */
  108. #define _DtPLATFORM_MAX_LEN 257
  109. #endif
  110. #define _DtPLATFORM_UNKNOWN ((const char *)0)
  111. #define _DtPLATFORM_CURRENT ((const char *)0)
  112. #define _DtPLATFORM_CDE "CDE"
  113. #define _DtPLATFORM_AIX "AIX"
  114. #define _DtPLATFORM_SUNOS "SunOS"
  115. #define _DtPLATFORM_SOLARIS "Solaris" /* verify */
  116. /*$END$*/
  117. /* Functions */
  118. int _DtXlateOpenDb(
  119. const char * databaseName,
  120. _DtXlateDb * ret_db);
  121. int _DtXlateOpenAndMergeDbs(
  122. const char * databaseName,
  123. _DtXlateDb * io_db);
  124. int _DtXlateMergeDbs(
  125. _DtXlateDb * io_dbToMerge,
  126. _DtXlateDb * io_mergeIntoDb);
  127. int _DtXlateOpenAllDbs(
  128. const char * searchPaths,
  129. const char * databaseName,
  130. _DtXlateDb * ret_db);
  131. int _DtXlateCloseDb(
  132. _DtXlateDb * io_db);
  133. int _DtXlateStdToOpValue(
  134. _DtXlateDb db,
  135. const char * platform,
  136. const int version,
  137. const char * operation,
  138. const char * stdValue,
  139. char * * ret_opValue,
  140. void * ret_reserved);
  141. int _DtXlateOpToStdValue(
  142. _DtXlateDb db,
  143. const char * platform,
  144. const int version,
  145. const char * operation,
  146. const char * opValue,
  147. char * * ret_stdValue,
  148. void * ret_reserved);
  149. int _DtXlateGetXlateEnv(
  150. _DtXlateDb db,
  151. char * ret_AppExecEnvPlatform,
  152. int * ret_AppExecEnvVersion,
  153. int * ret_XlateCompiledForOSVersion);
  154. /* Non DtXlate functions currently in XlationSvc.c */
  155. int _DtMBStrrchr (
  156. const char * s1,
  157. int value,
  158. int max_len,
  159. const char * * ret_ptr );
  160. int _DtMBStrchr (
  161. const char * s1,
  162. int value,
  163. int max_len,
  164. const char * * ret_ptr );
  165. #ifdef __cplusplus
  166. }
  167. #endif
  168. #endif /*_DtXLATE_XLATION_SVC_I*/
  169. /********* do not put anything below this line ********/