>From: Christian Biere <[EMAIL PROTECTED]>
>Date: Sun, 19 Nov 2006 04:51:18 +0100
>
>Lloyd Bryant wrote:
> > src/core/share.c:
> >  Modified recurse_scan_intern()
> >  Added shared_file_valid_extension()
> > src/core/share/h:
> >  Added shared_file_valid_extension() prototype
>
>As said, don't export it unless you want to use it elsewhere. It was a good
>idea to extract this code and put it into its own function in any case 
>though.
>Due to this I also found an old bug in it and optimized it a bit. I think
>it would be better to use a hashtable instead of a list because even by 
>default
>there are dozens of extensions.
>

I keep wanting to put a prototype *somewhere*.  Let's see if I can break 
that habit.

I noticed you also moved the entire "process a file" section out into a 
helper function as well, which noticeably simplifies things.  Though the use 
of goto's gave me a start (I spent several years wading though goto-laden 
spaghetti code at one job, and I'm still hesitant to use a goto as a 
result).  This is a classic example of the *proper* use of a goto, though.

> > src/lib/file.h
> >  Added S_ISLNK macro (this seemed like the correct file for this)
>
>lib/misc.[ch] is the right place for miscelleaneous stuff but in this case 
>I
>added it to common.h because it's only provided for portability. If one had
>to include a certain header file to be sure it's available, that would be
>likely forgotten. That's also why we include virtually every system header
>file from common.h. It would be too much of a hassle to ensure you're 
>including
>all necessary files otherwise as this differs for each platform.
>

I had it originally in "misc.h", but thought that since it's strictly 
file-related, file.h would be a more reasonable choice.  To tell the truth, 
I suspect that S_ISLNK is available on almost every platform the GtkG will 
run on - I just included that because of the note in the man page that this 
particular macro isn't defined by POSIX.

Lloyd Bryant



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Gtk-gnutella-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gtk-gnutella-devel

Reply via email to