ugBASIC 1.18
An isomorphic BASIC language compiler for retrocomputers
Loading...
Searching...
No Matches
rle.h
Go to the documentation of this file.
1#ifndef __RLE__
2#define __RLE__
3
4/*****************************************************************************
5 * ugBASIC - an isomorphic BASIC language compiler for retrocomputers *
6 *****************************************************************************
7 * Copyright 2021-2026 Marco Spedaletti (asimov@mclink.it)
8 *
9 * Licensed under the Apache License, Version 2.0 (the "License");
10 * you may not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
12 *
13 * http://www.apache.org/licenses/LICENSE-2.0
14 *
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
20 *----------------------------------------------------------------------------
21 * Concesso in licenza secondo i termini della Licenza Apache, versione 2.0
22 * (la "Licenza"); è proibito usare questo file se non in conformità alla
23 * Licenza. Una copia della Licenza è disponibile all'indirizzo:
24 *
25 * http://www.apache.org/licenses/LICENSE-2.0
26 *
27 * Se non richiesto dalla legislazione vigente o concordato per iscritto,
28 * il software distribuito nei termini della Licenza è distribuito
29 * "COSÌ COM'È", SENZA GARANZIE O CONDIZIONI DI ALCUN TIPO, esplicite o
30 * implicite. Consultare la Licenza per il testo specifico che regola le
31 * autorizzazioni e le limitazioni previste dalla medesima.
32 ****************************************************************************/
33
34/****************************************************************************
35 * INCLUDE SECTION
36 ****************************************************************************/
37
38#include <stdio.h>
39#include <string.h>
40#include <stdlib.h>
41#include <limits.h>
42#include <unistd.h>
43
44/****************************************************************************
45 * DECLARATIONS AND DEFINITIONS SECTION
46 ****************************************************************************/
47
66
72
73typedef unsigned char MemoryBlock;
74
76MemoryBlock * rle_compress( RLECompressor * _rle, MemoryBlock * _input, int _size, int * _output_size );
77MemoryBlock * rle_uncompress( RLECompressor * _rle, MemoryBlock * _input, int _size, int * _output_size );
78void rle_free( RLECompressor * _rle );
79
80#endif
unsigned char MemoryBlock
Definition msc1.h:90
MemoryBlock * rle_compress(RLECompressor *_rle, MemoryBlock *_input, int _size, int *_output_size)
Definition rle.c:88
enum _RLECompressorState RLECompressorState
RLECompressor * rle_create()
Definition rle.c:41
struct _RLECompressor RLECompressor
_RLECompressorState
Definition rle.h:48
@ RLE_CS_COUNTING
Definition rle.h:54
@ RLE_CS_END_OF_BLOCK
Definition rle.h:63
@ RLE_CS_EMIT
Definition rle.h:57
@ RLE_CS_EMIT_CONTINUE
Definition rle.h:60
@ RLE_CS_READY
Definition rle.h:51
MemoryBlock * rle_uncompress(RLECompressor *_rle, MemoryBlock *_input, int _size, int *_output_size)
Definition rle.c:230
void rle_free(RLECompressor *_rle)
Definition rle.c:224
RLECompressorState state
Definition rle.h:69