{
graph_ident_t *select;
+ uint32_t color;
+
graph_def_t *next;
};
return (NULL);
}
memset (ret, 0, sizeof (*ret));
+ ret->color = get_random_color ();
ret->next = NULL;
ret->select = ident_copy_with_selector (selector, ident,
def_destroy (next);
} /* }}} void def_destroy */
+int def_append (graph_def_t *head, graph_def_t *def) /* {{{ */
+{
+ graph_def_t *ptr;
+
+ if ((head == NULL) || (def == NULL))
+ return (EINVAL);
+
+ ptr = head;
+ while (ptr->next != NULL)
+ ptr = ptr->next;
+
+ ptr->next = def;
+
+ return (0);
+} /* }}} int def_append */
+
graph_def_t *def_search (graph_def_t *head, graph_ident_t *ident) /* {{{ */
{
graph_def_t *ptr;
/* Graph part */
array_append_format (args, "LINE1:def_%04i_avg#%06"PRIx32":%s",
- index, get_random_color (), dses[i]);
+ index, def->color, dses[i]);
array_append_format (args, "GPRINT:vdef_%04i_min:%%lg min,", index);
array_append_format (args, "GPRINT:vdef_%04i_avg:%%lg avg,", index);
array_append_format (args, "GPRINT:vdef_%04i_max:%%lg max,", index);