
/*
 * *********** WARNING **************
 * This file generated by Apache::DAV::WrapXS/0.01
 * Any changes made here will be lost
 * ***********************************
 * 1. /opt/perl5.6.1/lib/site_perl/5.6.1/ExtUtils/XSBuilder/WrapXS.pm:38
 * 2. /opt/perl5.6.1/lib/site_perl/5.6.1/ExtUtils/XSBuilder/WrapXS.pm:1898
 * 3. xsbuilder/xs_generate.pl:6
 */


#ifndef MODDAV_XS_SV_CONVERT_H
#define MODDAV_XS_SV_CONVERT_H


    
#ifndef aTHX_
/* let it work with 5.005 */
#define aTHX_
#endif
#define davxs_sv2_Apache__DAV__LivepropRollback(sv) (SvOK(sv)?((SvROK(sv) && (SvTYPE(SvRV(sv)) == SVt_PVMG)) \
|| (Perl_croak(aTHX_ "argument is not a blessed reference (expecting an Apache::DAV::LivepropRollback derived object)"),0) ? \
(dav_liveprop_rollback *)SvIV((SV*)SvRV(sv)) : (dav_liveprop_rollback *)NULL):(dav_liveprop_rollback *)NULL)

#define davxs_Apache__DAV__LivepropRollback_2obj(ptr)     sv_setref_pv(sv_newmortal(), "Apache::DAV::LivepropRollback", (void*)ptr)
#define davxs_Apache__DAV__LivepropRollback_create_obj(p,sv,rv,alloc)    rv = newSViv(0) ; \
    sv = newSVrv (rv, "Apache::DAV::LivepropRollback") ; \
    SvUPGRADE(sv, SVt_PVIV) ; \
    SvGROW(sv, sizeof (*p)) ;  \
    p = (dav_liveprop_rollback *)SvPVX(sv) ;\
    memset(p, 0, sizeof (*p)) ;\
    SvIVX(sv) = (IV)p ;\
    SvIOK_on(sv) ;\
    SvPOK_on(sv) ;

#define davxs_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 davxs_Apache__Server_2obj(ptr)     sv_setref_pv(sv_newmortal(), "Apache::Server", (void*)ptr)
#define davxs_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 davxs_sv2_Apache__DAV__IfHeader(sv) (SvOK(sv)?((SvROK(sv) && (SvTYPE(SvRV(sv)) == SVt_PVMG)) \
|| (Perl_croak(aTHX_ "argument is not a blessed reference (expecting an Apache::DAV::IfHeader derived object)"),0) ? \
(dav_if_header *)SvIV((SV*)SvRV(sv)) : (dav_if_header *)NULL):(dav_if_header *)NULL)

#define davxs_Apache__DAV__IfHeader_2obj(ptr)     sv_setref_pv(sv_newmortal(), "Apache::DAV::IfHeader", (void*)ptr)
#define davxs_Apache__DAV__IfHeader_create_obj(p,sv,rv,alloc)    rv = newSViv(0) ; \
    sv = newSVrv (rv, "Apache::DAV::IfHeader") ; \
    SvUPGRADE(sv, SVt_PVIV) ; \
    SvGROW(sv, sizeof (*p)) ;  \
    p = (dav_if_header *)SvPVX(sv) ;\
    memset(p, 0, sizeof (*p)) ;\
    SvIVX(sv) = (IV)p ;\
    SvIOK_on(sv) ;\
    SvPOK_on(sv) ;

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

#define davxs_Apache__DAV__Error_2obj(ptr)     sv_setref_pv(sv_newmortal(), "Apache::DAV::Error", (void*)ptr)
#define davxs_Apache__DAV__Error_create_obj(p,sv,rv,alloc)    rv = newSViv(0) ; \
    sv = newSVrv (rv, "Apache::DAV::Error") ; \
    SvUPGRADE(sv, SVt_PVIV) ; \
    SvGROW(sv, sizeof (*p)) ;  \
    p = (dav_error *)SvPVX(sv) ;\
    memset(p, 0, sizeof (*p)) ;\
    SvIVX(sv) = (IV)p ;\
    SvIOK_on(sv) ;\
    SvPOK_on(sv) ;

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

#define davxs_Apache__DAV__Stream_2obj(ptr)     sv_setref_pv(sv_newmortal(), "Apache::DAV::Stream", (void*)ptr)
#define davxs_Apache__DAV__Stream_create_obj(p,sv,rv,alloc)    rv = newSViv(0) ; \
    sv = newSVrv (rv, "Apache::DAV::Stream") ; \
    SvUPGRADE(sv, SVt_PVIV) ; \
    SvGROW(sv, sizeof (*p)) ;  \
    p = (dav_stream *)SvPVX(sv) ;\
    memset(p, 0, sizeof (*p)) ;\
    SvIVX(sv) = (IV)p ;\
    SvIOK_on(sv) ;\
    SvPOK_on(sv) ;

#define davxs_sv2_dav_prop_rw(sv) (dav_prop_rw)SvIV(sv)

#define davxs_dav_prop_rw_2obj(v) sv_2mortal(newSViv(v))

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

#define davxs_Apache__DAV__WalkerCtx_2obj(ptr)     sv_setref_pv(sv_newmortal(), "Apache::DAV::WalkerCtx", (void*)ptr)
#define davxs_Apache__DAV__WalkerCtx_create_obj(p,sv,rv,alloc)    rv = newSViv(0) ; \
    sv = newSVrv (rv, "Apache::DAV::WalkerCtx") ; \
    SvUPGRADE(sv, SVt_PVIV) ; \
    SvGROW(sv, sizeof (*p)) ;  \
    p = (dav_walker_ctx *)SvPVX(sv) ;\
    memset(p, 0, sizeof (*p)) ;\
    SvIVX(sv) = (IV)p ;\
    SvIOK_on(sv) ;\
    SvPOK_on(sv) ;

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

#define davxs_Apache__DAV__DynContext_2obj(ptr)     sv_setref_pv(sv_newmortal(), "Apache::DAV::DynContext", (void*)ptr)
#define davxs_Apache__DAV__DynContext_create_obj(p,sv,rv,alloc)    rv = newSViv(0) ; \
    sv = newSVrv (rv, "Apache::DAV::DynContext") ; \
    SvUPGRADE(sv, SVt_PVIV) ; \
    SvGROW(sv, sizeof (*p)) ;  \
    p = (dav_dyn_context *)SvPVX(sv) ;\
    memset(p, 0, sizeof (*p)) ;\
    SvIVX(sv) = (IV)p ;\
    SvIOK_on(sv) ;\
    SvPOK_on(sv) ;

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

#define davxs_Apache__DAV__TextHeader_2obj(ptr)     sv_setref_pv(sv_newmortal(), "Apache::DAV::TextHeader", (void*)ptr)
#define davxs_Apache__DAV__TextHeader_create_obj(p,sv,rv,alloc)    rv = newSViv(0) ; \
    sv = newSVrv (rv, "Apache::DAV::TextHeader") ; \
    SvUPGRADE(sv, SVt_PVIV) ; \
    SvGROW(sv, sizeof (*p)) ;  \
    p = (dav_text_header *)SvPVX(sv) ;\
    memset(p, 0, sizeof (*p)) ;\
    SvIVX(sv) = (IV)p ;\
    SvIOK_on(sv) ;\
    SvPOK_on(sv) ;

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

#define davxs_Apache__DAV__XMLDoc_2obj(ptr)     sv_setref_pv(sv_newmortal(), "Apache::DAV::XMLDoc", (void*)ptr)
#define davxs_Apache__DAV__XMLDoc_create_obj(p,sv,rv,alloc)    rv = newSViv(0) ; \
    sv = newSVrv (rv, "Apache::DAV::XMLDoc") ; \
    SvUPGRADE(sv, SVt_PVIV) ; \
    SvGROW(sv, sizeof (*p)) ;  \
    p = (dav_xml_doc *)SvPVX(sv) ;\
    memset(p, 0, sizeof (*p)) ;\
    SvIVX(sv) = (IV)p ;\
    SvIOK_on(sv) ;\
    SvPOK_on(sv) ;

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

#define davxs_Apache__DAV__IfStateType_2obj(ptr)     sv_setref_pv(sv_newmortal(), "Apache::DAV::IfStateType", (void*)ptr)
#define davxs_Apache__DAV__IfStateType_create_obj(p,sv,rv,alloc)    rv = newSViv(0) ; \
    sv = newSVrv (rv, "Apache::DAV::IfStateType") ; \
    SvUPGRADE(sv, SVt_PVIV) ; \
    SvGROW(sv, sizeof (*p)) ;  \
    p = (dav_if_state_type *)SvPVX(sv) ;\
    memset(p, 0, sizeof (*p)) ;\
    SvIVX(sv) = (IV)p ;\
    SvIOK_on(sv) ;\
    SvPOK_on(sv) ;

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

#define davxs_Apache__DAV__Resource_2obj(ptr)     sv_setref_pv(sv_newmortal(), "Apache::DAV::Resource", (void*)ptr)
#define davxs_Apache__DAV__Resource_create_obj(p,sv,rv,alloc)    rv = newSViv(0) ; \
    sv = newSVrv (rv, "Apache::DAV::Resource") ; \
    SvUPGRADE(sv, SVt_PVIV) ; \
    SvGROW(sv, sizeof (*p)) ;  \
    p = (dav_resource *)SvPVX(sv) ;\
    memset(p, 0, sizeof (*p)) ;\
    SvIVX(sv) = (IV)p ;\
    SvIOK_on(sv) ;\
    SvPOK_on(sv) ;

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

#define davxs_Apache__DAV__StateList_2obj(ptr)     sv_setref_pv(sv_newmortal(), "Apache::DAV::StateList", (void*)ptr)
#define davxs_Apache__DAV__StateList_create_obj(p,sv,rv,alloc)    rv = newSViv(0) ; \
    sv = newSVrv (rv, "Apache::DAV::StateList") ; \
    SvUPGRADE(sv, SVt_PVIV) ; \
    SvGROW(sv, sizeof (*p)) ;  \
    p = (dav_if_state_list *)SvPVX(sv) ;\
    memset(p, 0, sizeof (*p)) ;\
    SvIVX(sv) = (IV)p ;\
    SvIOK_on(sv) ;\
    SvPOK_on(sv) ;

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

#define davxs_Apache__DAV__DynProvider_2obj(ptr)     sv_setref_pv(sv_newmortal(), "Apache::DAV::DynProvider", (void*)ptr)
#define davxs_Apache__DAV__DynProvider_create_obj(p,sv,rv,alloc)    rv = newSViv(0) ; \
    sv = newSVrv (rv, "Apache::DAV::DynProvider") ; \
    SvUPGRADE(sv, SVt_PVIV) ; \
    SvGROW(sv, sizeof (*p)) ;  \
    p = (dav_dyn_provider *)SvPVX(sv) ;\
    memset(p, 0, sizeof (*p)) ;\
    SvIVX(sv) = (IV)p ;\
    SvIOK_on(sv) ;\
    SvPOK_on(sv) ;

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

#define davxs_Apache__DAV__LockRectype_2obj(ptr)     sv_setref_pv(sv_newmortal(), "Apache::DAV::LockRectype", (void*)ptr)
#define davxs_Apache__DAV__LockRectype_create_obj(p,sv,rv,alloc)    rv = newSViv(0) ; \
    sv = newSVrv (rv, "Apache::DAV::LockRectype") ; \
    SvUPGRADE(sv, SVt_PVIV) ; \
    SvGROW(sv, sizeof (*p)) ;  \
    p = (dav_lock_rectype *)SvPVX(sv) ;\
    memset(p, 0, sizeof (*p)) ;\
    SvIVX(sv) = (IV)p ;\
    SvIOK_on(sv) ;\
    SvPOK_on(sv) ;

#define davxs_sv2_time_t(sv) (time_t)SvNV(sv)

#define davxs_time_t_2obj(v) sv_2mortal(newSVnv(v))

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

#define davxs_Apache__DAV__HooksRepository_2obj(ptr)     sv_setref_pv(sv_newmortal(), "Apache::DAV::HooksRepository", (void*)ptr)
#define davxs_Apache__DAV__HooksRepository_create_obj(p,sv,rv,alloc)    rv = newSViv(0) ; \
    sv = newSVrv (rv, "Apache::DAV::HooksRepository") ; \
    SvUPGRADE(sv, SVt_PVIV) ; \
    SvGROW(sv, sizeof (*p)) ;  \
    p = (dav_hooks_repository *)SvPVX(sv) ;\
    memset(p, 0, sizeof (*p)) ;\
    SvIVX(sv) = (IV)p ;\
    SvIOK_on(sv) ;\
    SvPOK_on(sv) ;

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

#define davxs_Apache__DAV__XMLAttr_2obj(ptr)     sv_setref_pv(sv_newmortal(), "Apache::DAV::XMLAttr", (void*)ptr)
#define davxs_Apache__DAV__XMLAttr_create_obj(p,sv,rv,alloc)    rv = newSViv(0) ; \
    sv = newSVrv (rv, "Apache::DAV::XMLAttr") ; \
    SvUPGRADE(sv, SVt_PVIV) ; \
    SvGROW(sv, sizeof (*p)) ;  \
    p = (dav_xml_attr *)SvPVX(sv) ;\
    memset(p, 0, sizeof (*p)) ;\
    SvIVX(sv) = (IV)p ;\
    SvIOK_on(sv) ;\
    SvPOK_on(sv) ;

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

#define davxs_Apache__DAV__LockupResult_2obj(ptr)     sv_setref_pv(sv_newmortal(), "Apache::DAV::LockupResult", (void*)ptr)
#define davxs_Apache__DAV__LockupResult_create_obj(p,sv,rv,alloc)    rv = newSViv(0) ; \
    sv = newSVrv (rv, "Apache::DAV::LockupResult") ; \
    SvUPGRADE(sv, SVt_PVIV) ; \
    SvGROW(sv, sizeof (*p)) ;  \
    p = (dav_lookup_result *)SvPVX(sv) ;\
    memset(p, 0, sizeof (*p)) ;\
    SvIVX(sv) = (IV)p ;\
    SvIOK_on(sv) ;\
    SvPOK_on(sv) ;

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

#define davxs_Apache__DAV__PropCtx_2obj(ptr)     sv_setref_pv(sv_newmortal(), "Apache::DAV::PropCtx", (void*)ptr)
#define davxs_Apache__DAV__PropCtx_create_obj(p,sv,rv,alloc)    rv = newSViv(0) ; \
    sv = newSVrv (rv, "Apache::DAV::PropCtx") ; \
    SvUPGRADE(sv, SVt_PVIV) ; \
    SvGROW(sv, sizeof (*p)) ;  \
    p = (dav_prop_ctx *)SvPVX(sv) ;\
    memset(p, 0, sizeof (*p)) ;\
    SvIVX(sv) = (IV)p ;\
    SvIOK_on(sv) ;\
    SvPOK_on(sv) ;

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

#define davxs_Apache__DAV__HooksLocks_2obj(ptr)     sv_setref_pv(sv_newmortal(), "Apache::DAV::HooksLocks", (void*)ptr)
#define davxs_Apache__DAV__HooksLocks_create_obj(p,sv,rv,alloc)    rv = newSViv(0) ; \
    sv = newSVrv (rv, "Apache::DAV::HooksLocks") ; \
    SvUPGRADE(sv, SVt_PVIV) ; \
    SvGROW(sv, sizeof (*p)) ;  \
    p = (dav_hooks_locks *)SvPVX(sv) ;\
    memset(p, 0, sizeof (*p)) ;\
    SvIVX(sv) = (IV)p ;\
    SvIOK_on(sv) ;\
    SvPOK_on(sv) ;

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

#define davxs_Apache__DAV__Db_2obj(ptr)     sv_setref_pv(sv_newmortal(), "Apache::DAV::Db", (void*)ptr)
#define davxs_Apache__DAV__Db_create_obj(p,sv,rv,alloc)    rv = newSViv(0) ; \
    sv = newSVrv (rv, "Apache::DAV::Db") ; \
    SvUPGRADE(sv, SVt_PVIV) ; \
    SvGROW(sv, sizeof (*p)) ;  \
    p = (dav_db *)SvPVX(sv) ;\
    memset(p, 0, sizeof (*p)) ;\
    SvIVX(sv) = (IV)p ;\
    SvIOK_on(sv) ;\
    SvPOK_on(sv) ;

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

#define davxs_Apache__DAV__DynModule_2obj(ptr)     sv_setref_pv(sv_newmortal(), "Apache::DAV::DynModule", (void*)ptr)
#define davxs_Apache__DAV__DynModule_create_obj(p,sv,rv,alloc)    rv = newSViv(0) ; \
    sv = newSVrv (rv, "Apache::DAV::DynModule") ; \
    SvUPGRADE(sv, SVt_PVIV) ; \
    SvGROW(sv, sizeof (*p)) ;  \
    p = (dav_dyn_module *)SvPVX(sv) ;\
    memset(p, 0, sizeof (*p)) ;\
    SvIVX(sv) = (IV)p ;\
    SvIOK_on(sv) ;\
    SvPOK_on(sv) ;

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

#define davxs_Apache__DAV__HooksLiveprop_2obj(ptr)     sv_setref_pv(sv_newmortal(), "Apache::DAV::HooksLiveprop", (void*)ptr)
#define davxs_Apache__DAV__HooksLiveprop_create_obj(p,sv,rv,alloc)    rv = newSViv(0) ; \
    sv = newSVrv (rv, "Apache::DAV::HooksLiveprop") ; \
    SvUPGRADE(sv, SVt_PVIV) ; \
    SvGROW(sv, sizeof (*p)) ;  \
    p = (dav_hooks_liveprop *)SvPVX(sv) ;\
    memset(p, 0, sizeof (*p)) ;\
    SvIVX(sv) = (IV)p ;\
    SvIOK_on(sv) ;\
    SvPOK_on(sv) ;

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

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

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

#define davxs_Apache__DAV__Response_2obj(ptr)     sv_setref_pv(sv_newmortal(), "Apache::DAV::Response", (void*)ptr)
#define davxs_Apache__DAV__Response_create_obj(p,sv,rv,alloc)    rv = newSViv(0) ; \
    sv = newSVrv (rv, "Apache::DAV::Response") ; \
    SvUPGRADE(sv, SVt_PVIV) ; \
    SvGROW(sv, sizeof (*p)) ;  \
    p = (dav_response *)SvPVX(sv) ;\
    memset(p, 0, sizeof (*p)) ;\
    SvIVX(sv) = (IV)p ;\
    SvIOK_on(sv) ;\
    SvPOK_on(sv) ;

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

#define davxs_Apache__DAV__Lock_2obj(ptr)     sv_setref_pv(sv_newmortal(), "Apache::DAV::Lock", (void*)ptr)
#define davxs_Apache__DAV__Lock_create_obj(p,sv,rv,alloc)    rv = newSViv(0) ; \
    sv = newSVrv (rv, "Apache::DAV::Lock") ; \
    SvUPGRADE(sv, SVt_PVIV) ; \
    SvGROW(sv, sizeof (*p)) ;  \
    p = (dav_lock *)SvPVX(sv) ;\
    memset(p, 0, sizeof (*p)) ;\
    SvIVX(sv) = (IV)p ;\
    SvIOK_on(sv) ;\
    SvPOK_on(sv) ;

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

#define davxs_Apache__DAV__LockToken_2obj(ptr)     sv_setref_pv(sv_newmortal(), "Apache::DAV::LockToken", (void*)ptr)
#define davxs_Apache__DAV__LockToken_create_obj(p,sv,rv,alloc)    rv = newSViv(0) ; \
    sv = newSVrv (rv, "Apache::DAV::LockToken") ; \
    SvUPGRADE(sv, SVt_PVIV) ; \
    SvGROW(sv, sizeof (*p)) ;  \
    p = (dav_locktoken *)SvPVX(sv) ;\
    memset(p, 0, sizeof (*p)) ;\
    SvIVX(sv) = (IV)p ;\
    SvIOK_on(sv) ;\
    SvPOK_on(sv) ;

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

#define davxs_Apache__DAV__LockType_2obj(ptr)     sv_setref_pv(sv_newmortal(), "Apache::DAV::LockType", (void*)ptr)
#define davxs_Apache__DAV__LockType_create_obj(p,sv,rv,alloc)    rv = newSViv(0) ; \
    sv = newSVrv (rv, "Apache::DAV::LockType") ; \
    SvUPGRADE(sv, SVt_PVIV) ; \
    SvGROW(sv, sizeof (*p)) ;  \
    p = (dav_lock_type *)SvPVX(sv) ;\
    memset(p, 0, sizeof (*p)) ;\
    SvIVX(sv) = (IV)p ;\
    SvIOK_on(sv) ;\
    SvPOK_on(sv) ;

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

#define davxs_Apache__DAV__PropDB_2obj(ptr)     sv_setref_pv(sv_newmortal(), "Apache::DAV::PropDB", (void*)ptr)
#define davxs_Apache__DAV__PropDB_create_obj(p,sv,rv,alloc)    rv = newSViv(0) ; \
    sv = newSVrv (rv, "Apache::DAV::PropDB") ; \
    SvUPGRADE(sv, SVt_PVIV) ; \
    SvGROW(sv, sizeof (*p)) ;  \
    p = (dav_propdb *)SvPVX(sv) ;\
    memset(p, 0, sizeof (*p)) ;\
    SvIVX(sv) = (IV)p ;\
    SvIOK_on(sv) ;\
    SvPOK_on(sv) ;

#define davxs_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 davxs_Apache_2obj(ptr)     sv_setref_pv(sv_newmortal(), "Apache", (void*)ptr)
#define davxs_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 davxs_sv2_Apache__DAV__HooksDb(sv) (SvOK(sv)?((SvROK(sv) && (SvTYPE(SvRV(sv)) == SVt_PVMG)) \
|| (Perl_croak(aTHX_ "argument is not a blessed reference (expecting an Apache::DAV::HooksDb derived object)"),0) ? \
(dav_hooks_db *)SvIV((SV*)SvRV(sv)) : (dav_hooks_db *)NULL):(dav_hooks_db *)NULL)

#define davxs_Apache__DAV__HooksDb_2obj(ptr)     sv_setref_pv(sv_newmortal(), "Apache::DAV::HooksDb", (void*)ptr)
#define davxs_Apache__DAV__HooksDb_create_obj(p,sv,rv,alloc)    rv = newSViv(0) ; \
    sv = newSVrv (rv, "Apache::DAV::HooksDb") ; \
    SvUPGRADE(sv, SVt_PVIV) ; \
    SvGROW(sv, sizeof (*p)) ;  \
    p = (dav_hooks_db *)SvPVX(sv) ;\
    memset(p, 0, sizeof (*p)) ;\
    SvIVX(sv) = (IV)p ;\
    SvIOK_on(sv) ;\
    SvPOK_on(sv) ;

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

#define davxs_Apache__DAV__LockScope_2obj(ptr)     sv_setref_pv(sv_newmortal(), "Apache::DAV::LockScope", (void*)ptr)
#define davxs_Apache__DAV__LockScope_create_obj(p,sv,rv,alloc)    rv = newSViv(0) ; \
    sv = newSVrv (rv, "Apache::DAV::LockScope") ; \
    SvUPGRADE(sv, SVt_PVIV) ; \
    SvGROW(sv, sizeof (*p)) ;  \
    p = (dav_lock_scope *)SvPVX(sv) ;\
    memset(p, 0, sizeof (*p)) ;\
    SvIVX(sv) = (IV)p ;\
    SvIOK_on(sv) ;\
    SvPOK_on(sv) ;

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

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

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

#define davxs_Apache__DAV__DynHooks_2obj(ptr)     sv_setref_pv(sv_newmortal(), "Apache::DAV::DynHooks", (void*)ptr)
#define davxs_Apache__DAV__DynHooks_create_obj(p,sv,rv,alloc)    rv = newSViv(0) ; \
    sv = newSVrv (rv, "Apache::DAV::DynHooks") ; \
    SvUPGRADE(sv, SVt_PVIV) ; \
    SvGROW(sv, sizeof (*p)) ;  \
    p = (dav_dyn_hooks *)SvPVX(sv) ;\
    memset(p, 0, sizeof (*p)) ;\
    SvIVX(sv) = (IV)p ;\
    SvIOK_on(sv) ;\
    SvPOK_on(sv) ;

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

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

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

#define davxs_Apache__DAV__PropsResult_2obj(ptr)     sv_setref_pv(sv_newmortal(), "Apache::DAV::PropsResult", (void*)ptr)
#define davxs_Apache__DAV__PropsResult_create_obj(p,sv,rv,alloc)    rv = newSViv(0) ; \
    sv = newSVrv (rv, "Apache::DAV::PropsResult") ; \
    SvUPGRADE(sv, SVt_PVIV) ; \
    SvGROW(sv, sizeof (*p)) ;  \
    p = (dav_get_props_result *)SvPVX(sv) ;\
    memset(p, 0, sizeof (*p)) ;\
    SvIVX(sv) = (IV)p ;\
    SvIOK_on(sv) ;\
    SvPOK_on(sv) ;

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

#define davxs_Apache__DAV__Text_2obj(ptr)     sv_setref_pv(sv_newmortal(), "Apache::DAV::Text", (void*)ptr)
#define davxs_Apache__DAV__Text_create_obj(p,sv,rv,alloc)    rv = newSViv(0) ; \
    sv = newSVrv (rv, "Apache::DAV::Text") ; \
    SvUPGRADE(sv, SVt_PVIV) ; \
    SvGROW(sv, sizeof (*p)) ;  \
    p = (dav_text *)SvPVX(sv) ;\
    memset(p, 0, sizeof (*p)) ;\
    SvIVX(sv) = (IV)p ;\
    SvIOK_on(sv) ;\
    SvPOK_on(sv) ;

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

#define davxs_Apache__DAV__XMLElem_2obj(ptr)     sv_setref_pv(sv_newmortal(), "Apache::DAV::XMLElem", (void*)ptr)
#define davxs_Apache__DAV__XMLElem_create_obj(p,sv,rv,alloc)    rv = newSViv(0) ; \
    sv = newSVrv (rv, "Apache::DAV::XMLElem") ; \
    SvUPGRADE(sv, SVt_PVIV) ; \
    SvGROW(sv, sizeof (*p)) ;  \
    p = (dav_xml_elem *)SvPVX(sv) ;\
    memset(p, 0, sizeof (*p)) ;\
    SvIVX(sv) = (IV)p ;\
    SvIOK_on(sv) ;\
    SvPOK_on(sv) ;

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

#define davxs_Apache__DAV__Datum_2obj(ptr)     sv_setref_pv(sv_newmortal(), "Apache::DAV::Datum", (void*)ptr)
#define davxs_Apache__DAV__Datum_create_obj(p,sv,rv,alloc)    rv = newSViv(0) ; \
    sv = newSVrv (rv, "Apache::DAV::Datum") ; \
    SvUPGRADE(sv, SVt_PVIV) ; \
    SvGROW(sv, sizeof (*p)) ;  \
    p = (dav_datum *)SvPVX(sv) ;\
    memset(p, 0, sizeof (*p)) ;\
    SvIVX(sv) = (IV)p ;\
    SvIOK_on(sv) ;\
    SvPOK_on(sv) ;

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

#define davxs_Apache__DAV__LockTokenList_2obj(ptr)     sv_setref_pv(sv_newmortal(), "Apache::DAV::LockTokenList", (void*)ptr)
#define davxs_Apache__DAV__LockTokenList_create_obj(p,sv,rv,alloc)    rv = newSViv(0) ; \
    sv = newSVrv (rv, "Apache::DAV::LockTokenList") ; \
    SvUPGRADE(sv, SVt_PVIV) ; \
    SvGROW(sv, sizeof (*p)) ;  \
    p = (dav_locktoken_list *)SvPVX(sv) ;\
    memset(p, 0, sizeof (*p)) ;\
    SvIVX(sv) = (IV)p ;\
    SvIOK_on(sv) ;\
    SvPOK_on(sv) ;

#define davxs_sv2_unsigned(sv) (unsigned)SvUV(sv)

#define davxs_unsigned_2obj(v) sv_2mortal(newSVuv(v))

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

#define davxs_Apache__DAV__LockDB_2obj(ptr)     sv_setref_pv(sv_newmortal(), "Apache::DAV::LockDB", (void*)ptr)
#define davxs_Apache__DAV__LockDB_create_obj(p,sv,rv,alloc)    rv = newSViv(0) ; \
    sv = newSVrv (rv, "Apache::DAV::LockDB") ; \
    SvUPGRADE(sv, SVt_PVIV) ; \
    SvGROW(sv, sizeof (*p)) ;  \
    p = (dav_lockdb *)SvPVX(sv) ;\
    memset(p, 0, sizeof (*p)) ;\
    SvIVX(sv) = (IV)p ;\
    SvIOK_on(sv) ;\
    SvPOK_on(sv) ;

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

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

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

#define davxs_Apache__DAV__ResourcePrivate_2obj(ptr)     sv_setref_pv(sv_newmortal(), "Apache::DAV::ResourcePrivate", (void*)ptr)
#define davxs_Apache__DAV__ResourcePrivate_create_obj(p,sv,rv,alloc)    rv = newSViv(0) ; \
    sv = newSVrv (rv, "Apache::DAV::ResourcePrivate") ; \
    SvUPGRADE(sv, SVt_PVIV) ; \
    SvGROW(sv, sizeof (*p)) ;  \
    p = (dav_resource_type *)SvPVX(sv) ;\
    memset(p, 0, sizeof (*p)) ;\
    SvIVX(sv) = (IV)p ;\
    SvIOK_on(sv) ;\
    SvPOK_on(sv) ;

#define davxs_sv2_SV(sv) (sv)

#define davxs_SV_2obj(x) (x)

#define davxs_sv2_SVPTR(sv) (sv)

#define davxs_SVPTR_2obj(x) (sv_2mortal(SvREFCNT_inc(x)))

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

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

#define davxs_sv2_IV(sv) SvIV(sv)

#define davxs_IV_2obj(x) sv_2mortal(newSViv(x))

#define davxs_sv2_NV(sv) SvNV(sv)

#define davxs_NV_2obj(x) sv_2mortal(newSVnv(x))

#define davxs_sv2_UV(sv) SvUV(sv)

#define davxs_UV_2obj(x) sv_2mortal(newSVuv(x))

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

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

#define davxs_sv2_CHAR(sv) (char)SvNV(sv)

#define davxs_CHAR_2obj(x) sv_2mortal(newSVnv(x))

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

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

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

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


#endif /* MODDAV_XS_SV_CONVERT_H */
