#pragma once
// vim: ft=cpp

// The kernel depends on libj6 for some shared code,
// but should not include the user-specific code.
#ifndef __j6kernel

#include <j6/types.h>

#ifdef __cplusplus
extern "C" {
#endif

/*[[[cog code generation
from definitions.context import Context

ctx = Context(definitions_path)
ctx.parse("syscalls.def")
syscalls = ctx.interfaces["syscalls"]

last_scope = None
for id, scope, method in syscalls.methods:
    if scope:
        name = f"{scope.name}_{method.name}"
    else:
        name = method.name

    if scope != last_scope:
        cog.outl("")
    last_scope = scope

    args = []
    if method.constructor:
        args.append("j6_handle_t *handle")
    elif not method.static:
        args.append("j6_handle_t handle")

    for param in method.params:
        for type, suffix in param.type.c_names(param.options):
            args.append(f"{type} {param.name}{suffix}")

    cog.outl(f"""j6_status_t j6_{name} ({", ".join(args)});""")
]]]*/
/// [[[end]]]

#ifdef __cplusplus
}
#endif

#endif // __j6kernel
