1#pragma once
2
3/*
4 * Function arguments helpers
5 */
6
7#include <stdarg.h>
8
9#include <pw_types.h>
10#include <pw_interfaces.h>
11#include <pw_status.h>
12#include <pw_task.h>
13
14#ifdef __cplusplus
15extern "C" {
16#endif
17
18static inline void _pw_destroy_args(va_list ap)
19/*
20 * Helper for functions that accept values created on stack during function call.
21 * Such values cannot be automatically cleaned on error, the callee
22 * should do that.
23 * See pw_array(), pw_array_append_va, PwMap(), pw_map_update_va
24 */
25{
26 for (;;) {
27 PwValue arg = va_arg(ap, _PwValue);
28 if (pw_is_va_end(&arg)) {
29 break;
30 }
31 }
32}
33
34#ifdef __cplusplus
35}
36#endif