zabbix-agent2/src/libs/zbxdbcache/dbsync.c
/******************************************************************************
 *                                                                            *
 * Function: dbsync_compare_expression                                        *
 *                                                                            *
 * Purpose: compares expressions table row with cached configuration data     *
 *                                                                            *
 * Parameter: expression - [IN] the cached expression                         *
 *            dbrow      - [IN] the database row                              *
 *                                                                            *
 * Return value: SUCCEED - the row matches configuration data                 *
 *               FAIL    - otherwise                                          *
 *                                                                            *
 ******************************************************************************/
dbsync_compare_expression

Purpose: compares expressions table row with cached configuration data

Parameter: expression - [IN] the cached expression
dbrow      - [IN] the database row

Return value: SUCCEED - the row matches configuration data
FAIL    - otherwise
dbsync_compare_expression Purpose : compares expressions table row with cached configuration data Parameter : expression - [ IN ] the cached expression dbrow - [ IN ] the database row Return value : SUCCEED - the row matches configuration data FAIL - otherwise
static int	dbsync_compare_expression(const ZBX_DC_EXPRESSION *expression, const DB_ROW dbrow)
{
	if (FAIL == dbsync_compare_str(dbrow[0], expression->regexp))
		return FAIL;
	if (FAIL == dbsync_compare_str(dbrow[2], expression->expression))
		return FAIL;
	if (FAIL == dbsync_compare_uchar(dbrow[3], expression->type))
		return FAIL;
	if (*dbrow[4] != expression->delimiter)
		return FAIL;
	if (FAIL == dbsync_compare_uchar(dbrow[5], expression->case_sensitive))
		return FAIL;
	return SUCCEED;
}
static int dbsync_compare_expression ( const ZBX_DC_EXPRESSION * expression , const DB_ROW dbrow ) { if ( FAIL == dbsync_compare_str ( dbrow [ 0 ] , expression -> regexp ) ) return FAIL ; if ( FAIL == dbsync_compare_str ( dbrow [ 2 ] , expression -> expression ) ) return FAIL ; if ( FAIL == dbsync_compare_uchar ( dbrow [ 3 ] , expression -> type ) ) return FAIL ; if ( * dbrow [ 4 ] != expression -> delimiter ) return FAIL ; if ( FAIL == dbsync_compare_uchar ( dbrow [ 5 ] , expression -> case_sensitive ) ) return FAIL ; return SUCCEED ; }
Function: dbsync_compare_expression                                        
                                                                            
 Purpose: compares expressions table row with cached configuration data     
                                                                            
 Parameter: expression - [IN] the cached expression                         
            dbrow      - [IN] the database row                              
                                                                            
 Return value: SUCCEED - the row matches configuration data                 
               FAIL    - otherwise
Function : dbsync_compare_expression Purpose : compares expressions table row with cached configuration data Parameter : expression - [ IN ] the cached expression dbrow - [ IN ] the database row Return value : SUCCEED - the row matches configuration data FAIL - otherwise