#include "common.h"
#include "revision.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/file_object.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/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/local_shell.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/shell.h"
#include "core/sockets.h"
#include "core/spam.h"
#include "core/sq.h"
#include "core/tls_cache.h"
#include "core/tls_common.h"
#include "core/tsync.h"
#include "core/tx.h"
#include "core/udp.h"
#include "core/uhc.h"
#include "core/upload_stats.h"
#include "core/verify_sha1.h"
#include "core/verify_tth.h"
#include "core/version.h"
#include "core/vmsg.h"
#include "core/whitelist.h"
#include "dht/kuid.h"
#include "dht/routing.h"
#include "dht/rpc.h"
#include "lib/adns.h"
#include "lib/atoms.h"
#include "lib/bg.h"
#include "lib/cq.h"
#include "lib/crash.h"
#include "lib/crc.h"
#include "lib/dbus_util.h"
#include "lib/eval.h"
#include "lib/glib-missing.h"
#include "lib/halloc.h"
#include "lib/iso3166.h"
#include "lib/pattern.h"
#include "lib/socket.h"
#include "lib/tiger.h"
#include "lib/tigertree.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'. | |
| #define | EXIT_GRACE 30 |
| Seconds to wait before exiting. | |
| #define | ATEXIT_TIMEOUT 20 |
| Final cleanup must not take longer. | |
| #define | LOAD_HIGH_WATERMARK 90 |
| amount over which we're overloaded | |
| #define | LOAD_LOW_WATERMARK 55 |
| lower threshold to clear condition | |
| #define | DO(fn) do { exit_step = #fn; fn(); } while (0) |
| #define | CASE(x) case CAT2(G_LOG_LEVEL_,x): prefix = #x; break; |
| #define | OPTION(name, type, summary) { main_arg_ ## name , #name, summary, ARG_TYPE_ ## type, NULL, FALSE } |
Enumerations | |
| enum | main_arg { main_arg_daemonize, main_arg_exec_on_crash, main_arg_geometry, main_arg_help, main_arg_log_stderr, main_arg_log_stdout, main_arg_no_halloc, main_arg_no_xshm, main_arg_pause_on_crash, main_arg_ping, main_arg_shell, main_arg_version, main_arg_class, main_arg_g_fatal_warnings, main_arg_gdk_debug, main_arg_gdk_no_debug, main_arg_gtk_debug, main_arg_gtk_no_debug, main_arg_gtk_module, main_arg_name, num_main_args } |
| enum | arg_type { ARG_TYPE_NONE, ARG_TYPE_TEXT, ARG_TYPE_PATH } |
Functions | |
| void | gtk_gnutella_exit (gint n) |
| Exit program, return status `n' to parent process. | |
| gint | reopen_log_files (void) |
| void | sig_alarm (int n) |
| Force immediate shutdown of SIGALRM reception. | |
| void | sig_hup (int n) |
| void | sig_chld (int n) |
| guint32 | main_get_build (void) |
| Get build number. | |
| 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 | gtk_gnutella_request_shutdown (void) |
| 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) |
| gchar | underscore_to_hyphen (gchar c) |
| gboolean | option_match (const gchar *a, const gchar *b) |
| Checks whether two strings qualify as equivalent, the ASCII underscore character and the ASCII hyphen character are considered equivalent. | |
| const gchar * | option_pretty_name (const gchar *name) |
| Copies the given option name to a static buffer replacing underscores with hyphens. | |
| void | usage (int exit_code) |
| void | prehandle_arguments (char **argv) |
| void | handle_arguments (int argc, char **argv) |
| int | main (int argc, char **argv) |
Variables | |
| guint | main_slow_update = 0 |
| gboolean | exiting = FALSE |
| volatile sig_atomic_t | from_atexit = FALSE |
| volatile sig_atomic_t | signal_received = 0 |
| volatile sig_atomic_t | shutdown_requested = 0 |
| volatile sig_atomic_t | sig_hup_received = 0 |
| jmp_buf | atexit_env |
| volatile const gchar * | exit_step = "gtk_gnutella_exit" |
| tm_t | start_time |
| const gchar *const | log_domains [] |
| char ** | environ |
| struct { | |
| const gchar *const name | |
| const gchar *const summary | |
| const gchar * arg | |
| gboolean used | |
| } | options [] |
|
|
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.
|
|
|
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.
|
|
||||||||||||||||||||
|
|
|
|
|
|
||||||||||||
|
|
|
|
Get build number.
|
|
|
Main timer routine, called once per second.
|
|
||||||||||||
|
Checks whether two strings qualify as equivalent, the ASCII underscore character and the ASCII hyphen character are considered equivalent.
|
|
|
Copies the given option name to a static buffer replacing underscores with hyphens.
|
|
|
|
|
|
|
|
|
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"
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1.3.9.1