xref: /freebsd/sys/contrib/openzfs/cmd/zstream/zstream_modules.h (revision d0b3ecdc274930e190ea233b6b69ff03782eaf8d)
1 // SPDX-License-Identifier: CDDL-1.0
2 /*
3  * CDDL HEADER START
4  *
5  * This file and its contents are supplied under the terms of the Common
6  * Development and Distribution License ("CDDL"), version 1.0. You may only use
7  * this file in accordance with the terms of version 1.0 of the CDDL.
8  *
9  * A full copy of the text of the CDDL should have accompanied this source. A
10  * copy of the CDDL is also available via the Internet at
11  * http://www.illumos.org/license/CDDL.
12  *
13  * CDDL HEADER END
14  */
15 
16 /*
17  * Copyright (c) 2026 by Garth Snyder. All rights reserved.
18  */
19 
20 #ifndef _ZSTREAM_MODULES_H
21 #define	_ZSTREAM_MODULES_H
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
27 /*
28  * This file aggregates all zstream_chain utility modules into a single
29  * header and defines macros for standard input and output operations.
30  */
31 
32 #include "zstream_byteswap.h"
33 #include "zstream_chain.h"
34 #include "zstream_fletcher4.h"
35 #include "zstream_io.h"
36 #include "zstream_recompress.h"
37 #include "zstream_util.h"
38 #include "zstream_validate.h"
39 
40 #define	READ_STEP 0
41 
42 #define	STANDARD_INPUT_STACK(infile)					\
43 	serial_read_stream(infile),					\
44 	serial_validate_fletcher4(),					\
45 	serial_byteswap(BS_INCOMING),					\
46 	serial_validate_records()
47 
48 #define	STANDARD_OUTPUT_STACK(outfile)					\
49 	serial_byteswap(BS_OUTGOING),					\
50 	serial_add_fletcher4(),						\
51 	serial_write_stream(outfile),					\
52 	chain_terminator()
53 
54 #define	NULL_OUTPUT_STACK()						\
55 	serial_null_output(),						\
56 	chain_terminator()
57 
58 #ifdef __cplusplus
59 }
60 #endif
61 
62 #endif  /* _ZSTREAM_MODULES_H */
63