diff options
author | neksard <neksard@yandex-team.ru> | 2022-02-10 16:45:23 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:23 +0300 |
commit | 8f7cf138264e0caa318144bf8a2c950e0b0a8593 (patch) | |
tree | 83bf5c8c8047c42d8475e6095df90ccdc3d1b57f /contrib/libs/icu/i18n/uspoof_build.cpp | |
parent | d3a398281c6fd1d3672036cb2d63f842d2cb28c5 (diff) | |
download | ydb-8f7cf138264e0caa318144bf8a2c950e0b0a8593.tar.gz |
Restoring authorship annotation for <neksard@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'contrib/libs/icu/i18n/uspoof_build.cpp')
-rw-r--r-- | contrib/libs/icu/i18n/uspoof_build.cpp | 170 |
1 files changed, 85 insertions, 85 deletions
diff --git a/contrib/libs/icu/i18n/uspoof_build.cpp b/contrib/libs/icu/i18n/uspoof_build.cpp index 192fb9a688..307f337797 100644 --- a/contrib/libs/icu/i18n/uspoof_build.cpp +++ b/contrib/libs/icu/i18n/uspoof_build.cpp @@ -1,76 +1,76 @@ // © 2016 and later: Unicode, Inc. and others. -// License & terms of use: http://www.unicode.org/copyright.html -/* - *************************************************************************** - * Copyright (C) 2008-2015, International Business Machines Corporation - * and others. All Rights Reserved. - *************************************************************************** - * file name: uspoof_build.cpp +// License & terms of use: http://www.unicode.org/copyright.html +/* + *************************************************************************** + * Copyright (C) 2008-2015, International Business Machines Corporation + * and others. All Rights Reserved. + *************************************************************************** + * file name: uspoof_build.cpp * encoding: UTF-8 - * tab size: 8 (not used) - * indentation:4 - * - * created on: 2008 Dec 8 - * created by: Andy Heninger - * - * Unicode Spoof Detection Data Builder - * Builder-related functions are kept in separate files so that applications not needing - * the builder can more easily exclude them, typically by means of static linking. - * - * There are three relatively independent sets of Spoof data, - * Confusables, - * Whole Script Confusables - * ID character extensions. - * - * The data tables for each are built separately, each from its own definitions - */ - -#include "unicode/utypes.h" -#include "unicode/uspoof.h" -#include "unicode/unorm.h" -#include "unicode/uregex.h" -#include "unicode/ustring.h" -#include "cmemory.h" -#include "uspoof_impl.h" -#include "uhash.h" -#include "uvector.h" -#include "uassert.h" -#include "uarrsort.h" -#include "uspoof_conf.h" - -#if !UCONFIG_NO_NORMALIZATION - -U_NAMESPACE_USE - -// Defined in uspoof.cpp, initializes file-static variables. -U_CFUNC void uspoof_internalInitStatics(UErrorCode *status); - -// The main data building function - -U_CAPI USpoofChecker * U_EXPORT2 -uspoof_openFromSource(const char *confusables, int32_t confusablesLen, - const char* /*confusablesWholeScript*/, int32_t /*confusablesWholeScriptLen*/, - int32_t *errorType, UParseError *pe, UErrorCode *status) { - uspoof_internalInitStatics(status); - if (U_FAILURE(*status)) { - return NULL; - } -#if UCONFIG_NO_REGULAR_EXPRESSIONS - *status = U_UNSUPPORTED_ERROR; - return NULL; -#else - if (errorType!=NULL) { - *errorType = 0; - } - if (pe != NULL) { - pe->line = 0; - pe->offset = 0; - pe->preContext[0] = 0; - pe->postContext[0] = 0; - } - - // Set up a shell of a spoof detector, with empty data. - SpoofData *newSpoofData = new SpoofData(*status); + * tab size: 8 (not used) + * indentation:4 + * + * created on: 2008 Dec 8 + * created by: Andy Heninger + * + * Unicode Spoof Detection Data Builder + * Builder-related functions are kept in separate files so that applications not needing + * the builder can more easily exclude them, typically by means of static linking. + * + * There are three relatively independent sets of Spoof data, + * Confusables, + * Whole Script Confusables + * ID character extensions. + * + * The data tables for each are built separately, each from its own definitions + */ + +#include "unicode/utypes.h" +#include "unicode/uspoof.h" +#include "unicode/unorm.h" +#include "unicode/uregex.h" +#include "unicode/ustring.h" +#include "cmemory.h" +#include "uspoof_impl.h" +#include "uhash.h" +#include "uvector.h" +#include "uassert.h" +#include "uarrsort.h" +#include "uspoof_conf.h" + +#if !UCONFIG_NO_NORMALIZATION + +U_NAMESPACE_USE + +// Defined in uspoof.cpp, initializes file-static variables. +U_CFUNC void uspoof_internalInitStatics(UErrorCode *status); + +// The main data building function + +U_CAPI USpoofChecker * U_EXPORT2 +uspoof_openFromSource(const char *confusables, int32_t confusablesLen, + const char* /*confusablesWholeScript*/, int32_t /*confusablesWholeScriptLen*/, + int32_t *errorType, UParseError *pe, UErrorCode *status) { + uspoof_internalInitStatics(status); + if (U_FAILURE(*status)) { + return NULL; + } +#if UCONFIG_NO_REGULAR_EXPRESSIONS + *status = U_UNSUPPORTED_ERROR; + return NULL; +#else + if (errorType!=NULL) { + *errorType = 0; + } + if (pe != NULL) { + pe->line = 0; + pe->offset = 0; + pe->preContext[0] = 0; + pe->postContext[0] = 0; + } + + // Set up a shell of a spoof detector, with empty data. + SpoofData *newSpoofData = new SpoofData(*status); if (newSpoofData == NULL) { *status = U_MEMORY_ALLOCATION_ERROR; @@ -81,8 +81,8 @@ uspoof_openFromSource(const char *confusables, int32_t confusablesLen, delete newSpoofData; return NULL; } - SpoofImpl *This = new SpoofImpl(newSpoofData, *status); - + SpoofImpl *This = new SpoofImpl(newSpoofData, *status); + if (This == NULL) { *status = U_MEMORY_ALLOCATION_ERROR; delete newSpoofData; // explicit delete as the destructor for SpoofImpl won't be called. @@ -94,15 +94,15 @@ uspoof_openFromSource(const char *confusables, int32_t confusablesLen, return NULL; } - // Compile the binary data from the source (text) format. - ConfusabledataBuilder::buildConfusableData(This, confusables, confusablesLen, errorType, pe, *status); - - if (U_FAILURE(*status)) { - delete This; - This = NULL; - } - return (USpoofChecker *)This; -#endif // UCONFIG_NO_REGULAR_EXPRESSIONS -} - -#endif + // Compile the binary data from the source (text) format. + ConfusabledataBuilder::buildConfusableData(This, confusables, confusablesLen, errorType, pe, *status); + + if (U_FAILURE(*status)) { + delete This; + This = NULL; + } + return (USpoofChecker *)This; +#endif // UCONFIG_NO_REGULAR_EXPRESSIONS +} + +#endif |