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 "../include_protected/persistence_client_library_data_organization.h"
24 #include "../include_protected/persistence_client_library_rc_table.h"
29 * @brief Create database search key and database location path
31 * @param dbContext the database context
32 * @param resource_id the resource id
33 * @param user_no user identification
34 * @param seat_no seat identifier
35 * @param isFile identifier if this resource is a file
36 * @param dbKey the array where the database key will be stored
37 * @param dbPath the array where the database location path will be stored
38 * @param cached_resource flag to identify if the resource is cached (value 1)or write through (value 0)
40 * @return 1 if shared database and 0 if local database or PersistenceStoragePolicy_LastEntry
41 * when no valid database has been found
43 int get_db_path_and_key(PersistenceInfo_s* dbContext, const char* resource_id, unsigned int isFile, char dbKey[], char dbPath[]);
48 * Create database search key and database location path
50 * @param dbContext the database context
51 * @param resource_id the resource id
52 * @param user_no user identification
53 * @param seat_no seat identifier
54 * @param isFile identifier if this resource is a file
55 * @param dbKey the array where the database key will be stored
56 * @param dbPath the array where the database location path will be stored
57 * @param cached_resource flag to identify if the resource is cached (value 1)or write through (value 0)
59 * @return 0 or a negative value with one of the following errors: EPERS_NOKEYDATA or EPERS_NOPRCTABLE
61 int get_db_context(PersistenceInfo_s* dbContext, const char* resource_id, unsigned int isFile, char dbKey[], char dbPath[]);
66 * @brief get the resource configuration table gvbd database by id
68 * @return pointer to the gvdb database table or NULL if no valid database has been found
70 itzam_btree* get_resource_cfg_table_by_idx(int i);
74 #endif /* PERSISTENCE_CLIENT_LIBRARY_ACCESS_HELPER_H */