ARSperl

 view release on metacpan or  search on metacpan

supportrev_generated.c  view on Meta::CPAN

									{
										SV **val;
										strncpy( k, "deleteEntryReturn", 255 );
										val = hv_fetch( h, "deleteEntryReturn", 17, 0 );
										if( val && *val && SvOK(*val) ){
											{
												rev_ARStatusList( ctrl, h, k, &(p->u.deleteEntryReturn) );
											}
										}else{
											ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "hv_fetch error: key \"deleteEntryReturn\"" );
											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_CREATE:
								{
								
								
									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, "createEntryReturn", 255 );
										val = hv_fetch( h, "createEntryReturn", 17, 0 );
										if( val && *val && SvOK(*val) ){
											{
												rev_AREntryReturn( ctrl, h, k, &(p->u.createEntryReturn) );
											}
										}else{
											ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "hv_fetch error: key \"createEntryReturn\"" );
											return -1;
										}
									}
								
								
									}else{
										ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "rev_ARBulkEntryReturn: hash value is not a hash reference" );
										return -1;
									}
								
								
								}
								break;
				
							default:
								sprintf( errText, "rev_ARBulkEntryReturn: invalid switch value %d", p->entryCallType );
								ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, errText );
							}
				
					}
				
				}
			}else{
				ARError_add(AR_RETURN_WARNING, AP_ERR_GENERAL, "rev_ARBulkEntryReturn: hv_fetch returned null");
				return -2;
			}
		}else{
			ARError_add(AR_RETURN_WARNING, AP_ERR_GENERAL, "rev_ARBulkEntryReturn: 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_ARBulkEntryReturn: first argument is not a hash");
		return -1;
	}

	return 0;
}
#endif


#if AR_CURRENT_API_VERSION >= 11
int
rev_ARBulkEntryReturnList( ARControlStruct *ctrl, HV *h, char *k, ARBulkEntryReturnList *p ){
	SV  **val;
	int i = 0;

	if( !p ){
		ARError_add(AR_RETURN_ERROR, AP_ERR_GENERAL, "rev_ARBulkEntryReturnList: AR Object param is NULL" );
		return -1;
	}

	if( SvTYPE((SV*) h) == SVt_PVHV ){

		// printf( "ARBulkEntryReturnList: 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->entryReturnList = (ARBulkEntryReturn*) MALLOCNN( sizeof(ARBulkEntryReturn) * num );
							/* if( p->entryReturnList == NULL ){
								croak( "rev_ARBulkEntryReturnList: malloc error\n" );
								exit( 1 );
							} */
				
							for( i = 0; i < num; ++i ){

supportrev_generated.c  view on Meta::CPAN

										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);
											}
										}else{
											ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "hv_fetch error: key \"fieldId\"" );
											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_NULL:
								break;
							default:
								sprintf( errText, "rev_ARCOMValueStruct: invalid switch value %d", p->valueType );
								ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, errText );
							}
				
					}
				
				
				
					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, "valueIId", 255 );
						val = hv_fetch( h, "valueIId", 8, 0 );
						if( val && *val && SvOK(*val) ){
							{
								p->valueIId = strdup( SvPV_nolen(*val) );
							}
						}else{
							ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "hv_fetch error: key \"valueIId\"" );
							return -1;
						}
					}
				
				
					{
						SV **val;
						strncpy( k, "valueType", 255 );
						val = hv_fetch( h, "valueType", 9, 0 );
						if( val && *val && SvOK(*val) ){
							{
								p->valueType = SvIV(*val);
							}
						}else{
							ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "hv_fetch error: key \"valueType\"" );
							return -1;
						}
					}
				
				
					{
						SV **val;
						strncpy( k, "transId", 255 );
						val = hv_fetch( h, "transId", 7, 0 );
						if( val && *val && SvOK(*val) ){
							{
								p->transId = SvIV(*val);
							}
						}else{
							ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "hv_fetch error: key \"transId\"" );
							return -1;
						}
					}
				
				

supportrev_generated.c  view on Meta::CPAN

					}
				
				
					{
						SV **val;
						strncpy( k, "maxLength", 255 );
						val = hv_fetch( h, "maxLength", 9, 0 );
						if( val && *val && SvOK(*val) ){
							{
								p->maxLength = SvIV(*val);
							}
						}else{
							ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "hv_fetch error: key \"maxLength\"" );
							return -1;
						}
					}
				
				
					{
						SV **val;
						strncpy( k, "match", 255 );
						val = hv_fetch( h, "match", 5, 0 );
						if( val && *val && SvOK(*val) ){
							{
								int flag = 0;
								if( !strcmp(SvPV_nolen(*val),"leading") ){
									p->qbeMatchOperation = AR_QBE_MATCH_LEADING;
									flag = 1;
								}
								if( !strcmp(SvPV_nolen(*val),"equal") ){
									p->qbeMatchOperation = AR_QBE_MATCH_EQUAL;
									flag = 1;
								}
								if( !strcmp(SvPV_nolen(*val),"anywhere") ){
									p->qbeMatchOperation = AR_QBE_MATCH_ANYWHERE;
									flag = 1;
								}
								if( flag == 0 ){
									ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL,  "rev_ARCharLimitsStruct: invalid key value" );
									ARError_add( AR_RETURN_ERROR, AP_ERR_CONTINUE, SvPV_nolen(*val) );
								}
							}
						}else{
							ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "hv_fetch error: key \"match\"" );
							return -1;
						}
					}
				
				#if AR_CURRENT_API_VERSION >= 14
					{
						SV **val;
						strncpy( k, "storageOptionForCLOB", 255 );
						val = hv_fetch( h, "storageOptionForCLOB", 20, 0 );
						if( val && *val && SvOK(*val) ){
							{
								int flag = 0;
								if( !strcmp(SvPV_nolen(*val),"inrow") ){
									p->storageOptionForCLOB = AR_STORE_OPT_INROW;
									flag = 1;
								}
								if( !strcmp(SvPV_nolen(*val),"default") ){
									p->storageOptionForCLOB = AR_STORE_OPT_DEF;
									flag = 1;
								}
								if( !strcmp(SvPV_nolen(*val),"outrow") ){
									p->storageOptionForCLOB = AR_STORE_OPT_OUTROW;
									flag = 1;
								}
								if( flag == 0 ){
									ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL,  "rev_ARCharLimitsStruct: invalid key value" );
									ARError_add( AR_RETURN_ERROR, AP_ERR_CONTINUE, SvPV_nolen(*val) );
								}
							}
						}else{
							ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "hv_fetch error: key \"storageOptionForCLOB\"" );
							return -1;
						}
					}
				#endif
				
					{
						SV **val;
						strncpy( k, "fullTextOptions", 255 );
						val = hv_fetch( h, "fullTextOptions", 15, 0 );
						if( val && *val && SvOK(*val) ){
							{
								int flag = 0;
								if( !strcmp(SvPV_nolen(*val),"indexed") ){
									p->fullTextOptions = AR_FULLTEXT_OPTIONS_INDEXED;
									flag = 1;
								}
								if( !strcmp(SvPV_nolen(*val),"none") ){
									p->fullTextOptions = AR_FULLTEXT_OPTIONS_NONE;
									flag = 1;
								}
								if( flag == 0 ){
									ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL,  "rev_ARCharLimitsStruct: invalid key value" );
									ARError_add( AR_RETURN_ERROR, AP_ERR_CONTINUE, SvPV_nolen(*val) );
								}
							}
						}else{
							ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "hv_fetch error: key \"fullTextOptions\"" );
							return -1;
						}
					}
				
				
					{
						SV **val;
						strncpy( k, "menuStyle", 255 );
						val = hv_fetch( h, "menuStyle", 9, 0 );
						if( val && *val && SvOK(*val) ){
							{
								int flag = 0;
								if( !strcmp(SvPV_nolen(*val),"append") ){
									p->menuStyle = AR_MENU_APPEND;
									flag = 1;
								}
								if( !strcmp(SvPV_nolen(*val),"overwrite") ){
									p->menuStyle = AR_MENU_OVERWRITE;
									flag = 1;

supportrev_generated.c  view on Meta::CPAN

		}else{
			ARError_add(AR_RETURN_WARNING, AP_ERR_GENERAL, "rev_ARCharMenuDDFormStruct: 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_ARCharMenuDDFormStruct: first argument is not a hash");
		return -1;
	}

	return 0;
}




int
rev_ARCharMenuDDStruct( ARControlStruct *ctrl, HV *h, char *k, ARCharMenuDDStruct *p ){
	SV  **val;
	int i = 0;

	if( !p ){
		ARError_add(AR_RETURN_ERROR, AP_ERR_GENERAL, "rev_ARCharMenuDDStruct: AR Object param is NULL" );
		return -1;
	}

	if( SvTYPE((SV*) h) == SVt_PVHV ){

		// printf( "ARCharMenuDDStruct: 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];
				
							// pcase = SvPV_nolen(*val);
							// p->structType = caseLookUpTypeNumber( (TypeMapStruct*) structType, pcase );
							HV *h2 = (HV* ) SvRV((SV*) *val);
							SV** val = hv_fetch( h2, "structType", 10, 0 );
							p->structType = SvIV(*val);
				
				
							switch( p->structType ){
				
							case AR_CHAR_MENU_DD_FIELD:
								{
									rev_ARCharMenuDDFieldStruct( ctrl, h, k, &(p->u.fieldDefn) );
								}
								break;
				
				
							case AR_CHAR_MENU_DD_FORM:
								{
									rev_ARCharMenuDDFormStruct( ctrl, h, k, &(p->u.formDefn) );
								}
								break;
				
							default:
								sprintf( errText, "rev_ARCharMenuDDStruct: invalid switch value %d", p->structType );
								ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, errText );
							}
				
					}
				
				
				
					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, "structType", 255 );
						val = hv_fetch( h, "structType", 10, 0 );
						if( val && *val && SvOK(*val) ){
							{
								p->structType = SvIV(*val);
							}
						}else{
							ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "hv_fetch error: key \"structType\"" );
							return -1;
						}
					}
				
				
					{
						SV **val;
						strncpy( k, "nameType", 255 );
						val = hv_fetch( h, "nameType", 8, 0 );
						if( val && *val && SvOK(*val) ){
							{
								p->nameType = SvIV(*val);
							}
						}else{
							ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "hv_fetch error: key \"nameType\"" );
							return -1;
						}
					}
				
				
					{
						SV **val;
						strncpy( k, "valueFormat", 255 );
						val = hv_fetch( h, "valueFormat", 11, 0 );
						if( val && *val && SvOK(*val) ){
							{
								p->valueFormat = SvIV(*val);
							}
						}else{
							ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "hv_fetch error: key \"valueFormat\"" );
							return -1;
						}
					}
				
				

supportrev_generated.c  view on Meta::CPAN

										if( val && *val && SvOK(*val) ){
											{
												rev_ARViewSchema( ctrl, h, k, &(p->u.view) );
											}
										}else{
											ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "hv_fetch error: key \"view\"" );
											return -1;
										}
									}
								
								
									}else{
										ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "rev_ARCompoundSchema: hash value is not a hash reference" );
										return -1;
									}
								
								
								}
								break;
				
				
							case AR_SCHEMA_JOIN:
								{
								
								
									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, "join", 255 );
										val = hv_fetch( h, "join", 4, 0 );
										if( val && *val && SvOK(*val) ){
											{
												rev_ARJoinSchema( ctrl, h, k, &(p->u.join) );
											}
										}else{
											ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "hv_fetch error: key \"join\"" );
											return -1;
										}
									}
								
								
									}else{
										ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "rev_ARCompoundSchema: hash value is not a hash reference" );
										return -1;
									}
								
								
								}
								break;
				
							case AR_SCHEMA_REGULAR:
								break;
							case AR_SCHEMA_DIALOG:
								break;
							default:
								sprintf( errText, "rev_ARCompoundSchema: invalid switch value %d", p->schemaType );
								ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, errText );
							}
				
					}
				
				}
			}else{
				ARError_add(AR_RETURN_WARNING, AP_ERR_GENERAL, "rev_ARCompoundSchema: hv_fetch returned null");
				return -2;
			}
		}else{
			ARError_add(AR_RETURN_WARNING, AP_ERR_GENERAL, "rev_ARCompoundSchema: 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_ARCompoundSchema: first argument is not a hash");
		return -1;
	}

	return 0;
}




int
rev_ARCompoundSchemaList( ARControlStruct *ctrl, HV *h, char *k, ARCompoundSchemaList *p ){
	SV  **val;
	int i = 0;

	if( !p ){
		ARError_add(AR_RETURN_ERROR, AP_ERR_GENERAL, "rev_ARCompoundSchemaList: AR Object param is NULL" );
		return -1;
	}

	if( SvTYPE((SV*) h) == SVt_PVHV ){

		// printf( "ARCompoundSchemaList: 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->compoundSchema = (ARCompoundSchema*) MALLOCNN( sizeof(ARCompoundSchema) * num );
							/* if( p->compoundSchema == NULL ){
								croak( "rev_ARCompoundSchemaList: malloc error\n" );
								exit( 1 );
							} */
				
							for( i = 0; i < num; ++i ){

supportrev_generated.c  view on Meta::CPAN

												{
													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) );
														}
													}else{
														ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "hv_fetch error: key \"customList\"" );
														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_REGULAR:
											{
											
											
												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, "regularList", 255 );
													val = hv_fetch( h, "regularList", 11, 0 );
													if( val && *val && SvOK(*val) ){
														{
															rev_ARNameList( ctrl, h, k, &(p->u.regularList) );
														}
													}else{
														ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "hv_fetch error: key \"regularList\"" );
														return -1;
													}
												}
											
											
												}else{
													ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "rev_AREnumLimitsStruct: hash value is not a hash reference" );
													return -1;
												}
											
											
											}
											break;
							
										default:
											sprintf( errText, "rev_AREnumLimitsStruct: invalid switch value %d", p->listStyle );
											ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, errText );
										}
							
								}
							
							}
						}else{
							ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "hv_fetch error: key \"enumLimits\"" );
							return -1;
						}
					}
				
				
					}else{
						ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "rev_AREnumLimitsStruct: hash value is not a hash reference" );
						return -1;
					}
				
				
				}
			}else{
				ARError_add(AR_RETURN_WARNING, AP_ERR_GENERAL, "rev_AREnumLimitsStruct: hv_fetch returned null");
				return -2;
			}
		}else{
			ARError_add(AR_RETURN_WARNING, AP_ERR_GENERAL, "rev_AREnumLimitsStruct: 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_AREnumLimitsStruct: first argument is not a hash");
		return -1;
	}

	return 0;
}
#endif


#if AR_CURRENT_API_VERSION >= 8
int
rev_AREnumQueryStruct( ARControlStruct *ctrl, HV *h, char *k, AREnumQueryStruct *p ){
	SV  **val;
	int i = 0;

	if( !p ){
		ARError_add(AR_RETURN_ERROR, AP_ERR_GENERAL, "rev_AREnumQueryStruct: AR Object param is NULL" );
		return -1;
	}

	if( SvTYPE((SV*) h) == SVt_PVHV ){

		// printf( "AREnumQueryStruct: k = <%s>\n", k );
		if( hv_exists(h,k,strlen(k)) ){
			val = hv_fetch( h, k, strlen(k), 0 );
			if( val && *val ){
				{
				
				

supportrev_generated.c  view on Meta::CPAN

									{
										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);
											}
										}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;
				
							default:
								sprintf( errText, "rev_AREscalationTmStruct: invalid switch value %d", p->escalationTmType );
								ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, errText );
							}
				
					}
				
				}
			}else{
				ARError_add(AR_RETURN_WARNING, AP_ERR_GENERAL, "rev_AREscalationTmStruct: hv_fetch returned null");
				return -2;
			}
		}else{
			ARError_add(AR_RETURN_WARNING, AP_ERR_GENERAL, "rev_AREscalationTmStruct: 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_AREscalationTmStruct: first argument is not a hash");
		return -1;
	}

	return 0;
}




int
rev_ARExitGuideStruct( ARControlStruct *ctrl, HV *h, char *k, ARExitGuideStruct *p ){
	SV  **val;
	int i = 0;

	if( !p ){
		ARError_add(AR_RETURN_ERROR, AP_ERR_GENERAL, "rev_ARExitGuideStruct: AR Object param is NULL" );
		return -1;
	}

	if( SvTYPE((SV*) h) == SVt_PVHV ){

		// printf( "ARExitGuideStruct: 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, "closeAll", 255 );
						val = hv_fetch( h, "closeAll", 8, 0 );
						if( val && *val && SvOK(*val) ){
							{
								int flag = 0;

supportrev_generated.c  view on Meta::CPAN

									rev_ARDateLimitsStruct( ctrl, h, k, &(p->u.dateLimits) );
								}
								break;
				#endif
				#if AR_CURRENT_API_VERSION >= 8
							case AR_DATA_TYPE_ENUM:
								{
									rev_AREnumLimitsStruct( ctrl, h, k, &(p->u.enumLimits) );
								}
								break;
				#endif
				#if AR_CURRENT_API_VERSION >= 9
							case AR_DATA_TYPE_CURRENCY:
								{
									rev_ARCurrencyLimitsStruct( ctrl, h, k, &(p->u.currencyLimits) );
								}
								break;
				#endif
				
							case AR_DATA_TYPE_COLUMN:
								{
									rev_ARColumnLimitsStruct( ctrl, h, k, &(p->u.columnLimits) );
								}
								break;
				
				
							case AR_DATA_TYPE_ATTACH:
								{
									rev_ARAttachLimitsStruct( ctrl, h, k, &(p->u.attachLimits) );
								}
								break;
				
				#if AR_CURRENT_API_VERSION >= 8
							case AR_DATA_TYPE_DISPLAY:
								{
									rev_ARDisplayLimits( ctrl, h, k, &(p->u.displayLimits) );
								}
								break;
				#endif
				
							case AR_DATA_TYPE_TABLE:
								{
									rev_ARTableLimitsStruct( ctrl, h, k, &(p->u.tableLimits) );
								}
								break;
				
				
							case AR_DATA_TYPE_DECIMAL:
								{
									rev_ARDecimalLimitsStruct( ctrl, h, k, &(p->u.decimalLimits) );
								}
								break;
				
				
							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 ){

supportrev_generated.c  view on Meta::CPAN

										if( val && *val && SvOK(*val) ){
											{
												rev_ARViewMappingStruct( ctrl, h, k, &(p->u.view) );
											}
										}else{
											ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "hv_fetch error: key \"view\"" );
											return -1;
										}
									}
								
								
									}else{
										ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "rev_ARFieldMappingStruct: hash value is not a hash reference" );
										return -1;
									}
								
								
								}
								break;
				
				
							case AR_FIELD_JOIN:
								{
								
								
									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, "join", 255 );
										val = hv_fetch( h, "join", 4, 0 );
										if( val && *val && SvOK(*val) ){
											{
												rev_ARJoinMappingStruct( ctrl, h, k, &(p->u.join) );
											}
										}else{
											ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "hv_fetch error: key \"join\"" );
											return -1;
										}
									}
								
								
									}else{
										ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "rev_ARFieldMappingStruct: hash value is not a hash reference" );
										return -1;
									}
								
								
								}
								break;
				
							case AR_FIELD_REGULAR:
								break;
							case AR_FIELD_NONE:
								break;
							default:
								sprintf( errText, "rev_ARFieldMappingStruct: invalid switch value %d", p->fieldType );
								ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, errText );
							}
				
					}
				
				}
			}else{
				ARError_add(AR_RETURN_WARNING, AP_ERR_GENERAL, "rev_ARFieldMappingStruct: hv_fetch returned null");
				return -2;
			}
		}else{
			ARError_add(AR_RETURN_WARNING, AP_ERR_GENERAL, "rev_ARFieldMappingStruct: 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_ARFieldMappingStruct: first argument is not a hash");
		return -1;
	}

	return 0;
}




int
rev_ARFieldValueList( ARControlStruct *ctrl, HV *h, char *k, ARFieldValueList *p ){
	SV  **val;
	int i = 0;

	if( !p ){
		ARError_add(AR_RETURN_ERROR, AP_ERR_GENERAL, "rev_ARFieldValueList: AR Object param is NULL" );
		return -1;
	}

	if( SvTYPE((SV*) h) == SVt_PVHV ){

		// printf( "ARFieldValueList: 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->fieldValueList = (ARFieldValueStruct*) MALLOCNN( sizeof(ARFieldValueStruct) * num );
							/* if( p->fieldValueList == NULL ){
								croak( "rev_ARFieldValueList: malloc error\n" );
								exit( 1 );
							} */
				
							for( i = 0; i < num; ++i ){

supportrev_generated.c  view on Meta::CPAN

									{
										SV **val;
										strncpy( k, "variable", 255 );
										val = hv_fetch( h, "variable", 8, 0 );
										if( val && *val && SvOK(*val) ){
											{
												p->u.variable = SvIV(*val);
											}
										}else{
											ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "hv_fetch error: key \"variable\"" );
											return -1;
										}
									}
								
								
									}else{
										ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "rev_ARFieldValueOrArithStruct: hash value is not a hash reference" );
										return -1;
									}
								
								
								}
								break;
				
				
							case AR_FIELD_DB:
								{
								
								
									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, "DB_fieldId", 255 );
										val = hv_fetch( h, "DB_fieldId", 10, 0 );
										if( val && *val && SvOK(*val) ){
											{
												p->u.fieldId = SvIV(*val);
											}
										}else{
											ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "hv_fetch error: key \"DB_fieldId\"" );
											return -1;
										}
									}
								
								
									}else{
										ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "rev_ARFieldValueOrArithStruct: hash value is not a hash reference" );
										return -1;
									}
								
								
								}
								break;
				
							default:
								sprintf( errText, "rev_ARFieldValueOrArithStruct: invalid switch value %d", p->tag );
								ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, errText );
							}
				
					}
				
				}
			}else{
				ARError_add(AR_RETURN_WARNING, AP_ERR_GENERAL, "rev_ARFieldValueOrArithStruct: hv_fetch returned null");
				return -2;
			}
		}else{
			ARError_add(AR_RETURN_WARNING, AP_ERR_GENERAL, "rev_ARFieldValueOrArithStruct: 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_ARFieldValueOrArithStruct: first argument is not a hash");
		return -1;
	}

	return 0;
}




int
rev_ARFieldValueStruct( ARControlStruct *ctrl, HV *h, char *k, ARFieldValueStruct *p ){
	SV  **val;
	int i = 0;

	if( !p ){
		ARError_add(AR_RETURN_ERROR, AP_ERR_GENERAL, "rev_ARFieldValueStruct: AR Object param is NULL" );
		return -1;
	}

	if( SvTYPE((SV*) h) == SVt_PVHV ){

		// printf( "ARFieldValueStruct: 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, "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->value) );

supportrev_generated.c  view on Meta::CPAN

										strncpy( k, "sqlCommand", 255 );
										val = hv_fetch( h, "sqlCommand", 10, 0 );
										if( val && *val && SvOK(*val) ){
											{
												rev_ARSQLStruct( ctrl, h, k, &(p->u.sqlCommand) );
											}
										}else{
											ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "hv_fetch error: key \"sqlCommand\"" );
											return -1;
										}
									}
								
								
									}else{
										ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "rev_ARFilterActionStruct: hash value is not a hash reference" );
										return -1;
									}
								
								
								}
								break;
				
				#if AR_CURRENT_API_VERSION <= 9
							case AR_FILTER_ACTION_FIELDP:
								{
								
								
									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, "fieldp", 255 );
										val = hv_fetch( h, "fieldp", 6, 0 );
										if( val && *val && SvOK(*val) ){
											{
												rev_ARPushFieldsList( ctrl, h, k, &(p->u.pushFieldsList) );
											}
										}else{
											ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "hv_fetch error: key \"fieldp\"" );
											return -1;
										}
									}
								
								
									}else{
										ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "rev_ARFilterActionStruct: hash value is not a hash reference" );
										return -1;
									}
								
								
								}
								break;
				#endif
							case AR_FILTER_ACTION_NONE:
								break;
							default:
								sprintf( errText, "rev_ARFilterActionStruct: invalid switch value %d", p->action );
								ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, errText );
							}
				
					}
				
				}
			}else{
				ARError_add(AR_RETURN_WARNING, AP_ERR_GENERAL, "rev_ARFilterActionStruct: hv_fetch returned null");
				return -2;
			}
		}else{
			ARError_add(AR_RETURN_WARNING, AP_ERR_GENERAL, "rev_ARFilterActionStruct: 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_ARFilterActionStruct: first argument is not a hash");
		return -1;
	}

	return 0;
}




int
rev_ARGotoActionStruct( ARControlStruct *ctrl, HV *h, char *k, ARGotoActionStruct *p ){
	SV  **val;
	int i = 0;

	if( !p ){
		ARError_add(AR_RETURN_ERROR, AP_ERR_GENERAL, "rev_ARGotoActionStruct: AR Object param is NULL" );
		return -1;
	}

	if( SvTYPE((SV*) h) == SVt_PVHV ){

		// printf( "ARGotoActionStruct: 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, "fieldIdOrValue", 255 );
						val = hv_fetch( h, "fieldIdOrValue", 14, 0 );
						if( val && *val && SvOK(*val) ){
							{
								p->fieldIdOrValue = SvIV(*val);

supportrev_generated.c  view on Meta::CPAN

									{
										SV **val;
										strncpy( k, "valueSet", 255 );
										val = hv_fetch( h, "valueSet", 8, 0 );
										if( val && *val && SvOK(*val) ){
											{
												rev_ARValueList( ctrl, h, k, &(p->u.valueSet) );
											}
										}else{
											ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "hv_fetch error: key \"valueSet\"" );
											return -1;
										}
									}
								
								
									}else{
										ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "rev_ARMultiSchemaFieldFuncValueOrArithStruct: hash value is not a hash reference" );
										return -1;
									}
								
								
								}
								break;
				
				
							case AR_STAT_HISTORY:
								{
								
								
									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, "statHistory", 255 );
										val = hv_fetch( h, "statHistory", 11, 0 );
										if( val && *val && SvOK(*val) ){
											{
												rev_ARMultiSchemaFuncStatHistoryValue( ctrl, h, k, &(p->u.statHistory) );
											}
										}else{
											ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "hv_fetch error: key \"statHistory\"" );
											return -1;
										}
									}
								
								
									}else{
										ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "rev_ARMultiSchemaFieldFuncValueOrArithStruct: hash value is not a hash reference" );
										return -1;
									}
								
								
								}
								break;
				
							default:
								sprintf( errText, "rev_ARMultiSchemaFieldFuncValueOrArithStruct: invalid switch value %d", p->tag );
								ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, errText );
							}
				
					}
				
				}
			}else{
				ARError_add(AR_RETURN_WARNING, AP_ERR_GENERAL, "rev_ARMultiSchemaFieldFuncValueOrArithStruct: hv_fetch returned null");
				return -2;
			}
		}else{
			ARError_add(AR_RETURN_WARNING, AP_ERR_GENERAL, "rev_ARMultiSchemaFieldFuncValueOrArithStruct: 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_ARMultiSchemaFieldFuncValueOrArithStruct: first argument is not a hash");
		return -1;
	}

	return 0;
}
#endif


#if AR_CURRENT_API_VERSION >= 14
int
rev_ARMultiSchemaFieldIdList( ARControlStruct *ctrl, HV *h, char *k, ARMultiSchemaFieldIdList *p ){
	SV  **val;
	int i = 0;

	if( !p ){
		ARError_add(AR_RETURN_ERROR, AP_ERR_GENERAL, "rev_ARMultiSchemaFieldIdList: AR Object param is NULL" );
		return -1;
	}

	if( SvTYPE((SV*) h) == SVt_PVHV ){

		// printf( "ARMultiSchemaFieldIdList: 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->listPtr = (ARMultiSchemaFieldIdStruct*) MALLOCNN( sizeof(ARMultiSchemaFieldIdStruct) * num );
							/* if( p->listPtr == NULL ){
								croak( "rev_ARMultiSchemaFieldIdList: malloc error\n" );
								exit( 1 );
							} */
				
							for( i = 0; i < num; ++i ){

supportrev_generated.c  view on Meta::CPAN

									{
										SV **val;
										strncpy( k, "valueSet", 255 );
										val = hv_fetch( h, "valueSet", 8, 0 );
										if( val && *val && SvOK(*val) ){
											{
												rev_ARValueList( ctrl, h, k, &(p->u.valueSet) );
											}
										}else{
											ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "hv_fetch error: key \"valueSet\"" );
											return -1;
										}
									}
								
								
									}else{
										ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "rev_ARMultiSchemaFieldValueOrArithStruct: hash value is not a hash reference" );
										return -1;
									}
								
								
								}
								break;
				
				#if AR_CURRENT_API_VERSION >= 17
							case AR_STAT_HISTORY:
								{
								
								
									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, "statHistory", 255 );
										val = hv_fetch( h, "statHistory", 11, 0 );
										if( val && *val && SvOK(*val) ){
											{
												rev_ARMultiSchemaFuncStatHistoryValue( ctrl, h, k, &(p->u.statHistory) );
											}
										}else{
											ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "hv_fetch error: key \"statHistory\"" );
											return -1;
										}
									}
								
								
									}else{
										ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "rev_ARMultiSchemaFieldValueOrArithStruct: hash value is not a hash reference" );
										return -1;
									}
								
								
								}
								break;
				#endif
							default:
								sprintf( errText, "rev_ARMultiSchemaFieldValueOrArithStruct: invalid switch value %d", p->tag );
								ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, errText );
							}
				
					}
				
				}
			}else{
				ARError_add(AR_RETURN_WARNING, AP_ERR_GENERAL, "rev_ARMultiSchemaFieldValueOrArithStruct: hv_fetch returned null");
				return -2;
			}
		}else{
			ARError_add(AR_RETURN_WARNING, AP_ERR_GENERAL, "rev_ARMultiSchemaFieldValueOrArithStruct: 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_ARMultiSchemaFieldValueOrArithStruct: first argument is not a hash");
		return -1;
	}

	return 0;
}
#endif


#if AR_CURRENT_API_VERSION >= 17
int
rev_ARMultiSchemaFuncArithOpStruct( ARControlStruct *ctrl, HV *h, char *k, ARMultiSchemaFuncArithOpStruct *p ){
	SV  **val;
	int i = 0;

	if( !p ){
		ARError_add(AR_RETURN_ERROR, AP_ERR_GENERAL, "rev_ARMultiSchemaFuncArithOpStruct: AR Object param is NULL" );
		return -1;
	}

	if( SvTYPE((SV*) h) == SVt_PVHV ){

		// printf( "ARMultiSchemaFuncArithOpStruct: 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, "operandRight", 255 );
						val = hv_fetch( h, "operandRight", 12, 0 );
						if( val && *val && SvOK(*val) ){
							{
								rev_ARMultiSchemaFieldFuncValueOrArithStruct( ctrl, h, k, &(p->operandRight) );

supportrev_generated.c  view on Meta::CPAN

										return -1;
									}
								
								
								}
								break;
				
				
							case AR_COND_OP_OR:
								{
								
								
									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, "left", 255 );
										val = hv_fetch( h, "left", 4, 0 );
										if( val && *val && SvOK(*val) ){
											{
												p->u.andor.operandLeft = MALLOCNN(sizeof(ARMultiSchemaFuncQualifierStruct)); rev_ARMultiSchemaFuncQualifierStruct( ctrl, h, k, p->u.andor.operandLeft );
											}
										}else{
											ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "hv_fetch error: key \"left\"" );
											return -1;
										}
									}
								
								
									{
										SV **val;
										strncpy( k, "right", 255 );
										val = hv_fetch( h, "right", 5, 0 );
										if( val && *val && SvOK(*val) ){
											{
												p->u.andor.operandRight = MALLOCNN(sizeof(ARMultiSchemaFuncQualifierStruct)); rev_ARMultiSchemaFuncQualifierStruct( ctrl, h, k, p->u.andor.operandRight );
											}
										}else{
											ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "hv_fetch error: key \"right\"" );
											return -1;
										}
									}
								
								
									}else{
										ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "rev_ARMultiSchemaFuncQualifierStruct: hash value is not a hash reference" );
										return -1;
									}
								
								
								}
								break;
				
							case AR_COND_OP_NONE:
								break;
							default:
								sprintf( errText, "rev_ARMultiSchemaFuncQualifierStruct: invalid switch value %d", p->operation );
								ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, errText );
							}
				
					}
				
				}
			}else{
				ARError_add(AR_RETURN_WARNING, AP_ERR_GENERAL, "rev_ARMultiSchemaFuncQualifierStruct: hv_fetch returned null");
				return -2;
			}
		}else{
			ARError_add(AR_RETURN_WARNING, AP_ERR_GENERAL, "rev_ARMultiSchemaFuncQualifierStruct: 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_ARMultiSchemaFuncQualifierStruct: first argument is not a hash");
		return -1;
	}

	return 0;
}
#endif


#if AR_CURRENT_API_VERSION >= 17
int
rev_ARMultiSchemaFuncQueryFromList( ARControlStruct *ctrl, HV *h, char *k, ARMultiSchemaFuncQueryFromList *p ){
	SV  **val;
	int i = 0;

	if( !p ){
		ARError_add(AR_RETURN_ERROR, AP_ERR_GENERAL, "rev_ARMultiSchemaFuncQueryFromList: AR Object param is NULL" );
		return -1;
	}

	if( SvTYPE((SV*) h) == SVt_PVHV ){

		// printf( "ARMultiSchemaFuncQueryFromList: 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->listPtr = (ARMultiSchemaFuncQueryFromStruct*) MALLOCNN( sizeof(ARMultiSchemaFuncQueryFromStruct) * num );
							/* if( p->listPtr == NULL ){
								croak( "rev_ARMultiSchemaFuncQueryFromList: malloc error\n" );
								exit( 1 );
							} */
				
							for( i = 0; i < num; ++i ){

supportrev_generated.c  view on Meta::CPAN

									{
										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 );
											}
										}else{
											ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "hv_fetch error: key \"extRef\"" );
											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_RECURSIVE_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.recursiveQuery = MALLOCNN(sizeof(ARMultiSchemaRecursiveFuncQueryStruct)); rev_ARMultiSchemaRecursiveFuncQueryStruct( ctrl, h, k, p->u.recursiveQuery );
											}
										}else{
											ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "hv_fetch error: key \"extRef\"" );
											return -1;
										}
									}
								
								
									}else{
										ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "rev_ARMultiSchemaFuncQueryFromStruct: hash value is not a hash reference" );
										return -1;
									}
								
								
								}
								break;
				
							default:
								sprintf( errText, "rev_ARMultiSchemaFuncQueryFromStruct: invalid switch value %d", p->type );
								ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, errText );
							}
				
					}
				
				
				
					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, "joinType", 255 );
						val = hv_fetch( h, "joinType", 8, 0 );
						if( val && *val && SvOK(*val) ){
							{
								p->joinType = SvIV(*val);
							}
						}else{
							ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "hv_fetch error: key \"joinType\"" );
							return -1;
						}
					}
				
				
					{
						SV **val;
						strncpy( k, "joinQual", 255 );
						val = hv_fetch( h, "joinQual", 8, 0 );
						if( val && *val && SvOK(*val) ){
							{
								p->joinQual = MALLOCNN(sizeof(ARMultiSchemaQualifierStruct)); rev_ARMultiSchemaQualifierStruct( ctrl, h, k, p->joinQual );
							}
						}else{
							ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "hv_fetch error: key \"joinQual\"" );
							return -1;
						}
					}
				
				
					{
						SV **val;
						strncpy( k, "queryFromAlias", 255 );
						val = hv_fetch( h, "queryFromAlias", 14, 0 );
						if( val && *val && SvOK(*val) ){
							{
								strncpy( p->queryFromAlias, SvPV_nolen(*val), sizeof(p->queryFromAlias) );
							}
						}else{
							ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "hv_fetch error: key \"queryFromAlias\"" );
							return -1;
						}
					}
				
				

supportrev_generated.c  view on Meta::CPAN

										return -1;
									}
								
								
								}
								break;
				
				
							case AR_COND_OP_OR:
								{
								
								
									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, "left", 255 );
										val = hv_fetch( h, "left", 4, 0 );
										if( val && *val && SvOK(*val) ){
											{
												p->u.andor.operandLeft = MALLOCNN(sizeof(ARMultiSchemaQualifierStruct)); rev_ARMultiSchemaQualifierStruct( ctrl, h, k, p->u.andor.operandLeft );
											}
										}else{
											ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "hv_fetch error: key \"left\"" );
											return -1;
										}
									}
								
								
									{
										SV **val;
										strncpy( k, "right", 255 );
										val = hv_fetch( h, "right", 5, 0 );
										if( val && *val && SvOK(*val) ){
											{
												p->u.andor.operandRight = MALLOCNN(sizeof(ARMultiSchemaQualifierStruct)); rev_ARMultiSchemaQualifierStruct( ctrl, h, k, p->u.andor.operandRight );
											}
										}else{
											ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "hv_fetch error: key \"right\"" );
											return -1;
										}
									}
								
								
									}else{
										ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "rev_ARMultiSchemaQualifierStruct: hash value is not a hash reference" );
										return -1;
									}
								
								
								}
								break;
				
							case AR_COND_OP_NONE:
								break;
							default:
								sprintf( errText, "rev_ARMultiSchemaQualifierStruct: invalid switch value %d", p->operation );
								ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, errText );
							}
				
					}
				
				}
			}else{
				ARError_add(AR_RETURN_WARNING, AP_ERR_GENERAL, "rev_ARMultiSchemaQualifierStruct: hv_fetch returned null");
				return -2;
			}
		}else{
			ARError_add(AR_RETURN_WARNING, AP_ERR_GENERAL, "rev_ARMultiSchemaQualifierStruct: 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_ARMultiSchemaQualifierStruct: first argument is not a hash");
		return -1;
	}

	return 0;
}
#endif


#if AR_CURRENT_API_VERSION >= 14
int
rev_ARMultiSchemaQueryFromList( ARControlStruct *ctrl, HV *h, char *k, ARMultiSchemaQueryFromList *p ){
	SV  **val;
	int i = 0;

	if( !p ){
		ARError_add(AR_RETURN_ERROR, AP_ERR_GENERAL, "rev_ARMultiSchemaQueryFromList: AR Object param is NULL" );
		return -1;
	}

	if( SvTYPE((SV*) h) == SVt_PVHV ){

		// printf( "ARMultiSchemaQueryFromList: 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->listPtr = (ARMultiSchemaQueryFromStruct*) MALLOCNN( sizeof(ARMultiSchemaQueryFromStruct) * num );
							/* if( p->listPtr == NULL ){
								croak( "rev_ARMultiSchemaQueryFromList: malloc error\n" );
								exit( 1 );
							} */
				
							for( i = 0; i < num; ++i ){

supportrev_generated.c  view on Meta::CPAN

									{
										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 );
											}
										}else{
											ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "hv_fetch error: key \"nestedQuery\"" );
											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_RECURSIVE_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, "recursiveQuery", 255 );
										val = hv_fetch( h, "recursiveQuery", 14, 0 );
										if( val && *val && SvOK(*val) ){
											{
												p->u.recursiveQuery = MALLOCNN(sizeof(ARMultiSchemaRecursiveQueryStruct)); rev_ARMultiSchemaRecursiveQueryStruct( ctrl, h, k, p->u.recursiveQuery );
											}
										}else{
											ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "hv_fetch error: key \"recursiveQuery\"" );
											return -1;
										}
									}
								
								
									}else{
										ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "rev_ARMultiSchemaQueryFromStruct: hash value is not a hash reference" );
										return -1;
									}
								
								
								}
								break;
				
							default:
								sprintf( errText, "rev_ARMultiSchemaQueryFromStruct: invalid switch value %d", p->type );
								ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, errText );
							}
				
					}
				
				
				
					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, "joinType", 255 );
						val = hv_fetch( h, "joinType", 8, 0 );
						if( val && *val && SvOK(*val) ){
							{
								p->joinType = SvIV(*val);
							}
						}else{
							ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "hv_fetch error: key \"joinType\"" );
							return -1;
						}
					}
				
				
					{
						SV **val;
						strncpy( k, "joinQual", 255 );
						val = hv_fetch( h, "joinQual", 8, 0 );
						if( val && *val && SvOK(*val) ){
							{
								p->joinQual = MALLOCNN(sizeof(ARMultiSchemaQualifierStruct)); rev_ARMultiSchemaQualifierStruct( ctrl, h, k, p->joinQual );
							}
						}else{
							p->joinQual = NULL;
						}
					}
				
				
					{
						SV **val;
						strncpy( k, "queryFromAlias", 255 );
						val = hv_fetch( h, "queryFromAlias", 14, 0 );
						if( val && *val && SvOK(*val) ){
							{
								strncpy( p->queryFromAlias, SvPV_nolen(*val), sizeof(p->queryFromAlias) );
							}
						}else{
							ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "hv_fetch error: key \"queryFromAlias\"" );
							return -1;
						}
					}
				
				
					}else{

supportrev_generated.c  view on Meta::CPAN

										return -1;
									}
								
								
								}
								break;
				
				
							case AR_COND_OP_OR:
								{
								
								
									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, "left", 255 );
										val = hv_fetch( h, "left", 4, 0 );
										if( val && *val && SvOK(*val) ){
											{
												p->u.andor.operandLeft = MALLOCNN(sizeof(ARQualifierStruct)); rev_ARQualifierStruct( ctrl, h, k, p->u.andor.operandLeft );
											}
										}else{
											ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "hv_fetch error: key \"left\"" );
											return -1;
										}
									}
								
								
									{
										SV **val;
										strncpy( k, "right", 255 );
										val = hv_fetch( h, "right", 5, 0 );
										if( val && *val && SvOK(*val) ){
											{
												p->u.andor.operandRight = MALLOCNN(sizeof(ARQualifierStruct)); rev_ARQualifierStruct( ctrl, h, k, p->u.andor.operandRight );
											}
										}else{
											ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "hv_fetch error: key \"right\"" );
											return -1;
										}
									}
								
								
									}else{
										ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "rev_ARQualifierStruct: hash value is not a hash reference" );
										return -1;
									}
								
								
								}
								break;
				
							case AR_COND_OP_NONE:
								break;
							default:
								sprintf( errText, "rev_ARQualifierStruct: invalid switch value %d", p->operation );
								ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, errText );
							}
				
					}
				
				}
			}else{
				ARError_add(AR_RETURN_WARNING, AP_ERR_GENERAL, "rev_ARQualifierStruct: hv_fetch returned null");
				return -2;
			}
		}else{
			ARError_add(AR_RETURN_WARNING, AP_ERR_GENERAL, "rev_ARQualifierStruct: 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_ARQualifierStruct: first argument is not a hash");
		return -1;
	}

	return 0;
}




int
rev_ARQueryValueStruct( ARControlStruct *ctrl, HV *h, char *k, ARQueryValueStruct *p ){
	SV  **val;
	int i = 0;

	if( !p ){
		ARError_add(AR_RETURN_ERROR, AP_ERR_GENERAL, "rev_ARQueryValueStruct: AR Object param is NULL" );
		return -1;
	}

	if( SvTYPE((SV*) h) == SVt_PVHV ){

		// printf( "ARQueryValueStruct: 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, "qualifier", 255 );
						val = hv_fetch( h, "qualifier", 9, 0 );
						if( val && *val && SvOK(*val) ){
							{
								p->qualifier = MALLOCNN(sizeof(ARQualifierStruct)); rev_ARQualifierStruct( ctrl, h, k, p->qualifier );



( run in 0.474 second using v1.01-cache-2.11-cpan-39bf76dae61 )