File indexing completed on 2025-01-18 10:05:39
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef OPENSSL_BUFFER_H
0011 # define OPENSSL_BUFFER_H
0012 # pragma once
0013
0014 # include <openssl/macros.h>
0015 # ifndef OPENSSL_NO_DEPRECATED_3_0
0016 # define HEADER_BUFFER_H
0017 # endif
0018
0019 # include <openssl/types.h>
0020 # ifndef OPENSSL_CRYPTO_H
0021 # include <openssl/crypto.h>
0022 # endif
0023 # include <openssl/buffererr.h>
0024
0025
0026 #ifdef __cplusplus
0027 extern "C" {
0028 #endif
0029
0030 # include <stddef.h>
0031 # include <sys/types.h>
0032
0033 # ifndef OPENSSL_NO_DEPRECATED_3_0
0034 # define BUF_strdup(s) OPENSSL_strdup(s)
0035 # define BUF_strndup(s, size) OPENSSL_strndup(s, size)
0036 # define BUF_memdup(data, size) OPENSSL_memdup(data, size)
0037 # define BUF_strlcpy(dst, src, size) OPENSSL_strlcpy(dst, src, size)
0038 # define BUF_strlcat(dst, src, size) OPENSSL_strlcat(dst, src, size)
0039 # define BUF_strnlen(str, maxlen) OPENSSL_strnlen(str, maxlen)
0040 # endif
0041
0042 struct buf_mem_st {
0043 size_t length;
0044 char *data;
0045 size_t max;
0046 unsigned long flags;
0047 };
0048
0049 # define BUF_MEM_FLAG_SECURE 0x01
0050
0051 BUF_MEM *BUF_MEM_new(void);
0052 BUF_MEM *BUF_MEM_new_ex(unsigned long flags);
0053 void BUF_MEM_free(BUF_MEM *a);
0054 size_t BUF_MEM_grow(BUF_MEM *str, size_t len);
0055 size_t BUF_MEM_grow_clean(BUF_MEM *str, size_t len);
0056 void BUF_reverse(unsigned char *out, const unsigned char *in, size_t siz);
0057
0058
0059 # ifdef __cplusplus
0060 }
0061 # endif
0062 #endif