#include "common.h"
#include "ignore.h"
#include "huge.h"
#include "share.h"
#include "settings.h"
#include "namesize.h"
#include "lib/atoms.h"
#include "lib/base32.h"
#include "lib/file.h"
#include "lib/misc.h"
#include "lib/tm.h"
#include "if/gnet_property_priv.h"
#include "lib/override.h"
Functions | |
RCSID ("$Id:ignore.c, v 1.15 2005/12/27 16:34:49 cbiere Exp $") | |
void | ignore_sha1_load (const gchar *file, time_t *stamp) |
Load new SHA1 from `file'. | |
void | ignore_namesize_load (const gchar *file, time_t *stamp) |
Load new name/size tuples from `file'. | |
FILE * | open_read_stamp (const gchar *file, time_t *stamp) |
Open `file' for reading if it exists. | |
FILE * | open_append (const gchar *file) |
Open `file' for appending. | |
void | ignore_init (void) |
Initialize the ignore tables. | |
void | sha1_parse (FILE *f, const gchar *file) |
Parse opened file `f' containing SHA1s to ignore. | |
void | namesize_parse (FILE *f, const gchar *file) |
Parse opened `f' containing size/filenames to ignore. | |
gchar * | ignore_sha1_filename (const gchar *sha1) |
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_sha1 (const gchar *file, const gchar *sha1) |
Add `sha1' to the set of ignored entries. | |
void | ignore_add_filesize (const gchar *file, filesize_t size) |
Add `file', `size' to the set of ignored entries. | |
void | ignore_timer (time_t unused_now) |
Called periodically to check the file timestamps. | |
gboolean | free_sha1_kv (gpointer key, gpointer value, gpointer unused_udata) |
Remove iterator callback. | |
gboolean | free_namesize_kv (gpointer key, gpointer unused_value, gpointer unused_udata) |
Remove iterator callback. | |
void | ignore_close (void) |
Called during servent shutdown to free up resources. | |
Variables | |
GHashTable * | by_sha1 |
SHA1s to ignore. | |
GHashTable * | by_namesize |
By filename + filesize. | |
const gchar | ignore_sha1 [] = "ignore.sha1" |
const gchar | ignore_namesize [] = "ignore.namesize" |
const gchar | done_sha1 [] = "done.sha1" |
const gchar | done_namesize [] = "done.namesize" |
time_t | ignore_sha1_mtime |
time_t | ignore_namesize_mtime |
FILE * | sha1_out = NULL |
FILE * | namesize_out = NULL |
gchar | ign_tmp [1024] |
|
Remove iterator callback. Free a key/value pair from the by_namesize hash. |
|
Remove iterator callback. Free a key/value pair from the by_sha1 hash. |
|
Add `file', `size' to the set of ignored entries.
|
|
Add `sha1' to the set of ignored entries.
|
|
Called during servent shutdown to free up resources.
|
|
Initialize the ignore tables.
|
|
Is ignoring requested for `file' of size `size' and SHA1 `sha1'? Priority is given to the SHA1, if supplied.
|
|
Load new name/size tuples from `file'. If `stamp' is non-NULL, fill it with the mtime of the file, or the current time if the file does not exist. |
|
|
|
Load new SHA1 from `file'. If `stamp' is non-NULL, fill it with the mtime of the file, or the current time if the file does not exist. |
|
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. |
|
Parse opened `f' containing size/filenames to ignore.
|
|
Open `file' for appending.
|
|
Open `file' for reading if it exists. If `stamp' is non-NULL, fill it with the mtime of the file, or the current time if the file does not exist.
|
|
|
|
Parse opened file `f' containing SHA1s to ignore.
|
|
By filename + filesize.
|
|
SHA1s to ignore.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|