-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain_comp.c
More file actions
37 lines (37 loc) · 880 Bytes
/
main_comp.c
File metadata and controls
37 lines (37 loc) · 880 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<math.h>
#include "FileChar.h"//read characters from file
#include "huffman.h"//generate huffman codes
#include "BitToFile.h"//write bits to file
#include "adaptive.h"//adaptive character word length algorithm
#include "head.h"//creates the file header
void call_deleter(char *filer)
{
int status;
status = remove(filer);
if (status == 0)
printf("Processing...\n");
else
{
printf("Unable to delete the file\n");
}
}
int main()
{
printf("\n\t\t\tWELCOME TO FILE COMPRESSION TOOL\n");
file();
HuffmanCodes(characters, freq, ack);
write(ack);
adaptive();
reverse();
reverse_my_head();
create_head(ack);
call_deleter("compressed.txt");
call_deleter("checker.txt");
call_deleter("new_head.txt");
call_deleter("sample.txt");
printf("File Compression Success!\tyour new compressed file is 'comp_net.txt'");
return 0;
}