#include <stdlib.h>
#include <stdint.h>
#include <stdbool.h>
#include <string.h>
Go to the source code of this file.
|
static int64_t | lzss_position (LZSS *self) |
|
static int | lzss_mask (LZSS *self) |
|
static int | lzss_size (LZSS *self) |
|
static uint8_t * | lzss_window_pointer (LZSS *self) |
|
static int | lzss_offset_for_position (LZSS *self, int64_t pos) |
|
static uint8_t * | lzss_window_pointer_for_position (LZSS *self, int64_t pos) |
|
static int | lzss_current_window_offset (LZSS *self) |
|
static uint8_t * | lzss_current_window_pointer (LZSS *self) |
|
static int64_t | lzss_next_window_edge_after_position (LZSS *self, int64_t pos) |
|
static int64_t | lzss_next_window_edge (LZSS *self) |
|
static uint8_t | lzss_get_byte_from_window (LZSS *self, int64_t pos) |
|
static void | lzss_emit_literal (LZSS *self, uint8_t literal) |
|
static void | lzss_emit_match (LZSS *self, int offset, int length) |
|
static void | lzss_copy_bytes_from_window (LZSS *self, uint8_t *buffer, int64_t startpos, int length) |
|
static bool | lzss_initialize (LZSS *self, int windowsize) |
|
static void | lzss_cleanup (LZSS *self) |
|
static void lzss_cleanup |
( |
LZSS * |
self) | |
|
|
inlinestatic |
static void lzss_copy_bytes_from_window |
( |
LZSS * |
self, |
|
|
uint8_t * |
buffer, |
|
|
int64_t |
startpos, |
|
|
int |
length |
|
) |
| |
|
inlinestatic |
Definition at line 61 of file lzss.h.
63 int firstpart =
lzss_size(
self) - windowoffs;
64 if (length <= firstpart) {
71 memcpy(buffer + firstpart, &self->
window[0], length - firstpart);
static int lzss_current_window_offset |
( |
LZSS * |
self) | |
|
|
inlinestatic |
static uint8_t* lzss_current_window_pointer |
( |
LZSS * |
self) | |
|
|
inlinestatic |
static void lzss_emit_literal |
( |
LZSS * |
self, |
|
|
uint8_t |
literal |
|
) |
| |
|
inlinestatic |
static void lzss_emit_match |
( |
LZSS * |
self, |
|
|
int |
offset, |
|
|
int |
length |
|
) |
| |
|
inlinestatic |
Definition at line 52 of file lzss.h.
55 for (i = 0; i < length; i++) {
56 self->window[(windowoffs + i) &
lzss_mask(
self)] =
self->window[(windowoffs + i - offset) &
lzss_mask(
self)];
58 self->position += length;
static uint8_t lzss_get_byte_from_window |
( |
LZSS * |
self, |
|
|
int64_t |
pos |
|
) |
| |
|
inlinestatic |
static bool lzss_initialize |
( |
LZSS * |
self, |
|
|
int |
windowsize |
|
) |
| |
|
inlinestatic |
Definition at line 75 of file lzss.h.
76 self->window = malloc(windowsize);
80 self->mask = windowsize - 1;
static int lzss_mask |
( |
LZSS * |
self) | |
|
|
inlinestatic |
Definition at line 26 of file lzss.h.
26 {
return self->mask; }
static int64_t lzss_next_window_edge |
( |
LZSS * |
self) | |
|
|
inlinestatic |
static int64_t lzss_next_window_edge_after_position |
( |
LZSS * |
self, |
|
|
int64_t |
pos |
|
) |
| |
|
inlinestatic |
static int lzss_offset_for_position |
( |
LZSS * |
self, |
|
|
int64_t |
pos |
|
) |
| |
|
inlinestatic |
Definition at line 32 of file lzss.h.
32 {
return (
int)(pos &
self->mask); }
static int64_t lzss_position |
( |
LZSS * |
self) | |
|
|
inlinestatic |
Definition at line 24 of file lzss.h.
24 {
return self->position; }
static int lzss_size |
( |
LZSS * |
self) | |
|
|
inlinestatic |
Definition at line 28 of file lzss.h.
28 {
return self->mask + 1; }
static uint8_t* lzss_window_pointer |
( |
LZSS * |
self) | |
|
|
inlinestatic |
Definition at line 30 of file lzss.h.
30 {
return self->window; }
static uint8_t* lzss_window_pointer_for_position |
( |
LZSS * |
self, |
|
|
int64_t |
pos |
|
) |
| |
|
inlinestatic |