src/function.c
void buildHTML()
{
    int key = INT_MIN;

    HASH = (char**)malloc(sizeof(char*)*HASHSIZE);      // making hashtable of the size
    
    char* HTML[] ={"<!DOCTYPE","<a","<abbr","<address","<area","<article","<aside","<audio","<b","<base",
    "<bdi","<bdo","<blockquote","<body","<br/","<br","<button","<canvas","<caption","<cite","<code","<col",
    "<colgroup","<data","<datalist","<dd","<del","<details","<dfn","<dialog","<div","<dl","<dt","<em","<embed",
    "<fieldset","<figcaption","<figure","<footer","<form","<frame","<frameset","<h1","<h2","<h3","<h4","<h5",
    "<h6","<head","<header","<hr","<html","<i","<iframe","<img","<input","<ins","<kbd","<label","<legend",
    "<li","<link","<main","<map","<amrk","<meta","<meter","<nav","<noscript","<object","<ol","<optgroup",
    "<option","<output","<p","<param","<picture","<pre","<progress","<q","<rp","<rt","<ruby","<s","<samp",
    "<script","<section","<select","<small","<source","<span","<strong","<style","<sub","<summary","<sup",
    "<svg","<table","<tbody","<td","<template","<textarea","<tfoot","<th","<thead","<time","<title","<tr",
    "<track","<tt","<u","<ul","<var","<video","<wbr"};

    register int i;
    for(i=0;i<115;i++)
    {
        key = hashfunction(HTML[i]);

        if(key >= 0 && key<HASHSIZE && HASH[key]==NULL)
        {
            int s = strlen(HTML[i]);
            HASH[key] = (char*)malloc(sizeof(char)*(s+1));
            strcpy(HASH[key],HTML[i]);
        }
        else
        {
            // printf("collison: %d %s\n",key,HTML[i]);
            // printf("BUG FOUND IN BuildHTML!!!");
            // exit(1);
            key++;
            int s = strlen(HTML[i]);
            HASH[key] = (char*)malloc(sizeof(char)*(s+1));
            strcpy(HASH[key],HTML[i]);
        }
    }
}
/**
 * It will build keyword tree of html keywords
 * 
 * @return void
 **/
It will build keyword tree of html keywords

@return void
It will build keyword tree of html keywords @return void
void buildHTML()
{
    int key = INT_MIN;
    HASH = (char**)malloc(sizeof(char*)*HASHSIZE);      
    char* HTML[] ={"<!DOCTYPE","<a","<abbr","<address","<area","<article","<aside","<audio","<b","<base",
    "<bdi","<bdo","<blockquote","<body","<br/","<br","<button","<canvas","<caption","<cite","<code","<col",
    "<colgroup","<data","<datalist","<dd","<del","<details","<dfn","<dialog","<div","<dl","<dt","<em","<embed",
    "<fieldset","<figcaption","<figure","<footer","<form","<frame","<frameset","<h1","<h2","<h3","<h4","<h5",
    "<h6","<head","<header","<hr","<html","<i","<iframe","<img","<input","<ins","<kbd","<label","<legend",
    "<li","<link","<main","<map","<amrk","<meta","<meter","<nav","<noscript","<object","<ol","<optgroup",
    "<option","<output","<p","<param","<picture","<pre","<progress","<q","<rp","<rt","<ruby","<s","<samp",
    "<script","<section","<select","<small","<source","<span","<strong","<style","<sub","<summary","<sup",
    "<svg","<table","<tbody","<td","<template","<textarea","<tfoot","<th","<thead","<time","<title","<tr",
    "<track","<tt","<u","<ul","<var","<video","<wbr"};
    register int i;
    for(i=0;i<115;i++)
    {
        key = hashfunction(HTML[i]);
        if(key >= 0 && key<HASHSIZE && HASH[key]==NULL)
        {
            int s = strlen(HTML[i]);
            HASH[key] = (char*)malloc(sizeof(char)*(s+1));
            strcpy(HASH[key],HTML[i]);
        }
        else
        {
            key++;
            int s = strlen(HTML[i]);
            HASH[key] = (char*)malloc(sizeof(char)*(s+1));
            strcpy(HASH[key],HTML[i]);
        }
    }
}
void buildHTML ( ) { int key = INT_MIN ; HASH = ( char * * ) malloc ( sizeof ( char * ) * HASHSIZE ) ; char * HTML [ ] = { " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " } ; register int i ; for ( i = 0 ; i < 115 ; i ++ ) { key = hashfunction ( HTML [ i ] ) ; if ( key >= 0 && key < HASHSIZE && HASH [ key ] == NULL ) { int s = strlen ( HTML [ i ] ) ; HASH [ key ] = ( char * ) malloc ( sizeof ( char ) * ( s + 1 ) ) ; strcpy ( HASH [ key ] , HTML [ i ] ) ; } else { key ++ ; int s = strlen ( HTML [ i ] ) ; HASH [ key ] = ( char * ) malloc ( sizeof ( char ) * ( s + 1 ) ) ; strcpy ( HASH [ key ] , HTML [ i ] ) ; } } }
It will build keyword tree of html keywords
It will build keyword tree of html keywords
// making hashtable of the size // printf("collison: %d %s\n",key,HTML[i]); // printf("BUG FOUND IN BuildHTML!!!"); // exit(1);