#include <assert.h>
#include <math.h>
#include "types.h"
#include "spacedef.h"
#include "mapfile.h"
#include "reverse.h"
#include "wotd.h"
#include "fsmTree.h"
#include "suffixTree.h"
#include "decoderTree.h"
#include "encoder.h"
#include "decoder.h"
#include "debug.h"
#include "alpha.h"
#include "text.h"
#include "reset.h"
#include "arithmetic/coder.h"
#include "arithmetic/bitio.h"
Go to the source code of this file.
|
#define | UKKONEN 1 |
| Ukkonen linear suffix tree contruction algorithm. More...
|
|
#define | KURTZ 2 |
| Kurtz suffix tree contruction algorithm. More...
|
|
#define | MAGIC 0x3276 |
| Magic number to detect valid ctx files. More...
|
|
|
static void | writeByte (int byte, FILE *file) |
| Writes a byte to the output file using the arithmetic encoder. More...
|
|
static int | readByte (FILE *file) |
| Reads a byte using the arithmetic decoder. More...
|
|
static void | writeAlphabet (FILE *file) |
| Writes the alphabet to the output file. More...
|
|
static void | readAlphabet (FILE *file) |
| Reads the alphabet from the input file. More...
|
|
static void | zip (char *filename, char *compressed, BOOL algorithm, int parts, BOOL see) |
| Compresses the input text and writes the compressed data to a file. More...
|
|
static void | unzip (char *filename, char *output, BOOL see) |
| Decompresses the data in an input file and writes it in a new file. More...
|
|
static void | printUsage (char *progname) |
| Prints program usage instructions in the standard error output. More...
|
|
int | main (int argc, char *argv[]) |
| Parses input parameters and calls the appropriate function. More...
|
|
Kurtz suffix tree contruction algorithm.
Definition at line 46 of file main.c.
Magic number to detect valid ctx files.
Definition at line 49 of file main.c.
Ukkonen linear suffix tree contruction algorithm.
Definition at line 43 of file main.c.
int main |
( |
int |
argc, |
|
|
char * |
argv[] |
|
) |
| |
Parses input parameters and calls the appropriate function.
- Parameters
-
[in] | argc | number of input parameters. |
[in] | argv | input parameters. |
- Returns
- program return code.
Definition at line 422 of file main.c.
static void printUsage |
( |
char * |
progname | ) |
|
|
static |
Prints program usage instructions in the standard error output.
- Parameters
-
[in] | progname | name of the program as invoked by the user. |
Definition at line 401 of file main.c.
static void readAlphabet |
( |
FILE * |
file | ) |
|
|
static |
Reads the alphabet from the input file.
- Parameters
-
Definition at line 131 of file main.c.
static int readByte |
( |
FILE * |
file | ) |
|
|
static |
Reads a byte using the arithmetic decoder.
- Parameters
-
- Returns
- the readed byte
Definition at line 71 of file main.c.
static void unzip |
( |
char * |
filename, |
|
|
char * |
output, |
|
|
BOOL |
see |
|
) |
| |
|
static |
Decompresses the data in an input file and writes it in a new file.
- Parameters
-
[in] | filename | name and path of the input file. |
[in] | output | name and path of the output file. |
[in] | see | if see will be used. |
Definition at line 323 of file main.c.
static void writeAlphabet |
( |
FILE * |
file | ) |
|
|
static |
Writes the alphabet to the output file.
- Parameters
-
Definition at line 88 of file main.c.
static void writeByte |
( |
int |
byte, |
|
|
FILE * |
file |
|
) |
| |
|
static |
Writes a byte to the output file using the arithmetic encoder.
- Parameters
-
[in] | byte | the data to write |
[in] | file | the output file |
Definition at line 56 of file main.c.
static void zip |
( |
char * |
filename, |
|
|
char * |
compressed, |
|
|
BOOL |
algorithm, |
|
|
int |
parts, |
|
|
BOOL |
see |
|
) |
| |
|
static |
Compresses the input text and writes the compressed data to a file.
- Parameters
-
[in] | filename | name and path of the file to compress. |
[in] | compressed | name and path of the compressed output file. |
[in] | algorithm | the algorithm that will be used to build the suffix tree (Ukkonnen or Kurtz). |
[in] | see | if see will be used. |
Definition at line 194 of file main.c.