| 1 |
#include "config.h" |
| 2 |
|
| 3 |
#ifdef HAVE_LZO |
| 4 |
#include <lzo/lzo1x.h> |
| 5 |
#endif |
| 6 |
|
| 7 |
#ifndef _transformation_H |
| 8 |
#define _transformation_H |
| 9 |
|
| 10 |
struct tapebuf; |
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
typedef struct transformation { |
| 20 |
int enc; |
| 21 |
union { |
| 22 |
int initval__; |
| 23 |
#ifdef HAVE_LZO |
| 24 |
struct { |
| 25 |
lzo_align_t __LZO_MMODEL *LZO_WorkMem; |
| 26 |
} lzo; |
| 27 |
#endif |
| 28 |
#ifdef HAVE_ZLIB |
| 29 |
struct { |
| 30 |
int complvl; |
| 31 |
} zlib; |
| 32 |
#endif |
| 33 |
#ifdef HAVE_BZLIB |
| 34 |
struct { |
| 35 |
int complvl; |
| 36 |
} bzlib; |
| 37 |
#endif |
| 38 |
} state; |
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
|
| 43 |
|
| 44 |
const char *name; |
| 45 |
|
| 46 |
|
| 47 |
|
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
int mandatory; |
| 52 |
|
| 53 |
|
| 54 |
|
| 55 |
|
| 56 |
|
| 57 |
int (*initialize) (struct transformation *xform, int mode); |
| 58 |
|
| 59 |
|
| 60 |
|
| 61 |
|
| 62 |
int (*shutdown) (struct transformation *xform); |
| 63 |
|
| 64 |
|
| 65 |
|
| 66 |
|
| 67 |
int (*startNewTape) (struct transformation *xform, |
| 68 |
struct tapebuf *tpbin, unsigned long *destlen); |
| 69 |
|
| 70 |
|
| 71 |
|
| 72 |
|
| 73 |
|
| 74 |
|
| 75 |
|
| 76 |
|
| 77 |
int (*startDiskIOProcess) (struct transformation *xform); |
| 78 |
|
| 79 |
|
| 80 |
|
| 81 |
|
| 82 |
int (*endDiskIOProcess) (struct transformation *xform); |
| 83 |
|
| 84 |
|
| 85 |
|
| 86 |
|
| 87 |
int (*compress) (struct transformation *xform, struct tapebuf *, unsigned long *destlen, |
| 88 |
const char *src, int srclen); |
| 89 |
|
| 90 |
|
| 91 |
|
| 92 |
|
| 93 |
int (*decompress) (struct transformation *xform, struct tapebuf *, unsigned long *destlen, |
| 94 |
const char *src, int srclen, const char **reason); |
| 95 |
|
| 96 |
} Transformation; |
| 97 |
|
| 98 |
extern Transformation transformation_null; |
| 99 |
|
| 100 |
#ifdef HAVE_LZO |
| 101 |
#define HAVE_BLOCK_TRANSFORMATION 1 |
| 102 |
extern Transformation *transformation_lzo_factory(int enc); |
| 103 |
#endif |
| 104 |
|
| 105 |
#ifdef HAVE_ZLIB |
| 106 |
#define HAVE_BLOCK_TRANSFORMATION 1 |
| 107 |
extern Transformation *transformation_zlib_factory(int enc, int complvl); |
| 108 |
#endif |
| 109 |
|
| 110 |
#ifdef HAVE_BZLIB |
| 111 |
#define HAVE_BLOCK_TRANSFORMATION 1 |
| 112 |
extern Transformation *transformation_bzlib_factory(int enc, int complvl); |
| 113 |
#endif |
| 114 |
|
| 115 |
#endif |