#ifndef DLDOTA_H
#define DLDOTA_H
#include <stddef.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef struct dldota_ctx dldota_ctx;
#define DLDOTA_LAZY 0x0001
#define DLDOTA_NOW 0x0002
#define DLDOTA_NOLOAD 0x0004
#define DLDOTA_LOCAL 0x0000
#define DLDOTA_GLOBAL 0x0100
#define DLDOTA_NODELETE 0x1000
dldota_ctx *dldota_ctx_new(const char *interpreter);
void dldota_ctx_free(dldota_ctx *ctx);
int dldota_ctx_unload(dldota_ctx *ctx);
typedef struct dldota_heap_usage {
size_t live_allocations;
size_t live_bytes;
size_t mapped_bytes;
} dldota_heap_usage;
void dldota_heap_usage(const dldota_ctx *ctx, dldota_heap_usage *out);
void *dldota_open(dldota_ctx *ctx, const char *name, int flags);
void *dldota_sym(dldota_ctx *ctx, void *handle, const char *name);
int dldota_close(dldota_ctx *ctx, void *handle);
void *dldota_callback(dldota_ctx *ctx, void *func);
void dldota_callback_free(dldota_ctx *ctx, void *thunk);
void *dldota_foreign(dldota_ctx *ctx, void *func);
const char *dldota_error(void);
#ifdef __cplusplus
}
#endif
#endif