OLD | NEW |
1 /* | 1 /* |
2 ******************************************************************************* | 2 ******************************************************************************* |
3 * | 3 * |
4 * Copyright (C) 2003-2007, International Business Machines | 4 * Copyright (C) 2003-2014, International Business Machines |
5 * Corporation and others. All Rights Reserved. | 5 * Corporation and others. All Rights Reserved. |
6 * | 6 * |
7 ******************************************************************************* | 7 ******************************************************************************* |
8 * file name: nfsprep.c | 8 * file name: nfsprep.c |
9 * encoding: US-ASCII | 9 * encoding: US-ASCII |
10 * tab size: 8 (not used) | 10 * tab size: 8 (not used) |
11 * indentation:4 | 11 * indentation:4 |
12 * | 12 * |
13 * created on: 2003jul11 | 13 * created on: 2003jul11 |
14 * created by: Ram Viswanadha | 14 * created by: Ram Viswanadha |
15 */ | 15 */ |
16 | 16 |
17 #include "unicode/utypes.h" | 17 #include "unicode/utypes.h" |
18 | 18 |
19 #if !UCONFIG_NO_IDNA | 19 #if !UCONFIG_NO_IDNA |
20 | 20 |
21 #include "nfsprep.h" | 21 #include "nfsprep.h" |
22 #include "ustr_imp.h" | 22 #include "ustr_imp.h" |
23 #include "cintltst.h" | 23 #include "cintltst.h" |
| 24 #include "cmemory.h" |
24 | 25 |
25 #define LENGTHOF(array) (int32_t)(sizeof(array)/sizeof((array)[0])) | |
26 #define NFS4_MAX_BUFFER_SIZE 1000 | 26 #define NFS4_MAX_BUFFER_SIZE 1000 |
27 #define PREFIX_SUFFIX_SEPARATOR 0x0040 /* '@' */ | 27 #define PREFIX_SUFFIX_SEPARATOR 0x0040 /* '@' */ |
28 | 28 |
29 | 29 |
30 const char* NFS4DataFileNames[5] ={ | 30 const char* NFS4DataFileNames[5] ={ |
31 "nfscss", | 31 "nfscss", |
32 "nfscsi", | 32 "nfscsi", |
33 "nfscis", | 33 "nfscis", |
34 "nfsmxp", | 34 "nfsmxp", |
35 "nfsmxs" | 35 "nfsmxs" |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 } | 188 } |
189 i++;/* the prefix contains the separator */ | 189 i++;/* the prefix contains the separator */ |
190 *suffix = src + i; | 190 *suffix = src + i; |
191 break; | 191 break; |
192 } | 192 } |
193 i++; | 193 i++; |
194 } | 194 } |
195 *prefixLen = i; | 195 *prefixLen = i; |
196 *suffixLen = srcLength - i; | 196 *suffixLen = srcLength - i; |
197 /* special prefixes must not be followed by suffixes! */ | 197 /* special prefixes must not be followed by suffixes! */ |
198 if((findStringIndex(special_prefixes,LENGTHOF(special_prefixes), *prefix, *p
refixLen-1) != -1) && (*suffix != NULL)){ | 198 if((findStringIndex(special_prefixes,UPRV_LENGTHOF(special_prefixes), *prefi
x, *prefixLen-1) != -1) && (*suffix != NULL)){ |
199 *status = U_PARSE_ERROR; | 199 *status = U_PARSE_ERROR; |
200 return; | 200 return; |
201 } | 201 } |
202 | 202 |
203 } | 203 } |
204 | 204 |
205 int32_t | 205 int32_t |
206 nfs4_mixed_prepare( const char* src, int32_t srcLength, | 206 nfs4_mixed_prepare( const char* src, int32_t srcLength, |
207 char* dest, int32_t destCapacity, | 207 char* dest, int32_t destCapacity, |
208 UParseError* parseError, | 208 UParseError* parseError, |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
301 #endif | 301 #endif |
302 /* | 302 /* |
303 * Hey, Emacs, please set the following: | 303 * Hey, Emacs, please set the following: |
304 * | 304 * |
305 * Local Variables: | 305 * Local Variables: |
306 * indent-tabs-mode: nil | 306 * indent-tabs-mode: nil |
307 * End: | 307 * End: |
308 * | 308 * |
309 */ | 309 */ |
310 | 310 |
OLD | NEW |