1
/*****************************************************************************
2
* RRDtool 1.0.42 Copyright Tobias Oetiker, 1999
3
*****************************************************************************
4
* rrd_format.c RRD Database Format helper functions
5
*****************************************************************************
6
* $Id: rrd_format.c,v 1.1 2003/04/22 17:02:29 deri Exp $
7
* $Log: rrd_format.c,v $
8
* Revision 1.1 2003/04/22 17:02:29 deri
11
* Revision 1.1.1.1 2002/02/26 10:21:37 oetiker
14
* Revision 1.3 1998/03/08 12:35:11 oetiker
15
* checkpointing things because the current setup seems to work
16
* according to the things said in the manpages
18
* Revision 1.2 1998/02/26 22:58:22 oetiker
21
* Revision 1.1 1998/02/21 16:14:41 oetiker
25
*****************************************************************************/
28
#define converter(VV,VVV) \
29
if (strcmp(#VV, string) == 0) return VVV;
31
/* conversion functions to allow symbolic entry of enumerations */
32
enum dst_en dst_conv(char *string)
34
converter(COUNTER,DST_COUNTER)
35
converter(ABSOLUTE,DST_ABSOLUTE)
36
converter(GAUGE,DST_GAUGE)
37
converter(DERIVE,DST_DERIVE)
38
rrd_set_error("unknown date aquisition function '%s'",string);
43
enum cf_en cf_conv(char *string)
46
converter(AVERAGE,CF_AVERAGE)
47
converter(MIN,CF_MINIMUM)
48
converter(MAX,CF_MAXIMUM)
49
converter(LAST,CF_LAST)
50
rrd_set_error("unknown consolidation function '%s'",string);
57
ds_match(rrd_t *rrd,char *ds_nam){
59
for(i=0;i<rrd->stat_head->ds_cnt;i++)
60
if ((strcmp(ds_nam,rrd->ds_def[i].ds_nam))==0)
62
rrd_set_error("unknown data source name '%s'",ds_nam);