Initial revision
[rrdtool.git] / src / rrd.h
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.1  2001/02/25 22:25:05  oetiker
9  * Initial revision
10  *
11  *****************************************************************************/
12 #ifdef  __cplusplus
13 extern "C" {
14 #endif
15
16 #ifndef _RRDLIB_H
17 #define _RRDLIB_H
18
19 #include <time.h>
20
21 /* Transplanted from rrd_format.h */
22 typedef double       rrd_value_t;         /* the data storage type is
23                                            * double */
24 /* END rrd_format.h */
25
26 /* main function blocks */
27 int    rrd_create(int, char **);
28 int    rrd_update(int, char **);
29 int    rrd_graph(int, char **, char ***, int *, int *);
30 int    rrd_fetch(int, char **, time_t *, time_t *, unsigned long *,
31                  unsigned long *, char ***, rrd_value_t **);
32 int    rrd_restore(int, char **);
33 int    rrd_dump(int, char **);
34 int    rrd_tune(int, char **);
35 time_t rrd_last(int, char **);
36 int    rrd_resize(int, char **);
37
38 /* Transplanted from parsetime.h */
39 typedef enum {
40         ABSOLUTE_TIME,
41         RELATIVE_TO_START_TIME, 
42         RELATIVE_TO_END_TIME
43 } timetype;
44
45 #define TIME_OK NULL
46
47 struct time_value {
48   timetype type;
49   long offset;
50   struct tm tm;
51 };
52
53 char *parsetime(char *spec, struct time_value *ptv);
54 /* END parsetime.h */
55
56 int proc_start_end (struct time_value *,  struct time_value *, time_t *, time_t *);
57
58 /* HELPER FUNCTIONS */
59 void rrd_set_error(char *,...);
60 void rrd_clear_error(void);
61 int  rrd_test_error(void);
62 char *rrd_get_error(void);
63 int  LockRRD(FILE *);
64
65 #endif /* _RRDLIB_H */
66
67 #ifdef  __cplusplus
68 }
69 #endif