-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
88 lines (73 loc) · 1.91 KB
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
/*
* File: main.cpp
* Author: ashish
*
* Created on 4 July, 2011, 7:09 AM
*/
#include <iostream>
// Project Headers
#include </home/ashish/NetBeansProjects/greyhound1/webtalk.h>
#include </home/ashish/NetBeansProjects/greyhound1/wordbreak.h>
#include </home/ashish/NetBeansProjects/greyhound1/linkstore.h>
using namespace std;
int main()
{
float elapTime;
clock_t begint, endt;
deletedb();
char url[500];
cout<<"\n\n Enter the URL...";
cin>>url;
cout<<"\n\n"<<url;
cout<<"\n\n DOWNLOADING WEBPAGE";
fflush(stdout);
begint = clock();
webtalk(url);
endt = clock();
elapTime = endt - begint;
cout<<"\n\t[Process Time = "<<elapTime<<" ms.]";
fflush(stdout);
cout<<"\n\n BREAKING WEBPAGE INTO WORDS";
fflush(stdout);
begint = clock();
wordbreak(url);
endt = clock();
elapTime = endt - begint;
cout<<"\n\t[Process Time = "<<elapTime<<" ms.]";
fflush(stdout);
//displaylinks();
struct linkqueue *main;
main = start;
for(int x = 1; (x <= 500 && main != NULL) ; ++x)
{
int i = 0;
while(main->addr[i] != NULL)
{
url[i] = main->addr[i];
++i;
}
url[i] = '\0';
/*********************************************************/
cout<<"\n\n"<<(x+1)<<" "<<url;
cout<<"\n\n DOWNLOADING WEBPAGE";
fflush(stdout);
begint = clock();
webtalk(url);
endt = clock();
elapTime = endt - begint;
cout<<"\n\t[Process Time = "<<elapTime<<" ms.]";
fflush(stdout);
cout<<"\n\n BREAKING WEBPAGE INTO WORDS";
fflush(stdout);
begint = clock();
wordbreak(url);
endt = clock();
elapTime = endt - begint;
cout<<"\n\t[Process Time = "<<elapTime<<" ms.]";
fflush(stdout);
/***********************************************************/
main = main->link;
}
displaylinks();
cout<<"\n\n";
}