Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

ignore.h File Reference


Detailed Description

Management of download ignoring list.

Author:
Raphael Manfredi
Date:
2002-2003

#include <glib.h>

Go to the source code of this file.

Enumerations

enum  ignore_val {
  IGNORE_FALSE = 0, IGNORE_SHA1 = 1, IGNORE_NAMESIZE = 2, IGNORE_LIBRARY = 3,
  IGNORE_HOSTILE = 4, IGNORE_OURSELVES = 5
}

Functions

void ignore_init (void)
 Initialize the ignore tables.

void ignore_close (void)
 Called during servent shutdown to free up resources.

void ignore_timer (time_t now)
 Called periodically to check the file timestamps.

enum ignore_val ignore_is_requested (const gchar *file, filesize_t size, gchar *sha1)
 Is ignoring requested for `file' of size `size' and SHA1 `sha1'? Priority is given to the SHA1, if supplied.

void ignore_add_filesize (const gchar *file, filesize_t size)
 Add `file', `size' to the set of ignored entries.

void ignore_add_sha1 (const gchar *file, const gchar *sha1)
 Add `sha1' to the set of ignored entries.

gchar * ignore_sha1_filename (const gchar *sha1)


Enumeration Type Documentation

enum ignore_val
 

Enumeration values:
IGNORE_FALSE  Do not ignore.
IGNORE_SHA1  Ignore because of SHA1.
IGNORE_NAMESIZE  Ignore because of Name & Size.
IGNORE_LIBRARY  Ignore because SHA1 present in library.
IGNORE_HOSTILE  Ignore because IP address is hostile.
IGNORE_OURSELVES  Ignore because IP:port points to ourselves.


Function Documentation

void ignore_add_filesize const gchar *  file,
filesize_t  size
 

Add `file', `size' to the set of ignored entries.

void ignore_add_sha1 const gchar *  file,
const gchar *  sha1
 

Add `sha1' to the set of ignored entries.

void ignore_close void   ) 
 

Called during servent shutdown to free up resources.

void ignore_init void   ) 
 

Initialize the ignore tables.

enum ignore_val ignore_is_requested const gchar *  file,
filesize_t  size,
gchar *  sha1
 

Is ignoring requested for `file' of size `size' and SHA1 `sha1'? Priority is given to the SHA1, if supplied.

Parameters:
file Must be a basename, without any directory separator
size the filesize
sha1 must point to a SHA1 (binary) or NULL

gchar* ignore_sha1_filename const gchar *  sha1  ) 
 

Returns:
the filename associated with the digest if known, NULL otherwise.

void ignore_timer time_t  unused_now  ) 
 

Called periodically to check the file timestamps.

If files are newer, they are reloaded, but the previously recorded ignores are NOT forgotten. Therefore, we can ONLY append new ignores.


Generated on Sun Feb 12 10:50:03 2006 for Gtk-Gnutella by doxygen 1.3.6