#include "common.h"
#include <setjmp.h>
#include "core/ban.h"
#include "core/bitzi.h"
#include "core/bogons.h"
#include "core/bsched.h"
#include "core/clock.h"
#include "core/dh.h"
#include "core/dmesh.h"
#include "core/downloads.h"
#include "core/dq.h"
#include "core/extensions.h"
#include "core/features.h"
#include "core/fileinfo.h"
#include "core/geo_ip.h"
#include "core/gmsg.h"
#include "core/gnet_stats.h"
#include "core/gnutella.h"
#include "core/guid.h"
#include "core/gwcache.h"
#include "core/hcache.h"
#include "core/hostiles.h"
#include "core/hosts.h"
#include "core/hsep.h"
#include "core/http.h"
#include "core/ignore.h"
#include "core/inet.h"
#include "core/move.h"
#include "core/nodes.h"
#include "core/ntp.h"
#include "core/oob.h"
#include "core/parq.h"
#include "core/pcache.h"
#include "core/pproxy.h"
#include "core/routing.h"
#include "core/rx.h"
#include "core/search.h"
#include "core/settings.h"
#include "core/share.h"
#include "core/sockets.h"
#include "core/sq.h"
#include "core/tsync.h"
#include "core/tx.h"
#include "core/uhc.h"
#include "core/upload_stats.h"
#include "core/verify.h"
#include "core/version.h"
#include "core/vmsg.h"
#include "core/whitelist.h"
#include "lib/adns.h"
#include "lib/atoms.h"
#include "lib/bg.h"
#include "lib/cq.h"
#include "lib/crc.h"
#include "lib/dbus_util.h"
#include "lib/eval.h"
#include "lib/glib-missing.h"
#include "lib/iso3166.h"
#include "lib/pattern.h"
#include "lib/tiger.h"
#include "lib/tm.h"
#include "lib/utf8.h"
#include "lib/vendors.h"
#include "lib/walloc.h"
#include "lib/watcher.h"
#include "lib/wordvec.h"
#include "if/gnet_property.h"
#include "if/gnet_property_priv.h"
#include "if/bridge/c2ui.h"
#include "lib/override.h"
Defines | |
#define | CORE_SOURCES |
#define | SLOW_UPDATE_PERIOD 20 /**< Update period for `main_slow_update' */ |
Update period for `main_slow_update'. | |
#define | EXIT_GRACE 30 /**< Seconds to wait before exiting */ |
Seconds to wait before exiting. | |
#define | ATEXIT_TIMEOUT 20 /**< Final cleanup must not take longer */ |
Final cleanup must not take longer. | |
#define | LOAD_HIGH_WATERMARK 90 /**< % amount over which we're overloaded */ |
amount over which we're overloaded | |
#define | LOAD_LOW_WATERMARK 55 /**< lower threshold to clear condition */ |
lower threshold to clear condition | |
#define | DO(fn) do { exit_step = STRINGIFY(fn); fn(); } while (0) |
#define | CASE(x) case CAT2(G_LOG_LEVEL_,x): prefix = STRINGIFY(x); break; |
Functions | |
RCSID ("$Id:main.c, v 1.264 2005/11/29 22:14:55 rmanfredi Exp $") | |
void | gtk_gnutella_exit (gint n) |
Exit program, return status `n' to parent process. | |
void | sig_alarm (int n) |
Force immediate shutdown of SIGALRM reception. | |
gboolean | debugging (guint t) |
Are we debugging anything at a level greater than some threshold "t"? | |
void | gtk_gnutella_atexit (void) |
Invoked as an atexit() callback when someone does an exit(). | |
void | log_cpu_usage (tm_t *since_time, gdouble *prev_user, gdouble *prev_sys) |
Log cpu used since last time. | |
void | sig_terminate (int n) |
void | search_gui_store_searches (void) |
Persist searches to disk. | |
void | slow_main_timer (time_t now) |
void | icon_timer (void) |
time_t | check_cpu_usage (void) |
Check CPU usage. | |
gboolean | main_timer (gpointer p) |
Main timer routine, called once per second. | |
gboolean | scan_files_once (gpointer p) |
Scan files when the GUI is up. | |
void | log_handler (const gchar *domain, GLogLevelFlags level, const gchar *message, gpointer user_data) |
void | log_init (void) |
void | close_fds (gint fd) |
Closes all file descriptors greater or equal to ``fd''. | |
void | assertion_init (void) |
int | main (int argc, char **argv) |
Variables | |
guint | main_slow_update = 0 |
gboolean | exiting = FALSE |
gboolean | from_atexit = FALSE |
gint | signal_received = 0 |
jmp_buf | atexit_env |
volatile gchar * | exit_step = "gtk_gnutella_exit" |
tm_t | start_time |
const gchar *const | log_domains [] |
char ** | environ |
|
Final cleanup must not take longer.
|
|
|
|
|
|
|
|
Seconds to wait before exiting.
|
|
amount over which we're overloaded
|
|
lower threshold to clear condition
|
|
Update period for `main_slow_update'.
|
|
|
|
Check CPU usage.
|
|
Closes all file descriptors greater or equal to ``fd''.
|
|
Are we debugging anything at a level greater than some threshold "t"?
|
|
Invoked as an atexit() callback when someone does an exit().
|
|
Exit program, return status `n' to parent process. Shutdown systems, so we can track memory leaks, and wait for EXIT_GRACE seconds so that BYE messages can be sent to other nodes. |
|
|
|
Log cpu used since last time.
|
|
|
|
|
|
|
|
Main timer routine, called once per second.
|
|
|
|
Scan files when the GUI is up.
|
|
Persist searches to disk.
|
|
Force immediate shutdown of SIGALRM reception.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Initial value: { G_LOG_DOMAIN, "Gtk", "GLib", "Pango" } |
|
|
|
|
|
|