aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/icu/io/sscanf.cpp
diff options
context:
space:
mode:
authormcheshkov <mcheshkov@yandex-team.ru>2022-02-10 16:46:15 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:46:15 +0300
commite9d19cec64684c9c1e6b0c98297e5b895cf904fe (patch)
tree2768b1223e96a8a0610a93d18425d9647c1123c8 /contrib/libs/icu/io/sscanf.cpp
parent60040c91ffe701a84689b2c6310ff845e65cff42 (diff)
downloadydb-e9d19cec64684c9c1e6b0c98297e5b895cf904fe.tar.gz
Restoring authorship annotation for <mcheshkov@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'contrib/libs/icu/io/sscanf.cpp')
-rw-r--r--contrib/libs/icu/io/sscanf.cpp260
1 files changed, 130 insertions, 130 deletions
diff --git a/contrib/libs/icu/io/sscanf.cpp b/contrib/libs/icu/io/sscanf.cpp
index 47c0bace27..9fac103b07 100644
--- a/contrib/libs/icu/io/sscanf.cpp
+++ b/contrib/libs/icu/io/sscanf.cpp
@@ -1,130 +1,130 @@
-// © 2016 and later: Unicode, Inc. and others.
-// License & terms of use: http://www.unicode.org/copyright.html
-/*
-******************************************************************************
-*
-* Copyright (C) 2000-2014, International Business Machines
-* Corporation and others. All Rights Reserved.
-*
-******************************************************************************
-*
-* File sscanf.c
-*
-* Modification History:
-*
-* Date Name Description
-* 02/08/00 george Creation. Copied from uscanf.c
-******************************************************************************
-*/
-
-#include "unicode/utypes.h"
-
-#if !UCONFIG_NO_FORMATTING && !UCONFIG_NO_CONVERSION
-
-#include "unicode/putil.h"
-#include "unicode/ustdio.h"
-#include "unicode/ustring.h"
-#include "uscanf.h"
-#include "ufile.h"
-#include "ufmt_cmn.h"
-
-#include "cmemory.h"
-#include "cstring.h"
-
-
-U_CAPI int32_t U_EXPORT2
-u_sscanf(const UChar *buffer,
- const char *patternSpecification,
- ... )
-{
- va_list ap;
- int32_t converted;
-
- va_start(ap, patternSpecification);
- converted = u_vsscanf(buffer, patternSpecification, ap);
- va_end(ap);
-
- return converted;
-}
-
-U_CAPI int32_t U_EXPORT2
-u_sscanf_u(const UChar *buffer,
- const UChar *patternSpecification,
- ... )
-{
- va_list ap;
- int32_t converted;
-
- va_start(ap, patternSpecification);
- converted = u_vsscanf_u(buffer, patternSpecification, ap);
- va_end(ap);
-
- return converted;
-}
-
-U_CAPI int32_t U_EXPORT2 /* U_CAPI ... U_EXPORT2 added by Peter Kirk 17 Nov 2001 */
-u_vsscanf(const UChar *buffer,
- const char *patternSpecification,
- va_list ap)
-{
- int32_t converted;
- UChar *pattern;
- UChar patBuffer[UFMT_DEFAULT_BUFFER_SIZE];
- int32_t size = (int32_t)uprv_strlen(patternSpecification) + 1;
-
- /* convert from the default codepage to Unicode */
- if (size >= (int32_t)MAX_UCHAR_BUFFER_SIZE(patBuffer)) {
- pattern = (UChar *)uprv_malloc(size * sizeof(UChar));
- if(pattern == 0) {
- return 0;
- }
- }
- else {
- pattern = patBuffer;
- }
- u_charsToUChars(patternSpecification, pattern, size);
-
- /* do the work */
- converted = u_vsscanf_u(buffer, pattern, ap);
-
- /* clean up */
- if (pattern != patBuffer) {
- uprv_free(pattern);
- }
-
- return converted;
-}
-
-U_CAPI int32_t U_EXPORT2 /* U_CAPI ... U_EXPORT2 added by Peter Kirk 17 Nov 2001 */
-u_vsscanf_u(const UChar *buffer,
- const UChar *patternSpecification,
- va_list ap)
-{
- int32_t converted;
- UFILE inStr;
-
- inStr.fConverter = NULL;
- inStr.fFile = NULL;
- inStr.fOwnFile = FALSE;
-#if !UCONFIG_NO_TRANSLITERATION
- inStr.fTranslit = NULL;
-#endif
- inStr.fUCBuffer[0] = 0;
- inStr.str.fBuffer = (UChar *)buffer;
- inStr.str.fPos = (UChar *)buffer;
- inStr.str.fLimit = buffer + u_strlen(buffer);
-
- if(u_locbund_init(&inStr.str.fBundle, "en_US_POSIX") == 0) {
- return 0;
- }
-
- converted = u_scanf_parse(&inStr, patternSpecification, ap);
-
- u_locbund_close(&inStr.str.fBundle);
-
- /* return # of items converted */
- return converted;
-}
-
-#endif /* #if !UCONFIG_NO_FORMATTING */
-
+// © 2016 and later: Unicode, Inc. and others.
+// License & terms of use: http://www.unicode.org/copyright.html
+/*
+******************************************************************************
+*
+* Copyright (C) 2000-2014, International Business Machines
+* Corporation and others. All Rights Reserved.
+*
+******************************************************************************
+*
+* File sscanf.c
+*
+* Modification History:
+*
+* Date Name Description
+* 02/08/00 george Creation. Copied from uscanf.c
+******************************************************************************
+*/
+
+#include "unicode/utypes.h"
+
+#if !UCONFIG_NO_FORMATTING && !UCONFIG_NO_CONVERSION
+
+#include "unicode/putil.h"
+#include "unicode/ustdio.h"
+#include "unicode/ustring.h"
+#include "uscanf.h"
+#include "ufile.h"
+#include "ufmt_cmn.h"
+
+#include "cmemory.h"
+#include "cstring.h"
+
+
+U_CAPI int32_t U_EXPORT2
+u_sscanf(const UChar *buffer,
+ const char *patternSpecification,
+ ... )
+{
+ va_list ap;
+ int32_t converted;
+
+ va_start(ap, patternSpecification);
+ converted = u_vsscanf(buffer, patternSpecification, ap);
+ va_end(ap);
+
+ return converted;
+}
+
+U_CAPI int32_t U_EXPORT2
+u_sscanf_u(const UChar *buffer,
+ const UChar *patternSpecification,
+ ... )
+{
+ va_list ap;
+ int32_t converted;
+
+ va_start(ap, patternSpecification);
+ converted = u_vsscanf_u(buffer, patternSpecification, ap);
+ va_end(ap);
+
+ return converted;
+}
+
+U_CAPI int32_t U_EXPORT2 /* U_CAPI ... U_EXPORT2 added by Peter Kirk 17 Nov 2001 */
+u_vsscanf(const UChar *buffer,
+ const char *patternSpecification,
+ va_list ap)
+{
+ int32_t converted;
+ UChar *pattern;
+ UChar patBuffer[UFMT_DEFAULT_BUFFER_SIZE];
+ int32_t size = (int32_t)uprv_strlen(patternSpecification) + 1;
+
+ /* convert from the default codepage to Unicode */
+ if (size >= (int32_t)MAX_UCHAR_BUFFER_SIZE(patBuffer)) {
+ pattern = (UChar *)uprv_malloc(size * sizeof(UChar));
+ if(pattern == 0) {
+ return 0;
+ }
+ }
+ else {
+ pattern = patBuffer;
+ }
+ u_charsToUChars(patternSpecification, pattern, size);
+
+ /* do the work */
+ converted = u_vsscanf_u(buffer, pattern, ap);
+
+ /* clean up */
+ if (pattern != patBuffer) {
+ uprv_free(pattern);
+ }
+
+ return converted;
+}
+
+U_CAPI int32_t U_EXPORT2 /* U_CAPI ... U_EXPORT2 added by Peter Kirk 17 Nov 2001 */
+u_vsscanf_u(const UChar *buffer,
+ const UChar *patternSpecification,
+ va_list ap)
+{
+ int32_t converted;
+ UFILE inStr;
+
+ inStr.fConverter = NULL;
+ inStr.fFile = NULL;
+ inStr.fOwnFile = FALSE;
+#if !UCONFIG_NO_TRANSLITERATION
+ inStr.fTranslit = NULL;
+#endif
+ inStr.fUCBuffer[0] = 0;
+ inStr.str.fBuffer = (UChar *)buffer;
+ inStr.str.fPos = (UChar *)buffer;
+ inStr.str.fLimit = buffer + u_strlen(buffer);
+
+ if(u_locbund_init(&inStr.str.fBundle, "en_US_POSIX") == 0) {
+ return 0;
+ }
+
+ converted = u_scanf_parse(&inStr, patternSpecification, ap);
+
+ u_locbund_close(&inStr.str.fBundle);
+
+ /* return # of items converted */
+ return converted;
+}
+
+#endif /* #if !UCONFIG_NO_FORMATTING */
+