intl/icu/source/tools/genrb/errmsg.c

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 /*
     2 *******************************************************************************
     3 *
     4 *   Copyright (C) 1998-2011, International Business Machines
     5 *   Corporation and others.  All Rights Reserved.
     6 *
     7 *******************************************************************************
     8 *
     9 * File error.c
    10 *
    11 * Modification History:
    12 *
    13 *   Date        Name        Description
    14 *   05/28/99    stephen     Creation.
    15 *******************************************************************************
    16 */
    18 #include <stdarg.h>
    19 #include <stdio.h>
    20 #include "cstring.h"
    21 #include "errmsg.h"
    23 U_CFUNC void error(uint32_t linenumber, const char *msg, ...)
    24 {
    25     va_list va;
    27     va_start(va, msg);
    28     fprintf(stderr, "%s:%u: ", gCurrentFileName, (int)linenumber);
    29     vfprintf(stderr, msg, va);
    30     fprintf(stderr, "\n");
    31     va_end(va);
    32 }
    34 static UBool gShowWarning = TRUE;
    36 U_CFUNC void setShowWarning(UBool val)
    37 {
    38     gShowWarning = val;
    39 }
    41 U_CFUNC UBool getShowWarning(){
    42     return gShowWarning;
    43 }
    45 static UBool gStrict =FALSE;
    46 U_CFUNC UBool isStrict(){
    47     return gStrict;
    48 }
    49 U_CFUNC void setStrict(UBool val){
    50     gStrict = val;
    51 }
    52 static UBool gVerbose =FALSE;
    53 U_CFUNC UBool isVerbose(){
    54     return gVerbose;
    55 }
    56 U_CFUNC void setVerbose(UBool val){
    57     gVerbose = val;
    58 }
    59 U_CFUNC void warning(uint32_t linenumber, const char *msg, ...)
    60 {
    61     if (gShowWarning)
    62     {
    63         va_list va;
    65         va_start(va, msg);
    66         fprintf(stderr, "%s:%u: warning: ", gCurrentFileName, (int)linenumber);
    67         vfprintf(stderr, msg, va);
    68         fprintf(stderr, "\n");
    69         va_end(va);
    70     }
    71 }

mercurial