EmbLogic's Blog

Complete MDC project with a generalized compression function for 1 to 7 bit code lenght

Output of the project:
[root@VIPIN MDCGUR]# ./script
header.h,v <– header.h
file is unchanged; reverting to previous revision 1.32
done
main.c,v <– main.c
file is unchanged; reverting to previous revision 1.13
done
func.c,v > .
done
header.h,v –> header.h
revision 1.32
done
main.c,v –> main.c
revision 1.13
done
func.c,v –> func.c
revision 1.484
done

(In readd)
(In chkfile)
file read successfully as fd is 3
(In printfile)
the size of the file is:124
the content is in the file:
she sells sea shell on the sea shore.
when the going gets tough the tough gets going.
where there is will, there is way.
(In masterarray)
(In printma)
unique characters in master array are:
she laontr.
wgiu,y
(In mafile)
unique characters are written in mafile succesfully with a file descriptor: 4
the size of master array file is:19
(In codelength)
the code lenght is:5
(In compression)

the size of the compression file is:78
Compression Efficiency is:
eff%: ((124-78-19)/124)*100
=21.774193%
the content is in compression file:
$?!`Q??a?@A
??$?kA??????
d?
1??.
‘???b???@A$1?
“???hE?header.h,v –> header.h
revision 1.32 (locked)
done
main.c,v –> main.c
revision 1.13 (locked)
done
func.c,v –> func.c
revision 1.484 (locked)
done
[root@VIPIN MDCGUR]# cd rectest/
[root@VIPIN rectest]# ls
compfile decompfile mafile receiver.c script
[root@VIPIN rectest]# ./script

(In decompression)
(In codelength)
the code lenght is:5

Decompress data has written on decompfile sucessfully with a file descriptor:4
the size of decompression file is:124
the decompress data is:
she sells sea shell on the sea shore.
when the going gets tough the tough gets going.
where there is will, there is way.

[root@VIPIN rectest]#

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>