Internalfunctions - SmartSlog KP Library
|
Functions for work with properties. More...
#include "structures.h"
#include "utils/list.h"
#include "utils/check_func.h"
#include "utils/kp_debug.h"
Go to the source code of this file.
Macros | |
#define | SSLOG_EXTERN |
Functions | |
SSLOG_EXTERN const property_t * | sslog_get_property_type (const class_t *ont_class, const char *propname) |
Get property struct by given name. | |
SSLOG_EXTERN int | sslog_add_property (void *entity, property_t *property, const void *value) |
Set new property for entity. | |
SSLOG_EXTERN int | sslog_add_property_with_value_struct (void *entity, const prop_val_t *prop_val) |
SSLOG_EXTERN const prop_val_t * | sslog_get_property (individual_t *ind, const char *propname) |
Gets first found property by name. | |
SSLOG_EXTERN const prop_val_t * | sslog_get_property_by_value (individual_t *ind, const char *propname, void *data) |
Get property value with given data. | |
SSLOG_EXTERN list_t * | sslog_get_property_all (individual_t *ind, const char *propname) |
Get all properties with given name. | |
SSLOG_EXTERN int | sslog_update_property (void *entity, const char *propname, void *new_data) |
Update property with given name. | |
SSLOG_EXTERN int | sslog_update_property_with_value (void *entity, const char *propname, const void *old_data, void *new_data) |
Update property using old value. | |
SSLOG_EXTERN int | sslog_update_value_struct (prop_val_t *prop_value, void *new_data) |
Update property value. | |
SSLOG_EXTERN int | sslog_remove_property (individual_t *ind, property_t *prop) |
SSLOG_EXTERN int | sslog_remove_property_with_value (individual_t *ind, property_t *prop, void *data) |
Unset property value. | |
SSLOG_EXTERN bool | sslog_is_object_property (property_t *prop) |
bool | is_prop_values_equal (prop_val_t *a, prop_val_t *b) |
Checks equality of given properties values. | |
bool | is_prop_names_equal (prop_val_t *a, prop_val_t *b) |
Checks equality of properties names of the given properties values. |
Functions for work with properties.
Alaksandr A. Lomov lomov @cs. karel ia.r u
PetrSU KP library is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
SmartSlog KP Library 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 General Public License for more details.
You should have received a copy of the GNU General Public License along with SmartSlog KP Library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Described functions for work with properties. This file is part of SmartSlog KP Library.
#define SSLOG_EXTERN |
bool is_prop_names_equal | ( | prop_val_t * | a, |
prop_val_t * | b | ||
) |
Checks equality of properties names of the given properties values.
It checks names, about field and types.
a | one property value. |
b | another property value. |
bool is_prop_values_equal | ( | prop_val_t * | a, |
prop_val_t * | b | ||
) |
Checks equality of given properties values.
It checks names, about field, types and values.
a | one property value. |
b | another property value. |
SSLOG_EXTERN int sslog_add_property | ( | void * | entity, |
property_t * | prop, | ||
const void * | value | ||
) |
Set new property for entity.
Sets property for one individual or whole class (not implemented yet). Create new value from given if setting data property, or assigns given value(individual) to property.
ind | individual or class. |
property | property. |
value | value to set. |
SSLOG_EXTERN int sslog_add_property_with_value_struct | ( | void * | entity, |
const prop_val_t * | prop_val | ||
) |
SSLOG_EXTERN const prop_val_t* sslog_get_property | ( | individual_t * | ind, |
const char * | propname | ||
) |
Gets first found property by name.
ind | individual. |
propname | name of property. |
SSLOG_EXTERN list_t* sslog_get_property_all | ( | individual_t * | ind, |
const char * | propname | ||
) |
Get all properties with given name.
ind | individual. |
propname | name of property. |
SSLOG_EXTERN const prop_val_t* sslog_get_property_by_value | ( | individual_t * | ind, |
const char * | propname, | ||
void * | data | ||
) |
Get property value with given data.
ind | individual. |
propname | name of property. |
data | value of property. |
SSLOG_EXTERN const property_t* sslog_get_property_type | ( | const class_t * | ont_class, |
const char * | propname | ||
) |
Get property struct by given name.
ont_class | class. |
propname | name of property. |
SSLOG_EXTERN bool sslog_is_object_property | ( | property_t * | prop | ) |
SSLOG_EXTERN int sslog_remove_property | ( | individual_t * | ind, |
property_t * | prop | ||
) |
SSLOG_EXTERN int sslog_remove_property_with_value | ( | individual_t * | ind, |
property_t * | prop, | ||
void * | data | ||
) |
Unset property value.
ind | individual. |
propname | name of property. |
data | value of property. |
SSLOG_EXTERN int sslog_update_property | ( | void * | entity, |
const char * | propname, | ||
void * | new_data | ||
) |
Update property with given name.
ind | individual. |
propname | name of property. |
new_data | value of property. |
SSLOG_EXTERN int sslog_update_property_with_value | ( | void * | entity, |
const char * | propname, | ||
const void * | old_data, | ||
void * | new_data | ||
) |
Update property using old value.
ind | individual. |
propname | name of property. |
old_data | old value of property. |
new_data | new value of property. |
SSLOG_EXTERN int sslog_update_value_struct | ( | prop_val_t * | prop_value, |
void * | new_data | ||
) |
Update property value.
prop_value | value of property. |
new_data | new value of property. |