ugBASIC 1.18
An isomorphic BASIC language compiler for retrocomputers
Loading...
Searching...
No Matches
msc1.h File Reference
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <limits.h>
#include <unistd.h>

Go to the source code of this file.

Data Structures

struct  _MSC1Compressor

Typedefs

typedef enum _MSC1CompressorState MSC1CompressorState
typedef struct _MSC1Compressor MSC1Compressor
typedef unsigned char MemoryBlock

Enumerations

enum  _MSC1CompressorState {
  MSC1_CS_READY = 0 , MSC1_CS_STORE = 1 , MSC1_CS_MOVE1 = 2 , MSC1_CS_LITERAL = 3 ,
  MSC1_CS_LITERAL_DUPE = 4 , MSC1_CS_MOVE4 = 5 , MSC1_CS_DUPE_STORE = 6 , MSC1_CS_DUPE_MOVE4 = 7 ,
  MSC1_CS_DUPES = 8 , MSC1_CS_END_OF_BLOCK = 9
}

Functions

MSC1Compressormsc1_create (int _maximum_repeated_sequences)
MemoryBlockmsc1_compress (MSC1Compressor *_msc1, MemoryBlock *_input, int _size, int *_output_size)
MemoryBlockmsc1_uncompress (MSC1Compressor *_msc1, MemoryBlock *_input, int _size, int *_output_size)
void msc1_free (MSC1Compressor *_msc1)

Typedef Documentation

◆ MemoryBlock

typedef unsigned char MemoryBlock

Definition at line 90 of file msc1.h.

◆ MSC1Compressor

◆ MSC1CompressorState

Enumeration Type Documentation

◆ _MSC1CompressorState

Enumerator
MSC1_CS_READY 

Ready to compress

MSC1_CS_STORE 

Store literal

MSC1_CS_MOVE1 

Move 1 forward

MSC1_CS_LITERAL 

Emit literal

MSC1_CS_LITERAL_DUPE 

Emit literal dupe

MSC1_CS_MOVE4 

Move forward by 4

MSC1_CS_DUPE_STORE 

Store dupe

MSC1_CS_DUPE_MOVE4 

Move forward by 4

MSC1_CS_DUPES 

Emit dupes

MSC1_CS_END_OF_BLOCK 

End of block

Definition at line 48 of file msc1.h.

Function Documentation

◆ msc1_compress()

MemoryBlock * msc1_compress ( MSC1Compressor * _msc1,
MemoryBlock * _input,
int _size,
int * _output_size )

Definition at line 381 of file msc1.c.

◆ msc1_create()

MSC1Compressor * msc1_create ( int _maximum_repeated_sequences)

Definition at line 300 of file msc1.c.

◆ msc1_free()

void msc1_free ( MSC1Compressor * _msc1)

Definition at line 740 of file msc1.c.

◆ msc1_uncompress()

MemoryBlock * msc1_uncompress ( MSC1Compressor * _msc1,
MemoryBlock * _input,
int _size,
int * _output_size )

Definition at line 746 of file msc1.c.