Add GNU LGPL headers to all .c .C and .h files
[oweals/cde.git] / cde / lib / DtSvc / DtUtil2 / XlationSvc.h
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: 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
41
42 #ifndef _DtXLATE_XLATION_SVC_I
43 #define _DtXLATE_XLATION_SVC_I
44
45 #include <sys/utsname.h>      /* for UTSLEN, SYS_NMLN */
46
47 #ifdef __cplusplus
48 extern "C" {
49 #endif
50
51 /*=================================================================
52 $SHAREDBEG$: This header appears in all appropriate DtXlate topics
53 $INCLUDE$
54 #include <XlationSvc.h>
55 =$END$==========================================================*/
56
57
58 #if DOC
59 /*========================================================*/
60 $TYPEBEG$: _DtXlateDb
61 $1LINER$:  An opaque object used to represent translation dbs
62 $SUMMARY$:
63 _DtXlateDb is the type of a translation database object.
64 The database object must be opened before use and closed
65 after use.  The definition of the object is opaque to users.
66 $ARGS$:
67 /*================================================$SKIP$==*/
68 #endif
69 /*$DEF$*/
70 typedef struct __DtXlateDbRec * _DtXlateDb;
71 /*$END$*/
72
73
74 #if DOC
75 /*========================================================*/
76 $CONSTBEG$: _DtXLATE_OPER_xxx
77 $1LINER$:  Constants for specifying operations 
78 $SUMMARY$:
79 The _DtXLATE_OPER_xxx are constants that produce strings 
80 used in the translation specifications when specifying
81 the operation of a translation.
82
83 The operation string name must be identical both in the
84 source code and in the translation table.
85 These constants should be used whenever referencing
86 operations as part of a translation.
87 /*================================================$SKIP$==*/
88 #endif
89 /* $DEF$, Operation constants */
90 #define _DtXLATE_OPER_VERSION  "version"
91 /*$END$*/
92
93 #if DOC
94 /*========================================================*/
95 $CONSTBEG$: _DtPLATFORM_xxx
96 $1LINER$:  Constants for specifying platforms strings
97 $SUMMARY$:
98 The _DtPLATFORM_xxx are constants that produce strings 
99 used in the translation specifications and when performing
100 a translation using the API.  Recall that the platform name must
101 be an exact match if specified as translation criteria.
102 These names are the same strings returned by 'uname(1) -s'
103 and uname(2):utsname.sysname.
104
105 The operation string name must be identical both in the
106 source code and in the translation table.
107 These constants should be used whenever referencing
108 platforms as part of a translation.
109 /*================================================$SKIP$==*/
110 #endif
111 /* $DEF$, Platform constants */
112 #if defined(SVR4) || defined(_AIX)
113 #define _DtPLATFORM_MAX_LEN SYS_NMLN
114 #else
115 #if defined(SYS_NMLN)
116 #define _DtPLATFORM_MAX_LEN SYS_NMLN
117 #else
118 #define _DtPLATFORM_MAX_LEN UTSLEN
119 #endif
120 #endif
121
122 #define _DtPLATFORM_UNKNOWN ((const char *)0)
123 #define _DtPLATFORM_CURRENT ((const char *)0)
124 #define _DtPLATFORM_CDE     "CDE"
125 #define _DtPLATFORM_HPUX    "HP-UX"
126 #define _DtPLATFORM_AIX     "AIX"
127 #define _DtPLATFORM_SUNOS   "SunOS"
128 #define _DtPLATFORM_SOLARIS "Solaris"      /* verify */
129 #define _DtPLATFORM_USL     "USL"          /* verify */
130 #define _DtPLATFORM_SCO     "SCO"          /* verify */
131 #define _DtPLATFORM_XENIX   "Xenix"        /* verify */
132 /*$END$*/
133
134
135 /* Functions */
136 int _DtXlateOpenDb(
137        const char *  databaseName,
138        _DtXlateDb *  ret_db);
139
140 int _DtXlateOpenAndMergeDbs(
141        const char *   databaseName,
142        _DtXlateDb *   io_db);
143
144 int  _DtXlateMergeDbs(
145        _DtXlateDb *  io_dbToMerge,
146        _DtXlateDb *  io_mergeIntoDb);
147
148 int _DtXlateOpenAllDbs(
149          const char * searchPaths,
150          const char * databaseName,
151          _DtXlateDb * ret_db);
152
153 int _DtXlateCloseDb(
154        _DtXlateDb * io_db);
155
156 int _DtXlateStdToOpValue(
157        _DtXlateDb        db,
158        const char *      platform,
159        const int         version,
160        const char *      operation,
161        const char *      stdValue,
162        char * *          ret_opValue,
163        void *            ret_reserved);
164
165 int _DtXlateOpToStdValue(
166        _DtXlateDb        db,
167        const char *      platform,
168        const int         version,
169        const char *      operation,
170        const char *      opValue,
171        char * *          ret_stdValue,
172        void *            ret_reserved);
173
174 int _DtXlateGetXlateEnv(
175          _DtXlateDb db,
176          char *     ret_AppExecEnvPlatform,
177          int *      ret_AppExecEnvVersion,
178          int *      ret_XlateCompiledForOSVersion);
179
180 /* Non DtXlate functions currently in XlationSvc.c */
181 int _DtMBStrrchr (
182     const char *   s1,
183     int            value,
184     int            max_len,
185     const char * * ret_ptr );
186
187 int _DtMBStrchr (
188     const char * s1,
189     int          value,
190     int          max_len,
191     const char * * ret_ptr );
192
193 #ifdef __cplusplus
194 }
195 #endif
196
197 #endif /*_DtXLATE_XLATION_SVC_I*/
198 /********* do not put anything below this line ********/