OLD | NEW |
1 /* | 1 /* |
2 *************************************************************************** | 2 *************************************************************************** |
3 * Copyright (C) 2008-2009, International Business Machines Corporation | 3 * Copyright (C) 2008-2015, International Business Machines Corporation |
4 * and others. All Rights Reserved. | 4 * and others. All Rights Reserved. |
5 *************************************************************************** | 5 *************************************************************************** |
6 * file name: uspoof_build.cpp | 6 * file name: uspoof_build.cpp |
7 * encoding: US-ASCII | 7 * encoding: US-ASCII |
8 * tab size: 8 (not used) | 8 * tab size: 8 (not used) |
9 * indentation:4 | 9 * indentation:4 |
10 * | 10 * |
11 * created on: 2008 Dec 8 | 11 * created on: 2008 Dec 8 |
12 * created by: Andy Heninger | 12 * created by: Andy Heninger |
13 * | 13 * |
(...skipping 20 matching lines...) Expand all Loading... |
34 #include "uvector.h" | 34 #include "uvector.h" |
35 #include "uassert.h" | 35 #include "uassert.h" |
36 #include "uarrsort.h" | 36 #include "uarrsort.h" |
37 #include "uspoof_conf.h" | 37 #include "uspoof_conf.h" |
38 #include "uspoof_wsconf.h" | 38 #include "uspoof_wsconf.h" |
39 | 39 |
40 #if !UCONFIG_NO_NORMALIZATION | 40 #if !UCONFIG_NO_NORMALIZATION |
41 | 41 |
42 U_NAMESPACE_USE | 42 U_NAMESPACE_USE |
43 | 43 |
| 44 // Defined in uspoof.cpp, initializes file-static variables. |
| 45 U_CFUNC void uspoof_internalInitStatics(UErrorCode *status); |
44 | 46 |
45 // The main data building function | 47 // The main data building function |
46 | 48 |
47 U_CAPI USpoofChecker * U_EXPORT2 | 49 U_CAPI USpoofChecker * U_EXPORT2 |
48 uspoof_openFromSource(const char *confusables, int32_t confusablesLen, | 50 uspoof_openFromSource(const char *confusables, int32_t confusablesLen, |
49 const char *confusablesWholeScript, int32_t confusablesWho
leScriptLen, | 51 const char *confusablesWholeScript, int32_t confusablesWho
leScriptLen, |
50 int32_t *errorType, UParseError *pe, UErrorCode *status) { | 52 int32_t *errorType, UParseError *pe, UErrorCode *status) { |
51 | 53 uspoof_internalInitStatics(status); |
52 if (U_FAILURE(*status)) { | 54 if (U_FAILURE(*status)) { |
53 return NULL; | 55 return NULL; |
54 } | 56 } |
55 #if UCONFIG_NO_REGULAR_EXPRESSIONS | 57 #if UCONFIG_NO_REGULAR_EXPRESSIONS |
56 *status = U_UNSUPPORTED_ERROR; | 58 *status = U_UNSUPPORTED_ERROR; |
57 return NULL; | 59 return NULL; |
58 #else | 60 #else |
59 if (errorType!=NULL) { | 61 if (errorType!=NULL) { |
60 *errorType = 0; | 62 *errorType = 0; |
61 } | 63 } |
(...skipping 14 matching lines...) Expand all Loading... |
76 | 78 |
77 if (U_FAILURE(*status)) { | 79 if (U_FAILURE(*status)) { |
78 delete This; | 80 delete This; |
79 This = NULL; | 81 This = NULL; |
80 } | 82 } |
81 return (USpoofChecker *)This; | 83 return (USpoofChecker *)This; |
82 #endif // UCONFIG_NO_REGULAR_EXPRESSIONS | 84 #endif // UCONFIG_NO_REGULAR_EXPRESSIONS |
83 } | 85 } |
84 | 86 |
85 #endif | 87 #endif |
OLD | NEW |