ARSperl

 view release on metacpan or  search on metacpan

ARS.xs  view on Meta::CPAN

	  char        *objectModificationLogLabel = NULL;
	  ARStatusList status;
#if AR_CURRENT_API_VERSION >= 14
	  int          ret = 0;

	  (void) ARError_reset();
	  Zero(&status, 1,ARStatusList);
	  RETVAL = 0;

	  if(ctrl && name && *name) {
		ret = ARDeleteImage(ctrl, name,
		        updateRef,
#if AR_CURRENT_API_VERSION >= 17
			    objectModificationLogLabel,
#endif
		        &status);
		if( !ARError( ret, status) ){
			RETVAL = 1;
		}
	  }else{
		(void) ARError_add( AR_RETURN_ERROR, AP_ERR_BAD_ARGS);
	  }
#else	/* prior to ARS 7.5 */
	  (void) ARError_reset();
	  Zero(&status, 1, ARStatusList);
	  (void) ARError_add( AR_RETURN_ERROR, AP_ERR_DEPRECATED,
	  "ars_DeleteImage() is only available in ARS >= 7.5");
	  XSRETURN_UNDEF;
#endif
	}
	OUTPUT:
	RETVAL




void
ars_ExecuteProcess(ctrl, command, runOption=0)
	ARControlStruct *	ctrl
	char *			command
	int			runOption
	PPCODE:
	{
	 ARStatusList status;
	 int          returnStatus = 0;
	 char        *returnString;
	 int          ret = 0;

	 (void) ARError_reset();
	 Zero(&status, 1,ARStatusList);
#if AR_EXPORT_VERSION >= 3
	 if(ctrl && CVLD(command)) {
		if(runOption == 0)
			ret = ARExecuteProcess(ctrl, command, &returnStatus, &returnString, &status);
		else
			ret = ARExecuteProcess(ctrl, command, NULL, NULL, &status);
	 }
#ifdef PROFILE
	 ((ars_ctrl *)ctrl)->queries++;
#endif
	 /* if all went well, and user requested synchronous processing 
	  * then we push the returnStatus and returnString back out to them.
	  * if they requested async, then we just push a 1 to indicate that the
	  * command to the API was successfully handled (and foo || die constructs
	  * will work correctly).
	  */
	 if(!ARError( ret, status)) {
		if(runOption == 0) {
			XPUSHs(sv_2mortal(newSViv(returnStatus)));
			XPUSHs(sv_2mortal(newSVpv(returnString, 0)));
			if(returnString) AP_FREE(returnString);
		} else {
			XPUSHs(sv_2mortal(newSViv(1)));
		}
	 }
#else /* 2.x */
	  (void) ARError_add( AR_RETURN_ERROR, AP_ERR_DEPRECATED, "Not available in 2.x");
#endif
	}


HV *
ars_GetEscalation(ctrl, name)
	ARControlStruct *	ctrl
	char *			name
	CODE:
	{
	  ARStatusList         status;
	  AREscalationTmStruct escalationTm;
	  unsigned int         enable =  0;
	  ARFilterActionList   actionList;
	  ARFilterActionList   elseList;
	  char                *helpText = CPNULL;
	  ARTimestamp          timestamp;
	  ARAccessNameType     owner;
	  ARAccessNameType     lastChanged;
      char                *changeDiary = CPNULL;
	  SV                  *ref;
	  int                  ret;
	  ARQualifierStruct   *query = MALLOCNN(sizeof(ARQualifierStruct));
	  ARDiaryList          diaryList;
	  ARWorkflowConnectStruct schemaList;
	  ARPropList              objPropList;


	  (void) ARError_reset();
	  Zero(&status, 1,ARStatusList);
	  Zero(&escalationTm, 1, AREscalationTmStruct);
	  Zero(&actionList, 1,ARFilterActionList);
	  Zero(&timestamp, 1, ARTimestamp);
	  Zero(owner, 1, ARAccessNameType);
	  Zero(lastChanged, 1, ARAccessNameType);
	  Zero(&diaryList, 1, ARDiaryList);
	  Zero(&elseList, 1,ARFilterActionList);
	  Zero(&schemaList, 1, ARWorkflowConnectStruct);
	  Zero(&objPropList, 1, ARPropList);

	  ret = ARGetEscalation(ctrl, name, &escalationTm, &schemaList, &enable,
			query, &actionList, &elseList, &helpText, &timestamp,
			owner, lastChanged, &changeDiary, &objPropList, &status);
#ifdef PROFILE



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