library/src/network/httpd/BP-HTTPdRequests.cc
// simply checks the argument tables and determines whether or not a request has arguments of the
// specified type.
simply checks the argument tables and determines whether or not a request has arguments of the
specified type.
simply checks the argument tables and determines whether or not a request has arguments of the specified type .
BP_BOOL BP_HTTPdRequestContainsArgumentType
(
	P_BP_HTTPD_REQUEST             request,
	BP_HTTPD_REQUEST_VAR_TYPE      type
)
{
	if(!request)
		return BP_FALSE;
	if(!request->arg_hreg)
		return BP_FALSE;
	char *lookup_path[10];
	BP_ZERO_STACK(lookup_path);
	switch(type)
	{
		case BP_HTTPD_REQUEST_VAR_TYPE_POST_DATA:
			lookup_path[0] = "POST";
			break;
		case BP_HTTPD_REQUEST_VAR_TYPE_GET:
			lookup_path[0] = "GET";
			break;
		case BP_HTTPD_REQUEST_VAR_TYPE_COOKIE:
			lookup_path[0] = "COOKIE";
			break;
		case BP_HTTPD_REQUEST_VAR_TYPE_HEADER:
			lookup_path[0] = "HEADER";
			break;
		default:
			break;
	}
	P_BP_HASH_TABLE_KEYED_ENTRY lookup_entry = BP_HashRegLookupTableByPath(request->arg_hreg, (char **) &lookup_path);
	if(!lookup_entry)
		return BP_FALSE;
	if(!lookup_entry->data)
		return BP_FALSE;
	return BP_TRUE;
}
BP_BOOL BP_HTTPdRequestContainsArgumentType ( P_BP_HTTPD_REQUEST request , BP_HTTPD_REQUEST_VAR_TYPE type ) { if ( ! request ) return BP_FALSE ; if ( ! request -> arg_hreg ) return BP_FALSE ; char * lookup_path [ 10 ] ; BP_ZERO_STACK ( lookup_path ) ; switch ( type ) { case BP_HTTPD_REQUEST_VAR_TYPE_POST_DATA : lookup_path [ 0 ] = " " ; break ; case BP_HTTPD_REQUEST_VAR_TYPE_GET : lookup_path [ 0 ] = " " ; break ; case BP_HTTPD_REQUEST_VAR_TYPE_COOKIE : lookup_path [ 0 ] = " " ; break ; case BP_HTTPD_REQUEST_VAR_TYPE_HEADER : lookup_path [ 0 ] = " " ; break ; default : break ; } P_BP_HASH_TABLE_KEYED_ENTRY lookup_entry = BP_HashRegLookupTableByPath ( request -> arg_hreg , ( char * * ) & lookup_path ) ; if ( ! lookup_entry ) return BP_FALSE ; if ( ! lookup_entry -> data ) return BP_FALSE ; return BP_TRUE ; }
simply checks the argument tables and determines whether or not a request has arguments of the
specified type.
simply checks the argument tables and determines whether or not a request has arguments of the specified type .
// run basic null checks // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% // %%% Set Lookup Path %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% // set lookup path // switch on the provided type // attempt to lookup the entry // if there are no entries, the data member will be set to null // return indicating that there are entries