~ubuntu-branches/ubuntu/trusty/ntop/trusty

« back to all changes in this revision

Viewing changes to myrrd/rrd_error.c

  • Committer: Bazaar Package Importer
  • Author(s): Ola Lundqvist
  • Date: 2008-06-15 14:38:28 UTC
  • mfrom: (2.1.11 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080615143828-oalh84nda2hje4do
Tags: 3:3.3-11
Correction of Polish translation encoding, closes: #479490. Thanks
to Christian Perrier <bubulle@debian.org> for the help.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*****************************************************************************
2
 
 * RRDtool 1.0.49  Copyright Tobias Oetiker, 1997 - 2000
3
 
 *****************************************************************************
4
 
 * rrd_error.c   Common Header File
5
 
 *****************************************************************************
6
 
 * $Id: rrd_error.c,v 1.2 2004/09/06 10:20:05 deri Exp $
7
 
 * $Log: rrd_error.c,v $
8
 
 * Revision 1.2  2004/09/06 10:20:05  deri
9
 
 * Updated to RRDtool 1.0.49
10
 
 *
11
 
 * Revision 1.1.1.1  2002/02/26 10:21:37  oetiker
12
 
 * Intial Import
13
 
 *
14
 
 *************************************************************************** */
15
 
 
16
 
#include "rrd_tool.h"
17
 
#define MAXLEN 4096
18
 
static char rrd_error[MAXLEN] = "\0";
19
 
#include <stdarg.h>
20
 
 
21
 
 
22
 
 
23
 
void
24
 
rrd_set_error(char *fmt, ...)
25
 
{
26
 
    va_list argp;
27
 
    rrd_clear_error();
28
 
    va_start(argp, fmt);
29
 
#ifdef HAVE_VSNPRINTF
30
 
    vsnprintf((char *)rrd_error, MAXLEN-1, fmt, argp);
31
 
#else
32
 
    vsprintf((char *)rrd_error, fmt, argp);
33
 
#endif
34
 
    va_end(argp);
35
 
}
36
 
 
37
 
int
38
 
rrd_test_error(void) {
39
 
    return rrd_error[0] != '\0';
40
 
}
41
 
 
42
 
void
43
 
rrd_clear_error(void){
44
 
    rrd_error[0] = '\0';
45
 
}
46
 
 
47
 
char *
48
 
rrd_get_error(void){
49
 
    return (char *)rrd_error;
50
 
}
51
 
 
52
 
 
53
 
 
54
 
 
55
 
 
56
 
 
57
 
 
58
 
 
59
 
 
60
 
 
61