Curses
view release on metacpan or search on metacpan
}
static FORM *
c_sv2form(sv, argnum)
SV *sv;
int argnum;
{
if (sv_derived_from(sv, "Curses::Form"))
return (FORM *)SvIV((SV*)SvRV(sv));
if (argnum >= 0)
croak("argument %d to Curses function '%s' is not a Curses form",
argnum, c_function);
else
croak("argument is not a Curses form");
}
static void
c_form2sv(sv, val)
SV *sv;
FORM *val;
{
sv_setref_pv(sv, "Curses::Form", (void*)val);
}
static ITEM *
c_sv2item(sv, argnum)
SV *sv;
int argnum;
{
if (sv_derived_from(sv, "Curses::Item"))
return (ITEM *)SvIV((SV*)SvRV(sv));
if (argnum >= 0)
croak("argument %d to Curses function '%s' is not a Curses item",
argnum, c_function);
else
croak("argument is not a Curses item");
}
static void
c_item2sv(SV * const svP,
ITEM * const valP) {
/*----------------------------------------------------------------------------
Make *svP a reference to a new scalar whose implementation value is
'valP' and which is blessed into class Curses::Item.
Caller can pass the referenced scalar to other functions of the Curses
module, which can recover the ITEM * from it.
-----------------------------------------------------------------------------*/
sv_setref_pv(svP, "Curses::Item", (void*)valP);
}
static MENU *
c_sv2menu(sv, argnum)
SV *sv;
int argnum;
{
if (sv_derived_from(sv, "Curses::Menu"))
return (MENU *)SvIV((SV*)SvRV(sv));
if (argnum >= 0)
croak("argument %d to Curses function '%s' is not a Curses menu",
argnum, c_function);
else
croak("argument is not a Curses menu");
}
static void
c_menu2sv(sv, val)
SV *sv;
MENU *val;
{
sv_setref_pv(sv, "Curses::Menu", (void*)val);
}
static PANEL *
c_sv2panel(sv, argnum)
SV *sv;
int argnum;
{
if (sv_derived_from(sv, "Curses::Panel"))
return (PANEL *)SvIV((SV*)SvRV(sv));
if (argnum >= 0)
croak("argument %d to Curses function '%s' is not a Curses panel",
argnum, c_function);
else
croak("argument is not a Curses panel");
}
static void
c_panel2sv(sv, val)
SV *sv;
PANEL *val;
{
sv_setref_pv(sv, "Curses::Panel", (void*)val);
}
static SCREEN *
c_sv2screen(sv, argnum)
SV *sv;
int argnum;
{
if (sv_derived_from(sv, "Curses::Screen"))
return (SCREEN *)SvIV((SV*)SvRV(sv));
if (argnum >= 0)
croak("argument %d to Curses function '%s' is not a Curses screen",
argnum, c_function);
else
croak("argument is not a Curses screen");
}
static void
c_screen2sv(sv, val)
SV *sv;
SCREEN *val;
{
sv_setref_pv(sv, "Curses::Screen", (void*)val);
}
static WINDOW *
c_sv2window(sv, argnum)
SV *sv;
int argnum;
{
if (sv_derived_from(sv, "Curses::Window")) {
WINDOW *ret = (WINDOW *)SvIV((SV*)SvRV(sv));
return ret;
}
if (argnum >= 0)
croak("argument %d to Curses function '%s' is not a Curses window",
argnum, c_function);
else
croak("argument is not a Curses window");
( run in 0.719 second using v1.01-cache-2.11-cpan-39bf76dae61 )