📄 default.c
字号:
"\n"" -dither-images <0>/<1>\n"" Do image dithering.\n""\n"" -display-optimize <0>/<1>/<2>\n"" Optimize for CRT (0), LCD RGB (1), LCD BGR (2).\n""\n"" -gamma correction <0>/<1>/<2>\n"" Type of gamma correction:\n"" (default 2)\n"" 0 - 8-bit (fast).\n"" 1 - 16-bit (slow).\n"" 2 - automatically detect according to speed of FPU.\n""\n"#ifdef JS" -enable-javascript <0>/<1>\n"" Enable javascript.\n""\n"" -js.verbose-errors <0>/<1>\n"" Display javascript errors.\n""\n"" -js.verbose-warnings <0>/<1>\n"" Display javascript warnings.\n""\n"" -js.enable-all-conversions <0>/<1>\n"" Enable conversions between all types in javascript.\n""\n"" -js.enable-global-resolution <0>/<1>\n"" Resolve global names.\n""\n"" -js.manual-confirmation <0>/<1>\n"" Ask user to confirm potentially dangerous operations.\n"" (opening windows, going to url etc.) Default 1.\n""\n"" -js.recursion-depth <integer>\n"" Depth of javascript call stack.\n""\n"" -js.memory-limit <memory amount>\n"" Amount of kilobytes the javascript may allocate.\n""\n"#endif" -bookmarks-codepage <codepage>\n"" Character set of bookmarks file.\n""\n"" -bookmarks-file <file>\n"" File to store bookmarks.\n""\n"" -html-assume-codepage <codepage>\n"" If server didn't specify document character set, assume this.\n""\n"" -html-hard-assume <0>/<1>\n"" Use always character set from \"-html-assume-codepage\" no matter\n"" what server sent.\n""\n"" -html-tables <0>/<1>\n"" Render tables. (0) causes tables being rendered like in lynx.\n""\n"" -html-frames <0>/<1>\n"" Render frames. (0) causes frames rendered like in lynx.\n""\n"" -html-images <0>/<1>\n"" Display links to unnamed images as [IMG].\n""\n"" -html-image-names <0>/<1>\n"" Display filename of an image instead of [IMG].\n""\n"" -html-display-images <0>/<1>\n"" Display images in graphics mode.\n""\n"" -html-image-scale <percent>\n"" Scale images in graphics mode.\n""\n"" -html-bare-image-autoscale <0>/<1>\n"" Autoscale images displayed on full screen.\n""\n"" -html-numbered-links <0>/<1>\n"" Number links in text mode. Allow quick link selection by typing\n"" link number and enter.\n""\n"" -html-table-order <0>/<1>\n"" In text mode, walk through table by rows (0) or columns (1).\n""\n"" -html-auto-refresh <0>/<1>\n"" Process refresh to other page (1), or display link to that page (0).\n""\n"" -html-target-in-new-window <0>/<1>\n"" Allow opening new windows from html.\n""\n"" -html-margin <number of spaces>\n"" Margin in text mode.\n""\n"" -html-user-font-size <size>\n"" Size of font on pages in graphics mode.\n""\n"" -lookup <hostname>\n"" Does name lookup, like command \"host\".\n""\n"" -version\n"" Prints the links version number and exit.\n""\n"" -help\n"" Prints this help screen\n""\n""\n"),("Keys:\n"" ESC display menu\n"" ^C quit\n"" ^P scroll up\n"" ^N scroll down\n"" [, ] scroll left, right\n"" up, down select link\n"" ->, enter follow link\n"" <-, z go back\n"" g go to url\n"" G go to url based on current url\n"" ^G go to url based on current link\n"" ^R reload\n"" / search\n"" ? search back\n"" n find next\n"" N find previous\n"" = document info\n"" \\ document source\n"" | HTTP header\n"" * toggle displaying of image links (text mode)\n"" d download\n"" s bookmarks\n"" q quit or close current window\n"" ^X cut to clipboard\n"" ^V paste from clipboard\n"" ^K cut line (in textarea) or text to the end (in field)\n"" ^U cut all text before cursor\n"" ^W autocomplete url\n"" Alt-1 .. Alt-9\n"" switch virtual screens (svgalib and framebuffer)\n""\n""Keys for braille terminal:\n"" arrows move the cursor\n"" enter follow link\n"" a cursor to status line\n"" w cursor to title\n"" ^Y next link\n"" ^T previous link\n"" y next word\n"" t previous word\n"" ^O next form field entry\n")); fflush(stdout); return "";}void end_config(void){ struct driver_param *dp; foreach(dp,driver_params) { if (dp->param)mem_free(dp->param); if (dp->shell)mem_free(dp->shell); } free_list(driver_params); if (links_home) mem_free(links_home);}int ggr = 0;unsigned char ggr_drv[MAX_STR_LEN] = "";unsigned char ggr_mode[MAX_STR_LEN] = "";unsigned char ggr_display[MAX_STR_LEN] = "";int anonymous = 0;unsigned char system_name[MAX_STR_LEN];unsigned char default_target[MAX_STR_LEN] ="";unsigned char *links_home = NULL;int first_use = 0;int created_home = 0;int no_connect = 0;int base_session = 0;int dmp = 0;int force_html = 0;int async_lookup = 1;int download_utime = 0;int max_connections = 10;int max_connections_to_host = 8;int max_tries = 3;int receive_timeout = 120;int unrestartable_receive_timeout = 600;int screen_width = 80;int dump_codepage = -1;int max_format_cache_entries = 5;int memory_cache_size = 1048576;int image_cache_size = 1048576;int enable_html_tables = 1;int enable_html_frames = 1;struct document_setup dds = { 0, 0, 1, 1, 0, 0, 3, 0, 0, 0, 18, 1, 100, /* Image scale */ 0, /* Porn enable */ 0 };struct rgb default_fg = { 191, 191, 191, 0 };struct rgb default_bg = { 0, 0, 0, 0 };struct rgb default_link = { 255, 255, 255, 0 };struct rgb default_vlink = { 255, 255, 0, 0 };struct rgb default_fg_g = { 0, 0, 0, 0 };struct rgb default_bg_g = { 192, 192, 192, 0 };struct rgb default_link_g = { 0, 0, 255, 0 };struct rgb default_vlink_g = { 0, 0, 128, 0 };int default_left_margin = HTML_LEFT_MARGIN;struct proxies proxies = { "", "", "", 0 };int js_enable=1; /* 0=disable javascript */int js_verbose_errors=0; /* 1=create dialog on every javascript error, 0=be quiet and continue */int js_verbose_warnings=0; /* 1=create dialog on every javascript warning, 0=be quiet and continue */int js_all_conversions=1;int js_global_resolve=1; /* resolvovani v globalnim adresnim prostoru, kdyz BFU vomitne document */int js_manual_confirmation=1; /* !0==annoying dialog on every goto url etc. */int js_fun_depth=100;int js_memory_limit=5*1024; /* in kilobytes, should be in range 1M-20M (1MB=1024*1024B) */int display_optimize=0; /*0=CRT, 1=LCD RGB, 2=LCD BGR */int gamma_bits=2; /*0 --- 8, 1 --- 16, 2 --- auto */double bfu_aspect=1; /* 0.1 to 10.0, 1.0 default. >1 makes circle wider */int aspect_on=1;unsigned char download_dir[MAX_STR_LEN] = "";struct ftp_options ftp_options = { "somebody@host.domain", 0, 0, 1 };/* These are workarounds for some CGI script bugs */struct http_bugs http_bugs = { 0, 1, 1, 0, 0, 0, 0, 1, "", "", REFERER_NONE };/*int bug_302_redirect = 0;*/ /* When got 301 or 302 from POST request, change it to GET - this violates RFC2068, but some buggy message board scripts rely on it *//*int bug_post_no_keepalive = 0;*/ /* No keepalive connection after POST request. Some buggy PHP databases report bad results if GET wants to retreive data POSTed in the same connection */struct option links_options[] = { {1, printhelp_cmd, NULL, NULL, 0, 0, NULL, NULL, "?"}, {1, printhelp_cmd, NULL, NULL, 0, 0, NULL, NULL, "h"}, {1, printhelp_cmd, NULL, NULL, 0, 0, NULL, NULL, "help"}, {1, printhelp_cmd, NULL, NULL, 0, 0, NULL, NULL, "-help"}, {1, lookup_cmd, NULL, NULL, 0, 0, NULL, NULL, "lookup"}, {1, version_cmd, NULL, NULL, 0, 0, NULL, NULL, "version"}, {1, set_cmd, NULL, NULL, 0, 0, &no_connect, NULL, "no-connect"}, {1, set_cmd, NULL, NULL, 0, 0, &anonymous, NULL, "anonymous"}, {1, set_cmd, NULL, NULL, 0, 0, &ggr, NULL, "g"}, {1, unset_cmd, NULL, NULL, 0, 0, &ggr, NULL, "no-g"}, {1, setstr_cmd, NULL, NULL, 0, MAX_STR_LEN, &ggr_drv, NULL, "driver"}, {1, setstr_cmd, NULL, NULL, 0, MAX_STR_LEN, &default_target, NULL, "target"}, {1, setstr_cmd, NULL, NULL, 0, MAX_STR_LEN, &ggr_mode, NULL, "mode"}, {1, setstr_cmd, NULL, NULL, 0, MAX_STR_LEN, &ggr_display, NULL, "display"}, {1, gen_cmd, num_rd, NULL, 0, MAXINT, &base_session, NULL, "base-session"}, {1, force_html_cmd, NULL, NULL, 0, 0, NULL, NULL, "force-html"}, {1, dump_cmd, NULL, NULL, D_SOURCE, 0, NULL, NULL, "source"}, {1, dump_cmd, NULL, NULL, D_DUMP, 0, NULL, NULL, "dump"}, {1, gen_cmd, num_rd, NULL, 10, 512, &screen_width, "dump_width", "width" }, {1, gen_cmd, cp_rd, NULL, 1, 0, &dump_codepage, "dump_codepage", "codepage" }, {1, gen_cmd, num_rd, num_wr, 0, 1, &async_lookup, "async_dns", "async-dns"}, {1, gen_cmd, num_rd, num_wr, 0, 1, &download_utime, "download_utime", "download-utime"}, {1, gen_cmd, num_rd, num_wr, 1, 99, &max_connections, "max_connections", "max-connections"}, {1, gen_cmd, num_rd, num_wr, 1, 99, &max_connections_to_host, "max_connections_to_host", "max-connections-to-host"}, {1, gen_cmd, num_rd, num_wr, 0, 16, &max_tries, "retries", "retries"}, {1, gen_cmd, num_rd, num_wr, 1, 1800, &receive_timeout, "receive_timeout", "receive-timeout"}, {1, gen_cmd, num_rd, num_wr, 1, 1800, &unrestartable_receive_timeout, "unrestartable_receive_timeout", "unrestartable-receive-timeout"}, {1, gen_cmd, num_rd, num_wr, 0, 256, &max_format_cache_entries, "format_cache_size", "format-cache-size"}, {1, gen_cmd, num_rd, num_wr, 0, MAXINT, &memory_cache_size, "memory_cache_size", "memory-cache-size"}, {1, gen_cmd, num_rd, num_wr, 0, MAXINT, &image_cache_size, "image_cache_size", "image-cache-size"}, {1, gen_cmd, str_rd, str_wr, 0, MAX_STR_LEN, proxies.http_proxy, "http_proxy", "http-proxy"}, {1, gen_cmd, str_rd, str_wr, 0, MAX_STR_LEN, proxies.ftp_proxy, "ftp_proxy", "ftp-proxy"}, {1, gen_cmd, str_rd, str_wr, 0, MAX_STR_LEN, proxies.socks_proxy, "socks_proxy", "socks-proxy"}, {1, gen_cmd, num_rd, num_wr, 0, 1, &proxies.only_proxies, "only_proxies", "only-proxies"}, {1, gen_cmd, str_rd, str_wr, 0, MAX_STR_LEN, download_dir, "download_dir", "download-dir"}, {1, gen_cmd, lang_rd, lang_wr, 0, 0, ¤t_language, "language", "language"}, {1, gen_cmd, num_rd, num_wr, 0, 1, &http_bugs.http10, "http_bugs.http10", "http-bugs.http10"}, {1, gen_cmd, num_rd, num_wr, 0, 1, &http_bugs.allow_blacklist, "http_bugs.allow_blacklist", "http-bugs.allow-blacklist"}, {1, gen_cmd, num_rd, num_wr, 0, 1, &http_bugs.bug_302_redirect, "http_bugs.bug_302_redirect", "http-bugs.bug-302-redirect"}, {1, gen_cmd, num_rd, num_wr, 0, 1, &http_bugs.bug_post_no_keepalive, "http_bugs.bug_post_no_keepalive", "http-bugs.bug-post-no-keepalive"}, {1, gen_cmd, num_rd, num_wr, 0, 1, &http_bugs.no_accept_charset, "http_bugs.no_accept_charset", "http-bugs.bug-no-accept-charset"}, {1, gen_cmd, num_rd, num_wr, 0, 1, &http_bugs.no_compression, "http_bugs.no_compression", "http-bugs.no-compression"}, {1, gen_cmd, num_rd, num_wr, 0, 1, &http_bugs.retry_internal_errors, "http_bugs.retry_internal_errors", "http-bugs.retry-internal-errors"}, {1, gen_cmd, num_rd, num_wr, 0, 1, &http_bugs.aggressive_cache, "http_bugs.aggressive_cache", "http-bugs.aggressive-cache"}, {1, gen_cmd, num_rd, num_wr, 0, 4, &http_bugs.referer, "http_referer", "http-referer"}, {1, gen_cmd, str_rd, str_wr, 0, MAX_STR_LEN, http_bugs.fake_useragent, "fake_useragent", "fake-user-agent"}, {1, gen_cmd, str_rd, str_wr, 0, MAX_STR_LEN, http_bugs.fake_referer, "fake_referer", "fake-referer"}, {1, gen_cmd, str_rd, str_wr, 0, MAX_STR_LEN, ftp_options.anon_pass, "ftp.anonymous_password", "ftp.anonymous-password"}, {1, gen_cmd, num_rd, num_wr, 0, 1, &ftp_options.passive_ftp, "ftp.use_passive", "ftp.use-passive"}, {1, gen_cmd, num_rd, num_wr, 0, 1, &ftp_options.fast_ftp, "ftp.fast", "ftp.fast"}, {1, gen_cmd, num_rd, num_wr, 0, 1, &ftp_options.set_tos, "ftp.set_iptos", "ftp.set-iptos"}, {1, gen_cmd, num_rd, num_wr, 1, 999, &menu_font_size, "menu_font_size", "menu-font-size"}, {1, gen_cmd, num_rd, num_wr, 0, 0xffffff, &G_BFU_BG_COLOR, "background_color", "background-color"}, {1, gen_cmd, num_rd, num_wr, 0, 0xffffff, &G_BFU_FG_COLOR, "foreground_color", "foreground-color"}, {1, gen_cmd, num_rd, num_wr, 0, 0xffffff, &G_SCROLL_BAR_AREA_COLOR, "scroll_bar_area_color", "scroll-bar-area-color"}, {1, gen_cmd, num_rd, num_wr, 0, 0xffffff, &G_SCROLL_BAR_BAR_COLOR, "scroll_bar_bar_color", "scroll-bar-bar-color"}, {1, gen_cmd, num_rd, num_wr, 0, 0xffffff, &G_SCROLL_BAR_FRAME_COLOR, "scroll_bar_frame_color", "scroll-bar-frame-color"}, {1, gen_cmd, dbl_rd, dbl_wr, 1, 10000, &display_red_gamma, "display_red_gamma", "display-red-gamma"}, {1, gen_cmd, dbl_rd, dbl_wr, 1, 10000, &display_green_gamma, "display_green_gamma", "display-green-gamma"}, {1, gen_cmd, dbl_rd, dbl_wr, 1, 10000, &display_blue_gamma, "display_blue_gamma", "display-blue-gamma"}, {1, gen_cmd, dbl_rd, dbl_wr, 1, 10000, &user_gamma, "user_gamma", "user-gamma"}, {1, gen_cmd, dbl_rd, dbl_wr, 25, 400, &bfu_aspect, "bfu_aspect", "bfu-aspect"}, {1, gen_cmd, num_rd, num_wr, 0, 1, &aspect_on, "aspect_on", "aspect-on"}, {1, gen_cmd, num_rd, num_wr, 0, 1, &dither_letters, "dither_letters", "dither-letters"}, {1, gen_cmd, num_rd, num_wr, 0, 1, &dither_images, "dither_images", "dither-images"}, {1, gen_cmd, num_rd, num_wr, 0, 2, &display_optimize, "display_optimize", "display-optimize"}, {1, gen_cmd, num_rd, num_wr, 0, 2, &gamma_bits, "gamma_correction", "gamma-correction"}, {1, gen_cmd, num_rd, num_wr, 0, 1, &js_enable, "enable_javascript", "enable-javascript"}, {1, gen_cmd, num_rd, num_wr, 0, 1, &js_verbose_errors, "verbose_javascript_errors", "js.verbose-errors"}, {1, gen_cmd, num_rd, num_wr, 0, 1, &js_verbose_warnings, "verbose_javascript_warnings", "js.verbose-warnings"}, {1, gen_cmd, num_rd, num_wr, 0, 1, &js_all_conversions, "enable_all_conversions", "js.enable-all-conversions"}, {1, gen_cmd, num_rd, num_wr, 0, 1, &js_global_resolve, "enable_global_resolution", "js.enable-global-resolution"}, {1, gen_cmd, num_rd, num_wr, 0, 1, &js_manual_confirmation, "javascript_manual_confirmation", "js.manual-confirmation"}, {1, gen_cmd, num_rd, num_wr, 0, 999999, &js_fun_depth, "js_recursion_depth", "js.recursion-depth"}, {1, gen_cmd, num_rd, num_wr, 1024, 30*1024, &js_memory_limit, "js_memory_limit", "js.memory-limit"}, {1, gen_cmd, cp_rd, cp_wr, 0, 0, &bookmarks_codepage, "bookmarks_codepage", "bookmarks-codepage"}, {1, gen_cmd, str_rd, str_wr, 0, MAX_STR_LEN, bookmarks_file, "bookmarks_file", "bookmarks-file"}, {1, gen_cmd, cp_rd, NULL, 0, 0, &dds.assume_cp, "assume_codepage", "assume-codepage"}, {1, NULL, term_rd, term_wr, 0, 0, NULL, "terminal", NULL}, {1, NULL, term2_rd, NULL, 0, 0, NULL, "terminal2", NULL}, {1, NULL, type_rd, type_wr, 0, 0, NULL, "association", NULL}, {1, NULL, ext_rd, ext_wr, 0, 0, NULL, "extension", NULL}, {1, NULL, prog_rd, prog_wr, 0, 0, &mailto_prog, "mailto", NULL}, {1, NULL, prog_rd, prog_wr, 0, 0, &telnet_prog, "telnet", NULL}, {1, NULL, prog_rd, prog_wr, 0, 0, &tn3270_prog, "tn3270", NULL}, {1, NULL, prog_rd, prog_wr, 0, 0, &mms_prog, "mms", NULL}, {1, NULL, block_rd, block_wr, 0, 0, NULL, "imageblock", NULL}, {1, NULL, dp_rd, dp_wr, 0, 0, NULL, "video_driver", NULL}, {0, NULL, NULL, NULL, 0, 0, NULL, NULL, NULL},};struct option html_options[] = { {1, gen_cmd, num_rd, num_wr, 0, 1, &dds.hard_assume, "html_hard_assume", "html-hard-assume"}, {1, gen_cmd, cp_rd, cp_wr, 0, 0, &dds.assume_cp, "html_assume_codepage", "html-assume-codepage"}, {1, gen_cmd, num_rd, num_wr, 0, 1, &dds.tables, "html_tables", "html-tables"}, {1, gen_cmd, num_rd, num_wr, 0, 1, &dds.frames, "html_frames", "html-frames"}, {1, gen_cmd, num_rd, num_wr, 0, 1, &dds.images, "html_images", "html-images"}, {1, gen_cmd, num_rd, num_wr, 0, 1, &dds.image_names, "html_image_names", "html-image-names"}, {1, gen_cmd, num_rd, num_wr, 0, 1, &dds.display_images, "html_display_images", "html-display-images"}, {1, gen_cmd, num_rd, num_wr, 1, 500, &dds.image_scale, "html_image_scale", "html-image-scale"}, {1, gen_cmd, num_rd, num_wr, 0, 1, &dds.porn_enable, "html_bare_image_autoscale", "html-bare-image-autoscale"}, {1, gen_cmd, num_rd, num_wr, 0, 1, &dds.num_links, "html_numbered_links", "html-numbered-links"}, {1, gen_cmd, num_rd, num_wr, 0, 1, &dds.table_order, "html_table_order", "html-table-order"}, {1, gen_cmd, num_rd, num_wr, 0, 1, &dds.auto_refresh, "html_auto_refresh", "html-auto-refresh"}, {1, gen_cmd, num_rd, num_wr, 0, 1, &dds.target_in_new_window, "html_target_in_new_window", "html-target-in-new-window"}, {1, gen_cmd, num_rd, num_wr, 0, 9, &dds.margin, "html_margin", "html-margin"}, {1, gen_cmd, num_rd, num_wr, 1, 999, &dds.font_size, "html_font_size", "html-user-font-size"}, {0, NULL, NULL, NULL, 0, 0, NULL, NULL, NULL},};void load_url_history(void){ unsigned char *history_file, *hs; unsigned char *hsp; if (anonymous) return; /* Must have been called after init_home */ if (!links_home) return; history_file = stracpy(links_home); add_to_strn(&history_file, "links.his"); hs = read_config_file(history_file); mem_free(history_file); if (!hs) return; for (hsp = hs; *hsp; ) { unsigned char *hsl, *hsc; for (hsl = hsp; *hsl && *hsl != 10 && *hsl != 13; hsl++) ; hsc = memacpy(hsp, hsl - hsp); add_to_history(&goto_url_history, hsc); mem_free(hsc); hsp = hsl; while (*hsp == 10 || *hsp == 13) hsp++; } mem_free(hs);}void save_url_history(void){ struct history_item *hi; unsigned char *history_file; unsigned char *hs; int hsl = 0; int i = 0; if (anonymous) return; /* Must have been called after init_home */ if (!links_home) return; history_file = stracpy(links_home); add_to_strn(&history_file, "links.his"); hs = init_str(); hsl = 0; foreachback(hi, goto_url_history.items) { if (!*hi->d || strchr(hi->d, 10) || strchr(hi->d, 13)) continue; if (i++ > MAX_HISTORY_ITEMS) break; else { add_to_str(&hs, &hsl, hi->d); add_to_str(&hs, &hsl, NEWLINE); } } write_to_config_file(history_file, hs); mem_free(history_file); mem_free(hs); return;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -