common.h

#define NTRIALS 100000
#define BUFF_LEN 100
#define FILE_NAME "/home/nirendra/test.html"
#define measure_time(code) \
for(i=0; i < NTRIALS; i++) { \
rdtscl(ini); \
code; \
rdtscl(end); \
now = end - ini; \
if(now < best) best = now; \
}

static void parse_html(char *html, char *text)
{
int hcount = 0, tcount = 0;
int tag=0;
/*Parse buffer to remove html tags*/
for(hcount = 0; html[hcount] != '\0' && html[hcount]; hcount++)
{
if(html[hcount] == '<') /*HTML tag begins*/
tag = 1;
if(!tag)
text[tcount++] = html[hcount];
if(html[hcount] == '>') /*HTML tag ends*/
tag = 0;
}
text[tcount] = '\0';
}