Debian Codegraph @

libfcache/libfcache_cache_value.h

raw symbols SCIP
1 /*
2 * Cache value functions
3 *
4 * Copyright (C) 2010-2024, Joachim Metz <[email protected]>
5 *
6 * Refer to AUTHORS for acknowledgements.
7 *
8 * This program is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU Lesser General Public License as published by
10 * the Free Software Foundation, either version 3 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public License
19 * along with this program. If not, see <https://www.gnu.org/licenses/>.
20 */
21
22 #if !defined( _LIBFCACHE_CACHE_VALUE_H )
23 #define _LIBFCACHE_CACHE_VALUE_H
24
25 #include <common.h>
26 #include <types.h>
27
28 #include "libfcache_extern.h"
29 #include "libfcache_libcerror.h"
30 #include "libfcache_types.h"
31
32 #if defined( __cplusplus )
33 extern "C" {
34 #endif
35
36 typedef struct libfcache_internal_cache_value libfcache_internal_cache_value_t;
37
38 struct libfcache_internal_cache_value
39 {
40 /* The cache index
41 */
42 int cache_index;
43
44 /* The file index
45 */
46 int file_index;
47
48 /* The offset
49 */
50 off64_t offset;
51
52 /* The timestamp
53 */
54 int64_t timestamp;
55
56 /* The value
57 */
58 intptr_t *value;
59
60 /* The value free function
61 */
62 int (*value_free_function)(
63 intptr_t **value,
64 libcerror_error_t **error );
65
66 /* The flags
67 */
68 uint8_t flags;
69 };
70
71 int libfcache_cache_value_initialize(
72 libfcache_cache_value_t **cache_value,
73 libcerror_error_t **error );
74
75 LIBFCACHE_EXTERN \
76 int libfcache_cache_value_free(
77 libfcache_cache_value_t **cache_value,
78 libcerror_error_t **error );
79
80 LIBFCACHE_EXTERN \
81 int libfcache_cache_value_clear(
82 libfcache_cache_value_t *cache_value,
83 libcerror_error_t **error );
84
85 LIBFCACHE_EXTERN \
86 int libfcache_cache_value_get_identifier(
87 libfcache_cache_value_t *cache_value,
88 int *file_index,
89 off64_t *offset,
90 int64_t *timestamp,
91 libcerror_error_t **error );
92
93 int libfcache_cache_value_get_cache_index(
94 libfcache_cache_value_t *cache_value,
95 int *cache_index,
96 libcerror_error_t **error );
97
98 LIBFCACHE_EXTERN \
99 int libfcache_cache_value_set_identifier(
100 libfcache_cache_value_t *cache_value,
101 int file_index,
102 off64_t offset,
103 int64_t timestamp,
104 libcerror_error_t **error );
105
106 int libfcache_cache_value_set_cache_index(
107 libfcache_cache_value_t *cache_value,
108 int cache_index,
109 libcerror_error_t **error );
110
111 LIBFCACHE_EXTERN \
112 int libfcache_cache_value_get_value(
113 libfcache_cache_value_t *cache_value,
114 intptr_t **value,
115 libcerror_error_t **error );
116
117 LIBFCACHE_EXTERN \
118 int libfcache_cache_value_set_value(
119 libfcache_cache_value_t *cache_value,
120 intptr_t *value,
121 int (*value_free_function)(
122 intptr_t **value,
123 libcerror_error_t **error ),
124 uint8_t flags,
125 libcerror_error_t **error );
126
127 #if defined( __cplusplus )
128 }
129 #endif
130
131 #endif /* !defined( _LIBFCACHE_CACHE_VALUE_H ) */
132