]> git.ipfire.org Git - thirdparty/rrdtool-1.x.git/commitdiff
export 3 extra functions rrd_reduce_data(), rrd_lcd() and rrd_cf_conv()
authorTobias Oetiker <tobi@oetiker.ch>
Tue, 16 May 2017 08:32:19 +0000 (10:32 +0200)
committerTobias Oetiker <tobi@oetiker.ch>
Tue, 16 May 2017 08:32:19 +0000 (10:32 +0200)
16 files changed:
src/librrd.sym
src/rrd_create.c
src/rrd_dump.c
src/rrd_fetch.c
src/rrd_format.c
src/rrd_graph.c
src/rrd_graph.h
src/rrd_graph_helper.c
src/rrd_hw.c
src/rrd_info.c
src/rrd_modify.c
src/rrd_restore.c
src/rrd_tool.h
src/rrd_tune.c
src/rrd_update.c
src/rrd_xport.c

index 17bb693c1ea8f97fcadd16b665b1ace85684aedb..c5a707d8c5e717274e13288150e67c84dedd2847 100644 (file)
@@ -69,6 +69,9 @@ rrd_update_v_r
 rrd_version
 rrd_write
 rrd_xport
+rrd_reduce_data
+rrd_lcd
+rrd_cf_conv
 rrdc_connect
 rrdc_is_connected
 rrdc_is_any_connected
index ec6b4d39f65769940c4a53776d31d72b9df9ed19..53eb74b4f94493655f3838f11f8bd91ae2008e5c 100644 (file)
@@ -463,7 +463,7 @@ int parseRRA(const char *def,
        case 0:
            if (sscanf(token, CF_NAM_FMT, rra_def->cf_nam) != 1)
                rrd_set_error("Failed to parse CF name");
-           cf_id = cf_conv(rra_def->cf_nam);
+           cf_id = rrd_cf_conv(rra_def->cf_nam);
            switch (cf_id) {
            case CF_MHWPREDICT:
                 if (*require_version == NULL || atoi(*require_version) < atoi(RRD_VERSION4)) {
@@ -514,7 +514,7 @@ int parseRRA(const char *def,
            rra_def->pdp_cnt = 1;
            break;
        case 1:
-           switch (cf_conv
+           switch (rrd_cf_conv
                    (rra_def->cf_nam)) {
            case CF_HWPREDICT:
            case CF_MHWPREDICT:
@@ -536,7 +536,7 @@ int parseRRA(const char *def,
            }
            break;
        case 2:
-           switch (cf_conv
+           switch (rrd_cf_conv
                    (rra_def->cf_nam)) {
            case CF_HWPREDICT:
            case CF_MHWPREDICT:
@@ -580,7 +580,7 @@ int parseRRA(const char *def,
            }
            break;
        case 3:
-           switch (cf_conv(rra_def->cf_nam)) {
+           switch (rrd_cf_conv(rra_def->cf_nam)) {
            case CF_HWPREDICT:
            case CF_MHWPREDICT:
                if (rrd_strtodbl(token, NULL, &tmpdbl, NULL) != 2
@@ -632,7 +632,7 @@ int parseRRA(const char *def,
            }
            break;
        case 4:
-           switch (cf_conv(rra_def->cf_nam)) {
+           switch (rrd_cf_conv(rra_def->cf_nam)) {
            case CF_FAILURES:
                /* specifies the index (1-based) of CF_DEVSEASONAL array
                 * associated with this CF_DEVFAILURES array. */
@@ -727,8 +727,8 @@ rra_def_t *handle_dependent_rras(rra_def_t *rra_def_array,
     rra_def_t *rra_def = rra_def_array + (*rra_cnt-1);
 
     /* should we create CF_SEASONAL, CF_DEVSEASONAL, and CF_DEVPREDICT? */
-    if ((cf_conv(rra_def->cf_nam) == CF_HWPREDICT
-        || cf_conv(rra_def->cf_nam) == CF_MHWPREDICT)
+    if ((rrd_cf_conv(rra_def->cf_nam) == CF_HWPREDICT
+        || rrd_cf_conv(rra_def->cf_nam) == CF_MHWPREDICT)
        && rra_def->par[RRA_dependent_rra_idx].u_cnt == INT_MAX) {
        rra_def->par[RRA_dependent_rra_idx].u_cnt = *rra_cnt-1;
 #ifdef DEBUG
@@ -1172,7 +1172,7 @@ rra_def_t * create_hw_contingent_rras(rra_def_t *rra_defs,
 void init_cdp(const rrd_t *rrd, const rra_def_t *rra_def, const pdp_prep_t *pdp_prep, cdp_prep_t *cdp_prep)
 {
 
-    switch (cf_conv(rra_def->cf_nam)) {
+    switch (rrd_cf_conv(rra_def->cf_nam)) {
         case CF_HWPREDICT:
         case CF_MHWPREDICT:
             init_hwpredict_cdp(cdp_prep);
@@ -1771,10 +1771,10 @@ static rrd_value_t prefill_finish(rra_def_t UNUSED(*rra_def), enum cf_en current
 }
 
 static int order_candidates(candidate_t *a, candidate_t *b, const candidate_t UNUSED(*target)) {
-    enum cf_en acf = cf_conv(a->rra->cf_nam);
-    enum cf_en bcf = cf_conv(b->rra->cf_nam);
+    enum cf_en acf = rrd_cf_conv(a->rra->cf_nam);
+    enum cf_en bcf = rrd_cf_conv(b->rra->cf_nam);
 
-    enum cf_en tcf = cf_conv(target->rra->cf_nam);
+    enum cf_en tcf = rrd_cf_conv(target->rra->cf_nam);
     
     int astep = a->rrd->stat_head->pdp_step;
     int bstep = b->rrd->stat_head->pdp_step;
@@ -1809,9 +1809,9 @@ static int order_candidates(candidate_t *a, candidate_t *b, const candidate_t UN
 
 /* select AVERAGE and same CF RRAs. */
 static int select_create_candidates(const rra_def_t *tofill, const rra_def_t *maybe) {
-    enum cf_en cf = cf_conv(maybe->cf_nam);
+    enum cf_en cf = rrd_cf_conv(maybe->cf_nam);
     if (cf == CF_AVERAGE) return 1;
-    if (cf == cf_conv(tofill->cf_nam)) return 1;
+    if (cf == rrd_cf_conv(tofill->cf_nam)) return 1;
     return 0;
 }
 
@@ -2034,7 +2034,7 @@ static void prefill_cdp_prep(candidate_t *target,
     
     (target->cdp + target->extra.l)->scratch[CDP_unkn_pdp_cnt].u_cnt = 0;
 
-    enum cf_en tcf = cf_conv(target->rra->cf_nam);
+    enum cf_en tcf = rrd_cf_conv(target->rra->cf_nam);
     time_t t;
 
     rra_def_t *cdp_rra = rrd->rra_def + cdp_rra_index;
@@ -2211,7 +2211,7 @@ static long rra_for_cdp_prefilling(rrd_t *rrd, int *added)
         original_total_rows += rra->row_cnt;
         
         largest_pdp = max(largest_pdp, rra->pdp_cnt);
-        if (rra->pdp_cnt == 1 && cf_conv(rra->cf_nam) == CF_AVERAGE) {
+        if (rra->pdp_cnt == 1 && rrd_cf_conv(rra->cf_nam) == CF_AVERAGE) {
             if (average_1_pdp_rra == NULL) {
                 average_1_pdp_rra = rra;
                 found_rra_index = rra_index;
@@ -2292,8 +2292,8 @@ static void remove_temporary_rra_for_cdp_prefilling(rrd_t *rrd, long added_index
 }
 
 static int cdp_match(const rra_def_t *tofill, const rra_def_t *maybe) {
-    enum cf_en mcf = cf_conv(maybe->cf_nam);
-    if (cf_conv(tofill->cf_nam) == mcf &&
+    enum cf_en mcf = rrd_cf_conv(maybe->cf_nam);
+    if (rrd_cf_conv(tofill->cf_nam) == mcf &&
         tofill->pdp_cnt == maybe->pdp_cnt) {
         return 1;
     }
@@ -2331,7 +2331,7 @@ static int rrd_prefill_data(rrd_t *rrd, const GList *sources, mapping_t *mapping
         candidate_t target = {
             .rrd = rrd,
             .rra = rra_def,
-            .rra_cf = cf_conv(rra_def->cf_nam),
+            .rra_cf = rrd_cf_conv(rra_def->cf_nam),
             .rra_index = rra_index,
             .values = rrd->rrd_value + rrd->stat_head->ds_cnt * total_rows,
             .cdp = rrd->cdp_prep + rrd->stat_head->ds_cnt * rra_index,
@@ -2395,7 +2395,7 @@ static int rrd_prefill_data(rrd_t *rrd, const GList *sources, mapping_t *mapping
         candidate_t target = {
             .rrd = rrd,
             .rra = rrd->rra_def + rra_index,
-            .rra_cf = cf_conv(rrd->rra_def[rra_index].cf_nam),
+            .rra_cf = rrd_cf_conv(rrd->rra_def[rra_index].cf_nam),
             .rra_index = rra_index,
             .values = rrd->rrd_value + rrd->stat_head->ds_cnt * total_rows,
             .cdp = rrd->cdp_prep + rrd->stat_head->ds_cnt * rra_index,
index bc8264215ae2181767ebeda1083e428321e526e1..3653f012c47dcb839baf85334bdc26123de24341 100644 (file)
@@ -210,7 +210,7 @@ int rrd_dump_cb_r(
         /* support for RRA parameters */
         CB_PUTS("\t\t<params>\n");
 
-        switch (cf_conv(rrd.rra_def[i].cf_nam)) {
+        switch (rrd_cf_conv(rrd.rra_def[i].cf_nam)) {
         case CF_HWPREDICT:
         case CF_MHWPREDICT:
             CB_FMTS("\t\t<hw_alpha>%0.10e</hw_alpha>\n",
@@ -294,7 +294,7 @@ int rrd_dump_cb_r(
                 CB_FMTS("\t\t\t<secondary_value>%0.10e</secondary_value>\n", value);
             }
 
-            switch (cf_conv(rrd.rra_def[i].cf_nam)) {
+            switch (rrd_cf_conv(rrd.rra_def[i].cf_nam)) {
             case CF_HWPREDICT:
             case CF_MHWPREDICT:
                 value = rrd.cdp_prep[i * rrd.stat_head->ds_cnt + ii].
index 9466d615b31294dc14e6660c94e94f08f8053f99..1c3e7f5c58447b8331bc7a554b59d05c82362dab 100644 (file)
@@ -226,7 +226,7 @@ int rrd_fetch_r(
 {                       /* two dimensional array containing the data */
     enum cf_en cf_idx;
 
-    if ((int) (cf_idx = cf_conv(cf)) == -1) {
+    if ((int) (cf_idx = rrd_cf_conv(cf)) == -1) {
         return -1;
     }
 
@@ -342,7 +342,7 @@ int rrd_fetch_fn(
 
     /* find the rra which best matches the requirements */
     for (i = 0; (unsigned) i < rrd.stat_head->rra_cnt; i++) {
-      enum cf_en rratype=cf_conv(rrd.rra_def[i].cf_nam);
+      enum cf_en rratype=rrd_cf_conv(rrd.rra_def[i].cf_nam);
       /* handle this RRA */
       if (
          /* if we found a direct match */
index 1a31743383847825e35e442b41d45793161fa303..32a051a2aedcd0a6fc6238c202b45234e36f66bb 100644 (file)
@@ -27,7 +27,7 @@ enum dst_en dst_conv(
 }
 
 
-enum cf_en cf_conv(
+enum cf_en rrd_cf_conv(
     const char *string)
 {
 
index 2ec9462f68587fa6b8082fbd30146d6dd686bc9e..20f946fcb977ad31abd9884ec03f995727e3f67f 100644 (file)
@@ -759,7 +759,7 @@ void apply_gridfit(
 
 /* reduce data reimplementation by Alex */
 
-int reduce_data(
+int rrd_reduce_data(
     enum cf_en cf,      /* which consolidation function ? */
     unsigned long cur_step, /* step the data currently is in */
     time_t *start,      /* start, end and step as requested ... */
@@ -1033,7 +1033,7 @@ int data_fetch(
             im->gdes[i].step = max(im->gdes[i].step,im->step);
             if (ft_step < im->gdes[i].step) {
 
-                if (!reduce_data(im->gdes[i].cf_reduce_set ? im->gdes[i].cf_reduce : im->gdes[i].cf,
+                if (!rrd_reduce_data(im->gdes[i].cf_reduce_set ? im->gdes[i].cf_reduce : im->gdes[i].cf,
                             ft_step,
                             &im->gdes[i].start,
                             &im->gdes[i].end,
@@ -1072,7 +1072,7 @@ int data_fetch(
 
 /* find the greatest common divisor for all the numbers
    in the 0 terminated num array */
-long lcd(
+long rrd_lcd(
     long *num)
 {
     long      rest;
@@ -1253,7 +1253,7 @@ int data_calc(
             /* Now find the resulting step.  All steps in all
              * used RRAs have to be visited
              */
-            im->gdes[gdi].step = lcd(steparray);
+            im->gdes[gdi].step = rrd_lcd(steparray);
             free(steparray);
 
             if ((im->gdes[gdi].data = (rrd_value_t*)malloc(((im->gdes[gdi].end -
index a90a0ff65e56034fffa7a1910d7182e1578f2710..77dd2236d3452ab864fb1b88b4d7052c41651699 100644 (file)
@@ -216,7 +216,7 @@ typedef struct graph_desc_t {
     long      ds;       /* data source number */
     char      daemon[256];
     enum cf_en cf;      /* consolidation function */
-    enum cf_en cf_reduce;   /* consolidation function for reduce_data() */
+    enum cf_en cf_reduce;   /* consolidation function for rrd_reduce_data() */
     int        cf_reduce_set; /* is the cf_reduce option set */
     struct gfx_color_t col, col2; /* graph color */
        double    gradheight;
@@ -382,7 +382,7 @@ void      expand_range(
     image_desc_t *);
 void      apply_gridfit(
     image_desc_t *);
-int     reduce_data(
+int     rrd_reduce_data(
     enum cf_en,
     unsigned long,
     time_t *,
@@ -392,7 +392,7 @@ int     reduce_data(
     rrd_value_t **);
 int       data_fetch(
     image_desc_t *);
-long      lcd(
+long      rrd_lcd(
     long *);
 int       data_calc(
     image_desc_t *);
index 3f5c832efc218d4a0aa85aa921d0ea5f112e8ba5..94b1b22d4ff32cd378551f76d338fcfdb13fe196 100644 (file)
@@ -506,7 +506,7 @@ static graph_desc_t* newGraphDescription(image_desc_t *const im,enum gf_en gf,pa
   if (bitscmp(PARSE_REDUCE)) {
     char *reduce=getKeyValueArgument("reduce",1,pa);
     if (reduce) {
-      gdp->cf_reduce=cf_conv(reduce);
+      gdp->cf_reduce=rrd_cf_conv(reduce);
       gdp->cf_reduce_set=1;
       dprintfparsed("got reduce: %s (%i)\n",reduce,gdp->cf_reduce);
       if (((int)gdp->cf_reduce)==-1) { rrd_set_error("bad reduce CF: %s",reduce); return NULL; }
@@ -798,7 +798,7 @@ static graph_desc_t* newGraphDescription(image_desc_t *const im,enum gf_en gf,pa
     gdp->ds_nam[DS_NAM_SIZE - 1] = '\0';
   }
   if (cf) {
-    gdp->cf=cf_conv(cf);
+    gdp->cf=rrd_cf_conv(cf);
     if (((int)gdp->cf)==-1) {
       rrd_set_error("bad CF: %s",cf); return NULL; }
   } else { if (bitscmp(PARSE_CF)) { gdp->cf = (enum cf_en) -1; }}
@@ -1266,7 +1266,7 @@ static int parse_gprint(enum gf_en gf,parsedargs_t*pa,image_desc_t *const im) {
     if (((int)gdp->cf)==-1) {
       keyvalue_t* first=getFirstUnusedArgument(1,pa);
       if (first) {
-       gdp->cf=cf_conv(first->value);
+       gdp->cf=rrd_cf_conv(first->value);
        if (((int)gdp->cf)==-1) {
          rrd_set_error("bad CF for DEF/CDEF: %s",first->value); return 1; }
       } else { rrd_set_error("No positional CDEF"); return 1; }
index 4d74c1e93339f88546b639eefb35232227f472bf..9ce351f8c6a3d2e4e0630947b6401971e92e5772 100644 (file)
@@ -91,7 +91,7 @@ void erase_violations(
     char     *violations_array;
 
     /* check that rra_idx is a CF_FAILURES array */
-    if (cf_conv(rrd->rra_def[rra_idx].cf_nam) != CF_FAILURES) {
+    if (rrd_cf_conv(rrd->rra_def[rra_idx].cf_nam) != CF_FAILURES) {
 #ifdef DEBUG
         fprintf(stderr, "erase_violations called for non-FAILURES RRA: %s\n",
                 rrd->rra_def[rra_idx].cf_nam);
@@ -245,13 +245,13 @@ int apply_smoother(
     free(buffers);
     free(working_average);
 
-    if (cf_conv(rrd->rra_def[rra_idx].cf_nam) == CF_SEASONAL) {
+    if (rrd_cf_conv(rrd->rra_def[rra_idx].cf_nam) == CF_SEASONAL) {
         rrd_value_t (
     *init_seasonality) (
     rrd_value_t seasonal_coef,
     rrd_value_t intercept);
 
-        switch (cf_conv(rrd->rra_def[hw_dep_idx(rrd, rra_idx)].cf_nam)) {
+        switch (rrd_cf_conv(rrd->rra_def[hw_dep_idx(rrd, rra_idx)].cf_nam)) {
         case CF_HWPREDICT:
             init_seasonality = hw_additive_init_seasonality;
             break;
@@ -350,7 +350,7 @@ void reset_aberrant_coefficients(
     /* loop over the RRAs */
     for (rra_idx = 0; rra_idx < rrd->stat_head->rra_cnt; rra_idx++) {
         cdp_idx = rra_idx * (rrd->stat_head->ds_cnt) + ds_idx;
-        switch (cf_conv(rrd->rra_def[rra_idx].cf_nam)) {
+        switch (rrd_cf_conv(rrd->rra_def[rra_idx].cf_nam)) {
         case CF_HWPREDICT:
         case CF_MHWPREDICT:
             init_hwpredict_cdp(&(rrd->cdp_prep[cdp_idx]));
@@ -463,7 +463,7 @@ int update_aberrant_CF(
         return update_devpredict(rrd, cdp_idx, rra_idx, ds_idx,
                                  CDP_scratch_idx);
     case CF_SEASONAL:
-        switch (cf_conv(rrd->rra_def[hw_dep_idx(rrd, rra_idx)].cf_nam)) {
+        switch (rrd_cf_conv(rrd->rra_def[hw_dep_idx(rrd, rra_idx)].cf_nam)) {
         case CF_HWPREDICT:
             return update_seasonal(rrd, cdp_idx, rra_idx, ds_idx,
                                    CDP_scratch_idx, seasonal_coef,
@@ -476,7 +476,7 @@ int update_aberrant_CF(
             return -1;
         }
     case CF_DEVSEASONAL:
-        switch (cf_conv(rrd->rra_def[hw_dep_idx(rrd, rra_idx)].cf_nam)) {
+        switch (rrd_cf_conv(rrd->rra_def[hw_dep_idx(rrd, rra_idx)].cf_nam)) {
         case CF_HWPREDICT:
             return update_devseasonal(rrd, cdp_idx, rra_idx, ds_idx,
                                       CDP_scratch_idx, seasonal_coef,
@@ -489,7 +489,7 @@ int update_aberrant_CF(
             return -1;
         }
     case CF_FAILURES:
-        switch (cf_conv
+        switch (rrd_cf_conv
                 (rrd->rra_def[hw_dep_idx(rrd, hw_dep_idx(rrd, rra_idx))].
                  cf_nam)) {
         case CF_HWPREDICT:
index e7682afa1ae19b06381686aa7ed99d330e20548a..dc04c5c681ab1958cd535eb36eccda30db02b283 100644 (file)
@@ -256,7 +256,7 @@ rrd_info_t *rrd_info_r(
         info.u_str = rrd.rra_def[i].cf_nam;
         cd = rrd_info_push(cd, sprintf_alloc("rra[%d].cf", i), RD_I_STR,
                            info);
-        current_cf = cf_conv(rrd.rra_def[i].cf_nam);
+        current_cf = rrd_cf_conv(rrd.rra_def[i].cf_nam);
 
         info.u_cnt = rrd.rra_def[i].row_cnt;
         cd = rrd_info_push(cd, sprintf_alloc("rra[%d].rows", i), RD_I_CNT,
index 369d7a1f5ecf788b5d97e8a92bb147bc0c63cc93..aa34f86f64e39540e0765f84ccf2a60b1e800d12 100644 (file)
@@ -78,8 +78,8 @@ static int sort_candidates(const void *va, const void *vb) {
 }
 
 static int select_for_modify(const rra_def_t *tofill, const rra_def_t *maybe) {
-    enum cf_en cf = cf_conv(tofill->cf_nam);
-    enum cf_en other_cf = cf_conv(maybe->cf_nam);
+    enum cf_en cf = rrd_cf_conv(tofill->cf_nam);
+    enum cf_en other_cf = rrd_cf_conv(maybe->cf_nam);
     return (other_cf == cf ||
            (other_cf == CF_AVERAGE /*&& other_rra->pdp_cnt == 1*/));
 }
@@ -121,7 +121,7 @@ candidate_t *find_candidate_rras(const rrd_t *rrd, const rra_def_t *rra, int *cn
                .rra_index = i,
                .values = rrd->rrd_value + rrd->stat_head->ds_cnt * total_rows,
                .rra = rrd->rra_def + i,
-               .rra_cf = cf_conv(rrd->rra_def[i].cf_nam),
+               .rra_cf = rrd_cf_conv(rrd->rra_def[i].cf_nam),
                .ptr = rrd->rra_ptr + i,
                .cdp = rrd->cdp_prep + rrd->stat_head->ds_cnt * i,
                .extra = extra
@@ -417,7 +417,7 @@ static int populate_row(const rrd_t *in_rrd,
 
     if (in_rrd->stat_head->rra_cnt < 1) return 0;
 
-    enum cf_en cf = cf_conv(new_rra->cf_nam);
+    enum cf_en cf = rrd_cf_conv(new_rra->cf_nam);
     switch (cf) {
     case CF_AVERAGE:
     case CF_MINIMUM:
@@ -706,7 +706,7 @@ static int stretch_rras(rrd_t *out, int stretch) {
     unsigned int rra_index, ds_index;
     for (rra_index = 0 ; rra_index < out->stat_head->rra_cnt ; rra_index++) {
        rra_def_t *rra = out->rra_def + rra_index;
-       enum cf_en cf = cf_conv(rra->cf_nam);
+       enum cf_en cf = rrd_cf_conv(rra->cf_nam);
        
        cdp_prep_t *cdp_prep_row = out->cdp_prep + rra_index * ds_cnt;
        for (ds_index = 0 ; ds_index < ds_cnt ; ds_index++) {
@@ -1018,7 +1018,7 @@ static void prepare_CDPs(const rrd_t *in, rrd_t *out,
 
     rra_def_t *rra_def = out->rra_def + curr_rra;
 
-    enum cf_en cf = cf_conv(rra_def->cf_nam);
+    enum cf_en cf = rrd_cf_conv(rra_def->cf_nam);
     int candidates_cnt = 0;
     candidate_t *candidates = NULL;
     candidate_t *chosen_candidate = NULL;
@@ -1033,7 +1033,7 @@ static void prepare_CDPs(const rrd_t *in, rrd_t *out,
            rra_def_t *cand_rra = c->rrd->rra_def + c->rra_index;
                
            // we only accept AVERAGE RRAs or RRAs with pdp_cnt == 1
-           if (cand_rra->pdp_cnt == 1 || cf_conv(cand_rra->cf_nam) == CF_AVERAGE) {
+           if (cand_rra->pdp_cnt == 1 || rrd_cf_conv(cand_rra->cf_nam) == CF_AVERAGE) {
                chosen_candidate = c;
                break;
            }
index ba9375a7b9620dd5bc415cead0a7cf0b76808864..9c7f7cfdf7e163837831dcb4106759c4facf64d4 100644 (file)
@@ -813,7 +813,7 @@ static int parse_tag_rra_cf(
     if (status != 0)
         return status;
 
-    status = cf_conv(rra_def->cf_nam);
+    status = rrd_cf_conv(rra_def->cf_nam);
     if (status == -1) {
         rrd_set_error("parse_tag_rra_cf: Unknown consolidation function: %s",
                       rra_def->cf_nam);
index 0d9ca5d4eec548ce839c2e1b83f50a55a1f09431..4f7dfb3748aeb3010082876a4d90c760529b85b3 100644 (file)
@@ -134,7 +134,7 @@ typedef int (*rrd_fetch_cb_t)(
 #define RRD_EXCL        (1<<5)
 #define RRD_READVALUES  (1<<6)
 
-    enum cf_en cf_conv(
+    enum cf_en rrd_cf_conv(
     const char *string);
     enum dst_en dst_conv(
     const char *string);
index c82fe874a72385b63154b0ce4d9de55bd3f8e21d..11a9ea219752ae2df0eeabc9955a404088d8cdec 100644 (file)
@@ -451,7 +451,7 @@ static int set_hwarg(
     }
     /* does the appropriate RRA exist?  */
     for (i = 0; i < rrd->stat_head->rra_cnt; ++i) {
-        if (cf_conv(rrd->rra_def[i].cf_nam) == cf) {
+        if (rrd_cf_conv(rrd->rra_def[i].cf_nam) == cf) {
             rra_idx = i;
             break;
         }
@@ -491,7 +491,7 @@ static int set_hwsmootharg(
     }
     /* does the appropriate RRA exist?  */
     for (i = 0; i < rrd->stat_head->rra_cnt; ++i) {
-        if (cf_conv(rrd->rra_def[i].cf_nam) == cf) {
+        if (rrd_cf_conv(rrd->rra_def[i].cf_nam) == cf) {
             rra_idx = i;
             break;
         }
@@ -528,7 +528,7 @@ static int set_deltaarg(
 
     /* does the appropriate RRA exist?  */
     for (i = 0; i < rrd->stat_head->rra_cnt; ++i) {
-        if (cf_conv(rrd->rra_def[i].cf_nam) == CF_FAILURES) {
+        if (rrd_cf_conv(rrd->rra_def[i].cf_nam) == CF_FAILURES) {
             rra_idx = i;
             break;
         }
@@ -561,7 +561,7 @@ static int set_windowarg(
     }
     /* does the appropriate RRA exist?  */
     for (i = 0; i < rrd->stat_head->rra_cnt; ++i) {
-        if (cf_conv(rrd->rra_def[i].cf_nam) == CF_FAILURES) {
+        if (rrd_cf_conv(rrd->rra_def[i].cf_nam) == CF_FAILURES) {
             rra_idx = i;
             break;
         }
index c96141321f032b19bb4494de86944c064d42d34d..b36593ead66e32e63baaea4e90333998f97ef4a2 100644 (file)
@@ -1772,7 +1772,7 @@ static int update_all_cdp_prep(
 
     rra_start = rra_begin;
     for (rra_idx = 0; rra_idx < rrd->stat_head->rra_cnt; rra_idx++) {
-        current_cf = cf_conv(rrd->rra_def[rra_idx].cf_nam);
+        current_cf = rrd_cf_conv(rrd->rra_def[rra_idx].cf_nam);
         start_pdp_offset =
             rrd->rra_def[rra_idx].pdp_cnt -
             proc_pdp_cnt % rrd->rra_def[rra_idx].pdp_cnt;
@@ -2207,7 +2207,7 @@ static int update_aberrant_cdps(
         rra_start = rra_begin;
         for (rra_idx = 0; rra_idx < rrd->stat_head->rra_cnt; rra_idx++) {
             if (rrd->rra_def[rra_idx].pdp_cnt == 1) {
-                current_cf = cf_conv(rrd->rra_def[rra_idx].cf_nam);
+                current_cf = rrd_cf_conv(rrd->rra_def[rra_idx].cf_nam);
                 if (current_cf == CF_SEASONAL || current_cf == CF_DEVSEASONAL) {
                     if (scratch_idx == CDP_primary_val) {
                         lookup_seasonal(rrd, rra_idx, rra_start, rrd_file,
@@ -2382,8 +2382,8 @@ static int smooth_all_rras(
     unsigned long rra_idx;
 
     for (rra_idx = 0; rra_idx < rrd->stat_head->rra_cnt; ++rra_idx) {
-        if (cf_conv(rrd->rra_def[rra_idx].cf_nam) == CF_DEVSEASONAL ||
-            cf_conv(rrd->rra_def[rra_idx].cf_nam) == CF_SEASONAL) {
+        if (rrd_cf_conv(rrd->rra_def[rra_idx].cf_nam) == CF_DEVSEASONAL ||
+            rrd_cf_conv(rrd->rra_def[rra_idx].cf_nam) == CF_SEASONAL) {
 #ifdef DEBUG
             fprintf(stderr, "Running smoother for rra %lu\n", rra_idx);
 #endif
index 0bd1f71ba4f73236fcabfec754c575574e64116f..c63a9cc4e2880c94cb5321bba32ed0c05aa65f6b 100644 (file)
@@ -317,7 +317,7 @@ static int rrd_xport_fn(
     }
     *step_list_ptr=0;
     /* find a common step */
-    *step = lcd(step_list);
+    *step = rrd_lcd(step_list);
     /* printf("step: %lu\n",*step); */
     free(step_list);