Context algorithm
Semi-predictive context algorithm implementation
 All Data Structures Files Functions Variables Typedefs Macros Pages
alpha.h File Reference
#include "types.h"

Go to the source code of this file.

Macros

#define GETINDEX(N)   (N == textlen ? alphasize : alphaindex[text[N]])
 Returns the index of the Nth character in the input text. More...
 
#define GETINDEX3(N)   (N == textlen ? alphasize : alphaindex[text2[N]])
 
#define GETINDEX2(N)   (alphaindex[(*node->text)[N]])
 Returns the index of the Nth character in the input text. More...
 

Functions

void buildAlpha (Uchar *text, const Uint textlen)
 Reads input text and initializes alphabet variables. More...
 

Variables

Uint alphasize
 Alphabet size. More...
 
Uchar characters [UCHAR_MAX+1]
 Characters in text in alphabetical order. More...
 
Uint alphaindex [UCHAR_MAX+1]
 Index of each alphabet character. More...
 

Macro Definition Documentation

#define GETINDEX (   N)    (N == textlen ? alphasize : alphaindex[text[N]])

Returns the index of the Nth character in the input text.

Used in encoder.

Parameters
[in]Nposition of the character in the input text.
Returns
The index number of the input character.

Definition at line 38 of file alpha.h.

#define GETINDEX2 (   N)    (alphaindex[(*node->text)[N]])

Returns the index of the Nth character in the input text.

Used in decoder.

Parameters
[in]Nposition of the character in the input text.
Returns
The index number of the input character.

Definition at line 47 of file alpha.h.

#define GETINDEX3 (   N)    (N == textlen ? alphasize : alphaindex[text2[N]])

Definition at line 40 of file alpha.h.

Function Documentation

void buildAlpha ( Uchar text,
const Uint  textlen 
)

Reads input text and initializes alphabet variables.

Definition at line 21 of file alpha.c.

Variable Documentation

Uint alphaindex[UCHAR_MAX+1]

Index of each alphabet character.

Definition at line 31 of file alpha.h.

Uint alphasize

Alphabet size.

Definition at line 25 of file alpha.h.

Uchar characters[UCHAR_MAX+1]

Characters in text in alphabetical order.

Definition at line 28 of file alpha.h.