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

« back to all changes in this revision

Viewing changes to myrrd/rrd_tool.h

  • 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_tool.h   Common Header File
5
 
 *****************************************************************************
6
 
 * $Id: rrd_tool.h,v 1.4 2005/10/04 10:42:22 deri Exp $
7
 
 * $Log: rrd_tool.h,v $
8
 
 * Revision 1.4  2005/10/04 10:42:22  deri
9
 
 * Added MinGw/Win32 patches
10
 
 * Fixed bug on arbitrary graphs
11
 
 *
12
 
 * Courtesy of Georget Araujo <georger_br@yahoo.com.br>
13
 
 *
14
 
 * Revision 1.3  2004/09/06 10:20:05  deri
15
 
 * Updated to RRDtool 1.0.49
16
 
 *
17
 
 * Revision 1.1.1.1  2002/02/26 10:21:37  oetiker
18
 
 * Intial Import
19
 
 *
20
 
 *****************************************************************************/
21
 
#ifdef  __cplusplus
22
 
extern "C" {
23
 
#endif
24
 
 
25
 
 
26
 
#ifndef _RRD_TOOL_H
27
 
#define _RRD_TOOL_H
28
 
 
29
 
#ifdef WIN32
30
 
# include "ntconfig.h"
31
 
#else
32
 
#ifdef HAVE_CONFIG_H
33
 
#include <config.h>
34
 
#include "config_aux.h"
35
 
#endif
36
 
#endif
37
 
 
38
 
#ifdef MUST_DISABLE_SIGFPE
39
 
#include <signal.h>
40
 
#endif
41
 
 
42
 
#ifdef MUST_DISABLE_FPMASK
43
 
#include <floatingpoint.h>
44
 
#endif
45
 
    
46
 
#include <stdio.h>
47
 
#include <stdlib.h>
48
 
#include <errno.h>
49
 
#include <string.h>
50
 
#include <time.h>
51
 
#include <ctype.h>
52
 
 
53
 
#if HAVE_SYS_PARAM_H
54
 
#  include <sys/param.h>
55
 
#endif
56
 
 
57
 
#ifndef MAXPATH
58
 
#  define MAXPATH 1024
59
 
#endif
60
 
 
61
 
#if HAVE_MATH_H
62
 
# include <math.h>
63
 
#endif
64
 
#if HAVE_UNISTD_H
65
 
# include <unistd.h>
66
 
#endif
67
 
#if HAVE_SYS_TIME_H
68
 
# include <sys/time.h>
69
 
#endif
70
 
#if HAVE_SYS_TIMES_H
71
 
# include <sys/times.h>
72
 
#endif
73
 
#if HAVE_SYS_RESOURCE_H
74
 
# include <sys/resource.h>
75
 
#if (defined(__svr4__) && defined(__sun__))
76
 
/* Solaris headers (pre 2.6) don't have a getrusage prototype.
77
 
   Use this instead. */
78
 
extern int getrusage(int, struct rusage *);
79
 
#endif /* __svr4__ && __sun__ */
80
 
#endif
81
 
 
82
 
#include "rrd.h"
83
 
 
84
 
#ifndef WIN32
85
 
 
86
 
/* unix-only includes */
87
 
#ifndef isnan
88
 
int isnan(double value);
89
 
#endif
90
 
 
91
 
#else
92
 
 
93
 
/* Win32 only includes */
94
 
 
95
 
#include <float.h>        /* for _isnan  */
96
 
 
97
 
#if !defined(__GNUC__)
98
 
#define isnan _isnan
99
 
#define isinf(a) (_fpclass(a) == _FPCLASS_NINF || _fpclass(a) == _FPCLASS_PINF)
100
 
#endif
101
 
 
102
 
#define finite _finite
103
 
#endif
104
 
 
105
 
/* local include files -- need to be after the system ones */
106
 
#include "getopt.h"
107
 
#include "rrd_format.h"
108
 
 
109
 
#ifndef max
110
 
#define max(a,b) ((a) > (b) ? (a) : (b))
111
 
#endif
112
 
 
113
 
#ifndef min
114
 
#define min(a,b) ((a) < (b) ? (a) : (b))
115
 
#endif                                                   
116
 
 
117
 
#define DIM(x) (sizeof(x)/sizeof(x[0]))
118
 
 
119
 
/* rrd info interface */
120
 
enum info_type   { RD_I_VAL=0,
121
 
               RD_I_CNT,
122
 
               RD_I_STR  };
123
 
 
124
 
typedef union infoval { 
125
 
    unsigned long u_cnt; 
126
 
    rrd_value_t   u_val;
127
 
    char         *u_str;
128
 
} infoval;
129
 
 
130
 
typedef struct info_t {
131
 
    char            *key;
132
 
    enum info_type  type;
133
 
    union infoval   value;
134
 
    struct info_t   *next;
135
 
} info_t;
136
 
 
137
 
 
138
 
info_t *rrd_info(int, char **);
139
 
 
140
 
/* HELPER FUNCTIONS */
141
 
int GifSize(FILE *, long *, long *);
142
 
int PngSize(FILE *, long *, long *);
143
 
int PngSize(FILE *, long *, long *);
144
 
 
145
 
#include <gd.h>
146
 
void gdImagePng(gdImagePtr im, FILE *out);
147
 
 
148
 
int rrd_create_fn(char *file_name, rrd_t *rrd);
149
 
int rrd_fetch_fn(char *filename, enum cf_en cf_idx,
150
 
                 time_t *start,time_t *end,
151
 
                 unsigned long *step,
152
 
                 unsigned long *ds_cnt,
153
 
                 char        ***ds_namv,
154
 
                 rrd_value_t **data);
155
 
 
156
 
void rrd_free(rrd_t *rrd);
157
 
void rrd_init(rrd_t *rrd);
158
 
 
159
 
int rrd_open(char *file_name, FILE **in_file, rrd_t *rrd, int rdwr);
160
 
int readfile(char *file, char **buffer, int skipfirst);
161
 
 
162
 
#define RRD_READONLY    0
163
 
#define RRD_READWRITE   1
164
 
 
165
 
enum cf_en cf_conv(char *string);
166
 
enum dst_en dst_conv(char *string);
167
 
long ds_match(rrd_t *rrd,char *ds_nam);
168
 
double rrd_diff(char *a, char *b);
169
 
 
170
 
#endif
171
 
 
172
 
 
173
 
#ifdef  __cplusplus
174
 
}
175
 
#endif
176
 
 
177