1 /*****************************************************************************
2 * RRDtool 1.0.33 Copyright Tobias Oetiker, 1997,1998, 1999
3 *****************************************************************************
4 * rrdlib.h Public header file for librrd
5 *****************************************************************************
6 * $Id$
7 * $Log$
8 * Revision 1.2 2002/05/07 21:58:32 oetiker
9 * new command rrdtool xport integrated
10 * -- Wolfgang Schrimm <Wolfgang.Schrimm@urz.uni-heidelberg.de>
11 *
12 * Revision 1.1.1.1 2001/02/25 22:25:05 oetiker
13 * checkin
14 *
15 *****************************************************************************/
16 #ifdef __cplusplus
17 extern "C" {
18 #endif
20 #ifndef _RRDLIB_H
21 #define _RRDLIB_H
23 #include <time.h>
25 /* Transplanted from rrd_format.h */
26 typedef double rrd_value_t; /* the data storage type is
27 * double */
28 /* END rrd_format.h */
30 /* main function blocks */
31 int rrd_create(int, char **);
32 int rrd_update(int, char **);
33 int rrd_graph(int, char **, char ***, int *, int *);
34 int rrd_fetch(int, char **, time_t *, time_t *, unsigned long *,
35 unsigned long *, char ***, rrd_value_t **);
36 int rrd_restore(int, char **);
37 int rrd_dump(int, char **);
38 int rrd_tune(int, char **);
39 time_t rrd_last(int, char **);
40 int rrd_resize(int, char **);
41 int rrd_xport(int, char **, int *, time_t *, time_t *,
42 unsigned long *, unsigned long *,
43 char ***, rrd_value_t **);
45 /* Transplanted from parsetime.h */
46 typedef enum {
47 ABSOLUTE_TIME,
48 RELATIVE_TO_START_TIME,
49 RELATIVE_TO_END_TIME
50 } timetype;
52 #define TIME_OK NULL
54 struct time_value {
55 timetype type;
56 long offset;
57 struct tm tm;
58 };
60 char *parsetime(char *spec, struct time_value *ptv);
61 /* END parsetime.h */
63 int proc_start_end (struct time_value *, struct time_value *, time_t *, time_t *);
65 /* HELPER FUNCTIONS */
66 void rrd_set_error(char *,...);
67 void rrd_clear_error(void);
68 int rrd_test_error(void);
69 char *rrd_get_error(void);
70 int LockRRD(FILE *);
72 #endif /* _RRDLIB_H */
74 #ifdef __cplusplus
75 }
76 #endif