xref: /freebsd/crypto/openssl/include/openssl/comp.h.in (revision e7be843b4a162e68651d3911f0357ed464915629)
1/*
2 * Copyright 2015-2024 The OpenSSL Project Authors. All Rights Reserved.
3 *
4 * Licensed under the Apache License 2.0 (the "License").  You may not use
5 * this file except in compliance with the License.  You can obtain a copy
6 * in the file LICENSE in the source distribution or at
7 * https://www.openssl.org/source/license.html
8 */
9
10{-
11use OpenSSL::stackhash qw(generate_stack_macros);
12-}
13
14#ifndef OPENSSL_COMP_H
15# define OPENSSL_COMP_H
16# pragma once
17
18# include <openssl/macros.h>
19# ifndef OPENSSL_NO_DEPRECATED_3_0
20#  define HEADER_COMP_H
21# endif
22
23# include <openssl/opensslconf.h>
24
25# include <openssl/crypto.h>
26# include <openssl/comperr.h>
27# ifdef  __cplusplus
28extern "C" {
29# endif
30
31
32
33# ifndef OPENSSL_NO_COMP
34
35COMP_CTX *COMP_CTX_new(COMP_METHOD *meth);
36const COMP_METHOD *COMP_CTX_get_method(const COMP_CTX *ctx);
37int COMP_CTX_get_type(const COMP_CTX* comp);
38int COMP_get_type(const COMP_METHOD *meth);
39const char *COMP_get_name(const COMP_METHOD *meth);
40void COMP_CTX_free(COMP_CTX *ctx);
41
42int COMP_compress_block(COMP_CTX *ctx, unsigned char *out, int olen,
43                        unsigned char *in, int ilen);
44int COMP_expand_block(COMP_CTX *ctx, unsigned char *out, int olen,
45                      unsigned char *in, int ilen);
46
47COMP_METHOD *COMP_zlib(void);
48COMP_METHOD *COMP_zlib_oneshot(void);
49COMP_METHOD *COMP_brotli(void);
50COMP_METHOD *COMP_brotli_oneshot(void);
51COMP_METHOD *COMP_zstd(void);
52COMP_METHOD *COMP_zstd_oneshot(void);
53
54#  ifndef OPENSSL_NO_DEPRECATED_1_1_0
55#   define COMP_zlib_cleanup() while(0) continue
56#  endif
57
58#  ifdef OPENSSL_BIO_H
59const BIO_METHOD *BIO_f_zlib(void);
60const BIO_METHOD *BIO_f_brotli(void);
61const BIO_METHOD *BIO_f_zstd(void);
62#  endif
63
64# endif
65
66typedef struct ssl_comp_st SSL_COMP;
67
68{-
69    generate_stack_macros("SSL_COMP");
70-}
71
72
73# ifdef  __cplusplus
74}
75# endif
76#endif
77