Global Namespace

// namespaces

namespace jnc;

// typedefs

typedef const jnc_Error* jnc_GetLastErrorFunc();
typedef void jnc_SetErrorFunc(const jnc_Error *error);
typedef void jnc_SetErrnoFunc(int code);
typedef void jnc_SetStringErrorFunc(const char *string);
typedef const char* jnc_GetErrorDescriptionFunc(const jnc_Error *error);
typedef bool_t jnc_IsEveryCapabilityEnabledFunc();
typedef bool_t jnc_IsCapabilityEnabledFunc(const char *capability);

typedef size_t jnc_ReadCapabilityParamFunc(
    const char *param,
    void *value,
    size_t size
    );

typedef const char* jnc_ModuleItemDecl_GetNameFunc(jnc_ModuleItemDecl *decl);
typedef jnc_StorageKind jnc_ModuleItemDecl_GetStorageKindFunc(jnc_ModuleItemDecl *decl);
typedef jnc_AccessKind jnc_ModuleItemDecl_GetAccessKindFunc(jnc_ModuleItemDecl *decl);
typedef jnc_AttributeBlock* jnc_ModuleItemDecl_GetAttributeBlockFunc(jnc_ModuleItemDecl *decl);

typedef jnc_Attribute* jnc_ModuleItemDecl_FindAttributeFunc(
    jnc_ModuleItemDecl *decl,
    const char *name
    );

typedef jnc_Unit* jnc_ModuleItemDecl_GetParentUnitFunc(jnc_ModuleItemDecl *decl);
typedef jnc_Namespace* jnc_ModuleItemDecl_GetParentNamespaceFunc(jnc_ModuleItemDecl *decl);
typedef jnc_ModuleItem* jnc_ModuleItemDecl_GetDeclItemFunc(jnc_ModuleItemDecl *decl);
typedef int jnc_ModuleItemDecl_GetLineFunc(jnc_ModuleItemDecl *decl);
typedef int jnc_ModuleItemDecl_GetColFunc(jnc_ModuleItemDecl *decl);
typedef jnc_Module* jnc_ModuleItem_GetModuleFunc(jnc_ModuleItem *item);
typedef jnc_ModuleItemKind jnc_ModuleItem_GetItemKindFunc(jnc_ModuleItem *item);
typedef uint_t jnc_ModuleItem_GetFlagsFunc(jnc_ModuleItem *item);
typedef jnc_ModuleItemDecl* jnc_ModuleItem_GetDeclFunc(jnc_ModuleItem *item);
typedef jnc_Namespace* jnc_ModuleItem_GetNamespaceFunc(jnc_ModuleItem *item);
typedef jnc_Type* jnc_ModuleItem_GetTypeFunc(jnc_ModuleItem *item);

typedef const char* jnc_ModuleItem_GetItemStringFunc(
    jnc_ModuleItem *item,
    size_t index
    );

typedef size_t jnc_AttributeBlock_GetAttributeCountFunc(jnc_AttributeBlock *block);

typedef jnc_Attribute* jnc_AttributeBlock_GetAttributeFunc(
    jnc_AttributeBlock *block,
    size_t index
    );

typedef jnc_Attribute* jnc_AttributeBlock_FindAttributeFunc(
    jnc_AttributeBlock *block,
    const char *name
    );

typedef bool_t jnc_Namespace_IsReadyFunc(jnc_Namespace *nspace);
typedef jnc_NamespaceKind jnc_Namespace_GetNamespaceKindFunc(jnc_Namespace *nspace);
typedef size_t jnc_Namespace_GetItemCountFunc(jnc_Namespace *nspace);

typedef jnc_ModuleItem* jnc_Namespace_GetItemFunc(
    jnc_Namespace *nspace,
    size_t index
    );

typedef jnc_FindModuleItemResult jnc_Namespace_FindItemFunc(
    jnc_Namespace *nspace,
    const char *name
    );

typedef uint_t jnc_Variable_GetPtrTypeFlagsFunc(jnc_Variable *variable);
typedef bool_t jnc_Variable_HasInitializerFunc(jnc_Variable *variable);
typedef const char* jnc_Variable_GetInitializerStringFunc(jnc_Variable *variable);
typedef jnc_FunctionKind jnc_Function_GetFunctionKindFunc(jnc_Function *function);
typedef bool_t jnc_Function_IsMemberFunc(jnc_Function *function);
typedef bool_t jnc_Function_IsUnusedExternalFunc(jnc_Function *function);
typedef void* jnc_Function_GetMachineCodeFunc(jnc_Function *function);
typedef jnc_FunctionKind jnc_FunctionOverload_GetFunctionKindFunc(jnc_FunctionOverload *function);
typedef size_t jnc_FunctionOverload_GetOverloadCountFunc(jnc_FunctionOverload *function);

typedef jnc_Function* jnc_FunctionOverload_GetOverloadFunc(
    jnc_FunctionOverload *function,
    size_t index
    );

typedef jnc_Function* jnc_Property_GetGetterFunc(jnc_Property *prop);
typedef jnc_OverloadableFunction jnc_Property_GetSetterFunc(jnc_Property *prop);
typedef jnc_TypeKind jnc_Type_GetTypeKindFunc(jnc_Type *type);
typedef size_t jnc_Type_GetSizeFunc(jnc_Type *type);
typedef const char* jnc_Type_GetTypeStringFunc(jnc_Type *type);

typedef bool_t jnc_Type_IsEqualFunc(
    jnc_Type *type,
    jnc_Type *type2
    );

typedef jnc_ArrayType* jnc_Type_GetArrayTypeFunc(
    jnc_Type *type,
    size_t elementCount
    );

typedef jnc_DataPtrType* jnc_Type_GetBitFieldDataPtrTypeFunc(
    jnc_Type *type,
    uint_t bitOffset,
    uint_t bitCount,
    jnc_TypeKind typeKind,
    uint_t flags
    );

typedef jnc_DataPtrType* jnc_Type_GetDataPtrTypeFunc(
    jnc_Type *type,
    jnc_TypeKind typeKind,
    uint_t flags
    );

typedef bool_t jnc_Type_ensureLayoutFunc(jnc_Type *type);
typedef bool_t jnc_Type_ensureNoImportsFunc(jnc_Type *type);

typedef void jnc_Type_MarkGcRootsFunc(
    jnc_Type *type,
    const void *p,
    jnc_GcHeap *gcHeap
    );

typedef size_t jnc_BaseTypeSlot_GetOffsetFunc(jnc_BaseTypeSlot *baseType);
typedef size_t jnc_BaseTypeSlot_GetVtableIndexFunc(jnc_BaseTypeSlot *baseType);
typedef jnc_Function* jnc_DerivableType_GetMethodFunc(jnc_DerivableType *type);
typedef jnc_OverloadableFunction jnc_DerivableType_GetOverloadableMethodFunc(jnc_DerivableType *type);

typedef jnc_OverloadableFunction jnc_DerivableType_GetUnaryOperatorFunc(
    jnc_DerivableType *type,
    jnc_UnOpKind opKind
    );

typedef jnc_OverloadableFunction jnc_DerivableType_GetBinaryOperatorFunc(
    jnc_DerivableType *type,
    jnc_BinOpKind opKind
    );

typedef jnc_Function* jnc_DerivableType_FindCastOperatorFunc(
    jnc_DerivableType *type,
    jnc_Type *targetType
    );

typedef jnc_Type* jnc_ArrayType_GetElementTypeFunc(jnc_ArrayType *type);
typedef size_t jnc_ArrayType_GetElementCountFunc(jnc_ArrayType *type);
typedef jnc_Type* jnc_FunctionType_GetReturnTypeFunc(jnc_FunctionType *type);
typedef size_t jnc_FunctionType_GetArgCountFunc(jnc_FunctionType *type);

typedef jnc_FunctionArg* jnc_FunctionType_GetArgFunc(
    jnc_FunctionType *type,
    size_t index
    );

typedef jnc_FunctionPtrType* jnc_FunctionType_GetFunctionPtrTypeFunc(
    jnc_FunctionType *type,
    jnc_TypeKind typeKind,
    uint_t flags
    );

typedef jnc_FunctionType* jnc_FunctionType_GetShortTypeFunc(jnc_FunctionType *type);
typedef int64_t jnc_EnumConst_GetValueFunc(jnc_EnumConst *enumConst);
typedef jnc_Type* jnc_EnumType_GetBaseTypeFunc(jnc_EnumType *type);
typedef jnc_Type* jnc_EnumType_GetRootTypeFunc(jnc_EnumType *type);
typedef size_t jnc_EnumType_GetConstCountFunc(jnc_EnumType *type);

typedef jnc_EnumConst* jnc_EnumType_GetConstFunc(
    jnc_EnumType *type,
    size_t index
    );

typedef jnc_Type* jnc_Field_GetTypeFunc(jnc_Field *field);
typedef uint_t jnc_Field_GetBitOffsetFunc(jnc_Field *field);
typedef uint_t jnc_Field_GetBitCountFunc(jnc_Field *field);
typedef uint_t jnc_Field_GetPtrTypeFlagsFunc(jnc_Field *field);
typedef size_t jnc_Field_GetOffsetFunc(jnc_Field *field);
typedef jnc_ClassTypeKind jnc_ClassType_GetClassTypeKindFunc(jnc_ClassType *type);
typedef jnc_StructType* jnc_ClassType_GetIfaceStructTypeFunc(jnc_ClassType *type);

typedef jnc_ClassPtrType* jnc_ClassType_GetClassPtrTypeFunc(
    jnc_ClassType *type,
    jnc_TypeKind typeKind,
    uint_t flags
    );

typedef jnc_FunctionPtrType* jnc_MulticastClassType_GetTargetTypeFunc(jnc_MulticastClassType *type);

typedef jnc_Function* jnc_MulticastClassType_GetMethodFunc(
    jnc_MulticastClassType *type,
    jnc_MulticastMethodKind method
    );

typedef jnc_FunctionPtrType* jnc_McSnapshotClassType_GetTargetTypeFunc(jnc_McSnapshotClassType *type);

typedef jnc_Function* jnc_McSnapshotClassType_GetMethodFunc(
    jnc_McSnapshotClassType *type,
    jnc_McSnapshotMethodKind method
    );

typedef jnc_DataPtrKind jnc_DataPtrType_GetPtrKindFunc(jnc_DataPtrType *type);
typedef jnc_Type* jnc_DataPtrType_GetTargetTypeFunc(jnc_DataPtrType *type);
typedef uint_t jnc_DataPtrType_GetBitOffsetFunc(jnc_DataPtrType *type);
typedef uint_t jnc_DataPtrType_GetBitCountFunc(jnc_DataPtrType *type);
typedef jnc_ClassPtrKind jnc_ClassPtrType_GetPtrKindFunc(jnc_ClassPtrType *type);
typedef jnc_ClassType* jnc_ClassPtrType_GetTargetTypeFunc(jnc_ClassPtrType *type);
typedef jnc_FunctionPtrKind jnc_FunctionPtrType_GetPtrKindFunc(jnc_FunctionPtrType *type);
typedef jnc_FunctionType* jnc_FunctionPtrType_GetTargetTypeFunc(jnc_FunctionPtrType *type);

typedef bool_t jnc_Variant_CreateFunc(
    jnc_Variant *variant,
    const void *p,
    jnc_Type *type
    );

typedef bool_t jnc_Variant_CastFunc(
    const jnc_Variant *variant,
    jnc_Type *type,
    void *buffer
    );

typedef bool_t jnc_Variant_UnaryOperatorFunc(
    const jnc_Variant *variant,
    jnc_UnOpKind opKind,
    jnc_Variant *result
    );

typedef bool_t jnc_Variant_BinaryOperatorFunc(
    const jnc_Variant *variant,
    const jnc_Variant *variant2,
    jnc_BinOpKind opKind,
    jnc_Variant *result
    );

typedef bool_t jnc_Variant_RelationalOperatorFunc(
    const jnc_Variant *variant,
    const jnc_Variant *variant2,
    jnc_BinOpKind opKind,
    bool_t *result
    );

typedef bool_t jnc_Variant_GetMemberFunc(
    const jnc_Variant *variant,
    const char *name,
    jnc_Variant *result
    );

typedef bool_t jnc_Variant_SetMemberFunc(
    jnc_Variant *variant,
    const char *name,
    jnc_Variant value
    );

typedef bool_t jnc_Variant_GetElementFunc(
    const jnc_Variant *variant,
    size_t index,
    jnc_Variant *result
    );

typedef bool_t jnc_Variant_SetElementFunc(
    jnc_Variant *variant,
    size_t index,
    jnc_Variant value
    );

typedef size_t jnc_Variant_HashFunc(const jnc_Variant *variant);

typedef const char* jnc_Variant_FormatFunc(
    const jnc_Variant *variant,
    const char *fmtSpecifier
    );

typedef jnc_DataPtr jnc_String_SzFunc(const jnc_String *string);

typedef void jnc_String_SetPtrFunc(
    jnc_String *string,
    jnc_DataPtr ptr,
    size_t length
    );

typedef jnc_Promise* jnc_Promise_CreateFunc(jnc_Runtime *runtime);

typedef void jnc_Promise_CompleteFunc(
    jnc_Promise *promise,
    jnc_Variant result,
    jnc_DataPtr errorPtr
    );

typedef jnc_ExtensionLib* jnc_Unit_GetLibFunc(jnc_Unit *unit);
typedef const char* jnc_Unit_GetFilePathFunc(jnc_Unit *unit);
typedef const char* jnc_Unit_GetFileNameFunc(jnc_Unit *unit);
typedef const char* jnc_Unit_GetDirFunc(jnc_Unit *unit);
typedef const char* jnc_Module_GetNameFunc(jnc_Module *module);
typedef jnc_GlobalNamespace* jnc_Module_GetGlobalNamespaceFunc(jnc_Module *module);

typedef jnc_GlobalNamespace* jnc_Module_GetStdNamespaceFunc(
    jnc_Module *module,
    jnc_StdNamespace stdNamespace
    );

typedef jnc_Type* jnc_Module_GetPrimitiveTypeFunc(
    jnc_Module *module,
    jnc_TypeKind typeKind
    );

typedef jnc_Type* jnc_Module_GetStdTypeFunc(
    jnc_Module *module,
    jnc_StdType stdType
    );

typedef handle_t jnc_Module_GetExtensionSourceFileIteratorFunc(jnc_Module *module);

typedef const char* jnc_Module_GetNextExtensionSourceFileFunc(
    jnc_Module *module,
    handle_t *iterator
    );

typedef jnc_FindModuleItemResult jnc_Module_FindExtensionLibItemFunc(
    jnc_Module *module,
    const char *name,
    const jnc_Guid *libGuid,
    size_t itemCacheSlot
    );

typedef const char* jnc_Module_GetExtensionLibZipFilePathFunc(
    jnc_Module *module,
    jnc_ExtensionLib *lib
    );

typedef bool_t jnc_Module_MapVariableFunc(
    jnc_Module *module,
    jnc_Variable *variable,
    void *p
    );

typedef bool_t jnc_Module_MapFunctionFunc(
    jnc_Module *module,
    jnc_Function *function,
    void *p
    );

typedef void jnc_Module_AddSourceFunc(
    jnc_Module *module,
    jnc_ExtensionLib *lib,
    const char *fileName,
    const char *source,
    size_t length
    );

typedef handle_t jnc_Module_GetImportDirIteratorFunc(jnc_Module *module);

typedef const char* jnc_Module_GetNextImportDirFunc(
    jnc_Module *module,
    handle_t *iterator
    );

typedef void jnc_Module_AddImportDirFunc(
    jnc_Module *module,
    const char *dir
    );

typedef bool_t jnc_Module_AddImportFunc(
    jnc_Module *module,
    const char *fileName
    );

typedef void jnc_Module_AddSourceImportFunc(
    jnc_Module *module,
    const char *fileName,
    const char *source,
    size_t length
    );

typedef void jnc_Module_AddOpaqueClassTypeInfoFunc(
    jnc_Module *module,
    const char *qualifiedName,
    const jnc_OpaqueClassTypeInfo *info
    );

typedef void jnc_Module_AddStaticLibFunc(
    jnc_Module *module,
    jnc_ExtensionLib *lib
    );

typedef void jnc_Module_RequireFunc(
    jnc_Module *module,
    jnc_ModuleItemKind itemKind,
    const char *name,
    uint_t flags
    );

typedef void jnc_Module_RequireTypeFunc(
    jnc_Module *module,
    jnc_TypeKind typeKind,
    const char *name,
    uint_t flags
    );

typedef bool_t jnc_Module_ParseFunc(
    jnc_Module *module,
    const char *fileName,
    const char *source,
    size_t length
    );

typedef bool_t jnc_Module_ParseFileFunc(
    jnc_Module *module,
    const char *fileName
    );

typedef bool_t jnc_Module_ParseImportsFunc(jnc_Module *module);
typedef bool_t jnc_Module_CompileFunc(jnc_Module *module);
typedef bool_t jnc_Module_JitFunc(jnc_Module *module);
typedef const char* jnc_Module_getLlvmIrStringFunc(jnc_Module *module);
typedef jnc_Runtime* jnc_Runtime_CreateFunc();
typedef void jnc_Runtime_DestroyFunc(jnc_Runtime *runtime);
typedef jnc_Module* jnc_Runtime_GetModuleFunc(jnc_Runtime *runtime);
typedef jnc_GcHeap* jnc_Runtime_GetGcHeapFunc(jnc_Runtime *runtime);
typedef bool_t jnc_Runtime_IsAbortedFunc(jnc_Runtime *runtime);

typedef bool_t jnc_Runtime_StartupFunc(
    jnc_Runtime *runtime,
    jnc_Module *module
    );

typedef void jnc_Runtime_ShutdownFunc(jnc_Runtime *runtime);
typedef void jnc_Runtime_AbortFunc(jnc_Runtime *runtime);

typedef void jnc_Runtime_InitializeCallSiteFunc(
    jnc_Runtime *runtime,
    jnc_CallSite *callSite
    );

typedef void jnc_Runtime_UninitializeCallSiteFunc(
    jnc_Runtime *runtime,
    jnc_CallSite *callSite
    );

typedef jnc_SjljFrame* jnc_Runtime_SetSjljFrameFunc(
    jnc_Runtime *runtime,
    jnc_SjljFrame *frame
    );

typedef void* jnc_Runtime_GetUserDataFunc(jnc_Runtime *runtime);

typedef void* jnc_Runtime_SetUserDataFunc(
    jnc_Runtime *runtime,
    void *data
    );

typedef jnc_Runtime* jnc_GetCurrentThreadRuntimeFunc();
typedef jnc_Tls* jnc_GetCurrentThreadTlsFunc();
typedef void jnc_DynamicThrowFunc();
typedef void jnc_SaveSignalInfoFunc(jnc_SjljFrame *sjljFrame);

typedef void jnc_PrimeClassFunc(
    jnc_Box *box,
    jnc_Box *root,
    jnc_ClassType *type,
    const void *vtable
    );

typedef jnc_Runtime* jnc_GcHeap_GetRuntimeFunc(jnc_GcHeap *gcHeap);

typedef void jnc_GcHeap_GetStatsFunc(
    jnc_GcHeap *gcHeap,
    jnc_GcStats *stats
    );

typedef void jnc_GcHeap_GetSizeTriggersFunc(
    jnc_GcHeap *gcHeap,
    jnc_GcSizeTriggers *triggers
    );

typedef void jnc_GcHeap_SetSizeTriggersFunc(
    jnc_GcHeap *gcHeap,
    const jnc_GcSizeTriggers *triggers
    );

typedef void jnc_GcHeap_CollectFunc(jnc_GcHeap *gcHeap);
typedef void jnc_GcHeap_EnterNoCollectRegionFunc(jnc_GcHeap *gcHeap);

typedef void jnc_GcHeap_LeaveNoCollectRegionFunc(
    jnc_GcHeap *gcHeap,
    bool_t canCollectNow
    );

typedef void jnc_GcHeap_EnterWaitRegionFunc(jnc_GcHeap *gcHeap);
typedef void jnc_GcHeap_LeaveWaitRegionFunc(jnc_GcHeap *gcHeap);

typedef jnc_IfaceHdr* jnc_GcHeap_AllocateClassFunc(
    jnc_GcHeap *gcHeap,
    jnc_ClassType *type
    );

typedef jnc_DataPtr jnc_GcHeap_AllocateDataFunc(
    jnc_GcHeap *gcHeap,
    jnc_Type *type
    );

typedef jnc_DataPtr jnc_GcHeap_AllocateArrayFunc(
    jnc_GcHeap *gcHeap,
    jnc_Type *type,
    size_t count
    );

typedef jnc_DataPtr jnc_GcHeap_AllocateBufferFunc(
    jnc_GcHeap *gcHeap,
    size_t size
    );

typedef jnc_DataPtrValidator* jnc_GcHeap_CreateDataPtrValidatorFunc(
    jnc_GcHeap *gcHeap,
    jnc_Box *box,
    const void *rangeBegin,
    size_t rangeLength
    );

typedef jnc_DetachedDataBox* jnc_GcHeap_CreateForeignDataBoxFunc(
    jnc_GcHeap *gcHeap,
    jnc_Type *type,
    size_t elementCount,
    const void *p,
    bool_t isCallSiteLocal
    );

typedef jnc_DataPtr jnc_GcHeap_CreateForeignBufferPtrFunc(
    jnc_GcHeap *gcHeap,
    const void *p,
    size_t size,
    bool_t isCallSiteLocal
    );

typedef void jnc_GcHeap_InvalidateDataPtrValidatorFunc(
    jnc_GcHeap *gcHeap,
    jnc_DataPtrValidator *validator
    );

typedef void jnc_GcHeap_WeakMarkFunc(
    jnc_GcHeap *gcHeap,
    jnc_Box *box
    );

typedef void jnc_GcHeap_MarkDataFunc(
    jnc_GcHeap *gcHeap,
    jnc_Box *box
    );

typedef void jnc_GcHeap_MarkClassFunc(
    jnc_GcHeap *gcHeap,
    jnc_Box *box
    );

typedef void jnc_GcHeap_MarkVariantFunc(
    jnc_GcHeap *gcHeap,
    jnc_Variant variant
    );

typedef void jnc_GcHeap_AddBoxToCallSiteFunc(jnc_Box *box);

typedef jnc_StdHashTable* jnc_CreateStdHashTableFunc(
    jnc_Runtime *runtime,
    jnc_StdHashFunc *hashFunc,
    jnc_StdIsEqualFunc *isEqualFunc
    );

typedef void jnc_StdHashTable_ClearFunc(jnc_StdHashTable *hashTable);

typedef jnc_StdMapEntry* jnc_StdHashTable_FindFunc(
    jnc_StdHashTable *hashTable,
    jnc_Variant key
    );

typedef jnc_StdMapEntry* jnc_StdHashTable_AddFunc(
    jnc_StdHashTable *hashTable,
    jnc_Variant key,
    jnc_Variant value
    );

typedef void jnc_StdHashTable_RemoveFunc(
    jnc_StdHashTable *hashTable,
    jnc_StdMapEntry *entry
    );

typedef bool_t jnc_StdHashTable_RemoveKeyFunc(
    jnc_StdHashTable *hashTable,
    jnc_Variant key
    );

typedef jnc_StdRbTree* jnc_CreateStdRbTreeFunc(
    jnc_Runtime *runtime,
    jnc_StdCmpFunc *cmpFunc
    );

typedef void jnc_StdRbTree_ClearFunc(jnc_StdRbTree *RbTree);

typedef jnc_StdMapEntry* jnc_StdRbTree_FindFunc(
    jnc_StdRbTree *RbTree,
    jnc_Variant key
    );

typedef jnc_StdMapEntry* jnc_StdRbTree_AddFunc(
    jnc_StdRbTree *RbTree,
    jnc_Variant key,
    jnc_Variant value
    );

typedef void jnc_StdRbTree_RemoveFunc(
    jnc_StdRbTree *RbTree,
    jnc_StdMapEntry *entry
    );

typedef bool_t jnc_StdRbTree_RemoveKeyFunc(
    jnc_StdRbTree *RbTree,
    jnc_Variant key
    );

typedef jnc_StdBuffer* jnc_CreateStdBufferFunc(jnc_Runtime *runtime);

typedef bool_t jnc_StdBuffer_ReserveFunc(
    jnc_StdBuffer *buffer,
    size_t size
    );

typedef size_t jnc_StdBuffer_CopyFunc(
    jnc_StdBuffer *buffer,
    const void *p,
    size_t size
    );

typedef size_t jnc_StdBuffer_InsertFunc(
    jnc_StdBuffer *buffer,
    size_t offset,
    const void *p,
    size_t size
    );

typedef size_t jnc_StdBuffer_RemoveFunc(
    jnc_StdBuffer *Buffer,
    size_t offset,
    size_t size
    );

typedef size_t jnc_StdHashFunc(jnc_Variant key);

typedef bool_t jnc_StdIsEqualFunc(
    jnc_Variant key1,
    jnc_Variant key2
    );

typedef int jnc_StdCmpFunc(
    jnc_Variant key1,
    jnc_Variant key2
    );

// enums

enum jnc_CodeAssistFlag;
enum jnc_CodeAssistKind;
enum jnc_DynamicLayoutMode;
enum jnc_DynamicSectionKind;

// structs

struct jnc_ArrayType;
struct jnc_ArrayTypeFuncTable;
struct jnc_AttributeBlockFuncTable;
struct jnc_AttributeFuncTable;
struct jnc_BaseTypeSlotFuncTable;
struct jnc_Box;
struct jnc_CallSite;
struct jnc_CapabilityFuncTable;
struct jnc_ClassPtrTypeFuncTable;
struct jnc_ClassType;
struct jnc_ClassTypeFuncTable;
struct jnc_CodeAuthenticatorConfig;
struct jnc_DataBox;
struct jnc_DataPtr;
struct jnc_DataPtrTypeFuncTable;
struct jnc_DataPtrValidator;
struct jnc_DerivableType;
struct jnc_DerivableTypeFuncTable;
struct jnc_DetachedDataBox;
struct jnc_DynamicExtensionLibHost;
struct jnc_EnumConstFuncTable;
struct jnc_EnumType;
struct jnc_EnumTypeFuncTable;
struct jnc_Error;
struct jnc_ErrorFuncTable;
struct jnc_ExtensionLib;
struct jnc_FieldFuncTable;
struct jnc_FindModuleItemResult;
struct jnc_FmtLiteral;
struct jnc_Function;
struct jnc_FunctionArgFuncTable;
struct jnc_FunctionFuncTable;
struct jnc_FunctionOverloadFuncTable;
struct jnc_FunctionPtr;
struct jnc_FunctionPtrTypeFuncTable;
struct jnc_FunctionType;
struct jnc_FunctionTypeFuncTable;
struct jnc_GcHeap;
struct jnc_GcHeapFuncTable;
struct jnc_GcMutatorThread;
struct jnc_GcShadowStackFrame;
struct jnc_GcShadowStackFrameMapBuffer;
struct jnc_GcSizeTriggers;
struct jnc_GcStats;
struct jnc_GlobalNamespaceFuncTable;
struct jnc_Guid;
struct jnc_IfaceHdr;
struct jnc_ListLink;
struct jnc_McSnapshot;
struct jnc_McSnapshotClassTypeFuncTable;
struct jnc_Module;
struct jnc_ModuleConfig;
struct jnc_ModuleFuncTable;
struct jnc_ModuleItem;
struct jnc_ModuleItemDecl;
struct jnc_ModuleItemDeclFuncTable;
struct jnc_ModuleItemFuncTable;
struct jnc_Multicast;
struct jnc_MulticastClassTypeFuncTable;
struct jnc_NamedTypeFuncTable;
struct jnc_Namespace;
struct jnc_NamespaceFuncTable;
struct jnc_OpaqueClassTypeInfo;
struct jnc_Promise;
struct jnc_PromiseFuncTable;
struct jnc_Property;
struct jnc_PropertyFuncTable;
struct jnc_PropertyPtr;
struct jnc_PropertyPtrTypeFuncTable;
struct jnc_PropertyType;
struct jnc_PropertyTypeFuncTable;
struct jnc_Reactor;
struct jnc_ReactorClosure;
struct jnc_Runtime;
struct jnc_RuntimeFuncTable;
struct jnc_Scheduler;
struct jnc_SchedulerVtable;
struct jnc_SjljFrame;
struct jnc_StdBuffer;
struct jnc_StdBufferFuncTable;
struct jnc_StdHashTable;
struct jnc_StdHashTableFuncTable;
struct jnc_StdMap;
struct jnc_StdMapEntry;
struct jnc_StdRbTree;
struct jnc_StdRbTreeFuncTable;
struct jnc_String;
struct jnc_StringFuncTable;
struct jnc_StructType;
struct jnc_StructTypeFuncTable;
struct jnc_Tls;
struct jnc_TlsVariableTable;
struct jnc_Type;
struct jnc_TypeFuncTable;
struct jnc_TypedefFuncTable;
struct jnc_UnionType;
struct jnc_UnionTypeFuncTable;
struct jnc_UnitFuncTable;
struct jnc_Variable;
struct jnc_VariableFuncTable;
struct jnc_Variant;
struct jnc_VariantFuncTable;

// unions

union jnc_OverloadableFunction;

// global functions

JNC_EXTERN_C bool_t
jnc_isEveryCapabilityEnabled();

JNC_EXTERN_C bool_t
jnc_isCapabilityEnabled(const char* capability);

JNC_EXTERN_C size_t
jnc_readCapabilityParam(
    const char* param,
    void* value,
    size_t size
);

JNC_INLINE size_t
jnc_getCapabilityParamSize(const char* param);

JNC_EXTERN_C size_t
jnc_writeCapabilityParam(
    const char* param,
    const void* value,
    size_t size
);

JNC_EXTERN_C bool_t
jnc_failWithCapabilityError(const char* capability);

JNC_INLINE bool_t
jnc_requireCapability(const char* capability);

JNC_EXTERN_C void
jnc_enableCapability(
    const char* capability,
    bool_t isEnabled
);

JNC_EXTERN_C void
jnc_initializeCapabilities(const char* initializer);

jnc_CodeAssistKind
jnc_CodeAssist_getCodeAssistKind(jnc_CodeAssist* codeAssist);

uint_t
jnc_CodeAssist_getFlags(jnc_CodeAssist* codeAssist);

size_t
jnc_CodeAssist_getOffset(jnc_CodeAssist* codeAssist);

jnc_Module*
jnc_CodeAssist_getModule(jnc_CodeAssist* codeAssist);

jnc_ModuleItem*
jnc_CodeAssist_getModuleItem(jnc_CodeAssist* codeAssist);

jnc_Namespace*
jnc_CodeAssist_getNamespace(jnc_CodeAssist* codeAssist);

jnc_Template*
jnc_CodeAssist_getTemplate(jnc_CodeAssist* codeAssist);

jnc_FunctionTypeOverload*
jnc_CodeAssist_getFunctionTypeOverload(jnc_CodeAssist* codeAssist);

size_t
jnc_CodeAssist_getArgumentIdx(jnc_CodeAssist* codeAssist);

size_t
jnc_DynamicSectionGroup_getSectionCount(jnc_DynamicSectionGroup* sectionGroup);

jnc_DynamicSection*
jnc_DynamicSectionGroup_getSection(
    jnc_DynamicSectionGroup* sectionGroup,
    size_t i
);

jnc_DynamicSectionKind
jnc_DynamicSection_getSectionKind(jnc_DynamicSection* section);

size_t
jnc_DynamicSection_getOffset(jnc_DynamicSection* section);

size_t
jnc_DynamicSection_getSize(jnc_DynamicSection* section);

size_t
jnc_DynamicSection_getElementCount(jnc_DynamicSection* section);

uint_t
jnc_DynamicSection_getBitOffset(jnc_DynamicSection* section);

uint_t
jnc_DynamicSection_getBitCount(jnc_DynamicSection* section);

uint_t
jnc_DynamicSection_getPtrTypeFlags(jnc_DynamicSection* section);

jnc_Type*
jnc_DynamicSection_getType(jnc_DynamicSection* section);

jnc_ModuleItemDecl*
jnc_DynamicSection_getDecl(jnc_DynamicSection* section);

jnc_DynamicLayout*
jnc_createDynamicLayout(
    jnc_Runtime* runtime,
    uint_t mode,
    jnc_DataPtr ptr,
    size_t size
);

size_t
jnc_DynamicLayout_getSize(jnc_DynamicLayout* layout);

size_t
jnc_DynamicLayout_getBufferSize(jnc_DynamicLayout* layout);

size_t
jnc_DynamicLayout_getSizeLimit(jnc_DynamicLayout* layout);

void
jnc_DynamicLayout_setSizeLimit(
    jnc_DynamicLayout* layout,
    size_t size
);

uint_t
jnc_DynamicLayout_getMode(jnc_DynamicLayout* layout);

void
jnc_DynamicLayout_reset(
    jnc_DynamicLayout* layout,
    uint_t mode,
    jnc_DataPtr ptr,
    size_t size
);

static
void
jnc_DynamicLayout_clear(jnc_DynamicLayout* layout);

void
jnc_DynamicLayout_updateGroupSizes(jnc_DynamicLayout* layout);

jnc_StdBuffer*
jnc_createStdBuffer(jnc_Runtime* runtime);

static
size_t
jnc_StdBuffer_getSize(jnc_StdBuffer* buffer);

static
bool_t
jnc_StdBuffer_isEmpty(jnc_StdBuffer* buffer);

static
bool_t
jnc_StdBuffer_setSize(
    jnc_StdBuffer* buffer,
    size_t size
);

static
void
jnc_StdBuffer_clear(jnc_StdBuffer* buffer);

bool_t
jnc_StdBuffer_reserve(
    jnc_StdBuffer* buffer,
    size_t size
);

size_t
jnc_StdBuffer_copy(
    jnc_StdBuffer* buffer,
    const void* p,
    size_t size
);

static
size_t
jnc_StdBuffer_append(
    jnc_StdBuffer* buffer,
    const void* p,
    size_t size
);

size_t
jnc_StdBuffer_insert(
    jnc_StdBuffer* buffer,
    size_t offset,
    const void* p,
    size_t size
);

size_t
jnc_StdBuffer_remove(
    jnc_StdBuffer* buffer,
    size_t offset,
    size_t size
);

jnc_StdHashTable*
jnc_createStdHashTable(
    jnc_Runtime* runtime,
    jnc_StdHashFunc* hashFunc,
    jnc_StdIsEqualFunc* isEqualFunc
);

void
jnc_StdHashTable_clear(jnc_StdHashTable* hashTable);

jnc_StdMapEntry*
jnc_StdHashTable_find(
    jnc_StdHashTable* hashTable,
    jnc_Variant key
);

jnc_StdMapEntry*
jnc_StdHashTable_add(
    jnc_StdHashTable* hashTable,
    jnc_Variant key,
    jnc_Variant value
);

void
jnc_StdHashTable_remove(
    jnc_StdHashTable* hashTable,
    jnc_StdMapEntry* entry
);

bool_t
jnc_StdHashTable_removeKey(
    jnc_StdHashTable* hashTable,
    jnc_Variant key
);

static
jnc_StdMapEntry*
jnc_StdMapEntry_getNext(jnc_StdMapEntry* entry);

static
jnc_StdMapEntry*
jnc_StdMapEntry_getPrev(jnc_StdMapEntry* entry);

static
size_t
jnc_StdMap_getItemCount(jnc_StdMap* map);

static
bool_t
jnc_StdMap_isEmpty(jnc_StdMap* map);

static
jnc_StdMapEntry*
jnc_StdMap_getHead(jnc_StdMap* map);

static
jnc_StdMapEntry*
jnc_StdMap_getTail(jnc_StdMap* map);

jnc_StdRbTree*
jnc_createStdRbTree(
    jnc_Runtime* runtime,
    jnc_StdCmpFunc* cmpFunc
);

void
jnc_StdRbTree_clear(jnc_StdRbTree* RbTree);

jnc_StdMapEntry*
jnc_StdRbTree_find(
    jnc_StdRbTree* RbTree,
    jnc_Variant key
);

jnc_StdMapEntry*
jnc_StdRbTree_add(
    jnc_StdRbTree* RbTree,
    jnc_Variant key,
    jnc_Variant value
);

void
jnc_StdRbTree_remove(
    jnc_StdRbTree* RbTree,
    jnc_StdMapEntry* entry
);

bool_t
jnc_StdRbTree_removeKey(
    jnc_StdRbTree* RbTree,
    jnc_Variant key
);

// macros

#define JNC_EDIT_EXPORT