ARSperl
view release on metacpan or search on metacpan
supportrev_generated.c view on Meta::CPAN
}
if( SvTYPE((SV*) h) == SVt_PVHV ){
// printf( "ARBulkEntryReturn: k = <%s>\n", k );
if( hv_exists(h,k,strlen(k)) ){
val = hv_fetch( h, k, strlen(k), 0 );
if( val && *val ){
{
{
char *pcase = NULL;
char errText[512];
HV *h;
SV **hval = NULL;
char *k = NULL;
if( SvTYPE(SvRV(*val)) != SVt_PVHV ){
ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "rev_ARBulkEntryReturn: not a hash value" );
return -1;
}
h = (HV* ) SvRV((SV*) *val);
if( 0 ){
}else if( hv_exists(h,"xmlCreateEntryReturn",20) ){
p->entryCallType = AR_BULK_ENTRY_XMLCREATE;
k = "xmlCreateEntryReturn";
}else if( hv_exists(h,"setEntryReturn",14) ){
p->entryCallType = AR_BULK_ENTRY_SET;
k = "setEntryReturn";
}else if( hv_exists(h,"xmlSetEntryReturn",17) ){
p->entryCallType = AR_BULK_ENTRY_XMLSET;
k = "xmlSetEntryReturn";
}else if( hv_exists(h,"mergeEntryReturn",16) ){
p->entryCallType = AR_BULK_ENTRY_MERGE;
k = "mergeEntryReturn";
}else if( hv_exists(h,"xmlDeleteEntryReturn",20) ){
p->entryCallType = AR_BULK_ENTRY_XMLDELETE;
k = "xmlDeleteEntryReturn";
}else if( hv_exists(h,"deleteEntryReturn",17) ){
p->entryCallType = AR_BULK_ENTRY_DELETE;
k = "deleteEntryReturn";
}else if( hv_exists(h,"createEntryReturn",17) ){
p->entryCallType = AR_BULK_ENTRY_CREATE;
k = "createEntryReturn";
}else{
ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "rev_ARBulkEntryReturn: map error" );
}
switch( p->entryCallType ){
case AR_BULK_ENTRY_XMLCREATE:
{
if( SvTYPE(SvRV(*val)) == SVt_PVHV ){
int i = 0, num = 0;
HV *h = (HV* ) SvRV((SV*) *val);
char k[256];
k[255] = '\0';
{
SV **val;
strncpy( k, "xmlCreateEntryReturn", 255 );
val = hv_fetch( h, "xmlCreateEntryReturn", 20, 0 );
if( val && *val && SvOK(*val) ){
{
rev_ARXMLEntryReturn( ctrl, h, k, &(p->u.xmlCreateEntryReturn) );
}
}else{
ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "hv_fetch error: key \"xmlCreateEntryReturn\"" );
return -1;
}
}
}else{
ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "rev_ARBulkEntryReturn: hash value is not a hash reference" );
return -1;
}
}
break;
case AR_BULK_ENTRY_SET:
{
if( SvTYPE(SvRV(*val)) == SVt_PVHV ){
int i = 0, num = 0;
HV *h = (HV* ) SvRV((SV*) *val);
char k[256];
k[255] = '\0';
{
SV **val;
strncpy( k, "setEntryReturn", 255 );
val = hv_fetch( h, "setEntryReturn", 14, 0 );
if( val && *val && SvOK(*val) ){
{
rev_ARStatusList( ctrl, h, k, &(p->u.setEntryReturn) );
}
supportrev_generated.c view on Meta::CPAN
ARError_add(AR_RETURN_WARNING, AP_ERR_GENERAL, "rev_ARCOMMethodStruct: key doesn't exist");
ARError_add(AR_RETURN_WARNING, AP_ERR_GENERAL, k );
return -2;
}
}else{
ARError_add(AR_RETURN_ERROR, AP_ERR_GENERAL, "rev_ARCOMMethodStruct: first argument is not a hash");
return -1;
}
return 0;
}
int
rev_ARCOMValueStruct( ARControlStruct *ctrl, HV *h, char *k, ARCOMValueStruct *p ){
SV **val;
int i = 0;
if( !p ){
ARError_add(AR_RETURN_ERROR, AP_ERR_GENERAL, "rev_ARCOMValueStruct: AR Object param is NULL" );
return -1;
}
if( SvTYPE((SV*) h) == SVt_PVHV ){
// printf( "ARCOMValueStruct: k = <%s>\n", k );
if( hv_exists(h,k,strlen(k)) ){
val = hv_fetch( h, k, strlen(k), 0 );
if( val && *val ){
{
{
char *pcase = NULL;
char errText[512];
HV *h;
SV **hval = NULL;
char *k = NULL;
if( SvTYPE(SvRV(*val)) != SVt_PVHV ){
ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "rev_ARCOMValueStruct: not a hash value" );
return -1;
}
h = (HV* ) SvRV((SV*) *val);
if( 0 ){
}else if( hv_exists(h,"value",5) ){
p->valueType = AR_COM_PARM_VALUE;
k = "value";
}else if( hv_exists(h,"fieldId",7) ){
p->valueType = AR_COM_PARM_FIELDID;
k = "fieldId";
}else if( 1 ){
p->valueType = AR_COM_PARM_NULL;
}else{
ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "rev_ARCOMValueStruct: map error" );
}
switch( p->valueType ){
case AR_COM_PARM_VALUE:
{
if( SvTYPE(SvRV(*val)) == SVt_PVHV ){
int i = 0, num = 0;
HV *h = (HV* ) SvRV((SV*) *val);
char k[256];
k[255] = '\0';
{
SV **val;
strncpy( k, "value", 255 );
val = hv_fetch( h, "value", 5, 0 );
if( val && *val && (SvOK(*val) || SvTYPE(*val) == SVt_NULL) ){
{
rev_ARValueStruct( ctrl, h, k, "dataType", &(p->u.value) );
}
}else{
ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "hv_fetch error: key \"value\"" );
return -1;
}
}
}else{
ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "rev_ARCOMValueStruct: hash value is not a hash reference" );
return -1;
}
}
break;
case AR_COM_PARM_FIELDID:
{
if( SvTYPE(SvRV(*val)) == SVt_PVHV ){
int i = 0, num = 0;
HV *h = (HV* ) SvRV((SV*) *val);
char k[256];
k[255] = '\0';
{
SV **val;
strncpy( k, "fieldId", 255 );
val = hv_fetch( h, "fieldId", 7, 0 );
if( val && *val && SvOK(*val) ){
{
p->u.fieldId = SvIV(*val);
}
supportrev_generated.c view on Meta::CPAN
int i = 0;
if( !p ){
ARError_add(AR_RETURN_ERROR, AP_ERR_GENERAL, "rev_AREnumLimitsStruct: AR Object param is NULL" );
return -1;
}
if( SvTYPE((SV*) h) == SVt_PVHV ){
// printf( "AREnumLimitsStruct: k = <%s>\n", k );
if( hv_exists(h,k,strlen(k)) ){
val = hv_fetch( h, k, strlen(k), 0 );
if( val && *val ){
{
if( SvTYPE(SvRV(*val)) == SVt_PVHV ){
int i = 0, num = 0;
HV *h = (HV* ) SvRV((SV*) *val);
char k[256];
k[255] = '\0';
{
SV **val;
strncpy( k, "enumLimits", 255 );
val = hv_fetch( h, "enumLimits", 10, 0 );
if( val && *val && SvOK(*val) ){
{
{
char *pcase = NULL;
char errText[512];
HV *h;
SV **hval = NULL;
char *k = NULL;
if( SvTYPE(SvRV(*val)) != SVt_PVHV ){
ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "rev_AREnumLimitsStruct: not a hash value" );
return -1;
}
h = (HV* ) SvRV((SV*) *val);
if( 0 ){
}else if( hv_exists(h,"queryList",9) ){
p->listStyle = AR_ENUM_STYLE_QUERY;
k = "queryList";
}else if( hv_exists(h,"customList",10) ){
p->listStyle = AR_ENUM_STYLE_CUSTOM;
k = "customList";
}else if( hv_exists(h,"regularList",11) ){
p->listStyle = AR_ENUM_STYLE_REGULAR;
k = "regularList";
}else{
ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "rev_AREnumLimitsStruct: map error" );
}
switch( p->listStyle ){
case AR_ENUM_STYLE_QUERY:
{
if( SvTYPE(SvRV(*val)) == SVt_PVHV ){
int i = 0, num = 0;
HV *h = (HV* ) SvRV((SV*) *val);
char k[256];
k[255] = '\0';
{
SV **val;
strncpy( k, "queryList", 255 );
val = hv_fetch( h, "queryList", 9, 0 );
if( val && *val && SvOK(*val) ){
{
rev_AREnumQueryStruct( ctrl, h, k, &(p->u.queryList) );
}
}else{
ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "hv_fetch error: key \"queryList\"" );
return -1;
}
}
}else{
ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "rev_AREnumLimitsStruct: hash value is not a hash reference" );
return -1;
}
}
break;
case AR_ENUM_STYLE_CUSTOM:
{
if( SvTYPE(SvRV(*val)) == SVt_PVHV ){
int i = 0, num = 0;
HV *h = (HV* ) SvRV((SV*) *val);
char k[256];
k[255] = '\0';
{
SV **val;
strncpy( k, "customList", 255 );
val = hv_fetch( h, "customList", 10, 0 );
if( val && *val && SvOK(*val) ){
{
rev_AREnumItemList( ctrl, h, k, &(p->u.customList) );
}
supportrev_generated.c view on Meta::CPAN
}
}else{
ARError_add(AR_RETURN_WARNING, AP_ERR_GENERAL, "rev_AREnumQueryStruct: key doesn't exist");
ARError_add(AR_RETURN_WARNING, AP_ERR_GENERAL, k );
return -2;
}
}else{
ARError_add(AR_RETURN_ERROR, AP_ERR_GENERAL, "rev_AREnumQueryStruct: first argument is not a hash");
return -1;
}
return 0;
}
#endif
int
rev_AREscalationTmStruct( ARControlStruct *ctrl, HV *h, char *k, AREscalationTmStruct *p ){
SV **val;
int i = 0;
if( !p ){
ARError_add(AR_RETURN_ERROR, AP_ERR_GENERAL, "rev_AREscalationTmStruct: AR Object param is NULL" );
return -1;
}
if( SvTYPE((SV*) h) == SVt_PVHV ){
// printf( "AREscalationTmStruct: k = <%s>\n", k );
if( hv_exists(h,k,strlen(k)) ){
val = hv_fetch( h, k, strlen(k), 0 );
if( val && *val ){
{
{
char *pcase = NULL;
char errText[512];
HV *h;
SV **hval = NULL;
char *k = NULL;
if( SvTYPE(SvRV(*val)) != SVt_PVHV ){
ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "rev_AREscalationTmStruct: not a hash value" );
return -1;
}
h = (HV* ) SvRV((SV*) *val);
if( 0 ){
}else if( hv_exists(h,"exitGuide",9) ){
p->escalationTmType = AR_ESCALATION_TYPE_TIMEMARK;
k = "exitGuide";
}else if( hv_exists(h,"exitGuide",9) ){
p->escalationTmType = AR_ESCALATION_TYPE_INTERVAL;
k = "exitGuide";
}else{
ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "rev_AREscalationTmStruct: map error" );
}
switch( p->escalationTmType ){
case AR_ESCALATION_TYPE_TIMEMARK:
{
if( SvTYPE(SvRV(*val)) == SVt_PVHV ){
int i = 0, num = 0;
HV *h = (HV* ) SvRV((SV*) *val);
char k[256];
k[255] = '\0';
{
SV **val;
strncpy( k, "exitGuide", 255 );
val = hv_fetch( h, "exitGuide", 9, 0 );
if( val && *val && SvOK(*val) ){
{
rev_ARDayStruct( ctrl, h, k, &(p->u.date) );
}
}else{
ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "hv_fetch error: key \"exitGuide\"" );
return -1;
}
}
}else{
ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "rev_AREscalationTmStruct: hash value is not a hash reference" );
return -1;
}
}
break;
case AR_ESCALATION_TYPE_INTERVAL:
{
if( SvTYPE(SvRV(*val)) == SVt_PVHV ){
int i = 0, num = 0;
HV *h = (HV* ) SvRV((SV*) *val);
char k[256];
k[255] = '\0';
{
SV **val;
strncpy( k, "exitGuide", 255 );
val = hv_fetch( h, "exitGuide", 9, 0 );
if( val && *val && SvOK(*val) ){
{
p->u.interval = SvIV(*val);
}
supportrev_generated.c view on Meta::CPAN
case AR_DATA_TYPE_REAL:
{
rev_ARRealLimitsStruct( ctrl, h, k, &(p->u.realLimits) );
}
break;
default:
sprintf( errText, "rev_ARFieldLimitStruct: invalid switch value %d", p->dataType );
ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, errText );
}
}
}
}else{
ARError_add(AR_RETURN_WARNING, AP_ERR_GENERAL, "rev_ARFieldLimitStruct: hv_fetch returned null");
return -2;
}
}else{
ARError_add(AR_RETURN_WARNING, AP_ERR_GENERAL, "rev_ARFieldLimitStruct: key doesn't exist");
ARError_add(AR_RETURN_WARNING, AP_ERR_GENERAL, k );
return -2;
}
}else{
ARError_add(AR_RETURN_ERROR, AP_ERR_GENERAL, "rev_ARFieldLimitStruct: first argument is not a hash");
return -1;
}
return 0;
}
int
rev_ARFieldMappingList( ARControlStruct *ctrl, HV *h, char *k, ARFieldMappingList *p ){
SV **val;
int i = 0;
if( !p ){
ARError_add(AR_RETURN_ERROR, AP_ERR_GENERAL, "rev_ARFieldMappingList: AR Object param is NULL" );
return -1;
}
if( SvTYPE((SV*) h) == SVt_PVHV ){
// printf( "ARFieldMappingList: k = <%s>\n", k );
if( hv_exists(h,k,strlen(k)) ){
val = hv_fetch( h, k, strlen(k), 0 );
if( val && *val ){
{
{
if( SvTYPE(SvRV(*val)) == SVt_PVAV ){
int i = 0, num = 0;
AV *ar = (AV*) SvRV((SV*) *val);
num = av_len(ar) + 1;
p->numItems = num;
if( num == 0 ) return 0;
p->mappingList = (ARFieldMappingStruct*) MALLOCNN( sizeof(ARFieldMappingStruct) * num );
/* if( p->mappingList == NULL ){
croak( "rev_ARFieldMappingList: malloc error\n" );
exit( 1 );
} */
for( i = 0; i < num; ++i ){
SV **item = av_fetch( ar, i, 0 );
if( item && *item ){
char *k = "_";
HV *h = newHV();
SvREFCNT_inc( *item );
hv_store( h, k, strlen(k), *item, 0 );
rev_ARFieldMappingStruct( ctrl, h, k, &(p->mappingList[i]) );
hv_undef( h );
}else{
ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "rev_ARFieldMappingList: invalid inner array value" );
}
}
}else{
ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "rev_ARFieldMappingList: hash value is not an array reference" );
ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, k );
return -1;
}
}
}
}else{
ARError_add(AR_RETURN_WARNING, AP_ERR_GENERAL, "rev_ARFieldMappingList: hv_fetch returned null");
return -2;
}
}else{
ARError_add(AR_RETURN_WARNING, AP_ERR_GENERAL, "rev_ARFieldMappingList: key doesn't exist");
ARError_add(AR_RETURN_WARNING, AP_ERR_GENERAL, k );
return -2;
}
}else{
ARError_add(AR_RETURN_ERROR, AP_ERR_GENERAL, "rev_ARFieldMappingList: first argument is not a hash");
return -1;
}
return 0;
}
int
rev_ARFieldMappingStruct( ARControlStruct *ctrl, HV *h, char *k, ARFieldMappingStruct *p ){
SV **val;
int i = 0;
if( !p ){
ARError_add(AR_RETURN_ERROR, AP_ERR_GENERAL, "rev_ARFieldMappingStruct: AR Object param is NULL" );
return -1;
}
if( SvTYPE((SV*) h) == SVt_PVHV ){
// printf( "ARFieldMappingStruct: k = <%s>\n", k );
if( hv_exists(h,k,strlen(k)) ){
val = hv_fetch( h, k, strlen(k), 0 );
if( val && *val ){
{
{
char *pcase = NULL;
char errText[512];
HV *h;
SV **hval = NULL;
char *k = NULL;
if( SvTYPE(SvRV(*val)) != SVt_PVHV ){
ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "rev_ARFieldMappingStruct: not a hash value" );
return -1;
supportrev_generated.c view on Meta::CPAN
}
h = (HV* ) SvRV((SV*) *val);
if( 0 ){
#if AR_CURRENT_API_VERSION >= 9
}else if( hv_exists(h,"currencyField",13) ){
p->tag = AR_CURRENCY_FLD;
k = "currencyField";
#endif
}else if( hv_exists(h,"queryCurrent",12) ){
p->tag = AR_FIELD_CURRENT;
k = "queryCurrent";
}else if( hv_exists(h,"value",5) ){
p->tag = AR_VALUE;
k = "value";
}else if( hv_exists(h,"fieldId",7) ){
p->tag = AR_FIELD;
k = "fieldId";
}else if( hv_exists(h,"TR_fieldId",10) ){
p->tag = AR_FIELD_TRAN;
k = "TR_fieldId";
}else if( hv_exists(h,"queryValue",10) ){
p->tag = AR_QUERY;
k = "queryValue";
}else if( hv_exists(h,"statHistory",11) ){
p->tag = AR_STAT_HISTORY;
k = "statHistory";
}else if( hv_exists(h,"arith",5) ){
p->tag = AR_ARITHMETIC;
k = "arith";
}else if( hv_exists(h,"valueSet",8) ){
p->tag = AR_VALUE_SET;
k = "valueSet";
}else if( hv_exists(h,"variable",8) ){
p->tag = AR_LOCAL_VARIABLE;
k = "variable";
}else if( hv_exists(h,"DB_fieldId",10) ){
p->tag = AR_FIELD_DB;
k = "DB_fieldId";
}else{
ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "rev_ARFieldValueOrArithStruct: map error" );
}
switch( p->tag ){
#if AR_CURRENT_API_VERSION >= 9
case AR_CURRENCY_FLD:
{
if( SvTYPE(SvRV(*val)) == SVt_PVHV ){
int i = 0, num = 0;
HV *h = (HV* ) SvRV((SV*) *val);
char k[256];
k[255] = '\0';
{
SV **val;
strncpy( k, "currencyField", 255 );
val = hv_fetch( h, "currencyField", 13, 0 );
if( val && *val && SvOK(*val) ){
{
p->u.currencyField = MALLOCNN(sizeof(ARCurrencyPartStruct)); rev_ARCurrencyPartStruct( ctrl, h, k, p->u.currencyField );
}
}else{
ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "hv_fetch error: key \"currencyField\"" );
return -1;
}
}
}else{
ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "rev_ARFieldValueOrArithStruct: hash value is not a hash reference" );
return -1;
}
}
break;
#endif
case AR_FIELD_CURRENT:
{
if( SvTYPE(SvRV(*val)) == SVt_PVHV ){
int i = 0, num = 0;
HV *h = (HV* ) SvRV((SV*) *val);
char k[256];
k[255] = '\0';
{
SV **val;
strncpy( k, "queryCurrent", 255 );
val = hv_fetch( h, "queryCurrent", 12, 0 );
if( val && *val && SvOK(*val) ){
{
p->u.fieldId = SvIV(*val);
}
supportrev_generated.c view on Meta::CPAN
k = "gotoGuide";
}else if( hv_exists(h,"notify",6) ){
p->action = AR_FILTER_ACTION_NOTIFY;
k = "notify";
#if AR_CURRENT_API_VERSION <= 9
}else if( hv_exists(h,"assign_fields",13) ){
p->action = AR_FILTER_ACTION_FIELDS;
k = "assign_fields";
#endif
}else if( hv_exists(h,"log",3) ){
p->action = AR_FILTER_ACTION_LOG;
k = "log";
}else if( hv_exists(h,"message",7) ){
p->action = AR_FILTER_ACTION_MESSAGE;
k = "message";
#if AR_CURRENT_API_VERSION >= 10
}else if( hv_exists(h,"fieldp",6) ){
p->action = AR_FILTER_ACTION_FIELDP;
k = "fieldp";
#endif
}else if( hv_exists(h,"exitGuide",9) ){
p->action = AR_FILTER_ACTION_EXITGUIDE;
k = "exitGuide";
}else if( hv_exists(h,"process",7) ){
p->action = AR_FILTER_ACTION_PROCESS;
k = "process";
}else if( hv_exists(h,"callGuide",9) ){
p->action = AR_FILTER_ACTION_CALLGUIDE;
k = "callGuide";
#if AR_CURRENT_API_VERSION >= 10
}else if( hv_exists(h,"assign_fields",13) ){
p->action = AR_FILTER_ACTION_FIELDS;
k = "assign_fields";
#endif
}else if( hv_exists(h,"sqlCommand",10) ){
p->action = AR_FILTER_ACTION_SQL;
k = "sqlCommand";
#if AR_CURRENT_API_VERSION <= 9
}else if( hv_exists(h,"fieldp",6) ){
p->action = AR_FILTER_ACTION_FIELDP;
k = "fieldp";
#endif
}else if( 1 ){
p->action = AR_FILTER_ACTION_NONE;
}else{
ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "rev_ARFilterActionStruct: map error" );
}
switch( p->action ){
case AR_FILTER_ACTION_GOTOACTION:
{
if( SvTYPE(SvRV(*val)) == SVt_PVHV ){
int i = 0, num = 0;
HV *h = (HV* ) SvRV((SV*) *val);
char k[256];
k[255] = '\0';
{
SV **val;
strncpy( k, "gotoAction", 255 );
val = hv_fetch( h, "gotoAction", 10, 0 );
if( val && *val && SvOK(*val) ){
{
rev_ARGotoActionStruct( ctrl, h, k, &(p->u.gotoAction) );
}
}else{
ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "hv_fetch error: key \"gotoAction\"" );
return -1;
}
}
}else{
ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "rev_ARFilterActionStruct: hash value is not a hash reference" );
return -1;
}
}
break;
case AR_FILTER_ACTION_GOTOGUIDELABEL:
{
if( SvTYPE(SvRV(*val)) == SVt_PVHV ){
int i = 0, num = 0;
HV *h = (HV* ) SvRV((SV*) *val);
char k[256];
k[255] = '\0';
{
SV **val;
strncpy( k, "gotoGuide", 255 );
val = hv_fetch( h, "gotoGuide", 9, 0 );
if( val && *val && SvOK(*val) ){
{
p->u.gotoGuide.label = strdup( SvPV_nolen(*val) );
}
supportrev_generated.c view on Meta::CPAN
}
if( SvTYPE((SV*) h) == SVt_PVHV ){
// printf( "ARMultiSchemaFieldFuncValueOrArithStruct: k = <%s>\n", k );
if( hv_exists(h,k,strlen(k)) ){
val = hv_fetch( h, k, strlen(k), 0 );
if( val && *val ){
{
{
char *pcase = NULL;
char errText[512];
HV *h;
SV **hval = NULL;
char *k = NULL;
if( SvTYPE(SvRV(*val)) != SVt_PVHV ){
ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "rev_ARMultiSchemaFieldFuncValueOrArithStruct: not a hash value" );
return -1;
}
h = (HV* ) SvRV((SV*) *val);
if( 0 ){
#if AR_CURRENT_API_VERSION >= 9
}else if( hv_exists(h,"currencyField",13) ){
p->tag = AR_CURRENCY_FLD;
k = "currencyField";
#endif
}else if( hv_exists(h,"value",5) ){
p->tag = AR_VALUE;
k = "value";
}else if( hv_exists(h,"queryValue",10) ){
p->tag = AR_VALUE_SET_QUERY;
k = "queryValue";
}else if( hv_exists(h,"fieldFunc",9) ){
p->tag = AR_FIELD;
k = "fieldFunc";
}else if( hv_exists(h,"arith",5) ){
p->tag = AR_ARITHMETIC;
k = "arith";
}else if( hv_exists(h,"valueSet",8) ){
p->tag = AR_VALUE_SET;
k = "valueSet";
}else if( hv_exists(h,"statHistory",11) ){
p->tag = AR_STAT_HISTORY;
k = "statHistory";
}else{
ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "rev_ARMultiSchemaFieldFuncValueOrArithStruct: map error" );
}
switch( p->tag ){
#if AR_CURRENT_API_VERSION >= 9
case AR_CURRENCY_FLD:
{
if( SvTYPE(SvRV(*val)) == SVt_PVHV ){
int i = 0, num = 0;
HV *h = (HV* ) SvRV((SV*) *val);
char k[256];
k[255] = '\0';
{
SV **val;
strncpy( k, "currencyField", 255 );
val = hv_fetch( h, "currencyField", 13, 0 );
if( val && *val && SvOK(*val) ){
{
p->u.currencyField = MALLOCNN(sizeof(ARMultiSchemaFuncCurrencyPartStruct)); rev_ARMultiSchemaFuncCurrencyPartStruct( ctrl, h, k, p->u.currencyField );
}
}else{
ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "hv_fetch error: key \"currencyField\"" );
return -1;
}
}
}else{
ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "rev_ARMultiSchemaFieldFuncValueOrArithStruct: hash value is not a hash reference" );
return -1;
}
}
break;
#endif
case AR_VALUE:
{
if( SvTYPE(SvRV(*val)) == SVt_PVHV ){
int i = 0, num = 0;
HV *h = (HV* ) SvRV((SV*) *val);
char k[256];
k[255] = '\0';
{
SV **val;
strncpy( k, "value", 255 );
val = hv_fetch( h, "value", 5, 0 );
if( val && *val && (SvOK(*val) || SvTYPE(*val) == SVt_NULL) ){
{
rev_ARValueStruct( ctrl, h, k, "dataType", &(p->u.value) );
}
supportrev_generated.c view on Meta::CPAN
}
if( SvTYPE((SV*) h) == SVt_PVHV ){
// printf( "ARMultiSchemaFieldValueOrArithStruct: k = <%s>\n", k );
if( hv_exists(h,k,strlen(k)) ){
val = hv_fetch( h, k, strlen(k), 0 );
if( val && *val ){
{
{
char *pcase = NULL;
char errText[512];
HV *h;
SV **hval = NULL;
char *k = NULL;
if( SvTYPE(SvRV(*val)) != SVt_PVHV ){
ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "rev_ARMultiSchemaFieldValueOrArithStruct: not a hash value" );
return -1;
}
h = (HV* ) SvRV((SV*) *val);
if( 0 ){
#if AR_CURRENT_API_VERSION >= 17
}else if( hv_exists(h,"currencyField",13) ){
p->tag = AR_CURRENCY_FLD;
k = "currencyField";
#endif
}else if( hv_exists(h,"value",5) ){
p->tag = AR_VALUE;
k = "value";
#if AR_CURRENT_API_VERSION >= 17
}else if( hv_exists(h,"queryValue",10) ){
p->tag = AR_VALUE_SET_QUERY;
k = "queryValue";
#endif
}else if( hv_exists(h,"fieldId",7) ){
p->tag = AR_FIELD;
k = "fieldId";
}else if( hv_exists(h,"arith",5) ){
p->tag = AR_ARITHMETIC;
k = "arith";
}else if( hv_exists(h,"valueSet",8) ){
p->tag = AR_VALUE_SET;
k = "valueSet";
#if AR_CURRENT_API_VERSION >= 17
}else if( hv_exists(h,"statHistory",11) ){
p->tag = AR_STAT_HISTORY;
k = "statHistory";
#endif
}else{
ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "rev_ARMultiSchemaFieldValueOrArithStruct: map error" );
}
switch( p->tag ){
#if AR_CURRENT_API_VERSION >= 17
case AR_CURRENCY_FLD:
{
if( SvTYPE(SvRV(*val)) == SVt_PVHV ){
int i = 0, num = 0;
HV *h = (HV* ) SvRV((SV*) *val);
char k[256];
k[255] = '\0';
{
SV **val;
strncpy( k, "currencyField", 255 );
val = hv_fetch( h, "currencyField", 13, 0 );
if( val && *val && SvOK(*val) ){
{
p->u.currencyField = MALLOCNN(sizeof(ARMultiSchemaFuncCurrencyPartStruct)); rev_ARMultiSchemaFuncCurrencyPartStruct( ctrl, h, k, p->u.currencyField );
}
}else{
ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "hv_fetch error: key \"currencyField\"" );
return -1;
}
}
}else{
ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "rev_ARMultiSchemaFieldValueOrArithStruct: hash value is not a hash reference" );
return -1;
}
}
break;
#endif
case AR_VALUE:
{
if( SvTYPE(SvRV(*val)) == SVt_PVHV ){
int i = 0, num = 0;
HV *h = (HV* ) SvRV((SV*) *val);
char k[256];
k[255] = '\0';
{
SV **val;
strncpy( k, "value", 255 );
val = hv_fetch( h, "value", 5, 0 );
if( val && *val && (SvOK(*val) || SvTYPE(*val) == SVt_NULL) ){
{
rev_ARValueStruct( ctrl, h, k, "dataType", &(p->u.value) );
}
supportrev_generated.c view on Meta::CPAN
}
}else{
ARError_add(AR_RETURN_ERROR, AP_ERR_GENERAL, "rev_ARMultiSchemaFuncQueryFromList: first argument is not a hash");
return -1;
}
return 0;
}
#endif
#if AR_CURRENT_API_VERSION >= 17
int
rev_ARMultiSchemaFuncQueryFromStruct( ARControlStruct *ctrl, HV *h, char *k, ARMultiSchemaFuncQueryFromStruct *p ){
SV **val;
int i = 0;
if( !p ){
ARError_add(AR_RETURN_ERROR, AP_ERR_GENERAL, "rev_ARMultiSchemaFuncQueryFromStruct: AR Object param is NULL" );
return -1;
}
if( SvTYPE((SV*) h) == SVt_PVHV ){
// printf( "ARMultiSchemaFuncQueryFromStruct: k = <%s>\n", k );
if( hv_exists(h,k,strlen(k)) ){
val = hv_fetch( h, k, strlen(k), 0 );
if( val && *val ){
{
{
char *pcase = NULL;
char errText[512];
HV *h;
SV **hval = NULL;
char *k = NULL;
if( SvTYPE(SvRV(*val)) != SVt_PVHV ){
ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "rev_ARMultiSchemaFuncQueryFromStruct: not a hash value" );
return -1;
}
h = (HV* ) SvRV((SV*) *val);
if( 0 ){
}else if( hv_exists(h,"name",4) ){
p->type = AR_MULTI_SCHEMA_SCHEMA_NAME;
k = "name";
}else if( hv_exists(h,"extRef",6) ){
p->type = AR_MULTI_SCHEMA_NESTED_QUERY;
k = "extRef";
}else if( hv_exists(h,"extRef",6) ){
p->type = AR_MULTI_SCHEMA_RECURSIVE_QUERY;
k = "extRef";
}else{
ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "rev_ARMultiSchemaFuncQueryFromStruct: map error" );
}
switch( p->type ){
case AR_MULTI_SCHEMA_SCHEMA_NAME:
{
if( SvTYPE(SvRV(*val)) == SVt_PVHV ){
int i = 0, num = 0;
HV *h = (HV* ) SvRV((SV*) *val);
char k[256];
k[255] = '\0';
{
SV **val;
strncpy( k, "name", 255 );
val = hv_fetch( h, "name", 4, 0 );
if( val && *val && SvOK(*val) ){
{
strncpy( p->u.schemaName, SvPV_nolen(*val), sizeof(p->u.schemaName) );
}
}else{
ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "hv_fetch error: key \"name\"" );
return -1;
}
}
}else{
ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "rev_ARMultiSchemaFuncQueryFromStruct: hash value is not a hash reference" );
return -1;
}
}
break;
case AR_MULTI_SCHEMA_NESTED_QUERY:
{
if( SvTYPE(SvRV(*val)) == SVt_PVHV ){
int i = 0, num = 0;
HV *h = (HV* ) SvRV((SV*) *val);
char k[256];
k[255] = '\0';
{
SV **val;
strncpy( k, "extRef", 255 );
val = hv_fetch( h, "extRef", 6, 0 );
if( val && *val && SvOK(*val) ){
{
p->u.nestedQuery = MALLOCNN(sizeof(ARMultiSchemaNestedFuncQueryStruct)); rev_ARMultiSchemaNestedFuncQueryStruct( ctrl, h, k, p->u.nestedQuery );
}
supportrev_generated.c view on Meta::CPAN
}
}else{
ARError_add(AR_RETURN_ERROR, AP_ERR_GENERAL, "rev_ARMultiSchemaQueryFromList: first argument is not a hash");
return -1;
}
return 0;
}
#endif
#if AR_CURRENT_API_VERSION >= 14
int
rev_ARMultiSchemaQueryFromStruct( ARControlStruct *ctrl, HV *h, char *k, ARMultiSchemaQueryFromStruct *p ){
SV **val;
int i = 0;
if( !p ){
ARError_add(AR_RETURN_ERROR, AP_ERR_GENERAL, "rev_ARMultiSchemaQueryFromStruct: AR Object param is NULL" );
return -1;
}
if( SvTYPE((SV*) h) == SVt_PVHV ){
// printf( "ARMultiSchemaQueryFromStruct: k = <%s>\n", k );
if( hv_exists(h,k,strlen(k)) ){
val = hv_fetch( h, k, strlen(k), 0 );
if( val && *val ){
{
{
char *pcase = NULL;
char errText[512];
HV *h;
SV **hval = NULL;
char *k = NULL;
if( SvTYPE(SvRV(*val)) != SVt_PVHV ){
ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "rev_ARMultiSchemaQueryFromStruct: not a hash value" );
return -1;
}
h = (HV* ) SvRV((SV*) *val);
if( 0 ){
}else if( hv_exists(h,"schemaName",10) ){
p->type = AR_MULTI_SCHEMA_SCHEMA_NAME;
k = "schemaName";
}else if( hv_exists(h,"nestedQuery",11) ){
p->type = AR_MULTI_SCHEMA_NESTED_QUERY;
k = "nestedQuery";
}else if( hv_exists(h,"recursiveQuery",14) ){
p->type = AR_MULTI_SCHEMA_RECURSIVE_QUERY;
k = "recursiveQuery";
}else{
ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "rev_ARMultiSchemaQueryFromStruct: map error" );
}
switch( p->type ){
case AR_MULTI_SCHEMA_SCHEMA_NAME:
{
if( SvTYPE(SvRV(*val)) == SVt_PVHV ){
int i = 0, num = 0;
HV *h = (HV* ) SvRV((SV*) *val);
char k[256];
k[255] = '\0';
{
SV **val;
strncpy( k, "schemaName", 255 );
val = hv_fetch( h, "schemaName", 10, 0 );
if( val && *val && SvOK(*val) ){
{
strncpy( p->u.schemaName, SvPV_nolen(*val), sizeof(p->u.schemaName) );
}
}else{
ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "hv_fetch error: key \"schemaName\"" );
return -1;
}
}
}else{
ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "rev_ARMultiSchemaQueryFromStruct: hash value is not a hash reference" );
return -1;
}
}
break;
case AR_MULTI_SCHEMA_NESTED_QUERY:
{
if( SvTYPE(SvRV(*val)) == SVt_PVHV ){
int i = 0, num = 0;
HV *h = (HV* ) SvRV((SV*) *val);
char k[256];
k[255] = '\0';
{
SV **val;
strncpy( k, "nestedQuery", 255 );
val = hv_fetch( h, "nestedQuery", 11, 0 );
if( val && *val && SvOK(*val) ){
{
p->u.nestedQuery = MALLOCNN(sizeof(ARMultiSchemaNestedQueryStruct)); rev_ARMultiSchemaNestedQueryStruct( ctrl, h, k, p->u.nestedQuery );
}
( run in 1.601 second using v1.01-cache-2.11-cpan-39bf76dae61 )