Debian Codegraph @

common/transformation_null.c

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