diff options
Diffstat (limited to 'fs/cifs/cifs_unicode.h')
-rw-r--r-- | fs/cifs/cifs_unicode.h | 39 |
1 files changed, 20 insertions, 19 deletions
diff --git a/fs/cifs/cifs_unicode.h b/fs/cifs/cifs_unicode.h index 39e5b970325f..614c11fcdcb6 100644 --- a/fs/cifs/cifs_unicode.h +++ b/fs/cifs/cifs_unicode.h | |||
@@ -5,20 +5,20 @@ | |||
5 | * Convert a unicode character to upper or lower case using | 5 | * Convert a unicode character to upper or lower case using |
6 | * compressed tables. | 6 | * compressed tables. |
7 | * | 7 | * |
8 | * Copyright (c) International Business Machines Corp., 2000,2005555555555555555555555555555555555555555555555555555555 | 8 | * Copyright (c) International Business Machines Corp., 2000,2007 |
9 | * | 9 | * |
10 | * This program is free software; you can redistribute it and/or modify | 10 | * This program is free software; you can redistribute it and/or modify |
11 | * it under the terms of the GNU General Public License as published by | 11 | * it under the terms of the GNU General Public License as published by |
12 | * the Free Software Foundation; either version 2 of the License, or | 12 | * the Free Software Foundation; either version 2 of the License, or |
13 | * (at your option) any later version. | 13 | * (at your option) any later version. |
14 | * | 14 | * |
15 | * This program is distributed in the hope that it will be useful, | 15 | * This program is distributed in the hope that it will be useful, |
16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See | 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See |
18 | * the GNU General Public License for more details. | 18 | * the GNU General Public License for more details. |
19 | * | 19 | * |
20 | * You should have received a copy of the GNU General Public License | 20 | * You should have received a copy of the GNU General Public License |
21 | * along with this program; if not, write to the Free Software | 21 | * along with this program; if not, write to the Free Software |
22 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 22 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
23 | * | 23 | * |
24 | * | 24 | * |
@@ -70,7 +70,7 @@ int cifs_strtoUCS(__le16 *, const char *, int, const struct nls_table *); | |||
70 | * Address of the first string | 70 | * Address of the first string |
71 | */ | 71 | */ |
72 | static inline wchar_t * | 72 | static inline wchar_t * |
73 | UniStrcat(wchar_t * ucs1, const wchar_t * ucs2) | 73 | UniStrcat(wchar_t *ucs1, const wchar_t *ucs2) |
74 | { | 74 | { |
75 | wchar_t *anchor = ucs1; /* save a pointer to start of ucs1 */ | 75 | wchar_t *anchor = ucs1; /* save a pointer to start of ucs1 */ |
76 | 76 | ||
@@ -88,7 +88,7 @@ UniStrcat(wchar_t * ucs1, const wchar_t * ucs2) | |||
88 | * or NULL if the character is not in the string | 88 | * or NULL if the character is not in the string |
89 | */ | 89 | */ |
90 | static inline wchar_t * | 90 | static inline wchar_t * |
91 | UniStrchr(const wchar_t * ucs, wchar_t uc) | 91 | UniStrchr(const wchar_t *ucs, wchar_t uc) |
92 | { | 92 | { |
93 | while ((*ucs != uc) && *ucs) | 93 | while ((*ucs != uc) && *ucs) |
94 | ucs++; | 94 | ucs++; |
@@ -107,7 +107,7 @@ UniStrchr(const wchar_t * ucs, wchar_t uc) | |||
107 | * > 0: First string is greater than second | 107 | * > 0: First string is greater than second |
108 | */ | 108 | */ |
109 | static inline int | 109 | static inline int |
110 | UniStrcmp(const wchar_t * ucs1, const wchar_t * ucs2) | 110 | UniStrcmp(const wchar_t *ucs1, const wchar_t *ucs2) |
111 | { | 111 | { |
112 | while ((*ucs1 == *ucs2) && *ucs1) { | 112 | while ((*ucs1 == *ucs2) && *ucs1) { |
113 | ucs1++; | 113 | ucs1++; |
@@ -120,7 +120,7 @@ UniStrcmp(const wchar_t * ucs1, const wchar_t * ucs2) | |||
120 | * UniStrcpy: Copy a string | 120 | * UniStrcpy: Copy a string |
121 | */ | 121 | */ |
122 | static inline wchar_t * | 122 | static inline wchar_t * |
123 | UniStrcpy(wchar_t * ucs1, const wchar_t * ucs2) | 123 | UniStrcpy(wchar_t *ucs1, const wchar_t *ucs2) |
124 | { | 124 | { |
125 | wchar_t *anchor = ucs1; /* save the start of result string */ | 125 | wchar_t *anchor = ucs1; /* save the start of result string */ |
126 | 126 | ||
@@ -132,7 +132,7 @@ UniStrcpy(wchar_t * ucs1, const wchar_t * ucs2) | |||
132 | * UniStrlen: Return the length of a string (in 16 bit Unicode chars not bytes) | 132 | * UniStrlen: Return the length of a string (in 16 bit Unicode chars not bytes) |
133 | */ | 133 | */ |
134 | static inline size_t | 134 | static inline size_t |
135 | UniStrlen(const wchar_t * ucs1) | 135 | UniStrlen(const wchar_t *ucs1) |
136 | { | 136 | { |
137 | int i = 0; | 137 | int i = 0; |
138 | 138 | ||
@@ -142,10 +142,11 @@ UniStrlen(const wchar_t * ucs1) | |||
142 | } | 142 | } |
143 | 143 | ||
144 | /* | 144 | /* |
145 | * UniStrnlen: Return the length (in 16 bit Unicode chars not bytes) of a string (length limited) | 145 | * UniStrnlen: Return the length (in 16 bit Unicode chars not bytes) of a |
146 | * string (length limited) | ||
146 | */ | 147 | */ |
147 | static inline size_t | 148 | static inline size_t |
148 | UniStrnlen(const wchar_t * ucs1, int maxlen) | 149 | UniStrnlen(const wchar_t *ucs1, int maxlen) |
149 | { | 150 | { |
150 | int i = 0; | 151 | int i = 0; |
151 | 152 | ||
@@ -161,7 +162,7 @@ UniStrnlen(const wchar_t * ucs1, int maxlen) | |||
161 | * UniStrncat: Concatenate length limited string | 162 | * UniStrncat: Concatenate length limited string |
162 | */ | 163 | */ |
163 | static inline wchar_t * | 164 | static inline wchar_t * |
164 | UniStrncat(wchar_t * ucs1, const wchar_t * ucs2, size_t n) | 165 | UniStrncat(wchar_t *ucs1, const wchar_t *ucs2, size_t n) |
165 | { | 166 | { |
166 | wchar_t *anchor = ucs1; /* save pointer to string 1 */ | 167 | wchar_t *anchor = ucs1; /* save pointer to string 1 */ |
167 | 168 | ||
@@ -179,7 +180,7 @@ UniStrncat(wchar_t * ucs1, const wchar_t * ucs2, size_t n) | |||
179 | * UniStrncmp: Compare length limited string | 180 | * UniStrncmp: Compare length limited string |
180 | */ | 181 | */ |
181 | static inline int | 182 | static inline int |
182 | UniStrncmp(const wchar_t * ucs1, const wchar_t * ucs2, size_t n) | 183 | UniStrncmp(const wchar_t *ucs1, const wchar_t *ucs2, size_t n) |
183 | { | 184 | { |
184 | if (!n) | 185 | if (!n) |
185 | return 0; /* Null strings are equal */ | 186 | return 0; /* Null strings are equal */ |
@@ -194,7 +195,7 @@ UniStrncmp(const wchar_t * ucs1, const wchar_t * ucs2, size_t n) | |||
194 | * UniStrncmp_le: Compare length limited string - native to little-endian | 195 | * UniStrncmp_le: Compare length limited string - native to little-endian |
195 | */ | 196 | */ |
196 | static inline int | 197 | static inline int |
197 | UniStrncmp_le(const wchar_t * ucs1, const wchar_t * ucs2, size_t n) | 198 | UniStrncmp_le(const wchar_t *ucs1, const wchar_t *ucs2, size_t n) |
198 | { | 199 | { |
199 | if (!n) | 200 | if (!n) |
200 | return 0; /* Null strings are equal */ | 201 | return 0; /* Null strings are equal */ |
@@ -209,7 +210,7 @@ UniStrncmp_le(const wchar_t * ucs1, const wchar_t * ucs2, size_t n) | |||
209 | * UniStrncpy: Copy length limited string with pad | 210 | * UniStrncpy: Copy length limited string with pad |
210 | */ | 211 | */ |
211 | static inline wchar_t * | 212 | static inline wchar_t * |
212 | UniStrncpy(wchar_t * ucs1, const wchar_t * ucs2, size_t n) | 213 | UniStrncpy(wchar_t *ucs1, const wchar_t *ucs2, size_t n) |
213 | { | 214 | { |
214 | wchar_t *anchor = ucs1; | 215 | wchar_t *anchor = ucs1; |
215 | 216 | ||
@@ -226,7 +227,7 @@ UniStrncpy(wchar_t * ucs1, const wchar_t * ucs2, size_t n) | |||
226 | * UniStrncpy_le: Copy length limited string with pad to little-endian | 227 | * UniStrncpy_le: Copy length limited string with pad to little-endian |
227 | */ | 228 | */ |
228 | static inline wchar_t * | 229 | static inline wchar_t * |
229 | UniStrncpy_le(wchar_t * ucs1, const wchar_t * ucs2, size_t n) | 230 | UniStrncpy_le(wchar_t *ucs1, const wchar_t *ucs2, size_t n) |
230 | { | 231 | { |
231 | wchar_t *anchor = ucs1; | 232 | wchar_t *anchor = ucs1; |
232 | 233 | ||
@@ -247,7 +248,7 @@ UniStrncpy_le(wchar_t * ucs1, const wchar_t * ucs2, size_t n) | |||
247 | * NULL if no matching string is found | 248 | * NULL if no matching string is found |
248 | */ | 249 | */ |
249 | static inline wchar_t * | 250 | static inline wchar_t * |
250 | UniStrstr(const wchar_t * ucs1, const wchar_t * ucs2) | 251 | UniStrstr(const wchar_t *ucs1, const wchar_t *ucs2) |
251 | { | 252 | { |
252 | const wchar_t *anchor1 = ucs1; | 253 | const wchar_t *anchor1 = ucs1; |
253 | const wchar_t *anchor2 = ucs2; | 254 | const wchar_t *anchor2 = ucs2; |
@@ -297,7 +298,7 @@ UniToupper(register wchar_t uc) | |||
297 | * UniStrupr: Upper case a unicode string | 298 | * UniStrupr: Upper case a unicode string |
298 | */ | 299 | */ |
299 | static inline wchar_t * | 300 | static inline wchar_t * |
300 | UniStrupr(register wchar_t * upin) | 301 | UniStrupr(register wchar_t *upin) |
301 | { | 302 | { |
302 | register wchar_t *up; | 303 | register wchar_t *up; |
303 | 304 | ||
@@ -338,7 +339,7 @@ UniTolower(wchar_t uc) | |||
338 | * UniStrlwr: Lower case a unicode string | 339 | * UniStrlwr: Lower case a unicode string |
339 | */ | 340 | */ |
340 | static inline wchar_t * | 341 | static inline wchar_t * |
341 | UniStrlwr(register wchar_t * upin) | 342 | UniStrlwr(register wchar_t *upin) |
342 | { | 343 | { |
343 | register wchar_t *up; | 344 | register wchar_t *up; |
344 | 345 | ||