proglang automatic "simple"(?) FFI interface -------------------------------------------- functions: void ffi_get_info(const char *language, const FFIInfo *info); FFI *ffi_new(const char *language); int ffi_add_system(FFI *ffi, const char *name); int ffi_add_local(FFI *ffi, const char *path, const char *name); int ffi_load(FFI *ffi); /* or have a list of pointers (then records can have variable size!) */ int ffi_get_symbols(FFI *ffi, FFISymbol **syms, size_t *count); void ffi_free_symbols(FFI *ffi, FFISymbol *syms, size_t count); void ffi_free(FFI *ffi); typedef struct { FFIKind kind; /* language-dependent type of symbol (e.g. function, variable, type, etc.) */ FFIBits flags; /* language-dependent bits */ const char *name; /* name. not all symbols have names */ size_t ref1, ref2, ref3; } FFISymbol; typedef enum { Decl_ } FFIInfoType; typedef struct { size_t num_kinds; /* bits --> string that is semi-"standardized". e.g "c-function" or "se.kodafritt.ffi.kinds.function" */ size_t num_flags; /* bits --> string that is semi-"standardized". e.g "bits.const" or "se.kodafritt.ffi.bits.const" */ } FFIInfo;