RTEMS
6.3
Toggle main menu visibility
Loading...
Searching...
No Matches
cpukit
include
rtems
rtl
rtl-obj-cache.h
Go to the documentation of this file.
1
/* SPDX-License-Identifier: BSD-2-Clause */
2
3
/*
4
* COPYRIGHT (c) 2012, 2018 Chris Johns <chrisj@rtems.org>
5
*
6
* Redistribution and use in source and binary forms, with or without
7
* modification, are permitted provided that the following conditions
8
* are met:
9
* 1. Redistributions of source code must retain the above copyright
10
* notice, this list of conditions and the following disclaimer.
11
* 2. Redistributions in binary form must reproduce the above copyright
12
* notice, this list of conditions and the following disclaimer in the
13
* documentation and/or other materials provided with the distribution.
14
*
15
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
16
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
19
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
22
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
23
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
24
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25
* POSSIBILITY OF SUCH DAMAGE.
26
*/
56
57
#if !defined (_RTEMS_RTL_OBJ_CACHE_H_)
58
#define _RTEMS_RTL_OBJ_CACHE_H_
59
60
#include <fcntl.h>
61
#include <stdbool.h>
62
#include <stdint.h>
63
#include <stdlib.h>
64
65
#ifdef __cplusplus
66
extern
"C"
{
67
#endif
/* __cplusplus */
68
72
typedef
struct
rtems_rtl_obj_cache
73
{
74
int
fd
;
75
size_t
file_size
;
76
off_t
offset
;
77
size_t
size
;
78
size_t
level
;
80
uint8_t*
buffer
;
81
}
rtems_rtl_obj_cache
;
82
92
bool
rtems_rtl_obj_cache_open
(
rtems_rtl_obj_cache
* cache,
size_t
size);
93
99
void
rtems_rtl_obj_cache_close
(
rtems_rtl_obj_cache
* cache);
100
106
void
rtems_rtl_obj_cache_flush
(
rtems_rtl_obj_cache
* cache);
107
124
bool
rtems_rtl_obj_cache_read
(
rtems_rtl_obj_cache
* cache,
125
int
fd,
126
off_t offset,
127
void
** buffer,
128
size_t
* length);
129
141
bool
rtems_rtl_obj_cache_read_byval
(
rtems_rtl_obj_cache
* cache,
142
int
fd,
143
off_t offset,
144
void
* buffer,
145
size_t
length);
146
147
#ifdef __cplusplus
148
}
149
#endif
/* __cplusplus */
150
151
#endif
rtems_rtl_obj_cache_flush
void rtems_rtl_obj_cache_flush(rtems_rtl_obj_cache *cache)
Definition
rtl-obj-cache.c:83
rtems_rtl_obj_cache_open
bool rtems_rtl_obj_cache_open(rtems_rtl_obj_cache *cache, size_t size)
Definition
rtl-obj-cache.c:54
rtems_rtl_obj_cache_read_byval
bool rtems_rtl_obj_cache_read_byval(rtems_rtl_obj_cache *cache, int fd, off_t offset, void *buffer, size_t length)
Definition
rtl-obj-cache.c:262
rtems_rtl_obj_cache_read
bool rtems_rtl_obj_cache_read(rtems_rtl_obj_cache *cache, int fd, off_t offset, void **buffer, size_t *length)
Definition
rtl-obj-cache.c:94
rtems_rtl_obj_cache_close
void rtems_rtl_obj_cache_close(rtems_rtl_obj_cache *cache)
Definition
rtl-obj-cache.c:71
rtems_rtl_obj_cache
Definition
rtl-obj-cache.h:73
rtems_rtl_obj_cache::file_size
size_t file_size
Definition
rtl-obj-cache.h:75
rtems_rtl_obj_cache::buffer
uint8_t * buffer
Definition
rtl-obj-cache.h:80
rtems_rtl_obj_cache::fd
int fd
Definition
rtl-obj-cache.h:74
rtems_rtl_obj_cache::size
size_t size
Definition
rtl-obj-cache.h:77
rtems_rtl_obj_cache::offset
off_t offset
Definition
rtl-obj-cache.h:76
rtems_rtl_obj_cache::level
size_t level
Definition
rtl-obj-cache.h:78
Generated by
1.18.0