if(!engine_internal_check()) ENGINEerr(ENGINE_F_ENGINE_BY_ID, ENGINE_R_INTERNAL_LIST_ERROR); else
iterator = engine_list_head; while(iterator && (strcmp(id, iterator->id) != 0)) iterator = iterator->next; if(iterator)
ENGINE *ENGINE_by_id(const char *id)	{	ENGINE *iterator = NULL, *cp = NULL;	if(id == NULL)		{		ENGINEerr(ENGINE_F_ENGINE_BY_ID,			ERR_R_PASSED_NULL_PARAMETER);		return NULL;		}	CRYPTO_r_lock(CRYPTO_LOCK_ENGINE);	if(!engine_internal_check())		ENGINEerr(ENGINE_F_ENGINE_BY_ID,			ENGINE_R_INTERNAL_LIST_ERROR);	else		{		iterator = engine_list_head;		while(iterator && (strcmp(id, iterator->id) != 0))			iterator = iterator->next;		if(iterator)			{			/* We need to return a structural reference. If this is			 * a "dynamic" ENGINE type, make a duplicate - otherwise			 * increment the existing ENGINE's reference count. */			if(iterator->flags & ENGINE_FLAGS_BY_ID_COPY)				{				cp = ENGINE_new();				if(!cp)					iterator = NULL;				else					{					ENGINE_cpy(cp, iterator);					iterator = cp;					}				}			else				{				iterator->struct_ref++;				engine_ref_debug(iterator, 0, 1)				}			}		}	CRYPTO_r_unlock(CRYPTO_LOCK_ENGINE);	if(iterator == NULL)		ENGINEerr(ENGINE_F_ENGINE_BY_ID,			ENGINE_R_NO_SUCH_ENGINE);	return iterator;	}