Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:05:39

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 
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;              /* current number of bytes */
0044     char *data;
0045     size_t max;                 /* size of buffer */
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