ARSperl
view release on metacpan or search on metacpan
return 0;
}
} else
ARError_add(AR_RETURN_ERROR, AP_ERR_BAD_EID);
return -1;
}
SV *
perl_ARPropStruct(ARControlStruct * ctrl, ARPropStruct * in)
{
HV *hash = newHV();
hv_store(hash, "prop", strlen("prop") , newSViv(in->prop), 0);
hv_store(hash, "value", strlen("value") , perl_ARValueStruct(ctrl, &in->value), 0);
hv_store(hash, "valueType", strlen("valueType") ,
perl_ARValueStructType(ctrl, &in->value), 0);
return newRV_noinc((SV *) hash);
}
SV *
perl_ARPropList(ARControlStruct * ctrl, ARPropList * in)
{
AV *array = newAV();
unsigned int i;
for(i = 0 ; i < in->numItems ; i++)
av_push(array,
perl_ARPropStruct(ctrl, &(in->props[i]) ));
return newRV_noinc((SV *)array);
}
SV *
perl_ARDisplayInstanceStruct(ARControlStruct * ctrl, ARDisplayInstanceStruct * in)
{
HV *hash = newHV();
hv_store(hash, "vui", strlen("vui") , newSViv(in->vui), 0);
hv_store(hash, "props", strlen("props") ,
perl_ARList(ctrl,
(ARList *) & in->props,
(ARS_fn) perl_ARPropStruct,
sizeof(ARPropStruct)), 0);
return newRV_noinc((SV *) hash);
}
SV *
perl_ARDisplayInstanceList(ARControlStruct * ctrl, ARDisplayInstanceList * in)
{
HV *hash = newHV();
hv_store(hash, "commonProps", strlen("commonProps") ,
perl_ARList(ctrl,
(ARList *) & in->commonProps,
(ARS_fn) perl_ARPropStruct,
sizeof(ARPropStruct)), 0);
/*
* the part of ARDisplayInstanceList after ARPropList looks like
* ARS's other list structures, so take address of numItems field and
* pass that to perl_ARList
*/
hv_store(hash, "numItems", strlen("numItems") , newSViv(in->numItems), 0);
hv_store(hash, "dInstanceList", strlen("dInstanceList") ,
perl_ARList(ctrl,
(ARList *) & in->numItems,
(ARS_fn) perl_ARDisplayInstanceStruct,
sizeof(ARDisplayInstanceStruct)), 0);
return newRV_noinc((SV *) hash);
}
SV *
perl_ARFieldMappingStruct(ARControlStruct * ctrl, ARFieldMappingStruct * in)
{
HV *hash = newHV();
hv_store(hash, "fieldType", strlen("fieldType") , newSViv(in->fieldType), 0);
switch (in->fieldType) {
case AR_FIELD_JOIN:
hv_store(hash, "join", strlen("join") , perl_ARJoinMappingStruct(ctrl, &in->u.join), 0);
break;
case AR_FIELD_VIEW:
hv_store(hash, "view", strlen("view") , perl_ARViewMappingStruct(ctrl, &in->u.view), 0);
break;
#if AR_EXPORT_VERSION >= 6L
case AR_FIELD_VENDOR:
hv_store(hash, "vendor", strlen("vendor") , perl_ARVendorMappingStruct(ctrl, &in->u.vendor), 0);
break;
#endif
}
return newRV_noinc((SV *) hash);
}
SV *
perl_ARJoinMappingStruct(ARControlStruct * ctrl, ARJoinMappingStruct * in)
{
HV *hash = newHV();
hv_store(hash, "schemaIndex", strlen("schemaIndex") , newSViv(in->schemaIndex), 0);
hv_store(hash, "realId", strlen("realId") , newSViv(in->realId), 0);
return newRV_noinc((SV *) hash);
}
SV *
perl_ARViewMappingStruct(ARControlStruct * ctrl, ARViewMappingStruct * in)
{
HV *hash = newHV();
hv_store(hash, "fieldName", strlen("fieldName") , newSVpv(in->fieldName, 0), 0);
return newRV_noinc((SV *) hash);
}
#if AR_EXPORT_VERSION >= 6L
SV *
perl_ARVendorMappingStruct(ARControlStruct * ctrl, ARVendorMappingStruct * in)
{
( run in 2.294 seconds using v1.01-cache-2.11-cpan-5735350b133 )