xref: /freebsd/sbin/hastd/hast_compression.h (revision b3e7694832e81d7a904a10f525f8797b753bf0d3)
18cd3d45aSPawel Jakub Dawidek /*-
2*4d846d26SWarner Losh  * SPDX-License-Identifier: BSD-2-Clause
31de7b4b8SPedro F. Giffuni  *
48cd3d45aSPawel Jakub Dawidek  * Copyright (c) 2011 Pawel Jakub Dawidek <pawel@dawidek.net>
58cd3d45aSPawel Jakub Dawidek  * All rights reserved.
68cd3d45aSPawel Jakub Dawidek  *
78cd3d45aSPawel Jakub Dawidek  * Redistribution and use in source and binary forms, with or without
88cd3d45aSPawel Jakub Dawidek  * modification, are permitted provided that the following conditions
98cd3d45aSPawel Jakub Dawidek  * are met:
108cd3d45aSPawel Jakub Dawidek  * 1. Redistributions of source code must retain the above copyright
118cd3d45aSPawel Jakub Dawidek  *    notice, this list of conditions and the following disclaimer.
128cd3d45aSPawel Jakub Dawidek  * 2. Redistributions in binary form must reproduce the above copyright
138cd3d45aSPawel Jakub Dawidek  *    notice, this list of conditions and the following disclaimer in the
148cd3d45aSPawel Jakub Dawidek  *    documentation and/or other materials provided with the distribution.
158cd3d45aSPawel Jakub Dawidek  *
168cd3d45aSPawel Jakub Dawidek  * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
178cd3d45aSPawel Jakub Dawidek  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
188cd3d45aSPawel Jakub Dawidek  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
198cd3d45aSPawel Jakub Dawidek  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
208cd3d45aSPawel Jakub Dawidek  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
218cd3d45aSPawel Jakub Dawidek  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
228cd3d45aSPawel Jakub Dawidek  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
238cd3d45aSPawel Jakub Dawidek  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
248cd3d45aSPawel Jakub Dawidek  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
258cd3d45aSPawel Jakub Dawidek  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
268cd3d45aSPawel Jakub Dawidek  * SUCH DAMAGE.
278cd3d45aSPawel Jakub Dawidek  */
288cd3d45aSPawel Jakub Dawidek 
298cd3d45aSPawel Jakub Dawidek #ifndef	_HAST_COMPRESSION_H_
308cd3d45aSPawel Jakub Dawidek #define	_HAST_COMPRESSION_H_
318cd3d45aSPawel Jakub Dawidek 
328cd3d45aSPawel Jakub Dawidek #include <stdlib.h>	/* size_t */
338cd3d45aSPawel Jakub Dawidek 
348cd3d45aSPawel Jakub Dawidek #include <hast.h>
358cd3d45aSPawel Jakub Dawidek #include <nv.h>
368cd3d45aSPawel Jakub Dawidek 
378cd3d45aSPawel Jakub Dawidek const char *compression_name(int num);
388cd3d45aSPawel Jakub Dawidek 
398cd3d45aSPawel Jakub Dawidek int compression_send(const struct hast_resource *res, struct nv *nv,
408cd3d45aSPawel Jakub Dawidek     void **datap, size_t *sizep, bool *freedatap);
418cd3d45aSPawel Jakub Dawidek int compression_recv(const struct hast_resource *res, struct nv *nv,
428cd3d45aSPawel Jakub Dawidek     void **datap, size_t *sizep, bool *freedatap);
438cd3d45aSPawel Jakub Dawidek 
448cd3d45aSPawel Jakub Dawidek #endif	/* !_HAST_COMPRESSION_H_ */
45