Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
3 changed files
with
94 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/* Copyright (C) 2023 Harry Clark - Student No. 12340530 */ | ||
/* DATE: 13/03/23 */ | ||
|
||
/* HUFFMAN CODE DEMONSTRATION */ | ||
/* JUST A LITTLE THING I WANTED TO MAKE FOR FUN AFTER WATCHING A | ||
/* TOM SCOTT VIDEO ABOUT THE SUBJECT */ | ||
|
||
/* THESE ARE ALL OF THE COMMON DATA TYPES ASSOCIATED WITH THIS PROJECT */ | ||
|
||
#ifndef COMMON_TYPES | ||
#define COMMON_TYPES | ||
|
||
#include <string> | ||
#include <cstdint> | ||
#include <Windows.h> | ||
|
||
#ifndef UNSIGNED_TYPES | ||
#define UNSIGNED_TYPES | ||
|
||
typedef uint8_t U8; | ||
typedef uint16_t U16; | ||
typedef uint32_t U32; | ||
typedef uint64_t U64; | ||
typedef size_t UNK_SIZE; | ||
|
||
#endif | ||
|
||
#ifndef SIGNED_TYPES | ||
#define SIGNED_TYPES | ||
|
||
typedef int8_t S8; | ||
typedef int16_t S16; | ||
typedef int32_t S32; | ||
typedef int64_t S64; | ||
|
||
#endif | ||
|
||
#ifndef UNKNOWN_TYPES | ||
#define UNKNOWN_TYPES | ||
|
||
typedef unsigned char UNK_8; | ||
typedef unsigned short UNK_16; | ||
typedef unsigned int UNK_32; | ||
typedef unsigned long UNK_64; | ||
typedef size_t UNK_SIZE; | ||
|
||
#endif | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/* Copyright (C) 2023 Harry Clark - Student No. 12340530 */ | ||
/* DATE: 13/03/23 */ | ||
|
||
/* HUFFMAN CODE DEMONSTRATION */ | ||
/* JUST A LITTLE THING I WANTED TO MAKE FOR FUN AFTER WATCHING A | ||
/* TOM SCOTT VIDEO ABOUT THE SUBJECT */ | ||
|
||
/* THESE ARE THE TYPES AND FUNCTIONALITY PERTAINING TO THIS ALGORITHM */ | ||
|
||
#ifndef HUFFMAN_TYPES | ||
#define HUFFMAN_TYPES | ||
|
||
/* SYSTEM INCLUDES */ | ||
|
||
#include <stdio.h> | ||
|
||
/* NESTED INCLUDES */ | ||
|
||
#include "common.h" | ||
|
||
typedef struct NODE | ||
{ | ||
typedef UNK_SIZE* FREQUENCY; | ||
typedef U8* CHAR; | ||
|
||
NODE* LEAF(FREQUENCY, CHAR); | ||
NODE* INTERNAL_NODE(FREQUENCY, CHAR); | ||
NODE* LEFT_PTR(); | ||
NODE* RIGHT_PTR(); | ||
}; | ||
|
||
typedef struct ENCODER : NODE | ||
{ | ||
typedef U8* DATA[]; | ||
typedef UNK_SIZE* BITWISE_LENGTH; | ||
}; | ||
|
||
typedef struct TREE | ||
{ | ||
ENCODER* ENCODE(UNK_8* ENCODE_CHAR); | ||
ENCODER* DECODE(UNK_8* DECODE_CHAR); | ||
TREE* BUILD_TREE(void); | ||
}; | ||
|
||
#endif |
Empty file.