summaryrefslogtreecommitdiffstats
path: root/intl/icu/source/tools/genrb/errmsg.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
commit36d22d82aa202bb199967e9512281e9a53db42c9 (patch)
tree105e8c98ddea1c1e4784a60a5a6410fa416be2de /intl/icu/source/tools/genrb/errmsg.c
parentInitial commit. (diff)
downloadfirefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz
firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip
Adding upstream version 115.7.0esr.upstream/115.7.0esrupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'intl/icu/source/tools/genrb/errmsg.c')
-rw-r--r--intl/icu/source/tools/genrb/errmsg.c75
1 files changed, 75 insertions, 0 deletions
diff --git a/intl/icu/source/tools/genrb/errmsg.c b/intl/icu/source/tools/genrb/errmsg.c
new file mode 100644
index 0000000000..a99d797ec5
--- /dev/null
+++ b/intl/icu/source/tools/genrb/errmsg.c
@@ -0,0 +1,75 @@
+// © 2016 and later: Unicode, Inc. and others.
+// License & terms of use: http://www.unicode.org/copyright.html
+/*
+*******************************************************************************
+*
+* Copyright (C) 1998-2011, International Business Machines
+* Corporation and others. All Rights Reserved.
+*
+*******************************************************************************
+*
+* File error.c
+*
+* Modification History:
+*
+* Date Name Description
+* 05/28/99 stephen Creation.
+*******************************************************************************
+*/
+
+#include <stdarg.h>
+#include <stdbool.h>
+#include <stdio.h>
+#include "cstring.h"
+#include "errmsg.h"
+#include "toolutil.h"
+
+U_CFUNC void error(uint32_t linenumber, const char *msg, ...)
+{
+ va_list va;
+
+ va_start(va, msg);
+ fprintf(stderr, "%s:%u: ", gCurrentFileName, (int)linenumber);
+ vfprintf(stderr, msg, va);
+ fprintf(stderr, "\n");
+ va_end(va);
+}
+
+static UBool gShowWarning = true;
+
+U_CFUNC void setShowWarning(UBool val)
+{
+ gShowWarning = val;
+}
+
+U_CFUNC UBool getShowWarning(){
+ return gShowWarning;
+}
+
+static UBool gStrict =false;
+U_CFUNC UBool isStrict(){
+ return gStrict;
+}
+U_CFUNC void setStrict(UBool val){
+ gStrict = val;
+}
+static UBool gVerbose =false;
+U_CFUNC UBool isVerbose(){
+ return gVerbose;
+}
+U_CFUNC void setVerbose(UBool val){
+ gVerbose = val;
+}
+U_CFUNC void warning(uint32_t linenumber, const char *msg, ...)
+{
+ if (gShowWarning)
+ {
+ va_list va;
+
+ va_start(va, msg);
+ fprintf(stderr, "%s:%u: warning: ", gCurrentFileName, (int)linenumber);
+ vfprintf(stderr, msg, va);
+ fprintf(stderr, "\n");
+ va_end(va);
+ }
+}