Source
xxxxxxxxxx
/*
** Copyright (C) 2001-2025 Zabbix SIA
**
** This program is free software: you can redistribute it and/or modify it under the terms of
** the GNU Affero General Public License as published by the Free Software Foundation, version 3.
**
** This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
** without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
** See the GNU Affero General Public License for more details.
**
** You should have received a copy of the GNU Affero General Public License along with this program.
** If not, see <https://www.gnu.org/licenses/>.
**/
/* no changes */
/* a new object must be added to configuration cache */
/* a cached object must be updated in configuration cache */
/* a cached object must be removed from configuration cache */
/******************************************************************************
* *
* Purpose: applies necessary preprocessing before row is compared/used *
* *
* Parameter: row - [IN] the row to preprocess *
* *
* Return value: the preprocessed row *
* *
* Comments: The row preprocessing can be used to expand user macros in *
* some columns. *
* *
******************************************************************************/
typedef char **(*zbx_dbsync_preproc_row_func_t)(zbx_dbsync_t *sync, char **row);
typedef struct
{
/* a row tag, describing the changes (see ZBX_DBSYNC_ROW_* defines) */
unsigned char tag;
/* the identifier of the object represented by the row */
zbx_uint64_t rowid;
/* the column values, NULL if the tag is ZBX_DBSYNC_ROW_REMOVE */
char **row;
}
zbx_dbsync_row_t;
struct zbx_dbsync
{
/* the synchronization mode (see ZBX_DBSYNC_* defines) */
unsigned char mode;
unsigned char type;
/* the number of columns in diff */
int columns_num;
/* the current row */
int row_index;
/* the changed rows */
zbx_vector_ptr_t rows;
/* the database result set for ZBX_DBSYNC_ALL mode */