Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-25 09:21:57

0001 /*
0002  * Copyright 2015-2024 The OpenSSL Project Authors. All Rights Reserved.
0003  *
0004  * Licensed under the Apache License 2.0 (the "License").  You may not use
0005  * this file except in compliance with the License.  You can obtain a copy
0006  * in the file LICENSE in the source distribution or at
0007  * https://www.openssl.org/source/license.html
0008  */
0009 
0010 /* clang-format off */
0011 
0012 /* clang-format on */
0013 
0014 #ifndef OPENSSL_COMP_H
0015 #define OPENSSL_COMP_H
0016 #pragma once
0017 
0018 #include <openssl/macros.h>
0019 #ifndef OPENSSL_NO_DEPRECATED_3_0
0020 #define HEADER_COMP_H
0021 #endif
0022 
0023 #include <openssl/opensslconf.h>
0024 
0025 #include <openssl/crypto.h>
0026 #include <openssl/comperr.h>
0027 #ifdef __cplusplus
0028 extern "C" {
0029 #endif
0030 
0031 #ifndef OPENSSL_NO_COMP
0032 
0033 COMP_CTX *COMP_CTX_new(COMP_METHOD *meth);
0034 const COMP_METHOD *COMP_CTX_get_method(const COMP_CTX *ctx);
0035 int COMP_CTX_get_type(const COMP_CTX *comp);
0036 int COMP_get_type(const COMP_METHOD *meth);
0037 const char *COMP_get_name(const COMP_METHOD *meth);
0038 void COMP_CTX_free(COMP_CTX *ctx);
0039 
0040 int COMP_compress_block(COMP_CTX *ctx, unsigned char *out, int olen,
0041     unsigned char *in, int ilen);
0042 int COMP_expand_block(COMP_CTX *ctx, unsigned char *out, int olen,
0043     unsigned char *in, int ilen);
0044 
0045 COMP_METHOD *COMP_zlib(void);
0046 COMP_METHOD *COMP_zlib_oneshot(void);
0047 COMP_METHOD *COMP_brotli(void);
0048 COMP_METHOD *COMP_brotli_oneshot(void);
0049 COMP_METHOD *COMP_zstd(void);
0050 COMP_METHOD *COMP_zstd_oneshot(void);
0051 
0052 #ifndef OPENSSL_NO_DEPRECATED_1_1_0
0053 #define COMP_zlib_cleanup() \
0054     while (0)               \
0055     continue
0056 #endif
0057 
0058 #ifdef OPENSSL_BIO_H
0059 const BIO_METHOD *BIO_f_zlib(void);
0060 const BIO_METHOD *BIO_f_brotli(void);
0061 const BIO_METHOD *BIO_f_zstd(void);
0062 #endif
0063 
0064 #endif
0065 
0066 typedef struct ssl_comp_st SSL_COMP;
0067 
0068 /* clang-format off */
0069 SKM_DEFINE_STACK_OF_INTERNAL(SSL_COMP, SSL_COMP, SSL_COMP)
0070 #define sk_SSL_COMP_num(sk) OPENSSL_sk_num(ossl_check_const_SSL_COMP_sk_type(sk))
0071 #define sk_SSL_COMP_value(sk, idx) ((SSL_COMP *)OPENSSL_sk_value(ossl_check_const_SSL_COMP_sk_type(sk), (idx)))
0072 #define sk_SSL_COMP_new(cmp) ((STACK_OF(SSL_COMP) *)OPENSSL_sk_new(ossl_check_SSL_COMP_compfunc_type(cmp)))
0073 #define sk_SSL_COMP_new_null() ((STACK_OF(SSL_COMP) *)OPENSSL_sk_new_null())
0074 #define sk_SSL_COMP_new_reserve(cmp, n) ((STACK_OF(SSL_COMP) *)OPENSSL_sk_new_reserve(ossl_check_SSL_COMP_compfunc_type(cmp), (n)))
0075 #define sk_SSL_COMP_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_SSL_COMP_sk_type(sk), (n))
0076 #define sk_SSL_COMP_free(sk) OPENSSL_sk_free(ossl_check_SSL_COMP_sk_type(sk))
0077 #define sk_SSL_COMP_zero(sk) OPENSSL_sk_zero(ossl_check_SSL_COMP_sk_type(sk))
0078 #define sk_SSL_COMP_delete(sk, i) ((SSL_COMP *)OPENSSL_sk_delete(ossl_check_SSL_COMP_sk_type(sk), (i)))
0079 #define sk_SSL_COMP_delete_ptr(sk, ptr) ((SSL_COMP *)OPENSSL_sk_delete_ptr(ossl_check_SSL_COMP_sk_type(sk), ossl_check_SSL_COMP_type(ptr)))
0080 #define sk_SSL_COMP_push(sk, ptr) OPENSSL_sk_push(ossl_check_SSL_COMP_sk_type(sk), ossl_check_SSL_COMP_type(ptr))
0081 #define sk_SSL_COMP_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_SSL_COMP_sk_type(sk), ossl_check_SSL_COMP_type(ptr))
0082 #define sk_SSL_COMP_pop(sk) ((SSL_COMP *)OPENSSL_sk_pop(ossl_check_SSL_COMP_sk_type(sk)))
0083 #define sk_SSL_COMP_shift(sk) ((SSL_COMP *)OPENSSL_sk_shift(ossl_check_SSL_COMP_sk_type(sk)))
0084 #define sk_SSL_COMP_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_SSL_COMP_sk_type(sk), ossl_check_SSL_COMP_freefunc_type(freefunc))
0085 #define sk_SSL_COMP_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_SSL_COMP_sk_type(sk), ossl_check_SSL_COMP_type(ptr), (idx))
0086 #define sk_SSL_COMP_set(sk, idx, ptr) ((SSL_COMP *)OPENSSL_sk_set(ossl_check_SSL_COMP_sk_type(sk), (idx), ossl_check_SSL_COMP_type(ptr)))
0087 #define sk_SSL_COMP_find(sk, ptr) OPENSSL_sk_find(ossl_check_SSL_COMP_sk_type(sk), ossl_check_SSL_COMP_type(ptr))
0088 #define sk_SSL_COMP_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_SSL_COMP_sk_type(sk), ossl_check_SSL_COMP_type(ptr))
0089 #define sk_SSL_COMP_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_SSL_COMP_sk_type(sk), ossl_check_SSL_COMP_type(ptr), pnum)
0090 #define sk_SSL_COMP_sort(sk) OPENSSL_sk_sort(ossl_check_SSL_COMP_sk_type(sk))
0091 #define sk_SSL_COMP_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_SSL_COMP_sk_type(sk))
0092 #define sk_SSL_COMP_dup(sk) ((STACK_OF(SSL_COMP) *)OPENSSL_sk_dup(ossl_check_const_SSL_COMP_sk_type(sk)))
0093 #define sk_SSL_COMP_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(SSL_COMP) *)OPENSSL_sk_deep_copy(ossl_check_const_SSL_COMP_sk_type(sk), ossl_check_SSL_COMP_copyfunc_type(copyfunc), ossl_check_SSL_COMP_freefunc_type(freefunc)))
0094 #define sk_SSL_COMP_set_cmp_func(sk, cmp) ((sk_SSL_COMP_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_SSL_COMP_sk_type(sk), ossl_check_SSL_COMP_compfunc_type(cmp)))
0095 
0096 /* clang-format on */
0097 
0098 #ifdef __cplusplus
0099 }
0100 #endif
0101 #endif