-
Notifications
You must be signed in to change notification settings - Fork 32
/
rrdfunc.c
39 lines (32 loc) · 984 Bytes
/
rrdfunc.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#include <stdlib.h>
#include <errno.h>
#include "rrd.h"
const char *rrdCreate(const char *filename, unsigned long step,
time_t start, int argc, const char **argv) {
int ret;
ret = rrd_create_r(filename, step, start, argc, argv);
return rrd_strerror(ret);
}
const char *rrdUpdate(const char *filename, const char *template,
int argc, const char **argv) {
int ret;
ret = rrd_update_r(filename, template, argc, argv);
return rrd_strerror(ret);
}
const char *rrdInfo(rrd_info_t **info, char *filename) {
int ret = 0;
*info = rrd_info_r(filename, &ret);
return rrd_strerror(ret);
}
const char *rrdFetch(int *ret, char *filename, const char *cf, time_t *start,
time_t *end, unsigned long *step, unsigned long *ds_cnt,
char ***ds_namv, double **data) {
*ret = rrd_fetch_r(filename, cf, start, end, step, ds_cnt, ds_namv, data);
return rrd_strerror(*ret);
}
char *arrayGetCString(char **values, int i) {
return values[i];
}
int getErrno(void){
return errno;
}