RTEMS  5.1
rtl-obj-cache.h
Go to the documentation of this file.
1 /*
2  * COPYRIGHT (c) 2012, 2018 Chris Johns <chrisj@rtems.org>
3  *
4  * The license and distribution terms for this file may be
5  * found in the file LICENSE in this distribution or at
6  * http://www.rtems.org/license/LICENSE.
7  */
38 #if !defined (_RTEMS_RTL_OBJ_CACHE_H_)
39 #define _RTEMS_RTL_OBJ_CACHE_H_
40 
41 #include <fcntl.h>
42 #include <stdbool.h>
43 #include <stdint.h>
44 #include <stdlib.h>
45 
46 #ifdef __cplusplus
47 extern "C" {
48 #endif /* __cplusplus */
49 
53 typedef struct rtems_rtl_obj_cache
54 {
55  int fd;
56  size_t file_size;
57  off_t offset;
58  size_t size;
59  size_t level;
61  uint8_t* buffer;
63 
74 
81 
88 
106  int fd,
107  off_t offset,
108  void** buffer,
109  size_t* length);
110 
123  int fd,
124  off_t offset,
125  void* buffer,
126  size_t length);
127 
128 #ifdef __cplusplus
129 }
130 #endif /* __cplusplus */
131 
132 #endif
struct rtems_rtl_obj_cache rtems_rtl_obj_cache
size_t file_size
Definition: rtl-obj-cache.h:56
int fd
Definition: rtl-obj-cache.h:55
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:74
Definition: rtl-obj-cache.h:53
size_t level
Definition: rtl-obj-cache.h:59
uint8_t * buffer
Definition: rtl-obj-cache.h:61
void rtems_rtl_obj_cache_close(rtems_rtl_obj_cache *cache)
Definition: rtl-obj-cache.c:51
void rtems_rtl_obj_cache_flush(rtems_rtl_obj_cache *cache)
Definition: rtl-obj-cache.c:63
size_t size
Definition: rtl-obj-cache.h:58
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:242
unsigned size
Definition: tte.h:74
off_t offset
Definition: rtl-obj-cache.h:57
bool rtems_rtl_obj_cache_open(rtems_rtl_obj_cache *cache, size_t size)
Definition: rtl-obj-cache.c:34