Reorg context.c

This commit is contained in:
0x1eef 2024-10-12 13:38:25 -03:00
parent e6a48c3216
commit a04dbc90ab

View file

@ -19,14 +19,6 @@ bsdcontrol_context_alloc(VALUE klass)
return Data_Wrap_Struct(klass, NULL, bsdcontrol_context_free, ctx);
}
hbsdctrl_ctx_t *
bsdcontrol_context_unwrap(VALUE rbcontext)
{
hbsdctrl_ctx_t *ctx;
Data_Get_Struct(rbcontext, hbsdctrl_ctx_t, ctx);
return ctx;
}
static void
bsdcontrol_context_free(hbsdctrl_ctx_t *ctx)
{
@ -70,3 +62,11 @@ bsdcontrol_context_library_version(VALUE self)
ctx = bsdcontrol_context_unwrap(self);
return ULONG2NUM(ctx->hc_version);
}
hbsdctrl_ctx_t *
bsdcontrol_context_unwrap(VALUE rbcontext)
{
hbsdctrl_ctx_t *ctx;
Data_Get_Struct(rbcontext, hbsdctrl_ctx_t, ctx);
return ctx;
}