-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdecompress.c
51 lines (48 loc) · 930 Bytes
/
decompress.c
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#include"header.h"
#include"prototypes.h"
int decompress()
{
printf("In Function %s\n", __func__);
int cl, len, fd, ret, pos;
char ch, c;
fd = open("masterArray", O_RDONLY);
len = lseek(fd, 0, SEEK_END);
printf("len = %d", len);
cl = code_length(len);
pos = lseek(fd, 0, SEEK_SET);
printf("Code Length = %d", cl);
printf("Position = %d", pos);
switch(cl) {
case 2 :
ret = decompress2(fd, len);
if(ret<0)
perror("Error:\n");
break;
case 3 :
ret = decompress3(fd, len);
if(ret<0)
perror("Error:\n");
break;
case 4 :
ret = decompress4(fd, len);
if(ret<0)
perror("Error:\n");
break;
case 5 :
ret = decompress5(fd, len);
if(ret<0)
perror("Error:\n");
break;
case 6 :
ret = decompress6(fd, len);
if(ret<0)
perror("Error:\n");
break;
case 7 :
ret = decompress7(fd, len);
if(ret<0)
perror("Error:\n");
break;
}
return 0;
}