File: gzip.h

package info (click to toggle)
segemehl 0.3.4-5
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 2,024 kB
  • sloc: ansic: 35,270; makefile: 43; sh: 37
file content (33 lines) | stat: -rw-r--r-- 670 bytes parent folder | download | duplicates (3)
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
#ifndef GZIP_H
#define GZIP_H

#include <stdint.h>
#include <sys/types.h>
#include <stdio.h>
#include "portable_endian.h"

// current we are only interested in xtra-fields
// of the bgzip file-format, which has 6 bytes in the extra field
#define MAX_XTRA_BYTES 6



// only contains header fields relevant for this program
typedef struct {
    off_t offsetInFile;
    size_t lenTotal;
    uint8_t compressionMethod;
    uint16_t lenExtraBytes;
    char extraBytes[MAX_XTRA_BYTES];

} gzip_Header;


/// Always use this function when generating a new gzip_Header.
gzip_Header gzip_Header_default();

int gzip_readHeader(FILE* f, gzip_Header* header);



#endif // GZIP_H