#include #include #include #include "../src/mlp_priv.h" #include "mlp_perl_priv.h" void *_mlp_perl_new_class(mlp_context *ctx, const char *name){ PerlInterpreter *my_perl = mlp_context_get_runtime(ctx)->runtime ; HV *stash = gv_stashpv(name, 0) ; if (stash == NULL){ mlp_context_set_error(ctx, MLP_NO_SUCH_CLASS, "Perl package %s is not defined", name) ; return NULL ; } SV *class_ = newRV_inc((SV *)stash) ; if (class_ == NULL){ mlp_context_set_error(ctx, MLP_INTERNAL_ERROR, "Can't create RV for stash of Perl package %s", name) ; return NULL ; } return (void *)class_ ; } /* void _mlp_perl_detach_class(mlp_context *ctx, const mlp_class *class_){ PerlInterpreter *my_perl = mlp_context_get_runtime(ctx)->runtime ; SvREFCNT_dec((SV *)class_->class) ; } void _mlp_perl_delete_class(mlp_context *ctx, void *class_){ PerlInterpreter *my_perl = mlp_context_get_runtime(ctx)->runtime ; SvREFCNT_dec((SV *)class_) ; } */