07168e55923fb33a4c6c264fffb02c526c7fb9c1
[oweals/cde.git] / cde / programs / dthelp / parser / canon1 / 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 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: basic.h /main/3 1995/11/08 09:46:43 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)
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 M_WCHAR *w_strcpy(
81 #if defined(M_PROTO)
82   M_WCHAR *string1, const M_WCHAR *string2
83 #endif
84   );
85
86 M_WCHAR *w_strncpy(
87 #if defined(M_PROTO)
88   M_WCHAR *string1, const M_WCHAR *string2, int max
89 #endif
90   );
91
92 int w_strlen(
93 #if defined(M_PROTO)
94   const M_WCHAR *string
95 #endif
96   );
97
98 M_WCHAR *w_strchr(
99 #if defined(M_PROTO)
100   M_WCHAR *string, const M_WCHAR chr
101 #endif
102   );
103
104 M_WCHAR *w_strstr(
105 #if defined(M_PROTO)
106   M_WCHAR *string1, M_WCHAR *string2
107 #endif
108   );
109
110 void *m_malloc(
111 #if defined(M_PROTO)
112   int size, char *msg
113 #endif
114 ) ;
115
116 void m_free(
117 #if defined(M_PROTO)
118   void *block, char *msg
119 #endif
120   ) ;
121
122 void m_err2(
123 #if defined(M_PROTO)
124   const char *text, const M_WCHAR *arg1, const M_WCHAR *arg2
125 #endif
126   ) ;
127
128 int mb_getwc(
129 #if defined(M_PROTO)
130   void *m_ptr
131 #endif
132   ) ;