~ubuntu-branches/ubuntu/quantal/icu/quantal

« back to all changes in this revision

Viewing changes to source/tools/genrb/error.c

  • Committer: Package Import Robot
  • Author(s): Yves Arrouye
  • Date: 2002-03-03 15:31:13 UTC
  • Revision ID: package-import@ubuntu.com-20020303153113-3ssceqlq45xbmbnc
Tags: upstream-2.0-2.1pre20020303
ImportĀ upstreamĀ versionĀ 2.0-2.1pre20020303

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
*******************************************************************************
 
3
*
 
4
*   Copyright (C) 1998-2000, 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
*/
 
17
 
 
18
#include <stdarg.h>
 
19
#include <stdio.h>
 
20
#include "cstring.h"
 
21
#include "error.h"
 
22
 
 
23
void error(uint32_t linenumber, const char *msg, ...)
 
24
{
 
25
    va_list va;
 
26
 
 
27
    va_start(va, msg);
 
28
    fprintf(stderr, "%s:%d: ", gCurrentFileName, linenumber);
 
29
    vfprintf(stderr, msg, va);
 
30
    fprintf(stderr, "\n");
 
31
    va_end(va);
 
32
}
 
33
 
 
34
static UBool gShowWarning = TRUE;
 
35
 
 
36
void setShowWarning(UBool val)
 
37
{
 
38
    gShowWarning = val;
 
39
}
 
40
 
 
41
UBool getShowWarning(){
 
42
    return gShowWarning;
 
43
}
 
44
 
 
45
void warning(uint32_t linenumber, const char *msg, ...)
 
46
{
 
47
    if (gShowWarning)
 
48
    {
 
49
        va_list va;
 
50
 
 
51
        va_start(va, msg);
 
52
        fprintf(stderr, "%s:%d: warning: ", gCurrentFileName, linenumber);
 
53
        vfprintf(stderr, msg, va);
 
54
        fprintf(stderr, "\n");
 
55
        va_end(va);
 
56
    }
 
57
}
 
58