[Courses] How to get line-information from buffer..

Abel Pires da Silva lybel_2000 at yahoo.com
Mon Sep 30 03:26:53 EST 2002


Thank you for your help..
I think I have to be more specific...
I'm reading a socket descriptor and open a file
containt with some addresses, and (here is the most
important thing...) make comparation is there any
"line" match between the two.

Here is the situation:
I have buffer containt some thing like this:

GET / HTTP/1.0
Connection: Keep-Alive
User-Agent: Mozilla/4.75 [en] (X11; U; Linux
2.2.17-21mdk i686)
Host: localhost:8000
Accept: image/gif, image/x-xbitmap, image/jpeg,
image/pjpeg, image/png, */*
Accept-Encoding: gzip
Accept-Language: en
Accept-Charset: iso-8859-1,*,utf-8

In the other hand, I have a file containt some
information (addresses, restricted words, or whatever)
like this:
yahoo.com
hotmail.com
cnn.com
abc.com
..
..

I'm at this stage:
/* reading socket descriptor */
read=(socket_desdriptor, buffer, sizeof (buffer));

/* then open the file tabel.txt */
PF=fopen ("tabel.txt", "r");

/* getting the file content */
while ((fgets (stream, 20, PF);

last step is to make comparation between *stream* and
*buffer*...is there any match between the two
strings...

For the strings with only 'single' line in it, is not
a problem...
But for the strings with several even hundreds of
line, I REALLY NEED YOUR HELP...
I'm sorry for my english, becouse I'm from East
TImor...
Best Regards,
Abel


__________________________________________________
Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!
http://sbc.yahoo.com



More information about the Courses mailing list