libs/xxinterface/src/xxinterface.cxx
// returns -1 if the id was not found in any license type, else XXX_LICENSE_TYPE
1 if the id was not found in any license type, else XXX_LICENSE_TYPE
1 if the id was not found in any license type else XXX_LICENSE_TYPE
static license_id searchLicenseType(license_id id) {
	int index=0;
	int indexValue=0;
	bool notFound=true;
	license_id returnValue=LIC_NULL;
	license_id const * idPointer;
	for(index=0; notFound && index < TOTAL_LICENSE_TYPES; index++) {
		int loopIndex=0;
		idPointer = LICENSE_TYPES[index]; 
		while(idPointer[loopIndex] != LIC_NULL && idPointer[loopIndex] != id ) {
			loopIndex++;
		}
		if(idPointer[loopIndex] != LIC_NULL) {
			notFound=false;
			indexValue=index; 
		}
	}
	if(notFound) {
		returnValue = LIC_NULL;
	} else {
		switch(indexValue) {
			case BUILD_LICENSE_TYPE :
				returnValue = LIC_BUILD;
				break;
			case DEVELOPER_LICENSE_TYPE :
				returnValue = LIC_DEVELOPER;
				break;
			case QUALITY_LICENSE_TYPE :
				returnValue = LIC_QUALITY;
				break;
			case ARCHITECT_LICENSE_TYPE :
				returnValue = LIC_ARCHITECT;
				break;
			case SERVER_LICENSE_TYPE :
				returnValue = LIC_SERVER;
				break;
			default:
				returnValue = LIC_NULL;
		}
	}	
	return(returnValue);
}
static license_id searchLicenseType ( license_id id ) { int index = 0 ; int indexValue = 0 ; bool notFound = true ; license_id returnValue = LIC_NULL ; license_id const * idPointer ; for ( index = 0 ; notFound && index < TOTAL_LICENSE_TYPES ; index ++ ) { int loopIndex = 0 ; idPointer = LICENSE_TYPES [ index ] ; while ( idPointer [ loopIndex ] != LIC_NULL && idPointer [ loopIndex ] != id ) { loopIndex ++ ; } if ( idPointer [ loopIndex ] != LIC_NULL ) { notFound = false ; indexValue = index ; } } if ( notFound ) { returnValue = LIC_NULL ; } else { switch ( indexValue ) { case BUILD_LICENSE_TYPE : returnValue = LIC_BUILD ; break ; case DEVELOPER_LICENSE_TYPE : returnValue = LIC_DEVELOPER ; break ; case QUALITY_LICENSE_TYPE : returnValue = LIC_QUALITY ; break ; case ARCHITECT_LICENSE_TYPE : returnValue = LIC_ARCHITECT ; break ; case SERVER_LICENSE_TYPE : returnValue = LIC_SERVER ; break ; default : returnValue = LIC_NULL ; } } return ( returnValue ) ; }
returns -1 if the id was not found in any license type, else XXX_LICENSE_TYPE
returns - 1 if the id was not found in any license type else XXX_LICENSE_TYPE
// we point to one of the license_id arrays // this is the license type ... XXX_LICENSE_TYPE