#ifndef _MLP_C_H_ #define _MLP_C_H_ #include "../src/mlp.h" #include class mlp_c_language : public mlp_language { public: mlp_c_language() ; virtual mlp_runtime *new_runtime(mlp_context *ctx, const void *opts) ; } ; class mlp_c_runtime : public mlp_runtime { protected: virtual ~mlp_c_runtime() ; public: mlp_c_runtime(mlp_context *ctx, mlp_language *lang, const void *opts) ; virtual void destroy(mlp_context *ctx) ; virtual mlp_library *load_library(mlp_context *ctx, const char *name, const void *opts) ; virtual void setup_context(mlp_context *ctx) ; } ; class mlp_c_library : public mlp_library { CInvLibrary *cil ; protected: virtual ~mlp_c_library() ; public: mlp_c_library(mlp_context *ctx, mlp_runtime *rt, const char *name, const void *opts) ; virtual mlp_function *get_function(mlp_context *ctx, mlp_type rtype, const char *name, mlp_prototype proto) ; void *_load_entrypoint(mlp_context *ctx, const char *name) ; virtual void destroy(mlp_context *ctx) ; } ; class mlp_c_function : public mlp_function { CInvFunction *cif ; void *entrypoint ; protected: virtual ~mlp_c_function() ; public: mlp_c_function(mlp_context *ctx, mlp_runtime *rt, mlp_library *lib, mlp_type rtype, const char *name, mlp_prototype proto) ; virtual mlp_value *call(mlp_context *ctx, mlp_arguments args) ; virtual void destroy(mlp_context *ctx) ; } ; char mlp_c_type2cinvformat(mlp_type t) ; void * mlp_c_allocate_cinv_type(mlp_type t) ; void * mlp_c_allocate_cinv_value(mlp_type t, mlp_value *v) ; mlp_value *mlp_c_allocate_mlp_value(mlp_type t, void *ptr) ; #endif