]> git.ipfire.org Git - thirdparty/openssl.git/blame - include/openssl/buffer.h
Add legacy include guards to public header files
[thirdparty/openssl.git] / include / openssl / buffer.h
CommitLineData
21dcbebc 1/*
6738bf14 2 * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
0f113f3e 3 *
48f4ad77 4 * Licensed under the Apache License 2.0 (the "License"). You may not use
21dcbebc
RS
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
d02b48c6
RE
8 */
9
ae4186b0
DMSP
10#ifndef OPENSSL_BUFFER_H
11# define OPENSSL_BUFFER_H
d86167ec
DMSP
12# pragma once
13
14# include <openssl/macros.h>
15# if !OPENSSL_API_3
16# define HEADER_BUFFER_H
17# endif
d02b48c6 18
50cd4768 19# include <openssl/types.h>
ae4186b0 20# ifndef OPENSSL_CRYPTO_H
7644a9ae
RS
21# include <openssl/crypto.h>
22# endif
52df25cf 23# include <openssl/buffererr.h>
7644a9ae 24
d6dda126 25
d02b48c6
RE
26#ifdef __cplusplus
27extern "C" {
28#endif
29
0f113f3e 30# include <stddef.h>
b379fe6c 31# include <sys/types.h>
54a656ef 32
7644a9ae
RS
33/*
34 * These names are outdated as of OpenSSL 1.1; a future release
35 * will move them to be deprecated.
36 */
37# define BUF_strdup(s) OPENSSL_strdup(s)
38# define BUF_strndup(s, size) OPENSSL_strndup(s, size)
39# define BUF_memdup(data, size) OPENSSL_memdup(data, size)
40# define BUF_strlcpy(dst, src, size) OPENSSL_strlcpy(dst, src, size)
41# define BUF_strlcat(dst, src, size) OPENSSL_strlcat(dst, src, size)
42# define BUF_strnlen(str, maxlen) OPENSSL_strnlen(str, maxlen)
02e112a8 43
0f113f3e
MC
44struct buf_mem_st {
45 size_t length; /* current number of bytes */
46 char *data;
47 size_t max; /* size of buffer */
74924dcb 48 unsigned long flags;
0f113f3e 49};
d02b48c6 50
74924dcb
RS
51# define BUF_MEM_FLAG_SECURE 0x01
52
d02b48c6 53BUF_MEM *BUF_MEM_new(void);
74924dcb 54BUF_MEM *BUF_MEM_new_ex(unsigned long flags);
0f113f3e 55void BUF_MEM_free(BUF_MEM *a);
e5bf3c92
DSH
56size_t BUF_MEM_grow(BUF_MEM *str, size_t len);
57size_t BUF_MEM_grow_clean(BUF_MEM *str, size_t len);
b6981744 58void BUF_reverse(unsigned char *out, const unsigned char *in, size_t siz);
d02b48c6 59
6d311938 60
0cd0a820 61# ifdef __cplusplus
d02b48c6 62}
0cd0a820 63# endif
d02b48c6 64#endif