libbtc
bitcoinclibrary
buffer.h
Go to the documentation of this file.
1 #ifndef __LIBCCOIN_BUFFER_H__
2 #define __LIBCCOIN_BUFFER_H__
3 /* Copyright 2012 exMULTI, Inc.
4  * Distributed under the MIT/X11 software license, see the accompanying
5  * file COPYING or http://www.opensource.org/licenses/mit-license.php.
6  */
7 
8 #include <btc/btc.h>
9 
10 #include <stdint.h>
11 #include <sys/types.h>
12 
13 struct buffer
14 {
15  void* p;
16  size_t len;
17 };
18 
20 {
21  const void* p;
22  size_t len;
23 };
24 
25 extern btc_bool buffer_equal(const void* a, const void* b);
26 extern void buffer_free(void* struct_buffer);
27 extern struct buffer* buffer_copy(const void* data, size_t data_len);
28 
29 #endif /* __LIBCCOIN_BUFFER_H__ */
uint8_t btc_bool
Definition: btc.h:34
size_t len
Definition: buffer.h:22
btc_bool buffer_equal(const void *a, const void *b)
Definition: buffer.c:11
const void * p
Definition: buffer.h:21
void * p
Definition: buffer.h:15
size_t len
Definition: buffer.h:16
void buffer_free(void *struct_buffer)
Definition: buffer.c:21
Definition: buffer.h:13
struct buffer * buffer_copy(const void *data, size_t data_len)
Definition: buffer.c:31