src/function.c
bool reservedHTML(char *str)
{
    int key = hashfunction(str);                            // finding the key of string

    /**
     * collison: 146 <code
     * collison: 109 <del
     * collison: 282 <details
     * collison: 165 <link
     * collison: 156 <main
     * collison: 118 <map
     * collison: 130 <sub
     * collison: 144 <sup
     * collison: 81 <td
     * collison: 188 <thead
     * collison: 166 <time
     * collison: 216 <title
     * collison: 95 <tr
     * collison: 131 <wbr
     **/
    char ch = str[1];
    switch (ch)
    {
        case 'c':
            if(strcmp(str,"<code")==0)
            {
                key++;
            }
            break;
        case 'd':
            if(strcmp(str,"<del")==0 || strcmp(str,"<details")==0)
            {
                key++;
            }
            break;
        case 'l':
            if(strcmp(str,"<link")==0)
            {
                key++;
            }
            break;
        case 'm':
            if(strcmp(str,"<main")==0 || strcmp(str,"<map")==0)
            {
                key++;
            }
            break;
        case 's':
            if(strcmp(str,"<sub")==0 || strcmp(str,"<sup")==0)
            {
                key++;
            }
            break;
        case 't':
            {
                ch = str[2];
                switch (ch)
                {
                    case 'h':
                        if(strcmp(str,"<thead")==0)
                        {
                            key++;
                        }
                        break;
                    case 'i':
                        if(strcmp(str,"<time")==0 || strcmp(str,"<title")==0)
                        {
                            key++;
                        }
                        break;
                    case 'r':
                        if(strcmp(str,"<tr")==0)
                        {
                            key++;
                        }
                        break;
                    default:
                        break;
                }
            }
            break;
        case 'w':
            if(strcmp(str,"<wbr")==0)
            {
                key++;
            }
            break;
        default:
            break;
    }

    if(key<0 || key>HASHSIZE)                               // if key not valid
    {
        return false;
    }
    else if(HASH[key]!=NULL && strcmp(str,HASH[key])==0)    // key found but checking the string for total surety
    {
        return true;
    }
    else
    {
        return false;
    }
}
/**
 * This function conveys that the string is a html keyword or not
 * 
 * @param search string
 * 
 * @return bool
 **/
This function conveys that the string is a html keyword or not

@param search string

@return bool
This function conveys that the string is a html keyword or not @param search string @return bool
bool reservedHTML(char *str)
{
    int key = hashfunction(str);                            
    char ch = str[1];
    switch (ch)
    {
        case 'c':
            if(strcmp(str,"<code")==0)
            {
                key++;
            }
            break;
        case 'd':
            if(strcmp(str,"<del")==0 || strcmp(str,"<details")==0)
            {
                key++;
            }
            break;
        case 'l':
            if(strcmp(str,"<link")==0)
            {
                key++;
            }
            break;
        case 'm':
            if(strcmp(str,"<main")==0 || strcmp(str,"<map")==0)
            {
                key++;
            }
            break;
        case 's':
            if(strcmp(str,"<sub")==0 || strcmp(str,"<sup")==0)
            {
                key++;
            }
            break;
        case 't':
            {
                ch = str[2];
                switch (ch)
                {
                    case 'h':
                        if(strcmp(str,"<thead")==0)
                        {
                            key++;
                        }
                        break;
                    case 'i':
                        if(strcmp(str,"<time")==0 || strcmp(str,"<title")==0)
                        {
                            key++;
                        }
                        break;
                    case 'r':
                        if(strcmp(str,"<tr")==0)
                        {
                            key++;
                        }
                        break;
                    default:
                        break;
                }
            }
            break;
        case 'w':
            if(strcmp(str,"<wbr")==0)
            {
                key++;
            }
            break;
        default:
            break;
    }
    if(key<0 || key>HASHSIZE)                               
    {
        return false;
    }
    else if(HASH[key]!=NULL && strcmp(str,HASH[key])==0)    
    {
        return true;
    }
    else
    {
        return false;
    }
}
bool reservedHTML ( char * str ) { int key = hashfunction ( str ) ; char ch = str [ 1 ] ; switch ( ch ) { case ' ' : if ( strcmp ( str , " " ) == 0 ) { key ++ ; } break ; case ' ' : if ( strcmp ( str , " " ) == 0 || strcmp ( str , " " ) == 0 ) { key ++ ; } break ; case ' ' : if ( strcmp ( str , " " ) == 0 ) { key ++ ; } break ; case ' ' : if ( strcmp ( str , " " ) == 0 || strcmp ( str , " " ) == 0 ) { key ++ ; } break ; case ' ' : if ( strcmp ( str , " " ) == 0 || strcmp ( str , " " ) == 0 ) { key ++ ; } break ; case ' ' : { ch = str [ 2 ] ; switch ( ch ) { case ' ' : if ( strcmp ( str , " " ) == 0 ) { key ++ ; } break ; case ' ' : if ( strcmp ( str , " " ) == 0 || strcmp ( str , " " ) == 0 ) { key ++ ; } break ; case ' ' : if ( strcmp ( str , " " ) == 0 ) { key ++ ; } break ; default : break ; } } break ; case ' ' : if ( strcmp ( str , " " ) == 0 ) { key ++ ; } break ; default : break ; } if ( key < 0 || key > HASHSIZE ) { return false ; } else if ( HASH [ key ] != NULL && strcmp ( str , HASH [ key ] ) == 0 ) { return true ; } else { return false ; } }
This function conveys that the string is a html keyword or not
This function conveys that the string is a html keyword or not
// finding the key of string /**
     * collison: 146 <code
     * collison: 109 <del
     * collison: 282 <details
     * collison: 165 <link
     * collison: 156 <main
     * collison: 118 <map
     * collison: 130 <sub
     * collison: 144 <sup
     * collison: 81 <td
     * collison: 188 <thead
     * collison: 166 <time
     * collison: 216 <title
     * collison: 95 <tr
     * collison: 131 <wbr
     **/ // if key not valid // key found but checking the string for total surety