summaryrefslogtreecommitdiff
path: root/src/persistence_client_library_handle.h
blob: 4d1a234d819bb36bf31406f4a2e8aa117bfabccf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#ifndef PERSISTENCE_CLIENT_LIBRARY_HANDLE_H
#define PERSISTENCE_CLIENT_LIBRARY_HANDLE_H

/******************************************************************************
 * Project         Persistency
 * (c) copyright   2012
 * Company         XS Embedded GmbH
 *****************************************************************************/
/******************************************************************************
 * This Source Code Form is subject to the terms of the
 * Mozilla Public License, v. 2.0. If a  copy of the MPL was not distributed
 * with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
******************************************************************************/
 /**
 * @file           persistence_client_library_handle.h
 * @ingroup        Persistence client library
 * @author         Ingo Huerner
 * @brief          Header of the persistence client library handle.
 *                 Library provides an API to access persistent data
 * @see            
 */

#include "../include_protected/persistence_client_library.h"

/// handle structure definition
typedef struct _PersistenceHandle_s
{
   PersistenceInfo_s info;    /// persistence info
   char dbPath[DbPathMaxLen]; /// path to the database
   char dbKey[DbKeyMaxLen];   /// database key
}
PersistenceHandle_s;


/// persistence handle array
extern PersistenceHandle_s gHandleArray[MaxPersHandle];


/// open file descriptor handle array
extern int gOpenFdArray[MaxPersHandle];


/**
 * @brief get persistence handle
 *
 * @return a new handle or 0 if an error occured
 */
int get_persistence_handle_idx();


/**
 * @brief close persistence handle
 *
 * @param the handle to close
 */
void set_persistence_handle_close_idx(int handle);




#endif /* PERSISTENCY_CLIENT_LIBRARY_HANDLE_H */