1 #ifndef PERSISTENCE_CLIENT_LIBRARY_ACCESS_HELPER_H
2 #define PERSISTENCE_CLIENT_LIBRARY_ACCESS_HELPER_H
4 /******************************************************************************
7 * Company XS Embedded GmbH
8 *****************************************************************************/
9 /******************************************************************************
10 * This Source Code Form is subject to the terms of the
11 * Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed
12 * with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
13 ******************************************************************************/
15 * @file persistence_client_library_prct_access.h
16 * @ingroup Persistence client library
17 * @author Ingo Huerner
18 * @brief Header of persistence resource configuration config
19 * table access functions
23 #include "persistence_client_library_data_organization.h"
26 * @brief Create database search key and database location path
28 * @param dbContext the database context
29 * @param resource_id the resource id
30 * @param dbKey the array where the database key will be stored
31 * @param dbPath the array where the database location path will be stored
33 * @return 1 if shared database and 0 if local database or PersistenceStoragePolicy_LastEntry
34 * when no valid database has been found
36 int get_db_path_and_key(PersistenceInfo_s* dbContext, const char* resource_id, char dbKey[], char dbPath[]);
41 * @brief Create database search key and database location path
43 * @param dbContext the database context
44 * @param resource_id the resource id
45 * @param isFile identifier if this resource is a file (used for file/key creation if resource does not exist)
46 * @param dbKey the array where the database key will be stored
47 * @param dbPath the array where the database location path will be stored
49 * @return 0 or a negative value with one of the following errors: EPERS_NOKEYDATA or EPERS_NOPRCTABLE
51 int get_db_context(PersistenceInfo_s* dbContext, const char* resource_id, unsigned int isFile, char dbKey[], char dbPath[]);
56 * @brief get the resource configuration table gvbd database by id
58 * @return i Handle to the gvdb database table or negative value if no valid database has been found
60 int get_resource_cfg_table_by_idx(int i);
64 * @brief mark the resource configuration table as closed
68 void invalidate_resource_cfg_table(int i);
72 #endif /* PERSISTENCE_CLIENT_LIBRARY_ACCESS_HELPER_H */