library/src/decoders/HTML/BP-HTMLDecoder.cc
// Sub-function used in the extraction of embedded variable values
Sub-function used in the extraction of embedded variable values
Sub - function used in the extraction of embedded variable values
char * HTMLGetAnchorEmbeddedVariableValue(char *inStr, P_BP_HTML_ANCHOR_DELIMITERS delims, size_t len, P_BP_GARBAGE_COLLECTOR_DATA gc)
{
	if(inStr  == NULL) return NULL;
	if(delims == NULL) return NULL;
	size_t i = 0;
	if( strncmp(inStr, delims->valueDelimiter, delims->vLen) == 0)
			inStr+=delims->vLen;
	if( strncmp(inStr, delims->nextDelimiter, delims->nLen) == 0)
		inStr+=delims->nLen;
	if( strncmp(inStr, delims->startDelimiter, delims->sLen) == 0)
			inStr+=delims->sLen;
	for(i = 0; (inStr[i] != '\0') && (i < len); i++){
		if( strncmp(&inStr[i], delims->valueDelimiter, delims->vLen) == 0){
			break;
		}
		if( strncmp(&inStr[i], delims->nextDelimiter, delims->nLen) == 0)
			break;
	}
	char *retStr = BP_strndup(gc, NULL, inStr, i);
	if(retStr != NULL)
		return(retStr);
	return NULL;
}
char * HTMLGetAnchorEmbeddedVariableValue ( char * inStr , P_BP_HTML_ANCHOR_DELIMITERS delims , size_t len , P_BP_GARBAGE_COLLECTOR_DATA gc ) { if ( inStr == NULL ) return NULL ; if ( delims == NULL ) return NULL ; size_t i = 0 ; if ( strncmp ( inStr , delims -> valueDelimiter , delims -> vLen ) == 0 ) inStr += delims -> vLen ; if ( strncmp ( inStr , delims -> nextDelimiter , delims -> nLen ) == 0 ) inStr += delims -> nLen ; if ( strncmp ( inStr , delims -> startDelimiter , delims -> sLen ) == 0 ) inStr += delims -> sLen ; for ( i = 0 ; ( inStr [ i ] != ' \0 ' ) && ( i < len ) ; i ++ ) { if ( strncmp ( & inStr [ i ] , delims -> valueDelimiter , delims -> vLen ) == 0 ) { break ; } if ( strncmp ( & inStr [ i ] , delims -> nextDelimiter , delims -> nLen ) == 0 ) break ; } char * retStr = BP_strndup ( gc , NULL , inStr , i ) ; if ( retStr != NULL ) return ( retStr ) ; return NULL ; }
Sub-function used in the extraction of embedded variable values
Sub - function used in the extraction of embedded variable values
// Default NULL checks // loop to count till the next delimiter, next value, or null