-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathparameter_port.h
More file actions
38 lines (28 loc) · 1.04 KB
/
parameter_port.h
File metadata and controls
38 lines (28 loc) · 1.04 KB
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
37
#ifndef PARAMETER_PORT_H
#define PARAMETER_PORT_H
#include <stddef.h>
#ifdef __cplusplus
extern "C" {
#endif
/** Acquires a mutual exclusion lock on the parameter tree. */
extern void parameter_port_lock(void);
/** Releases the lock acquired by parameter_port_lock. */
extern void parameter_port_unlock(void);
/** Checks that condition is true and aborts execution otherwise. */
extern void parameter_port_assert(int condition);
/** Allocates a buffer of at least the given size.
*
* @note This is only used when converting MessagePack objects.
* @note At most one buffer is allocated at any moment, which allows the use of
* a static buffer.
* @note The maximum allocated size is the length of the longest parameter or
* namespace name or the largest parameter array, matrix or string, whichever
* is the largest.
*/
extern void *parameter_port_buffer_alloc(size_t size);
/** Frees a buffer allocated by parameter_port_buffer_alloc. */
extern void parameter_port_buffer_free(void *buffer);
#ifdef __cplusplus
}
#endif
#endif /* PARAMETER_PORT_H */