/*
 * Copyright (C) 2022 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#pragma once

#include <stddef.h>
#include <stdint.h>
#include <string.h>

#ifdef __cplusplus
extern "C" {
#endif

{% for enum in env.enums.values() %}
enum {{enum.c_name}} {
{% for value in enum.values %}
    {{value.name}}{{" "*(enum.values_name_len-value.name_len+1)}}= {{value.value}},
{% endfor %}
};
{{''}}
{{''}}
{%- endfor %}

{% for atom in env.atoms %}
struct stats_{{atom.c_name}} {
    const char* reverse_domain_name;
    size_t reverse_domain_name_len;
{% for value in atom.values %}
    {{value.c_type}}{{value.c_name}};
{% if value.is_string %}
    size_t {{value.c_name}}_len;
{% endif %}
{% endfor %}
};
{{''}}
{% endfor %}

{% for atom in env.atoms %}
int stats_{{atom.c_name}}_report(const char* port_name, size_t port_name_len, struct stats_{{atom.c_name}} {{atom.c_name}});
{{''}}
{% endfor %}

#ifdef __cplusplus
}  // extern "C"
#endif
