Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-26 09:05:24

0001 /*
0002  * Copyright 1995-2018 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 #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 #ifdef __cplusplus
0026 extern "C" {
0027 #endif
0028 
0029 #include <stddef.h>
0030 #include <sys/types.h>
0031 
0032 #ifndef OPENSSL_NO_DEPRECATED_3_0
0033 #define BUF_strdup(s) OPENSSL_strdup(s)
0034 #define BUF_strndup(s, size) OPENSSL_strndup(s, size)
0035 #define BUF_memdup(data, size) OPENSSL_memdup(data, size)
0036 #define BUF_strlcpy(dst, src, size) OPENSSL_strlcpy(dst, src, size)
0037 #define BUF_strlcat(dst, src, size) OPENSSL_strlcat(dst, src, size)
0038 #define BUF_strnlen(str, maxlen) OPENSSL_strnlen(str, maxlen)
0039 #endif
0040 
0041 struct buf_mem_st {
0042     size_t length; /* current number of bytes */
0043     char *data;
0044     size_t max; /* size of buffer */
0045     unsigned long flags;
0046 };
0047 
0048 #define BUF_MEM_FLAG_SECURE 0x01
0049 
0050 BUF_MEM *BUF_MEM_new(void);
0051 BUF_MEM *BUF_MEM_new_ex(unsigned long flags);
0052 void BUF_MEM_free(BUF_MEM *a);
0053 size_t BUF_MEM_grow(BUF_MEM *str, size_t len);
0054 size_t BUF_MEM_grow_clean(BUF_MEM *str, size_t len);
0055 void BUF_reverse(unsigned char *out, const unsigned char *in, size_t siz);
0056 
0057 #ifdef __cplusplus
0058 }
0059 #endif
0060 #endif