#pragma once
// vim: ft=cpp

/// \file cap_flags.h
/// Capability bitfield constants

#define j6_handle_caps(h)  (((h)>>32) & 0xffffff)

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

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

for obj in syscalls.exposes:
    i = 0
    if obj.super:
        i = len(obj.super.caps)

    for cap in obj.caps:
        name = f"j6_cap_{obj.name}_{cap}"
        cog.outl(f"#define {name:<30} (1ull << {i})")
        i += 1

    name = f"j6_cap_{obj.name}_all"
    cog.outl(f"#define {name:<30} ((1ull<<{i})-1)")
    cog.outl()
]]]*/
/// [[[end]]]
