/*
Mocks header file

Generated with Nala version {{ nala_version }} (https://github.com/eerimoq/nala)
Do not edit manually
*/

#ifndef {{ guard_name }}
#define {{ guard_name }}

#ifndef NALA_GENERATE_MOCKS

#include <stdarg.h>
#include <stddef.h>
{{ includes }}

struct nala_traceback_t {
    void *addresses[32];
    int depth;
};

typedef void (*nala_mock_in_assert_t)(const void *actual_p,
                                      const void *expected_p,
                                      size_t size);

typedef void (*nala_mock_out_copy_t)(void *dst_p,
                                     const void *src_p,
                                     size_t size);

void nala_suspend_all_mocks(void);
void nala_resume_all_mocks(void);
void nala_reset_all_mocks(void);
void nala_assert_all_mocks_completed(void);
{% for mock in mocks %}

{{ mock.DECL_MARKER }} {{ mock.func_name }}

struct nala_{{mock.func_name}}_params_t {
    {% for param in mock.params_struct %}
    {{param | render}};
    {% endfor %}
};

{% if mock.is_variadic_func %}
{{ mock.variadic_func_real_wrapper_decl | render }};
{% endif %}
{{mock.mock_func | render}};
{{mock.mock_once_func | render}};
{% if mock.is_variadic_func %}
void {{mock.func_name}}_mock_ignore_in({{mock.return_value_decl | render}}, const char *vafmt_p);
int {{mock.func_name}}_mock_ignore_in_once({{mock.return_value_decl | render}}, const char *vafmt_p);
{% else %}
void {{mock.func_name}}_mock_ignore_in({{mock.return_value_decl | render}});
int {{mock.func_name}}_mock_ignore_in_once({{mock.return_value_decl | render}});
{% endif %}
{{mock.set_errno_func | render}};
void {{mock.func_name}}_mock_set_callback({{mock.callback_decl | render}});
struct nala_{{mock.func_name}}_params_t *{{mock.func_name}}_mock_get_params_in(int handle);
{% for param in mock.ignore_params %}
void {{mock.func_name}}_mock_ignore_{{param}}_in(void);
{% endfor %}
{% for param, buf, actual, expected, dst, src, _ in mock.set_params %}
void {{mock.func_name}}_mock_set_{{param.name}}_in({{buf | render}}, size_t size);
void {{mock.func_name}}_mock_set_{{param.name}}_in_assert(void (*callback)({{actual | render}}, {{expected | render}}, size_t size));
void {{mock.func_name}}_mock_set_{{param.name}}_in_pointer({{param | render}});
void {{mock.func_name}}_mock_set_{{param.name}}_out({{buf | render}}, size_t size);
void {{mock.func_name}}_mock_set_{{param.name}}_out_copy(void (*callback)({{dst | render}}, {{src | render}}, size_t size));
{% endfor %}
{% if mock.is_variadic_func %}
void {{mock.func_name}}_mock_ignore_va_arg_in_at(unsigned int index);
void {{mock.func_name}}_mock_set_va_arg_in_at(unsigned int index, const void *buf_p, size_t size);
void {{mock.func_name}}_mock_set_va_arg_in_assert_at(unsigned int index, nala_mock_in_assert_t in_assert);
void {{mock.func_name}}_mock_set_va_arg_in_pointer_at(unsigned int index, const void *buf_p);
void {{mock.func_name}}_mock_set_va_arg_out_at(unsigned int index, const void *buf_p, size_t size);
void {{mock.func_name}}_mock_set_va_arg_out_copy_at(unsigned int index, nala_mock_out_copy_t out_copy);
{% endif %}
void {{mock.func_name}}_mock_none(void);
void {{mock.func_name}}_mock_implementation({{mock.implementation_decl | render}});
void {{mock.func_name}}_mock_real(void);
void {{mock.func_name}}_mock_real_once(void);
void {{mock.func_name}}_mock_suspend(void);
void {{mock.func_name}}_mock_resume(void);
void {{mock.func_name}}_mock_reset(void);
void {{mock.func_name}}_mock_assert_completed(void);
{% endfor %}

// Struct assertions

{% for assert_in in struct_assert_ins %}
void nala_mock_assert_in_struct_{{assert_in.name}}(
    struct nala_traceback_t *traceback_p,
    const char *func_p,
    const char *param_p,
    const void *left_p,
    const void *right_p,
    size_t size);
{% endfor %}

#endif

#endif
