Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
att
GitHub Repository: att/ast
Path: blob/master/src/cmd/pax/pax-bzip.c
1808 views
1
/***********************************************************************
2
* *
3
* This software is part of the ast package *
4
* Copyright (c) 1987-2012 AT&T Intellectual Property *
5
* and is licensed under the *
6
* Eclipse Public License, Version 1.0 *
7
* by AT&T Intellectual Property *
8
* *
9
* A copy of the License is available at *
10
* http://www.eclipse.org/org/documents/epl-v10.html *
11
* (with md5 checksum b35adb5213ca9657e911e9befb180842) *
12
* *
13
* Information and Software Systems Research *
14
* AT&T Research *
15
* Florham Park NJ *
16
* *
17
* Glenn Fowler <[email protected]> *
18
* *
19
***********************************************************************/
20
#pragma prototyped
21
22
/*
23
* pax bzip format
24
*/
25
26
#include "format.h"
27
28
static int
29
bzip_getprologue(Pax_t* pax, Format_t* fp, Archive_t* ap, File_t* f, unsigned char* buf, size_t size)
30
{
31
if (size < 3 || buf[0] != 0x42 || buf[1] != 0x5a || buf[2] != 0x68)
32
return 0;
33
ap->uncompressed = ap->io->size * 7;
34
return 1;
35
}
36
37
static Compress_format_t pax_bzip_data =
38
{
39
0,
40
{ "bunzip2" },
41
{ 0 },
42
};
43
44
Format_t pax_bzip_format =
45
{
46
"bzip",
47
"bzip2|bz",
48
"bzip compression",
49
0,
50
COMPRESS|IN|OUT,
51
0,
52
0,
53
0,
54
PAXNEXT(bzip),
55
&pax_bzip_data,
56
0,
57
bzip_getprologue,
58
0,
59
0,
60
0,
61
0,
62
0,
63
0,
64
0,
65
0,
66
0,
67
0,
68
0
69
};
70
71
PAXLIB(bzip)
72
73