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

gtk1/search_stats.c File Reference


Detailed Description

Needs short description here.

Keep track of what search terms we have seen, and how frequently each has been seen.

Note:
This uses the glib hash tables and lists, but a much more efficient implementation could be done with a specialized hash table / re-keyable binary tree.
Author:
Raphael Manfredi
Date:
2001-2003
Author:
Michael Tesch
Date:
2002
Released with gtk-gnutella & its license.

#include "common.h"
#include "gtk/gui.h"
#include "gtk/gtk-missing.h"
#include "gtk/search_stats.h"
#include "gtk/columns.h"
#include "if/core/share.h"
#include "if/gui_property_priv.h"
#include "if/bridge/ui2c.h"
#include "lib/misc.h"
#include "lib/glib-missing.h"
#include "lib/wordvec.h"
#include "lib/override.h"

Data Structures

struct  term_counts
 This is what the stat_hash's 'val' points to. More...

Functions

gboolean delete_hash_entry (gpointer key, gpointer val, gpointer data)
void empty_hash_table (void)
gboolean stats_hash_to_clist (gpointer key, gpointer value, gpointer userdata)
 helper func for stats_display - does two things:
void search_stats_tally (const word_vec_t *vec)
 Count a word that has been seen.
void search_stats_notify_word (query_type_t type, const gchar *search, const host_addr_t unused_addr, guint16 unused_port)
void search_stats_notify_whole (query_type_t type, const gchar *search, const host_addr_t unused_addr, guint16 unused_port)
void search_stats_notify_routed (query_type_t unused_type, const gchar *unused_search, const host_addr_t addr, guint16 port)
void search_stats_gui_enable (search_request_listener_t lst)
 Enable search stats.
void search_stats_gui_disable (void)
void search_stats_gui_reset (void)
 Clear the list, empty the hash table.
void search_stats_gui_set_type (gint type)
void search_stats_gui_init (void)
void search_stats_gui_shutdown (void)
void search_stats_gui_update (time_t now)
 Display the data gathered during the last time period.

Variables

guint stat_count
GHashTable * stat_hash = NULL
gboolean callback_registered = FALSE
gint selected_type = NO_SEARCH_STATS


Function Documentation

gboolean delete_hash_entry gpointer  key,
gpointer  val,
gpointer  data
[static]
 

void empty_hash_table void   )  [static]
 

void search_stats_gui_disable void   )  [static]
 

void search_stats_gui_enable search_request_listener_t  lst  )  [static]
 

Enable search stats.

void search_stats_gui_init void   ) 
 

void search_stats_gui_reset void   ) 
 

Clear the list, empty the hash table.

void search_stats_gui_set_type gint  type  ) 
 

void search_stats_gui_shutdown void   ) 
 

void search_stats_gui_update time_t  now  ) 
 

Display the data gathered during the last time period.

Perhaps it would be better to have this done on a button click(?)

void search_stats_notify_routed query_type_t  unused_type,
const gchar *  unused_search,
const host_addr_t  addr,
guint16  port
[static]
 

void search_stats_notify_whole query_type_t  type,
const gchar *  search,
const host_addr_t  unused_addr,
guint16  unused_port
[static]
 

void search_stats_notify_word query_type_t  type,
const gchar *  search,
const host_addr_t  unused_addr,
guint16  unused_port
[static]
 

void search_stats_tally const word_vec_t vec  )  [static]
 

Count a word that has been seen.

gboolean stats_hash_to_clist gpointer  key,
gpointer  value,
gpointer  unused_udata
[static]
 

helper func for stats_display - does two things:

  • clears out aged / infrequent search terms

sticks the rest of the search terms in clist_search_stats


Variable Documentation

gboolean callback_registered = FALSE [static]
 

gint selected_type = NO_SEARCH_STATS [static]
 

guint stat_count [static]
 

GHashTable* stat_hash = NULL [static]
 


Generated on Sat Jun 30 17:53:30 2007 for gtk-gnutella by  doxygen 1.3.9.1