
/*
 * *********** WARNING **************
 * This file generated by Embperl::WrapXS/2.0.0
 * Any changes made here will be lost
 * ***********************************
 * 1. /usr/lib/perl5/site_perl/5.16.0/ExtUtils/XSBuilder/WrapXS.pm:52
 * 2. /usr/lib/perl5/site_perl/5.16.0/ExtUtils/XSBuilder/WrapXS.pm:2068
 * 3. xsbuilder/xs_generate.pl:6
 */


#ifndef EP_XS_SV_CONVERT_H
#define EP_XS_SV_CONVERT_H


    
#ifndef aTHX_
/* let it work with 5.005 */
#define aTHX_
#endif
#define epxs_sv2_tNode(sv) (tNode)SvIV(sv)

#define epxs_tNode_2obj(v) sv_2mortal(newSViv(v))

#define epxs_sv2_unsigned(sv) (unsigned)SvUV(sv)

#define epxs_unsigned_2obj(v) sv_2mortal(newSVuv(v))

#define epxs_sv2_Apache__Server(sv) (SvOK(sv)?((SvROK(sv) && (SvTYPE(SvRV(sv)) == SVt_PVMG)) \
|| (Perl_croak(aTHX_ "argument is not a blessed reference (expecting an Apache::Server derived object)"),0) ? \
(server_rec *)SvIV((SV*)SvRV(sv)) : (server_rec *)NULL):(server_rec *)NULL)

#define epxs_Apache__Server_2obj(ptr)     sv_setref_pv(sv_newmortal(), "Apache::Server", (void*)ptr)
#define epxs_Apache__Server_create_obj(p,sv,rv,alloc)    rv = newSViv(0) ; \
    sv = newSVrv (rv, "Apache::Server") ; \
    SvUPGRADE(sv, SVt_PVIV) ; \
    SvGROW(sv, sizeof (*p)) ;  \
    p = (server_rec *)SvPVX(sv) ;\
    memset(p, 0, sizeof (*p)) ;\
    SvIVX(sv) = (IV)p ;\
    SvIOK_on(sv) ;\
    SvPOK_on(sv) ;

#define epxs_sv2_Apache(sv) (SvOK(sv)?((SvROK(sv) && (SvTYPE(SvRV(sv)) == SVt_PVMG)) \
|| (Perl_croak(aTHX_ "argument is not a blessed reference (expecting an Apache derived object)"),0) ? \
(request_rec *)SvIV((SV*)SvRV(sv)) : (request_rec *)NULL):(request_rec *)NULL)

#define epxs_Apache_2obj(ptr)     sv_setref_pv(sv_newmortal(), "Apache", (void*)ptr)
#define epxs_Apache_create_obj(p,sv,rv,alloc)    rv = newSViv(0) ; \
    sv = newSVrv (rv, "Apache") ; \
    SvUPGRADE(sv, SVt_PVIV) ; \
    SvGROW(sv, sizeof (*p)) ;  \
    p = (request_rec *)SvPVX(sv) ;\
    memset(p, 0, sizeof (*p)) ;\
    SvIVX(sv) = (IV)p ;\
    SvIOK_on(sv) ;\
    SvPOK_on(sv) ;

#define epxs_sv2_Embperl__Syntax(sv) (SvOK(sv)?((SvROK(sv) && SvMAGICAL(SvRV(sv))) \
|| (Perl_croak(aTHX_ "argument is not a blessed reference (expecting an Embperl::Syntax derived object)"),0) ? \
*((tTokenTable **)(mg_find (SvRV(sv), '~') -> mg_ptr))  : (tTokenTable *)NULL):(tTokenTable *)NULL)

#define epxs_Embperl__Syntax_2obj(ptr) (ptr->_perlsv?ptr->_perlsv:&sv_undef)
#define epxs_Embperl__Syntax_create_obj(p,sv,rv,alloc)   sv = (SV *)newHV () ; \
    p = alloc ; \
    memset (p, 0, sizeof(tTokenTable)) ; \
    sv_magic ((SV *)sv, NULL, '~', (char *)&p, sizeof (p)) ; \
    rv = p -> _perlsv = newRV_noinc ((SV *)sv) ; \
    sv_bless (rv, gv_stashpv ("Embperl::Syntax", 0)) ; 
    

#define epxs_Embperl__Syntax_free_obj(ptr)     free(ptr)
#define epxs_sv2_Embperl__Component__Output(sv) (SvOK(sv)?((SvROK(sv) && SvMAGICAL(SvRV(sv))) \
|| (Perl_croak(aTHX_ "argument is not a blessed reference (expecting an Embperl::Component::Output derived object)"),0) ? \
*((tComponentOutput **)(mg_find (SvRV(sv), '~') -> mg_ptr))  : (tComponentOutput *)NULL):(tComponentOutput *)NULL)

#define epxs_Embperl__Component__Output_2obj(ptr) (ptr->_perlsv?ptr->_perlsv:&sv_undef)
#define epxs_Embperl__Component__Output_create_obj(p,sv,rv,alloc)   sv = (SV *)newHV () ; \
    p = alloc ; \
    memset (p, 0, sizeof(tComponentOutput)) ; \
    sv_magic ((SV *)sv, NULL, '~', (char *)&p, sizeof (p)) ; \
    rv = p -> _perlsv = newRV_noinc ((SV *)sv) ; \
    sv_bless (rv, gv_stashpv ("Embperl::Component::Output", 0)) ; 
    

#define epxs_Embperl__Component__Output_free_obj(ptr)     free(ptr)
#define epxs_sv2_Embperl__Req__Param(sv) (SvOK(sv)?((SvROK(sv) && SvMAGICAL(SvRV(sv))) \
|| (Perl_croak(aTHX_ "argument is not a blessed reference (expecting an Embperl::Req::Param derived object)"),0) ? \
*((tReqParam **)(mg_find (SvRV(sv), '~') -> mg_ptr))  : (tReqParam *)NULL):(tReqParam *)NULL)

#define epxs_Embperl__Req__Param_2obj(ptr) (ptr->_perlsv?ptr->_perlsv:&sv_undef)
#define epxs_Embperl__Req__Param_create_obj(p,sv,rv,alloc)   sv = (SV *)newHV () ; \
    p = alloc ; \
    memset (p, 0, sizeof(tReqParam)) ; \
    sv_magic ((SV *)sv, NULL, '~', (char *)&p, sizeof (p)) ; \
    rv = p -> _perlsv = newRV_noinc ((SV *)sv) ; \
    sv_bless (rv, gv_stashpv ("Embperl::Req::Param", 0)) ; 
    

#define epxs_Embperl__Req__Param_free_obj(ptr)     free(ptr)
#define epxs_sv2_Embperl__Thread(sv) (SvOK(sv)?((SvROK(sv) && SvMAGICAL(SvRV(sv))) \
|| (Perl_croak(aTHX_ "argument is not a blessed reference (expecting an Embperl::Thread derived object)"),0) ? \
*((tThreadData **)(mg_find (SvRV(sv), '~') -> mg_ptr))  : (tThreadData *)NULL):(tThreadData *)NULL)

#define epxs_Embperl__Thread_2obj(ptr) (ptr->_perlsv?ptr->_perlsv:&sv_undef)
#define epxs_Embperl__Thread_create_obj(p,sv,rv,alloc)   sv = (SV *)newHV () ; \
    p = alloc ; \
    memset (p, 0, sizeof(tThreadData)) ; \
    sv_magic ((SV *)sv, NULL, '~', (char *)&p, sizeof (p)) ; \
    rv = p -> _perlsv = newRV_noinc ((SV *)sv) ; \
    sv_bless (rv, gv_stashpv ("Embperl::Thread", 0)) ; 
    

#define epxs_Embperl__Thread_free_obj(ptr)     free(ptr)
#define epxs_sv2_time_t(sv) (time_t)SvNV(sv)

#define epxs_time_t_2obj(v) sv_2mortal(newSVnv(v))

#define epxs_sv2_Embperl__App(sv) (SvOK(sv)?((SvROK(sv) && SvMAGICAL(SvRV(sv))) \
|| (Perl_croak(aTHX_ "argument is not a blessed reference (expecting an Embperl::App derived object)"),0) ? \
*((tApp **)(mg_find (SvRV(sv), '~') -> mg_ptr))  : (tApp *)NULL):(tApp *)NULL)

#define epxs_Embperl__App_2obj(ptr) (ptr->_perlsv?ptr->_perlsv:&sv_undef)
#define epxs_Embperl__App_create_obj(p,sv,rv,alloc)   sv = (SV *)newHV () ; \
    p = alloc ; \
    memset (p, 0, sizeof(tApp)) ; \
    sv_magic ((SV *)sv, NULL, '~', (char *)&p, sizeof (p)) ; \
    rv = p -> _perlsv = newRV_noinc ((SV *)sv) ; \
    sv_bless (rv, gv_stashpv ("Embperl::App", 0)) ; 
    

#define epxs_Embperl__App_free_obj(ptr)     free(ptr)
#define epxs_sv2_Embperl__Component__Config(sv) (SvOK(sv)?((SvROK(sv) && SvMAGICAL(SvRV(sv))) \
|| (Perl_croak(aTHX_ "argument is not a blessed reference (expecting an Embperl::Component::Config derived object)"),0) ? \
*((tComponentConfig **)(mg_find (SvRV(sv), '~') -> mg_ptr))  : (tComponentConfig *)NULL):(tComponentConfig *)NULL)

#define epxs_Embperl__Component__Config_2obj(ptr) (ptr->_perlsv?ptr->_perlsv:&sv_undef)
#define epxs_Embperl__Component__Config_create_obj(p,sv,rv,alloc)   sv = (SV *)newHV () ; \
    p = alloc ; \
    memset (p, 0, sizeof(tComponentConfig)) ; \
    sv_magic ((SV *)sv, NULL, '~', (char *)&p, sizeof (p)) ; \
    rv = p -> _perlsv = newRV_noinc ((SV *)sv) ; \
    sv_bless (rv, gv_stashpv ("Embperl::Component::Config", 0)) ; 
    

#define epxs_Embperl__Component__Config_free_obj(ptr)     free(ptr)
#define epxs_sv2_Embperl__CacheItem(sv) (SvOK(sv)?((SvROK(sv) && SvMAGICAL(SvRV(sv))) \
|| (Perl_croak(aTHX_ "argument is not a blessed reference (expecting an Embperl::CacheItem derived object)"),0) ? \
*((tCacheItem **)(mg_find (SvRV(sv), '~') -> mg_ptr))  : (tCacheItem *)NULL):(tCacheItem *)NULL)

#define epxs_Embperl__CacheItem_2obj(ptr) (ptr->_perlsv?ptr->_perlsv:&sv_undef)
#define epxs_Embperl__CacheItem_create_obj(p,sv,rv,alloc)   sv = (SV *)newHV () ; \
    p = alloc ; \
    memset (p, 0, sizeof(tCacheItem)) ; \
    sv_magic ((SV *)sv, NULL, '~', (char *)&p, sizeof (p)) ; \
    rv = p -> _perlsv = newRV_noinc ((SV *)sv) ; \
    sv_bless (rv, gv_stashpv ("Embperl::CacheItem", 0)) ; 
    

#define epxs_Embperl__CacheItem_free_obj(ptr)     free(ptr)
#define epxs_sv2_Embperl__Component(sv) (SvOK(sv)?((SvROK(sv) && SvMAGICAL(SvRV(sv))) \
|| (Perl_croak(aTHX_ "argument is not a blessed reference (expecting an Embperl::Component derived object)"),0) ? \
*((tComponent **)(mg_find (SvRV(sv), '~') -> mg_ptr))  : (tComponent *)NULL):(tComponent *)NULL)

#define epxs_Embperl__Component_2obj(ptr) (ptr->_perlsv?ptr->_perlsv:&sv_undef)
#define epxs_Embperl__Component_create_obj(p,sv,rv,alloc)   sv = (SV *)newHV () ; \
    p = alloc ; \
    memset (p, 0, sizeof(tComponent)) ; \
    sv_magic ((SV *)sv, NULL, '~', (char *)&p, sizeof (p)) ; \
    rv = p -> _perlsv = newRV_noinc ((SV *)sv) ; \
    sv_bless (rv, gv_stashpv ("Embperl::Component", 0)) ; 
    

#define epxs_Embperl__Component_free_obj(ptr)     free(ptr)
#define epxs_sv2_Embperl__Component__Param(sv) (SvOK(sv)?((SvROK(sv) && SvMAGICAL(SvRV(sv))) \
|| (Perl_croak(aTHX_ "argument is not a blessed reference (expecting an Embperl::Component::Param derived object)"),0) ? \
*((tComponentParam **)(mg_find (SvRV(sv), '~') -> mg_ptr))  : (tComponentParam *)NULL):(tComponentParam *)NULL)

#define epxs_Embperl__Component__Param_2obj(ptr) (ptr->_perlsv?ptr->_perlsv:&sv_undef)
#define epxs_Embperl__Component__Param_create_obj(p,sv,rv,alloc)   sv = (SV *)newHV () ; \
    p = alloc ; \
    memset (p, 0, sizeof(tComponentParam)) ; \
    sv_magic ((SV *)sv, NULL, '~', (char *)&p, sizeof (p)) ; \
    rv = p -> _perlsv = newRV_noinc ((SV *)sv) ; \
    sv_bless (rv, gv_stashpv ("Embperl::Component::Param", 0)) ; 
    

#define epxs_Embperl__Component__Param_free_obj(ptr)     free(ptr)
#define epxs_sv2_Embperl__Req__Config(sv) (SvOK(sv)?((SvROK(sv) && SvMAGICAL(SvRV(sv))) \
|| (Perl_croak(aTHX_ "argument is not a blessed reference (expecting an Embperl::Req::Config derived object)"),0) ? \
*((tReqConfig **)(mg_find (SvRV(sv), '~') -> mg_ptr))  : (tReqConfig *)NULL):(tReqConfig *)NULL)

#define epxs_Embperl__Req__Config_2obj(ptr) (ptr->_perlsv?ptr->_perlsv:&sv_undef)
#define epxs_Embperl__Req__Config_create_obj(p,sv,rv,alloc)   sv = (SV *)newHV () ; \
    p = alloc ; \
    memset (p, 0, sizeof(tReqConfig)) ; \
    sv_magic ((SV *)sv, NULL, '~', (char *)&p, sizeof (p)) ; \
    rv = p -> _perlsv = newRV_noinc ((SV *)sv) ; \
    sv_bless (rv, gv_stashpv ("Embperl::Req::Config", 0)) ; 
    

#define epxs_Embperl__Req__Config_free_obj(ptr)     free(ptr)
#define epxs_sv2_Embperl__Req(sv) (SvOK(sv)?((SvROK(sv) && SvMAGICAL(SvRV(sv))) \
|| (Perl_croak(aTHX_ "argument is not a blessed reference (expecting an Embperl::Req derived object)"),0) ? \
*((tReq **)(mg_find (SvRV(sv), '~') -> mg_ptr))  : (tReq *)NULL):(tReq *)NULL)

#define epxs_Embperl__Req_2obj(ptr) (ptr->_perlsv?ptr->_perlsv:&sv_undef)
#define epxs_Embperl__Req_create_obj(p,sv,rv,alloc)   sv = (SV *)newHV () ; \
    p = alloc ; \
    memset (p, 0, sizeof(tReq)) ; \
    sv_magic ((SV *)sv, NULL, '~', (char *)&p, sizeof (p)) ; \
    rv = p -> _perlsv = newRV_noinc ((SV *)sv) ; \
    sv_bless (rv, gv_stashpv ("Embperl::Req", 0)) ; 
    

#define epxs_Embperl__Req_free_obj(ptr)     free(ptr)
#define epxs_sv2_Embperl__App__Config(sv) (SvOK(sv)?((SvROK(sv) && SvMAGICAL(SvRV(sv))) \
|| (Perl_croak(aTHX_ "argument is not a blessed reference (expecting an Embperl::App::Config derived object)"),0) ? \
*((tAppConfig **)(mg_find (SvRV(sv), '~') -> mg_ptr))  : (tAppConfig *)NULL):(tAppConfig *)NULL)

#define epxs_Embperl__App__Config_2obj(ptr) (ptr->_perlsv?ptr->_perlsv:&sv_undef)
#define epxs_Embperl__App__Config_create_obj(p,sv,rv,alloc)   sv = (SV *)newHV () ; \
    p = alloc ; \
    memset (p, 0, sizeof(tAppConfig)) ; \
    sv_magic ((SV *)sv, NULL, '~', (char *)&p, sizeof (p)) ; \
    rv = p -> _perlsv = newRV_noinc ((SV *)sv) ; \
    sv_bless (rv, gv_stashpv ("Embperl::App::Config", 0)) ; 
    

#define epxs_Embperl__App__Config_free_obj(ptr)     free(ptr)
#define epxs_sv2_SV(sv) (sv)

#define epxs_SV_2obj(x) (x)

#define epxs_sv2_SVPTR(sv) (sv)

#define epxs_SVPTR_2obj(x) (x==NULL?&PL_sv_undef:sv_2mortal(SvREFCNT_inc(x)))

#define epxs_sv2_PV(sv) (SvPV(sv, PL_na))

#define epxs_PV_2obj(x) (sv_2mortal(newSVpv(x, 0)))

#define epxs_sv2_PVnull(sv) (SvOK(sv)?SvPV(sv, PL_na):NULL)

#define epxs_PVnull_2obj(x) (x==NULL?&PL_sv_undef:sv_2mortal(newSVpv(x, 0)))

#define epxs_sv2_IV(sv) SvIV(sv)

#define epxs_IV_2obj(x) sv_2mortal(newSViv(x))

#define epxs_sv2_NV(sv) SvNV(sv)

#define epxs_NV_2obj(x) sv_2mortal(newSVnv(x))

#define epxs_sv2_UV(sv) SvUV(sv)

#define epxs_UV_2obj(x) sv_2mortal(newSVuv(x))

#define epxs_sv2_PTR(sv) (SvROK(sv)?((void *)SvIV(SvRV(sv))):NULL)

#define epxs_PTR_2obj(x) (x?newRV_noinc(newSViv ((IV)x)):&PL_sv_undef)

#define epxs_sv2_CHAR(sv) (char)SvNV(sv)

#define epxs_CHAR_2obj(x) sv_2mortal(newSVnv(x))

#define epxs_sv2_AVREF(sv) (AV*)SvRV(sv)

#define epxs_AVREF_2obj(x) (x?sv_2mortal(newRV((SV*)x)):&PL_sv_undef)

#define epxs_sv2_HVREF(sv) (HV*)SvRV(sv)

#define epxs_HVREF_2obj(x) (x?sv_2mortal(newRV((SV*)x)):&PL_sv_undef)


#endif /* EP_XS_SV_CONVERT_H */
