Merge branch 'linux1'
[oweals/cde.git] / cde / programs / dthelp / parser / pass2 / util / basic.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: basic.h /main/3 1995/11/08 11:02:02 rswiston $ */
24 /* Copyright (c) 1986, 1987, 1988, 1989 Hewlett-Packard Co. */
25 /* Basic.h has a few very primitive #define's used by all MARKUP programs */
26 #include <stdlib.h>
27
28 /* hpux protects stdio.h from multiple includes thru stdlib.h . */
29 #include <stdio.h>
30
31 #define TRUE 1
32 #define FALSE 0
33 typedef unsigned char LOGICAL;
34
35 /* End of String marker */
36 #define M_EOS '\0'
37
38 /* Integer null value marker */
39 #define M_NULLVAL 0
40
41 /* 8-bit data characters */
42 typedef unsigned char M_CHAR8;
43
44 /* wide characters */
45 typedef wchar_t M_WCHAR;
46
47 /* For function prototypes */
48 typedef char * M_POINTER;
49 #if defined(hpux) || defined(__aix) || defined(sun) || defined(USL) || defined(__uxp__)
50 /* Old unix stuff
51  *#define void int
52  *#define M_NOPAR
53  */
54 /* New Ansi style */
55 #define M_PROTO
56 #define M_NOPAR void
57 #else
58 #define M_PROTO
59 #define M_NOPAR void
60 #endif
61
62 char *MakeMByteString(
63 #if defined(M_PROTO)
64   const M_WCHAR *from
65 #endif
66   );
67
68 M_WCHAR *MakeWideCharString(
69 #if defined(M_PROTO)
70   const char *from
71 #endif
72   );
73
74 int w_strcmp(
75 #if defined(M_PROTO)
76   const M_WCHAR *string1, const M_WCHAR *string2
77 #endif
78   );
79
80 int w_strncmp(
81 #if defined(M_PROTO)
82   const M_WCHAR *string1, const M_WCHAR *string2, int max
83 #endif
84   );
85
86 M_WCHAR *w_strcpy(
87 #if defined(M_PROTO)
88   M_WCHAR *string1, const M_WCHAR *string2
89 #endif
90   );
91
92 M_WCHAR *w_strncpy(
93 #if defined(M_PROTO)
94   M_WCHAR *string1, const M_WCHAR *string2, int max
95 #endif
96   );
97
98 int w_strlen(
99 #if defined(M_PROTO)
100   const M_WCHAR *string
101 #endif
102   );
103
104 M_WCHAR *w_strchr(
105 #if defined(M_PROTO)
106   M_WCHAR *string, const M_WCHAR chr
107 #endif
108   );
109
110 M_WCHAR *w_strstr(
111 #if defined(M_PROTO)
112   M_WCHAR *string1, M_WCHAR *string2
113 #endif
114   );