API - SmartSlog KP Library
|
Interface for changes of the subscription. More...
#include "structures.h"
Go to the source code of this file.
Data Structures | |
struct | subscription_changes_data_s |
Struct contains information about subscription changes. More... |
Macros | |
#define | SSLOG_EXTERN |
Typedefs | |
typedef struct subscription_changes_data_s | subscription_changes_data_t |
Type that represets the subscription changes structure. |
Interface for changes of the subscription.
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
subscription_changes.h - Interface for changes of the subscription.
Subscription changes contains information about chnanges that were perfomed under subscribed data.
This file is part of SmartSlog KP Library.
Copyright (C) SmartSlog Team (Aleksandr A. Lomov). All rights reserved.
Mail-list: smart slog @cs.k arel ia.ru
#define SSLOG_EXTERN |
typedef struct subscription_changes_data_s subscription_changes_data_t |
Type that represets the subscription changes structure.
SSLOG_EXTERN list_t* sslog_sbcr_ch_get_individual_all | ( | subscription_changes_data_t * | changes | ) |
Gets all individual's UUID.
It make one list with all individual's UUIDs, that are were inserted, updated or removed.
You need to free the returned list, but without data relesed. Use #list_free_with_nodes with NULL as argument for free function.
Known bug: if under the individual was perfomed more that one actions, for example it was inserted and updated, then UUID will be inserted to list more that once. This will be fixed later.
This function sets a global error if it can't perfome operation, you can get an error code using get_error_code function.
[in] | changes | changes to get individuals UUIDs. |
SSLOG_EXTERN const list_t* sslog_sbcr_ch_get_individual_by_action | ( | subscription_changes_data_t * | changes, |
action_type | action | ||
) |
Gets all individual's UUID by action.
Individuals can be inserted, removed or updated. Updated means that some properties of the individual were changed.
Do not modify or free returned list.
This function sets a global error if it can't perfome operation, you can get an error code using get_error_code function.
[in] | changes | subscription chnages data structure. |
[in] | action | action that was perfom under individuals: insert, remove, update. |
SSLOG_EXTERN list_t* sslog_sbcr_ch_get_property_all | ( | subscription_changes_data_t * | changes | ) |
Gets all changed properties.
You need to free the returned list, but without data relesed. Use #list_free_with_nodes with NULL as argument for free function.
This function sets a global error if it can't perfome operation, you can get an error code using get_error_code function.
[in] | changes | changes to get properties. |
SSLOG_EXTERN const list_t* sslog_sbcr_ch_get_property_by_action | ( | subscription_changes_data_t * | changes, |
action_type | action | ||
) |
Gets all changed properties by action.
Do not modify or free returned list.
This function sets a global error if it can't perfome operation, you can get an error code using get_error_code function.
[in] | changes | changes to get properties. |
[in] | action | action that was perfom under properties: insert, remove, update. |
SSLOG_EXTERN list_t* sslog_sbcr_ch_get_property_by_uuid | ( | subscription_changes_data_t * | changes, |
const char * | uuid, | ||
action_type | action | ||
) |
Gets all changed properties by action for individual's UUID.
This function can returns list for updated individuals, for other returned list will be empty.
You need to free the returned list, but without data relesed. Use #list_free_with_nodes with NULL as argument for free function.
This function sets a global error if it can't perfome operation, you can get an error code using get_error_code function.
[in] | changes | changes to get properties. |
[in] | uuid | individual's UUID to get properties. |
[in] | action | action that was perfom under properties: insert, remove, update. |
SSLOG_EXTERN list_t* sslog_sbcr_ch_get_property_by_uuid_all | ( | subscription_changes_data_t * | changes, |
const char * | uuid | ||
) |
Gets all changed properties for individual's UUID.
This function can returns list for updated individuals, for other returned list will be empty.
You need to free the returned list, but without data relesed. Use #list_free_with_nodes with NULL as argument for free function.
This function sets a global error if it can't perfome operation, you can get an error code using get_error_code function.
[in] | changes | changes to get properties. |
[in] | uuid | individual's UUID to get properties. |
SSLOG_EXTERN int sslog_sbcr_ch_get_sequence_number | ( | subscription_changes_data_t * | changes | ) |
Gets a suquence number of the changes.
Changes are made based on data that were received with notification. This number is sequence of indication that was used to make changes. Firts changes are made while perfoming subscription operation, this changes has '1' as this number.
This function sets a global error if it can't perfome operation, you can get an error code using get_error_code function.
[in] | changes | subscription chnages data structure. |
SSLOG_EXTERN void sslog_sbcr_ch_print | ( | subscription_changes_data_t * | changes | ) |
Prints information about changes.
It prints sequence number and how manu individuals and properties were inserted, updated or removed.
[in] | changes | changes to print information about changes. |