Debian Codegraph @

libfdata/libfdata_cache.c

raw symbols SCIP
1 /*
2 * Cache 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 #include <common.h>
23 #include <types.h>
24
25 #include "libfdata_cache.h"
26 #include "libfdata_libcerror.h"
27 #include "libfdata_libfcache.h"
28
29 #if !defined( HAVE_LOCAL_LIBFDATA )
30
31 /* Creates a cache
32 * Make sure the value cache is referencing, is set to NULL
33 * Returns 1 if successful or -1 on error
34 */
35 int libfdata_cache_initialize(
36 libfdata_cache_t **cache,
37 int maximum_cache_entries,
38 libcerror_error_t **error )
39 {
40 return( libfcache_cache_initialize(
41 (libfcache_cache_t **) cache,
42 maximum_cache_entries,
43 error ) );
44 }
45
46 /* Frees a cache
47 * Returns 1 if successful or -1 on error
48 */
49 int libfdata_cache_free(
50 libfdata_cache_t **cache,
51 libcerror_error_t **error )
52 {
53 return( libfcache_cache_free(
54 (libfcache_cache_t **) cache,
55 error ) );
56 }
57
58 #endif /* !defined( HAVE_LOCAL_LIBFDATA ) */
59