aboutsummaryrefslogtreecommitdiff
path: root/lib/pbdrv/pb-buf.h
blob: 9ff53feb9910d64728f5ab55c40726b387411a8e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#pragma once

#include "pb-types.h"

#ifdef __cplusplus
extern "C" {
#endif

/**
 * \ingroup pbdrv
 * \ingroup pbdrv-mod
 * \defgroup pb_buf Buffer
 * \brief Binary data buffer type used in \ref pbdrv
 * \{
 */

//! binary buffer struct
typedef struct {
	char * data; //! pointer to data
	size_t size; //! size of data
} pb_buf_t;

/**
 * \brief free a \c pb_buf_t
 *
 * This function calls \c pb_free() on the \c data member of a \c pb_buf_t
 * struct if it is not equal to \c NULL.
 */
void pb_buf_free(pb_buf_t * buf);

/// \}

#ifdef __cplusplus
}
#endif