diff options
Diffstat (limited to 'src/lib/libcrypto/buffer/buffer.h')
-rw-r--r-- | src/lib/libcrypto/buffer/buffer.h | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/lib/libcrypto/buffer/buffer.h b/src/lib/libcrypto/buffer/buffer.h index 465dc34f3f..1db9607450 100644 --- a/src/lib/libcrypto/buffer/buffer.h +++ b/src/lib/libcrypto/buffer/buffer.h | |||
@@ -59,25 +59,35 @@ | |||
59 | #ifndef HEADER_BUFFER_H | 59 | #ifndef HEADER_BUFFER_H |
60 | #define HEADER_BUFFER_H | 60 | #define HEADER_BUFFER_H |
61 | 61 | ||
62 | #include <openssl/ossl_typ.h> | ||
63 | |||
62 | #ifdef __cplusplus | 64 | #ifdef __cplusplus |
63 | extern "C" { | 65 | extern "C" { |
64 | #endif | 66 | #endif |
65 | 67 | ||
66 | #include <stddef.h> | 68 | #include <stddef.h> |
69 | |||
70 | #if !defined(NO_SYS_TYPES_H) | ||
67 | #include <sys/types.h> | 71 | #include <sys/types.h> |
72 | #endif | ||
73 | |||
74 | /* Already declared in ossl_typ.h */ | ||
75 | /* typedef struct buf_mem_st BUF_MEM; */ | ||
68 | 76 | ||
69 | typedef struct buf_mem_st | 77 | struct buf_mem_st |
70 | { | 78 | { |
71 | int length; /* current number of bytes */ | 79 | int length; /* current number of bytes */ |
72 | char *data; | 80 | char *data; |
73 | int max; /* size of buffer */ | 81 | int max; /* size of buffer */ |
74 | } BUF_MEM; | 82 | }; |
75 | 83 | ||
76 | BUF_MEM *BUF_MEM_new(void); | 84 | BUF_MEM *BUF_MEM_new(void); |
77 | void BUF_MEM_free(BUF_MEM *a); | 85 | void BUF_MEM_free(BUF_MEM *a); |
78 | int BUF_MEM_grow(BUF_MEM *str, int len); | 86 | int BUF_MEM_grow(BUF_MEM *str, int len); |
79 | int BUF_MEM_grow_clean(BUF_MEM *str, int len); | 87 | int BUF_MEM_grow_clean(BUF_MEM *str, int len); |
80 | char * BUF_strdup(const char *str); | 88 | char * BUF_strdup(const char *str); |
89 | char * BUF_strndup(const char *str, size_t siz); | ||
90 | void * BUF_memdup(const void *data, size_t siz); | ||
81 | 91 | ||
82 | /* safe string functions */ | 92 | /* safe string functions */ |
83 | size_t BUF_strlcpy(char *dst,const char *src,size_t siz); | 93 | size_t BUF_strlcpy(char *dst,const char *src,size_t siz); |
@@ -93,9 +103,12 @@ void ERR_load_BUF_strings(void); | |||
93 | /* Error codes for the BUF functions. */ | 103 | /* Error codes for the BUF functions. */ |
94 | 104 | ||
95 | /* Function codes. */ | 105 | /* Function codes. */ |
106 | #define BUF_F_BUF_MEMDUP 103 | ||
96 | #define BUF_F_BUF_MEM_GROW 100 | 107 | #define BUF_F_BUF_MEM_GROW 100 |
108 | #define BUF_F_BUF_MEM_GROW_CLEAN 105 | ||
97 | #define BUF_F_BUF_MEM_NEW 101 | 109 | #define BUF_F_BUF_MEM_NEW 101 |
98 | #define BUF_F_BUF_STRDUP 102 | 110 | #define BUF_F_BUF_STRDUP 102 |
111 | #define BUF_F_BUF_STRNDUP 104 | ||
99 | 112 | ||
100 | /* Reason codes. */ | 113 | /* Reason codes. */ |
101 | 114 | ||