Print this page
remove support for non-ANSI compilation
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/head/widec.h
+++ new/usr/src/head/widec.h
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License, Version 1.0 only
6 6 * (the "License"). You may not use this file except in compliance
7 7 * with the License.
8 8 *
9 9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 10 * or http://www.opensolaris.org/os/licensing.
11 11 * See the License for the specific language governing permissions
12 12 * and limitations under the License.
↓ open down ↓ |
12 lines elided |
↑ open up ↑ |
13 13 *
14 14 * When distributing Covered Code, include this CDDL HEADER in each
15 15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 16 * If applicable, add the following below this CDDL HEADER, with the
17 17 * fields enclosed by brackets "[]" replaced with your own identifying
18 18 * information: Portions Copyright [yyyy] [name of copyright owner]
19 19 *
20 20 * CDDL HEADER END
21 21 */
22 22 /*
23 + * Copyright 2014 Garrett D'Amore <garrett@damore.org>
24 + *
23 25 * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
24 26 * Use is subject to license terms.
25 27 */
26 28
27 29 /* Copyright (c) 1986 AT&T */
28 30 /* All Rights Reserved */
29 31
30 32
31 33 /* This module is created for NLS on Jun.04.86 */
32 34
33 35 #ifndef _WIDEC_H
34 36 #define _WIDEC_H
35 37
36 -#pragma ident "%Z%%M% %I% %E% SMI"
37 -
38 38 #include <sys/feature_tests.h>
39 39
40 -#if defined(__STDC__)
41 40 #include <stdio.h> /* For definition of FILE */
42 -#endif
43 41 #include <euc.h>
44 42 #include <wchar.h>
45 43
46 44 #ifdef __cplusplus
47 45 extern "C" {
48 46 #endif
49 47
50 -#if defined(__STDC__)
51 48 /* Character based input and output functions */
52 49 extern wchar_t *getws(wchar_t *);
53 50 extern int putws(const wchar_t *);
54 51
55 52 #if !defined(__lint)
56 53 #define getwc(p) fgetwc(p)
57 54 #define putwc(x, p) fputwc((x), (p))
58 55 #define getwchar() getwc(stdin)
59 56 #define putwchar(x) putwc((x), stdout)
60 57 #endif
61 58
62 59 /* wchar_t string operation functions */
63 60 extern wchar_t *strtows(wchar_t *, char *);
64 61 extern wchar_t *wscpy(wchar_t *, const wchar_t *);
65 62 extern wchar_t *wsncpy(wchar_t *, const wchar_t *, size_t);
66 63 extern wchar_t *wscat(wchar_t *, const wchar_t *);
67 64 extern wchar_t *wsncat(wchar_t *, const wchar_t *, size_t);
68 65 extern wchar_t *wschr(const wchar_t *, wchar_t);
69 66 extern wchar_t *wsrchr(const wchar_t *, wchar_t);
70 67 extern wchar_t *wspbrk(const wchar_t *, const wchar_t *);
71 68 extern wchar_t *wstok(wchar_t *, const wchar_t *);
72 69 extern char *wstostr(char *, wchar_t *);
73 70
74 71 extern int wscmp(const wchar_t *, const wchar_t *);
75 72 extern int wsncmp(const wchar_t *, const wchar_t *, size_t);
76 73 extern size_t wslen(const wchar_t *);
77 74 extern size_t wsspn(const wchar_t *, const wchar_t *);
78 75 extern size_t wscspn(const wchar_t *, const wchar_t *);
79 76 extern int wscoll(const wchar_t *, const wchar_t *);
80 77 extern size_t wsxfrm(wchar_t *, const wchar_t *, size_t);
81 78
82 79 #if !defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX)
83 80
84 81 extern wchar_t *wsdup(const wchar_t *);
85 82 extern int wscol(const wchar_t *);
86 83 extern double wstod(const wchar_t *, wchar_t **);
↓ open down ↓ |
26 lines elided |
↑ open up ↑ |
87 84 extern long wstol(const wchar_t *, wchar_t **, int);
88 85 extern int wscasecmp(const wchar_t *, const wchar_t *);
89 86 extern int wsncasecmp(const wchar_t *, const wchar_t *, size_t);
90 87 extern int wsprintf(wchar_t *, const char *, ...);
91 88 #if defined(_LONGLONG_TYPE)
92 89 extern long long wstoll(const wchar_t *, wchar_t **, int);
93 90 #endif /* defined(_LONGLONG_TYPE) */
94 91
95 92 #endif /* !defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX) */
96 93
97 -#else /* !defined(__STDC__) */
98 -/* Character based input and output functions */
99 -extern wchar_t *getws();
100 -extern int putws();
101 -
102 -#ifndef getwc
103 -#define getwc(p) fgetwc(p)
104 -#endif
105 -#ifndef putwc
106 -#define putwc(x, p) fputwc((x), (p))
107 -#endif
108 -#ifndef getwchar
109 -#define getwchar() getwc(stdin)
110 -#endif
111 -#ifndef putwchar
112 -#define putwchar(x) putwc((x), stdout)
113 -#endif
114 -
115 -/* wchar_t string operation functions */
116 -extern wchar_t *strtows();
117 -extern wchar_t *wscpy();
118 -extern wchar_t *wsncpy();
119 -extern wchar_t *wscat();
120 -extern wchar_t *wsncat();
121 -extern wchar_t *wschr();
122 -extern wchar_t *wsrchr();
123 -extern wchar_t *wspbrk();
124 -extern wchar_t *wstok();
125 -
126 -extern int wscmp();
127 -extern int wsncmp();
128 -extern int wslen();
129 -extern int wsspn();
130 -extern int wscspn();
131 -extern int wscoll();
132 -extern int wsxfrm();
133 -
134 -extern char *wstostr();
135 -extern wchar_t *wsdup();
136 -extern int wscol();
137 -extern double wstod();
138 -extern long wstol();
139 -extern int wscasecmp();
140 -extern int wsncasecmp();
141 -extern int wsprintf();
142 -#if defined(_LONGLONG_TYPE)
143 -extern long long wstoll();
144 -#endif /* defined(_LONGLONG_TYPE) */
145 -
146 -#endif /* !defined(__STDC__) */
147 -
148 94 /* Returns the code set number for the process code c. */
149 95 #define WCHAR_SHIFT 7
150 96 #define WCHAR_S_MASK 0x7f
151 97 #define wcsetno(c) \
152 98 (((c)&0x20000000)?(((c)&0x10000000)?1:3):(((c)&0x10000000)?2:0))
153 99
154 100 /* Aliases... */
155 101 #define windex wschr
156 102 #define wrindex wsrchr
157 103
158 104 #define watol(s) wstol((s), (wchar_t **)0, 10)
159 105 #if defined(_LONGLONG_TYPE) && !defined(__lint)
160 106 #define watoll(s) wstoll((s), (wchar_t **)0, 10)
161 107 #endif /* defined(_LONGLONG_TYPE) && !defined(__lint) */
162 108 #define watoi(s) ((int)wstol((s), (wchar_t **)0, 10))
163 109 #define watof(s) wstod((s), (wchar_t **)0)
164 110
165 111 /*
166 112 * other macros.
167 113 */
168 114 #define WCHAR_CSMASK 0x30000000
169 115 #define EUCMASK 0x30000000
170 116 #define WCHAR_CS0 0x00000000
171 117 #define WCHAR_CS1 0x30000000
172 118 #define WCHAR_CS2 0x10000000
173 119 #define WCHAR_CS3 0x20000000
174 120 #define WCHAR_BYTE_OF(wc, i) (((wc&~0x30000000)>>(7*(3-i)))&0x7f)
175 121
176 122 #ifdef __cplusplus
177 123 }
178 124 #endif
179 125
180 126 #endif /* _WIDEC_H */
↓ open down ↓ |
23 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX