#include "graph_linking.h"
#include "zbxdb.h"
#include "zbxdbhigh.h"
#include "audit/zbxaudit.h"
#include "audit/zbxaudit_graph.h"
#include "zbxnum.h"
#include "zbxstr.h"
typedef enum
{
GRAPH_YAXIS_TYPE_CALCULATED = 0,
GRAPH_YAXIS_TYPE_FIXED,
GRAPH_YAXIS_TYPE_ITEM_VALUE
}
zbx_graph_yaxis_types_t;
typedef struct
{
zbx_uint64_t itemid;
zbx_uint64_t gitemid;
char key[ZBX_ITEM_KEY_LEN * ZBX_MAX_BYTES_IN_UTF8_CHAR + 1];
int drawtype_orig;
int drawtype_new;
int sortorder_orig;
int sortorder_new;
char color_orig[ZBX_GRAPH_ITEM_COLOR_LEN_MAX];
char color_new[ZBX_GRAPH_ITEM_COLOR_LEN_MAX];
int yaxisside_orig;
int yaxisside_new;
int calc_fnc_orig;
int calc_fnc_new;
int type_orig;
int type_new;
unsigned char flags;
#define ZBX_FLAG_LINK_GRAPHITEM_UNSET __UINT64_C(0x00)
#define ZBX_FLAG_LINK_GRAPHITEM_UPDATE_DRAWTYPE __UINT64_C(0x01)
#define ZBX_FLAG_LINK_GRAPHITEM_UPDATE_SORTORDER __UINT64_C(0x02)
#define ZBX_FLAG_LINK_GRAPHITEM_UPDATE_COLOR __UINT64_C(0x04)
#define ZBX_FLAG_LINK_GRAPHITEM_UPDATE_YAXISSIDE __UINT64_C(0x08)
#define ZBX_FLAG_LINK_GRAPHITEM_UPDATE_CALC_FNC __UINT64_C(0x10)
#define ZBX_FLAG_LINK_GRAPHITEM_UPDATE_TYPE __UINT64_C(0x20)
#define ZBX_FLAG_LINK_GRAPHITEM_UPDATE \
(ZBX_FLAG_LINK_GRAPHITEM_UPDATE_DRAWTYPE | ZBX_FLAG_LINK_GRAPHITEM_UPDATE_SORTORDER | \
ZBX_FLAG_LINK_GRAPHITEM_UPDATE_COLOR | ZBX_FLAG_LINK_GRAPHITEM_UPDATE_YAXISSIDE | \
ZBX_FLAG_LINK_GRAPHITEM_UPDATE_CALC_FNC | ZBX_FLAG_LINK_GRAPHITEM_UPDATE_TYPE)
zbx_uint64_t update_flags;
}
graph_item_entry;
typedef struct
{
zbx_uint64_t graphid;
char *name_orig;
char *name;
int width_orig;
int width;
int height_orig;
int height;
double yaxismin_orig;
double yaxismin;
double yaxismax_orig;
double yaxismax;
unsigned char show_work_period_orig;
unsigned char show_work_period;
unsigned char show_triggers_orig;
unsigned char show_triggers;
unsigned char graphtype_orig;
unsigned char graphtype;
unsigned char show_legend_orig;
unsigned char show_legend;
unsigned char show_3d_orig;
unsigned char show_3d;
double percent_left_orig;
double percent_left;