]> git.ipfire.org Git - thirdparty/rrdtool-1.x.git/blobdiff - src/rrd_format.h
Update Version and Copyright year in git files
[thirdparty/rrdtool-1.x.git] / src / rrd_format.h
index 5d86857674b91bf25a60fcb8b20211162351efb0..d20578441115fe35fb0d9cf7c9539f569fb373a6 100644 (file)
@@ -1,11 +1,23 @@
 /*****************************************************************************
- * RRDtool 1.3rc7  Copyright by Tobi Oetiker, 1997-2008
+ * RRDtool 1.8.0 Copyright by Tobi Oetiker, 1997-2022
  *****************************************************************************
  * rrd_format.h  RRD Database Format header
  *****************************************************************************/
 
-#ifndef _RRD_FORMAT_H
-#define _RRD_FORMAT_H
+#ifndef RRD_FORMAT_H_92768FBD7A3446C58B1097BEE038159D
+#define RRD_FORMAT_H_92768FBD7A3446C58B1097BEE038159D
+
+/* 
+ * _RRD_TOOL_H
+ *   We're building RRDtool itself.
+ *
+ * RRD_EXPORT_DEPRECATED
+ *   User is requesting internal function which need this struct. They have
+ *   been told that this will change and have agreed to adapt their programs.
+ */
+#if !defined(RRD_TOOL_H_3853987DDF7E4709A5B5849E5A6204F4) && !defined(RRD_EXPORT_DEPRECATED)
+# error "Do not include rrd_format.h directly. Include rrd.h instead!"
+#endif
 
 #include "rrd.h"
 
 #define RRD_COOKIE    "RRD"
 /* #define RRD_VERSION   "0002" */
 /* changed because microsecond precision requires another field */
-#define RRD_VERSION   "0004"
 #define RRD_VERSION3  "0003"
-#define FLOAT_COOKIE  8.642135E130
+#define RRD_VERSION4  "0004"
+#define RRD_VERSION5  "0005"
+#define FLOAT_COOKIE  ((double)8.642135E130)
 
 typedef union unival {
     unsigned long u_cnt;
@@ -35,13 +48,13 @@ typedef union unival {
  * The RRD Database Structure
  * ---------------------------
  * 
- * In oder to properly describe the database structure lets define a few
+ * In order to properly describe the database structure lets define a few
  * new words:
  *
  * ds - Data Source (ds) providing input to the database. A Data Source (ds)
  *       can be a traffic counter, a temperature, the number of users logged
  *       into a system. The rrd database format can handle the input of
- *       several Data Sources (ds) in a singe database.
+ *       several Data Sources (ds) in a single database.
  *  
  * dst - Data Source Type (dst). The Data Source Type (dst) defines the rules
  *       applied to Build Primary Data Points from the input provided by the
@@ -126,7 +139,9 @@ enum dst_en { DST_COUNTER = 0,  /* data source types available */
     DST_ABSOLUTE,
     DST_GAUGE,
     DST_DERIVE,
-    DST_CDEF
+    DST_CDEF,
+    DST_DCOUNTER,
+    DST_DDERIVE
 };
 
 enum ds_param_en { DS_mrhb_cnt = 0, /* minimum required heartbeat. A
@@ -145,9 +160,11 @@ enum ds_param_en { DS_mrhb_cnt = 0, /* minimum required heartbeat. A
 
 /* The magic number here is one less than DS_NAM_SIZE */
 #define DS_NAM_FMT    "%19[a-zA-Z0-9_-]"
+#define DS_NAM_RE     "[-a-zA-Z0-9_]{1,19}"
 #define DS_NAM_SIZE   20
 
 #define DST_FMT    "%19[A-Z]"
+#define DST_FMT_RE "[A-Z]{1,19}"
 #define DST_SIZE   20
 
 typedef struct ds_def_t {
@@ -213,6 +230,9 @@ enum rra_par_en { RRA_cdp_xff_val = 0,  /* what part of the consolidated
      * For CF_FAILURES: index of the CF_DEVSEASONAL array.
      * */
 
+    /* CF_HWPREDICT: */
+    RRA_period = 4,
+
     /* CF_SEASONAL and CF_DEVSEASONAL: */
     RRA_seasonal_gamma = 1,
     /* exponential smoothing parameter for seasonal effects. */
@@ -233,7 +253,7 @@ enum rra_par_en { RRA_cdp_xff_val = 0,  /* what part of the consolidated
     RRA_delta_neg = 2,
     /* RRA_dependent_rra_idx = 3, */
     RRA_window_len = 4,
-    RRA_failure_threshold = 5,
+    RRA_failure_threshold = 5
     /* For CF_FAILURES, number of violations within the last
      * window required to mark a failure. */
 };
@@ -301,7 +321,7 @@ typedef struct pdp_prep_t {
 
    * DS updates may only occur at ever increasing points in time
    * When any DS update arrives after a cdp update time, the *previous*
-     update cycle gets executed. All pdps are transfered to cdps and the
+     update cycle gets executed. All pdps are transferred to cdps and the
      cdps feed the rras where necessary. Only then the new DS value
      is loaded into the PDP.                                                   */
 
@@ -326,12 +346,12 @@ enum cdp_par_en { CDP_val = 0,
      * prediction algorithm. */
     CDP_hw_last_intercept,
     /* Last iteration intercept coefficient for the Holt-Winters
-     * prediction algorihtm. */
+     * prediction algorithm. */
     CDP_hw_slope,
     /* Current slope coefficient for the Holt-Winters
      * prediction algorithm. */
     CDP_hw_last_slope,
-    /* Last iteration slope coeffient. */
+    /* Last iteration slope coefficient. */
     CDP_null_count,
     /* Number of sequential Unknown (DNAN) values + 1 preceding
      * the current prediction.
@@ -349,7 +369,7 @@ enum cdp_par_en { CDP_val = 0,
      * prediction algorithm. This is stored in CDP prep to avoid
      * redundant seek operations. */
     CDP_hw_last_seasonal = CDP_hw_last_intercept,
-    /* Last iteration seasonal coeffient. */
+    /* Last iteration seasonal coefficient. */
     CDP_seasonal_deviation = CDP_hw_intercept,
     CDP_last_seasonal_deviation = CDP_hw_last_intercept,
     CDP_init_seasonal = CDP_null_count
@@ -389,6 +409,8 @@ typedef struct rrd_t {
     cdp_prep_t *cdp_prep;   /* cdp prep area */
     rra_ptr_t *rra_ptr; /* list of rra pointers */
     rrd_value_t *rrd_value; /* list of rrd values */
+    void *__mmap_start;            /* all __ variables will be used internally */
+    long __mmap_size;
 } rrd_t;
 
 /****************************************************************************