* This file is part of the oGRAC project.
* Copyright (c) 2024 Huawei Technologies Co.,Ltd.
*
* oGRAC is licensed under Mulan PSL v2.
* You can use this software according to the terms and conditions of the Mulan PSL v2.
* You may obtain a copy of Mulan PSL v2 at:
*
* http://license.coscl.org.cn/MulanPSL2
*
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
* See the Mulan PSL v2 for more details.
* -------------------------------------------------------------------------
*
* var_func.h
*
*
* IDENTIFICATION
* src/common/variant/var_func.h
*
* -------------------------------------------------------------------------
*/
#ifndef __VAR_FUNCTION_H__
#define __VAR_FUNCTION_H__
#include "cm_defs.h"
#include "cm_text.h"
typedef struct st_var_func {
uint32 func_id;
uint32 pack_id;
bool32 is_proc;
uint32 arg_cnt;
bool32 is_winsort_func;
int32 aggr_ref_count;
uint32 orig_func_id;
} var_func_t;
typedef struct st_var_udo {
bool8 name_sensitive;
bool8 pack_sensitive;
bool8 user_explicit;
uint8 unused;
text_t user;
text_t pack;
text_t name;
} var_udo_t;
static inline bool32 var_udo_text_equal(var_udo_t *obj1, var_udo_t *obj2)
{
if (obj1 == NULL && obj2 == NULL) {
return OG_TRUE;
}
if (obj1 == NULL || obj2 == NULL) {
return OG_FALSE;
}
if (cm_text_equal(&obj1->user, &obj2->user) &&
cm_text_equal(&obj1->pack, &obj2->pack) &&
cm_text_equal(&obj1->name, &obj2->name)) {
return OG_TRUE;
}
return OG_FALSE;
}
#endif