KrkNative Struct Reference

Managed binding to a C function. More...

#include <object.h>

Inheritance diagram for KrkNative:

Public Member Functions

KrkNativekrk_newNative (NativeFn function, const char *name, int type)
 Create a native function binding object. More...

Data Fields

NativeFn function
 C function pointer.
const char * name
 Name to use when repring.
const char * doc
 Docstring to supply from __doc__.
- Data Fields inherited from KrkObj
uint16_t type
 Tag indicating core type.
uint16_t flags
 General object flags, mostly related to garbage collection.
uint32_t hash
 Cached hash value for table keys.
struct KrkObjnext
 Invasive linked list of all objects in the VM.

Protected Attributes

KrkObj obj

Detailed Description

Managed binding to a C function.

Represents a C function that has been exposed to managed code.

Definition at line 309 of file object.h.

Member Function Documentation

◆ krk_newNative()

KrkNative * krk_newNative ( NativeFn  function,
const char *  name,
int  type 

Create a native function binding object.

Converts a C function pointer into a native binding object which can then be used in the same place a function object (KrkClosure) would be used.

Definition at line 281 of file object.c.

The documentation for this struct was generated from the following file: