]> git.wh0rd.org - dump.git/blame - common/transformation_null.c
Encryption (and compression as plugins) support.
[dump.git] / common / transformation_null.c
CommitLineData
e3956dfb
SP
1#include <stdio.h>
2#include <config.h>
3
4#include "transformation.h"
5
6/*
7 * Initialize
8 */
9static int
10null_initialize(Transformation *xform, int enc)
11{
12 return 0;
13}
14
15/*
16 * Shut down.
17 */
18static int
19null_shutdown(Transformation *xform)
20{
21 return 0;
22}
23
24/*
25 * Handle fork.
26 */
27static int
28null_startNewTape(Transformation *xform, struct tapebuf *tpbin,
29 unsigned long *destlen)
30{
31 return 0;
32}
33
34/*
35 * Start slave process.
36 */
37static int
38null_startDiskIOProcess(Transformation *xform)
39{
40 return 0;
41}
42
43/*
44 * End slave process.
45 */
46static int
47null_endDiskIOProcess(Transformation *xform)
48{
49 return 0;
50}
51
52/*
53 * Compress a buffer.
54 */
55static int
56null_compress(Transformation *xform, struct tapebuf *tpbin, unsigned long *destlen,
57 const char *src, int srclen)
58{
59 memcpy(tpbin->buf, src, srclen);
60 *destlen = srclen;
61
62 return 1;
63}
64
65/*
66 * Decompress a buffer.
67 */
68static int
69null_decompress(Transformation *xform, struct tapebuf *tpbin, unsigned long *destlen,
70 const char *src, int srclen, char **reason)
71{
72 memcpy(tpbin->buf, src, srclen);
73 *destlen = srclen;
74
75 return 1;
76}
77
78/*
79 *
80 */
81Transformation transformation_null =
82{
83 0,
84 NULL,
85 "null",
86 0,
87 &null_initialize,
88 &null_shutdown,
89 &null_startNewTape,
90 &null_startDiskIOProcess,
91 &null_endDiskIOProcess,
92 &null_compress,
93 &null_decompress
94};