library/src/network/Web/BP-NetworkWebUserAgents.cc
// Returns a pseudorandom result from the agents array
Returns a pseudorandom result from the agents array
Returns a pseudorandom result from the agents array
char * BP_HTTPGetRandomUserAgentString(char **agents, size_t totalElements)
{
	if(!agents)
		return NULL;
	if(!totalElements)
		return NULL;
	size_t random_selector = BP_GenRandomUnsignedLong(0, totalElements-1);
	char *retStr = bpstrdup(agents[random_selector]);
	return retStr;
}
char * BP_HTTPGetRandomUserAgentString ( char * * agents , size_t totalElements ) { if ( ! agents ) return NULL ; if ( ! totalElements ) return NULL ; size_t random_selector = BP_GenRandomUnsignedLong ( 0 , totalElements - 1 ) ; char * retStr = bpstrdup ( agents [ random_selector ] ) ; return retStr ; }
Returns a pseudorandom result from the agents array
Returns a pseudorandom result from the agents array
// ensure we have user agents // ensure we have a element count // create a random selector // duplicate random uer string and return // return the duplicated user agent string