/usr/include/io_lib/compress.h is in libstaden-read-dev 1.12.4-1build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 | /*
* Copyright (c) Medical Research Council 1994. All rights reserved.
*
* Permission to use, copy, modify and distribute this software and its
* documentation for any purpose is hereby granted without fee, provided that
* this copyright and notice appears in all copies.
*
* This file was written by James Bonfield, Simon Dear, Rodger Staden,
* as part of the Staden Package at the MRC Laboratory of Molecular
* Biology, Hills Road, Cambridge, CB2 2QH, United Kingdom.
*
* MRC disclaims all warranties with regard to this software.
*/
#ifndef _COMPRESS_H
#define _COMPRESS_H
#include <stdio.h>
#include "io_lib/mFILE.h"
#ifdef __cplusplus
extern "C" {
#endif
/*
* Compress a file using the method set in the compression_used value
* (set by set_compression_method and fopen_compressed).
*
* If compression succeeds, we rename the file back its original name.
*
* When compression_used is 0 no compression is done.
*/
int compress_file(char *file);
int fcompress_file(mFILE *fp);
/*
* Returns a file pointer of an uncompressed copy of 'file'.
* 'file' need not exist if 'file'.ext (eg file.gz)
* exists and can be uncompressed.
*
* If ofp is non NULL then the original file pointer will also be returned
* (opened for update) to allow writing back to the original file. In cases
* of uncompressed data this is the same as the returned file pointer.
*/
mFILE *fopen_compressed(char *file, mFILE **ofp);
/*
* Returns a file pointer of an uncompressed copy of 'fp'.
*
* If ofp is non NULL then the original file pointer will also be returned
* (opened for update) to allow writing back to the original file. In cases
* of uncompressed data this is the same as the returned file pointer.
*/
mFILE *freopen_compressed(mFILE *fp, mFILE **ofp);
/*
* Sets the desired compression method. The below macros relate to entries
* in the compression magic numbers table.
*/
void set_compression_method(int method);
int get_compression_method(void);
/*
* Converts compress mode strings (eg "gzip") to numbers.
*/
int compress_str2int(char *mode);
/*
* Converts compress mode numbers to strings (eg "gzip").
*/
char *compress_int2str(int mode);
#define COMP_METHOD_NONE 0
#define COMP_METHOD_BZIP 1
#define COMP_METHOD_GZIP 2
#define COMP_METHOD_COMPRESS 3
#define COMP_METHOD_BZIP2 5
#define COMP_METHOD_SZIP 6
/*
* In memory gzip and gunzip using zlib. In each case data is the input
* data (with 'size') and the returned value is the output data along with
* [cu]data_size being the returned data size.
*
* Both return NULL on failure
*/
char *memgzip(char *data, size_t size, size_t *cdata_size);
char *memgunzip(char *data, size_t size, size_t *udata_size);
/*
* Given a filename remove a known compression extension
*
* Returns: None
*/
void remove_extension(char *file);
#ifdef __cplusplus
}
#endif
#endif /* _COMPRESS_H */
|