API - SmartSlog KP Library
|
Contains functions for work with properties throw SS. More...
#include "ss_properties.h"
Macros | |
#define | _SS_PROPERTIES_C_ |
Functions | |
SSLOG_EXTERN int | sslog_ss_add_property (void *entity, property_t *prop, void *data) |
Sets property for entity in SS and localy by name. | |
SSLOG_EXTERN int | sslog_ss_set_property_with_value_struct (void *entity, prop_val_t *prop_val) |
Sets property for entity in SS and localy by name. | |
SSLOG_EXTERN prop_val_t * | sslog_ss_get_property (individual_t *ind, property_t *prop) |
Gets property for individual from SS by name. | |
SSLOG_EXTERN prop_val_t * | sslog_ss_get_property_by_name (individual_t *ind, char *propname) |
Gets property for individual from SS by name. | |
SSLOG_EXTERN prop_val_t * | sslog_ss_get_property_by_value (individual_t *ind, property_t *prop, void *data) |
Gets first founded property for individual from SS by name and value. | |
SSLOG_EXTERN list_t * | sslog_ss_get_property_max (individual_t *ind, property_t *prop, int max) |
Gets list of properties for individual from SS by name and value. | |
SSLOG_EXTERN bool | sslog_ss_exists_property_value (individual_t *ind, property_t *prop, void *data) |
Checks if individual has property with given value. | |
SSLOG_EXTERN int | sslog_ss_update_property (individual_t *ind, char *propname, void *old_data, void *new_data) |
Updates property of individual in SS and localy. | |
int | ss_update_properties (individual_t *individual, list_t *properties) |
SSLOG_EXTERN int | sslog_ss_remove_property_by_name_all (individual_t *ind, char *propname) |
Removes all properties with given name for individual in SS and localy. | |
SSLOG_EXTERN int | sslog_ss_remove_property_all (individual_t *ind, property_t *prop) |
Removes all properties with given structure for individual in SS and localy. | |
SSLOG_EXTERN int | sslog_ss_remove_property_by_value_struct (individual_t *ind, prop_val_t *prop_val) |
Removes all properties with given name and value for individual in SS and localy. |
Contains functions for work with properties throw SS.
Vanag Pavel vanag @cs. karel ia.r u
SmartSlog 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
Contains functions for work with properties throw SS. This file is part of SmartSlog KP library.
#define _SS_PROPERTIES_C_ |
int ss_update_properties | ( | individual_t * | individual, |
list_t * | properties | ||
) |
int sslog_ss_add_property | ( | void * | entity, |
property_t * | prop, | ||
void * | data | ||
) |
Sets property for entity in SS and localy by name.
Checks either entity is individual or class Checks entity correctness: cardinality, property values limitation and sets property for entity in SS and localy. Function sets global SmartSlog KP Library's errno.
[in] | void | *entity. Pointer to the individual struct. |
[in] | char | *propname. Pointer to the char array with name. |
[in] | void | *data. Pointer to the value. |
bool sslog_ss_exists_property_value | ( | individual_t * | ind, |
property_t * | prop, | ||
void * | data | ||
) |
Checks if individual has property with given value.
Checks if individual has property with given name and value. Function sets global SmartSlog KP Library's errno.
[in] | individual_t | * ind. Pointer to the individual struct. |
[in] | property_t | *prop. Pointer to the char array with name. |
[in] | void | *data. Pointer to the value. |
prop_val_t * sslog_ss_get_property | ( | individual_t * | ind, |
property_t * | prop | ||
) |
Gets property for individual from SS by name.
Gets the property from the SS by name and returns it. Function sets global SmartSlog KP Library's errno.
[in] | individual_t | * ind. Pointer to the individual struct. |
[in] | property_t | prop. Pointer to the char array with name. |
prop_val_t * sslog_ss_get_property_by_name | ( | individual_t * | ind, |
char * | propname | ||
) |
Gets property for individual from SS by name.
Gets the property from the SS by name and returns it. Function sets global SmartSlog KP Library's errno.
[in] | individual_t | * ind. Pointer to the individual struct. |
[in] | char | propname. Pointer to the char array with name. |
prop_val_t * sslog_ss_get_property_by_value | ( | individual_t * | ind, |
property_t * | prop, | ||
void * | data | ||
) |
Gets first founded property for individual from SS by name and value.
Gets the property from the SS by name and value and returns first founded. Function sets global SmartSlog KP Library's errno.
[in] | individual_t | * ind. Pointer to the individual struct. |
[in] | char | propname. Pointer to the char array with name. |
[in] | void | *data. Pointer to the value. |
Gets the property from the SS by name and value and returns first founded. Function sets global SmartSlog KP Library's errno.
[in] | individual_t | * ind. Pointer to the individual struct. |
[in] | property_t | prop. Pointer to the char array with name. |
[in] | void | *data. Pointer to the value. |
list_t * sslog_ss_get_property_max | ( | individual_t * | ind, |
property_t * | prop, | ||
int | max | ||
) |
Gets list of properties for individual from SS by name and value.
Gets the property from the SS by name and value and returns list of properties. Returns all founded but not more then max. Function sets global SmartSlog KP Library's errno.
[in] | individual_t | * ind. Pointer to the individual struct. |
[in] | property_t | prop. Pointer to the char array with name. |
[in] | int | max. Maximum returns properties. |
int sslog_ss_remove_property_all | ( | individual_t * | ind, |
property_t * | prop | ||
) |
Removes all properties with given structure for individual in SS and localy.
Finds properties with given structure for individual and removes it from SS. Then try find all local property with given structure and remove it. After all you have a struct without removed properties. Function sets global SmartSlog KP Library's errno.
[in] | individual_t | * ind. Pointer to the individual struct. |
[in] | property_t | *prop. Property structure with name of property. |
int sslog_ss_remove_property_by_name_all | ( | individual_t * | ind, |
char * | propname | ||
) |
Removes all properties with given name for individual in SS and localy.
Finds properties with given name for individual and removes it from SS. Then try find all local property with given name and remove it. After all you have a struct without removed properties. Function sets global SmartSlog KP Library's errno.
[in] | individual_t | * ind. Pointer to the individual struct. |
[in] | char | *propname. Char array with name of property. |
int sslog_ss_remove_property_by_value_struct | ( | individual_t * | ind, |
prop_val_t * | prop_val | ||
) |
Removes all properties with given name and value for individual in SS and localy.
Get name and value from value struct, finds properties with given name and value for individual and removes it from SS. Then try find all local property with given name and value and remove it. After all you have a struct without removed properties. Function sets global SmartSlog KP Library's errno.
[in] | individual_t | * ind. Pointer to the individual struct. |
[in] | prop_val_t | *prop_val. Pointer to the value struct. |
int sslog_ss_set_property_with_value_struct | ( | void * | entity, |
prop_val_t * | prop_val | ||
) |
Sets property for entity in SS and localy by name.
Checks either entity is individual or class Checks entity correctness: cardinality, property values limitation and sets property for entity in SS and localy. Function sets global SmartSlog KP Library's errno.
[in] | void | *entity. Pointer to the individual struct. |
[in] | prop_val_t | *prop_val. Pointer to the value struct. |
int sslog_ss_update_property | ( | individual_t * | ind, |
char * | propname, | ||
void * | old_data, | ||
void * | new_data | ||
) |
Updates property of individual in SS and localy.
Checks individual correctness: cardinality, prop- erty values limitation, and converts the individual’s given properties to triplets, which will be updated in SS, other properties not changed in SS. Same localy. Function sets global SmartSlog KP Library's errno.
[in] | individual_t | * ind. Pointer to the individual struct. |
[in] | char | *propname. Char array with name of property. |
[in] | void | *old_data. Pointer to the old value (DATATYPE or OBJECTTYPE). |
[in] | void | *new_data. Pointer to the new value (DATATYPE or OBJECTTYPE). |