RTEMS: cpukit/include/rtems/rtl/rtl-obj-cache.h Source File

| RTEMS 5.4-rc2

Loading...
Searching...
No Matches
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
47extern "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;
62} rtems_rtl_obj_cache;
63
73bool rtems_rtl_obj_cache_open (rtems_rtl_obj_cache* cache, size_t size);
74
80void rtems_rtl_obj_cache_close (rtems_rtl_obj_cache* cache);
81
87void rtems_rtl_obj_cache_flush (rtems_rtl_obj_cache* cache);
88
105bool rtems_rtl_obj_cache_read (rtems_rtl_obj_cache* cache,
106 int fd,
107 off_t offset,
108 void** buffer,
109 size_t* length);
110
122bool rtems_rtl_obj_cache_read_byval (rtems_rtl_obj_cache* cache,
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
rtems_rtl_obj_cache_flush
void rtems_rtl_obj_cache_flush(rtems_rtl_obj_cache *cache)
Definition: rtl-obj-cache.c:63
rtems_rtl_obj_cache_open
bool rtems_rtl_obj_cache_open(rtems_rtl_obj_cache *cache, size_t size)
Definition: rtl-obj-cache.c:34
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:242
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:74
rtems_rtl_obj_cache_close
void rtems_rtl_obj_cache_close(rtems_rtl_obj_cache *cache)
Definition: rtl-obj-cache.c:51
rtems_rtl_obj_cache
Definition: rtl-obj-cache.h:54
rtems_rtl_obj_cache::file_size
size_t file_size
Definition: rtl-obj-cache.h:56
rtems_rtl_obj_cache::buffer
uint8_t * buffer
Definition: rtl-obj-cache.h:61
rtems_rtl_obj_cache::fd
int fd
Definition: rtl-obj-cache.h:55
rtems_rtl_obj_cache::size
size_t size
Definition: rtl-obj-cache.h:58
rtems_rtl_obj_cache::offset
off_t offset
Definition: rtl-obj-cache.h:57
rtems_rtl_obj_cache::level
size_t level
Definition: rtl-obj-cache.h:59