"Fossies" - the Fresh Open Source Software Archive

Member "rrdtool-1.7.2/src/rrd_tool.h" (27 May 2019, 3981 Bytes) of package /linux/misc/rrdtool-1.7.2.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "rrd_tool.h" see the Fossies "Dox" file reference documentation and the latest Fossies "Diffs" side-by-side code changes report: 1.7.1_vs_1.7.2.

    1 #ifndef RRD_TOOL_H_3853987DDF7E4709A5B5849E5A6204F4
    2 #define RRD_TOOL_H_3853987DDF7E4709A5B5849E5A6204F4
    3 
    4 /*****************************************************************************
    5  * RRDtool 1.7.2 Copyright by Tobi Oetiker
    6  *****************************************************************************
    7  * rrd_tool.h   Common Header File
    8  *****************************************************************************/
    9 #ifdef  __cplusplus
   10 extern    "C" {
   11 #endif
   12 
   13 #include "rrd_config.h"
   14 
   15 #include "rrd.h"
   16 
   17 #if defined(_WIN32) && !defined(__CYGWIN__) && !defined(__CYGWIN32__) && !defined(__MINGW32__)
   18 
   19 /* Win32 only includes */
   20 
   21 #include <float.h>      /* for _isnan  */
   22 #include <io.h>         /* for chdir   */
   23 
   24     struct tm *localtime_r(
   25     const time_t *timep,
   26     struct tm *result);
   27     char     *ctime_r(
   28     const time_t *timep,
   29     char *result);
   30     struct tm *gmtime_r(
   31     const time_t *timep,
   32     struct tm *result);
   33     char     *strtok_r(
   34     char *str,
   35     const char *sep,
   36     char **last);
   37 
   38 #else
   39 
   40 /* unix-only includes */
   41 #if !defined isnan && !defined HAVE_ISNAN
   42     int       isnan(
   43     double value);
   44 #endif
   45 
   46 #endif
   47 
   48 /* local include files -- need to be after the system ones */
   49 #include "optparse.h"
   50 #include "rrd_format.h"
   51 
   52 #ifndef max
   53 #define max(a,b) ((a) > (b) ? (a) : (b))
   54 #endif
   55 
   56 #ifndef min
   57 #define min(a,b) ((a) < (b) ? (a) : (b))
   58 #endif
   59 
   60 #define DIM(x) (sizeof(x)/sizeof(x[0]))
   61 
   62     char     *sprintf_alloc(
   63     char *,
   64     ...);
   65 
   66 /* HELPER FUNCTIONS */
   67 
   68     int       PngSize(
   69     FILE *,
   70     long *,
   71     long *);
   72 
   73     int       rrd_create_fn(
   74     const char *file_name,
   75     rrd_t *rrd,
   76     int no_overwrite);
   77     int rrd_fetch_fn (const char *filename,
   78             enum cf_en cf_idx,
   79             time_t *start,
   80             time_t *end,
   81             unsigned long *step,
   82             unsigned long *ds_cnt,
   83             char ***ds_namv,
   84             rrd_value_t **data);
   85 
   86     int rrd_fetch_empty(
   87         time_t *start,
   88         time_t *end,
   89         unsigned long *step,
   90         unsigned long *ds_cnt,
   91         char *ds_nam,
   92         char ***ds_namv,
   93         rrd_value_t **data);
   94 
   95 
   96 #ifdef HAVE_LIBDBI
   97     int rrd_fetch_fn_libdbi(const char *filename, enum cf_en cf_idx,
   98             time_t *start,time_t *end,
   99             unsigned long *step,
  100             unsigned long *ds_cnt,
  101             char        ***ds_namv,
  102             rrd_value_t **data);
  103 #endif
  104 
  105 typedef int (*rrd_fetch_cb_t)(
  106     const char     *filename,  /* name of the rrd */
  107     enum cf_en     cf_idx, /* consolidation function */
  108     time_t         *start,
  109     time_t         *end,       /* which time frame do you want ?
  110                                 * will be changed to represent reality */
  111     unsigned long  *step,      /* which stepsize do you want? 
  112                                 * will be changed to represent reality */
  113     unsigned long  *ds_cnt,    /* number of data sources in file */
  114     char           ***ds_namv, /* names of data_sources */
  115     rrd_value_t    **data      /* two dimensional array containing the data */
  116 );
  117                                                                                                 
  118 
  119     int rrd_fetch_fn_cb(const char *filename, enum cf_en cf_idx,
  120         time_t *start,time_t *end,
  121         unsigned long *step,
  122         unsigned long *ds_cnt,
  123         char        ***ds_namv,
  124         rrd_value_t **data);
  125 
  126     int rrd_fetch_cb_register(rrd_fetch_cb_t cb);
  127 
  128 
  129 #define RRD_READONLY    (1<<0)
  130 #define RRD_READWRITE   (1<<1)
  131 #define RRD_CREAT       (1<<2)
  132 #define RRD_READAHEAD   (1<<3)
  133 #define RRD_COPY        (1<<4)
  134 #define RRD_EXCL        (1<<5)
  135 #define RRD_READVALUES  (1<<6)
  136 #define RRD_LOCK        (1<<7)
  137 
  138     enum cf_en rrd_cf_conv(
  139     const char *string);
  140     enum dst_en dst_conv(
  141     const char *string);
  142     long      ds_match(
  143     rrd_t *rrd,
  144     char *ds_nam);
  145     off_t rrd_get_header_size(
  146     rrd_t *rrd);
  147     double    rrd_diff(
  148     char *a,
  149     char *b);
  150 
  151     const char *cf_to_string (enum cf_en cf);
  152 
  153 #ifdef  __cplusplus
  154 }
  155 #endif
  156 
  157 #endif /* RRD_TOOL_H */