1 /*****************************************************************************
2 * RRDtool 1.0.33 Copyright Tobias Oetiker, 1997,1998, 1999
3 *****************************************************************************
4 * rrdlib.h Public header file for librrd
5 *****************************************************************************
8 * Revision 1.6 2003/11/11 19:46:21 oetiker
9 * replaced time_value with rrd_time_value as MacOS X introduced a struct of that name in their standard headers
11 * Revision 1.5 2003/04/25 18:35:08 jake
12 * Alternate update interface, updatev. Returns info about CDPs written to disk as result of update. Output format is similar to rrd_info, a hash of key-values.
14 * Revision 1.4 2003/04/01 22:52:23 jake
15 * Fix Win32 build. VC++ 6.0 and 7.0 now use the thread-safe code.
17 * Revision 1.3 2003/02/13 07:05:27 oetiker
18 * Find attached the patch I promised to send to you. Please note that there
19 * are three new source files (src/rrd_is_thread_safe.h, src/rrd_thread_safe.c
20 * and src/rrd_not_thread_safe.c) and the introduction of librrd_th. This
21 * library is identical to librrd, but it contains support code for per-thread
22 * global variables currently used for error information only. This is similar
23 * to how errno per-thread variables are implemented. librrd_th must be linked
24 * alongside of libpthred
26 * There is also a new file "THREADS", holding some documentation.
28 * -- Peter Stamfest <peter@stamfest.at>
30 * Revision 1.2 2002/05/07 21:58:32 oetiker
31 * new command rrdtool xport integrated
32 * -- Wolfgang Schrimm <Wolfgang.Schrimm@urz.uni-heidelberg.de>
34 * Revision 1.1.1.1 2001/02/25 22:25:05 oetiker
37 *****************************************************************************/
46 #include <stdio.h> /* for FILE */
48 /* Transplanted from rrd_format.h */
49 typedef double rrd_value_t; /* the data storage type is
51 /* END rrd_format.h */
53 /* main function blocks */
54 int rrd_create(int, char **);
55 int rrd_update(int, char **);
56 int rrd_graph(int, char **, char ***, int *, int *);
57 int rrd_fetch(int, char **, time_t *, time_t *, unsigned long *,
58 unsigned long *, char ***, rrd_value_t **);
59 int rrd_restore(int, char **);
60 int rrd_dump(int, char **);
61 int rrd_tune(int, char **);
62 time_t rrd_last(int, char **);
63 int rrd_resize(int, char **);
64 int rrd_xport(int, char **, int *, time_t *, time_t *,
65 unsigned long *, unsigned long *,
66 char ***, rrd_value_t **);
68 /* thread-safe (hopefully) */
69 int rrd_create_r(char *filename,
70 unsigned long pdp_step, time_t last_up,
71 int argc, char **argv);
72 /* NOTE: rrd_update_r are only thread-safe if no at-style time
73 specifications get used!!! */
74 int rrd_update_r(char *filename, char *_template,
75 int argc, char **argv);
76 int rrd_dump_r(char *filename);
77 time_t rrd_last_r(char *filename);
79 /* Transplanted from parsetime.h */
82 RELATIVE_TO_START_TIME,
88 struct rrd_time_value {
101 /* returns the current per-thread rrd_context */
102 struct rrd_context *rrd_get_context(void);
104 char *parsetime(char *spec, struct rrd_time_value *ptv);
105 /* END parsetime.h */
107 int proc_start_end (struct rrd_time_value *, struct rrd_time_value *, time_t *, time_t *);
109 /* HELPER FUNCTIONS */
110 void rrd_set_error(char *,...);
111 void rrd_clear_error(void);
112 int rrd_test_error(void);
113 char *rrd_get_error(void);
115 /** MULTITHREADED HELPER FUNCTIONS */
116 struct rrd_context *rrd_new_context(void);
117 void rrd_free_context (struct rrd_context *buf);
119 /* void rrd_set_error_r (struct rrd_context *, char *, ...); */
120 /* void rrd_clear_error_r(struct rrd_context *); */
121 /* int rrd_test_error_r (struct rrd_context *); */
122 /* char *rrd_get_error_r (struct rrd_context *); */
126 #endif /* _RRDLIB_H */