RTEMS 6.1-rc5
Loading...
Searching...
No Matches
rtl-obj-comp.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 */
42#if !defined (_RTEMS_RTL_OBJ_COMP_H_)
43#define _RTEMS_RTL_OBJ_COMP_H_
44
46
47#ifdef __cplusplus
48extern "C" {
49#endif /* __cplusplus */
50
54#define RTEMS_RTL_DECOMP_INPUT_SIZE (256)
55
59#define RTEMS_RTL_COMP_NONE (0)
60#define RTEMS_RTL_COMP_LZ77 (1)
61
65typedef struct rtems_rtl_obj_cpmp
66{
69 int fd;
71 off_t offset;
72 size_t size;
73 size_t level;
74 uint8_t* buffer;
75 uint32_t read;
77
81static inline uint32_t rtems_rtl_obj_comp_input (rtems_rtl_obj_comp* comp)
82{
83 return comp->read;
84}
85
95 size_t size);
96
103
114 rtems_rtl_obj_cache* cache,
115 int fd,
116 int compression,
117 off_t offset);
118
134 void* buffer,
135 size_t length);
136
137#ifdef __cplusplus
138}
139#endif /* __cplusplus */
140
141#endif
RTEMS Run-Time Linker Object File cache buffers a section of the object file in a buffer to localise ...
bool rtems_rtl_obj_comp_read(rtems_rtl_obj_comp *comp, void *buffer, size_t length)
Definition: rtl-obj-comp.c:105
void rtems_rtl_obj_comp_set(rtems_rtl_obj_comp *comp, rtems_rtl_obj_cache *cache, int fd, int compression, off_t offset)
Definition: rtl-obj-comp.c:90
void rtems_rtl_obj_comp_close(rtems_rtl_obj_comp *comp)
Definition: rtl-obj-comp.c:77
bool rtems_rtl_obj_comp_open(rtems_rtl_obj_comp *comp, size_t size)
Definition: rtl-obj-comp.c:57
struct rtems_rtl_obj_cpmp rtems_rtl_obj_comp
Definition: rtl-obj-cache.h:73
Definition: rtl-obj-comp.h:66
size_t size
Definition: rtl-obj-comp.h:72
int compression
Definition: rtl-obj-comp.h:70
rtems_rtl_obj_cache * cache
Definition: rtl-obj-comp.h:67
uint8_t * buffer
Definition: rtl-obj-comp.h:74
int fd
Definition: rtl-obj-comp.h:69
uint32_t read
Definition: rtl-obj-comp.h:75
size_t level
Definition: rtl-obj-comp.h:73
off_t offset
Definition: rtl-obj-comp.h:71