📄 lymain.c
字号:
case 'a': if (strncmp(argv[0], "-anonymous", 10) == 0) { /* * Should already have been set, so we don't * override or replace any additional * restrictions from the command line. - FM */ if (!anon_restrictions_set) parse_restrictions("default"); anon_restrictions_set = TRUE; } else if ((strncmp(argv[0], "-assume_charset", 15) == 0) || (strncmp(argv[0], "-assume_local_charset", 21) == 0) || (strncmp(argv[0], "-assume_unrec_charset", 21) == 0)) { BOOL local_flag = (argv[0][8] == 'l'); BOOL unrec_flag = (argv[0][8] == 'u'); if (nextarg) { int j; for (j = 0; cp[j]; j++) cp[j] = TOLOWER(cp[j]); if (local_flag) { StrAllocCopy(UCAssume_localMIMEcharset, cp); if (UCAssume_localMIMEcharset && *UCAssume_localMIMEcharset) UCLYhndl_HTFile_for_unspec = UCGetLYhndl_byMIME(UCAssume_localMIMEcharset); } else if (unrec_flag) { StrAllocCopy(UCAssume_unrecMIMEcharset, cp); if (UCAssume_unrecMIMEcharset && *UCAssume_unrecMIMEcharset) UCLYhndl_for_unrec = UCGetLYhndl_byMIME(UCAssume_unrecMIMEcharset); } else { StrAllocCopy(UCAssume_MIMEcharset, cp); if (UCAssume_MIMEcharset && *UCAssume_MIMEcharset) UCLYhndl_for_unspec = UCGetLYhndl_byMIME(UCAssume_MIMEcharset); } } else { if (local_flag) UCLYhndl_HTFile_for_unspec = 0; else if (unrec_flag) UCLYhndl_for_unrec = 0; else UCLYhndl_for_unspec = 0; } } else if (strncmp(argv[0], "-auth", 5) == 0) { /* * Authentication information for protected documents. */ char *auth_info = NULL; if (nextarg) { StrAllocCopy(auth_info, cp); memset(cp, ' ', strlen(cp)); /* Let's not show too much */ } if (auth_info != NULL) { if ((cp = strchr(auth_info, ':')) != NULL) { /* Pw */ *cp++ = '\0'; /* Terminate ID */ if (*cp) { HTUnEscape(cp); StrAllocCopy(authentication_info[1], cp); } } if (*auth_info) { /* Id */ HTUnEscape(auth_info); StrAllocCopy(authentication_info[0], auth_info); } FREE(auth_info); } } else { goto Output_Error_and_Help_List; } break; case 'b': if (strcmp(argv[0], "-base") == 0) { /* * Treat -source equivalently to an interactive * download with LYPrefixBaseToSource configured * to TRUE, so that a BASE tag is prepended for * text/html content types. We normally treat * the module-wide global LYPrefixBaseToSource * flag as FALSE with -source, but force it TRUE, * later, if LYPrependBase is set TRUE here. - FM */ LYPrependBase = TRUE; if (HTOutputFormat == HTAtom_for("www/dump")) { HTOutputFormat = HTAtom_for("www/download"); } } else if (strcmp(argv[0], "-book") == 0) { /* * Use bookmarks as startfile. */ bookmark_start = TRUE; } else if (strcmp(argv[0], "-buried_news") == 0) { /* * Toggle scans for buried news references. */ if (scan_for_buried_news_references) scan_for_buried_news_references = FALSE; else scan_for_buried_news_references = TRUE;#ifdef USE_SLANG } else if (strncmp(argv[0], "-blink", 6) == 0) { Lynx_Color_Flags |= SL_LYNX_USE_BLINK;#endif /* USE_SLANG */ } else { goto Output_Error_and_Help_List; } break; case 'c': if (strncmp(argv[0], "-cache", 6) == 0) { if (nextarg) HTCacheSize = atoi(cp); /* * Limit size. */ if (HTCacheSize < 2) HTCacheSize = 2; } else if (strncmp(argv[0], "-case", 5) == 0) { case_sensitive = TRUE; } else if (strncmp(argv[0], "-cfg", 4) == 0) { /* * Already read the alternate configuration file * so just check whether we need to increment i */ if (nextarg) ; /* do nothing */ } else if (strncmp(argv[0], "-child", 6) == 0) { child_lynx = TRUE; no_disk_save = TRUE;#ifdef USE_SLANG } else if (strncmp(argv[0], "-color", 6) == 0) { Lynx_Color_Flags |= SL_LYNX_USE_COLOR; if (LYShowColor != SHOW_COLOR_ALWAYS) { LYShowColor = SHOW_COLOR_ON; }#endif /* USE_SLANG */ } else if (strncmp(argv[0], "-crawl", 6) == 0) { crawl = TRUE; LYcols = 80; } else if (strncmp(argv[0], "-cookies", 8) == 0) { if (LYSetCookies) LYSetCookies = FALSE; else LYSetCookies = TRUE;#ifndef VMS } else if (strncmp(argv[0], "-core", 5) == 0) { if (LYNoCore) LYNoCore = FALSE; else LYNoCore = TRUE;#endif /* !VMS */ } else { goto Output_Error_and_Help_List; } break; case 'd': if (strncmp(argv[0], "-display", 8) == 0) { if (nextarg) {#ifdef VMS int j; for (j = 0; cp[j]; j++) cp[j] = TOUPPER(cp[j]); Define_VMSLogical(DISPLAY, cp ? cp : "");#else sprintf(display_putenv_command, "DISPLAY=%s", cp ? cp : ""); putenv(display_putenv_command);#endif /* VMS */ if ((cp = getenv(DISPLAY)) != NULL && *cp != '\0') { StrAllocCopy(display, cp); } } } else if (strncmp(argv[0], "-dump", 5) == 0) { dump_output_immediately = TRUE; LYcols=80; } else { goto Output_Error_and_Help_List; } break; case 'e': if (strncmp(argv[0], "-editor", 7) == 0) { if (nextarg) StrAllocCopy(editor,cp); system_editor = TRUE; } else if (strncmp(argv[0], "-emacskeys", 10) == 0) { emacs_keys = TRUE; } else if (strncmp(argv[0], "-enable_scrollback", 18) == 0) { if (enable_scrollback) enable_scrollback = FALSE; else enable_scrollback = TRUE; } else if (strncmp(argv[0], "-error_file", 11) == 0) { /* * Output return (success/failure) code * of an HTTP transaction. */ if (nextarg) http_error_file = cp;#if defined(EXEC_LINKS) || defined(EXEC_SCRIPTS) } else if (strncmp(argv[0], "-exec", 5) == 0) {#ifndef NEVER_ALLOW_REMOTE_EXEC local_exec = TRUE;#else local_exec_on_local_files = TRUE;#endif /* NEVER_ALLOW_REMOTE_EXEC */#endif /* EXEC_LINKS || EXEC_SCRIPTS */ } else { goto Output_Error_and_Help_List; } break; case 'f': if (strncmp(argv[0], "-force_html", 11) == 0) { LYforce_HTML_mode = TRUE; } else if (strncmp(argv[0], "-fileversions", 13) == 0) {#ifdef VMS HTVMSFileVersions = TRUE;#else break;;#endif /* VMS */ } else if (strncmp(argv[0], "-force_secure", 13) == 0) { if (LYForceSSLCookiesSecure) LYForceSSLCookiesSecure = FALSE; else LYForceSSLCookiesSecure = TRUE; } else if (strncmp(argv[0], "-from", 5) == 0) { if (LYNoFromHeader) LYNoFromHeader = FALSE; else LYNoFromHeader = TRUE; } else if (strncmp(argv[0], "-ftp", 4) == 0) { ftp_ok = FALSE; } else { goto Output_Error_and_Help_List; } break; case 'g': if (strcmp(argv[0], "-get_data") == 0) { /* * User data for GET form. */ char **get_data; char buf[1024]; /* * On Unix, conflicts with curses when interactive * so let's force a dump. - CL * * On VMS, mods have been made in LYCurses.c to deal with * potential conflicts, so don't force the dump here. - FM */#ifndef VMS dump_output_immediately = TRUE; LYcols = 80;#endif /* VMS */ StrAllocCopy(form_get_data, "?"); /* Prime the pump */ get_data = &form_get_data; /* * Build GET data for later. Stop reading when we see a line * with "---" as its first three characters. */ while (fgets(buf, sizeof(buf), stdin) && strncmp(buf, "---", 3) != 0) { int j; for (j = strlen(buf) - 1; j >= 0 && /* Strip line terminators */ (buf[j] == CR || buf[j] == LF); j--) { buf[j] = '\0'; } StrAllocCat(*get_data, buf); } } else { goto Output_Error_and_Help_List; } break; case 'h': if (strcmp(argv[0], "-help") == 0) { goto Output_Help_List; } else if (strcmp(argv[0], "-head") == 0) { /* * Return mime headers. */ HEAD_request = TRUE; } else if (strncmp(argv[0], "-hiddenlinks", 7) == 0) { if (nextarg) { if (strncasecomp(cp, "merge", 1) == 0) LYHiddenLinks = HIDDENLINKS_MERGE; else if (strncasecomp(cp, "listonly", 1) == 0) LYHiddenLinks = HIDDENLINKS_SEPARATE; else if (strncasecomp(cp, "ignore", 1) == 0) LYHiddenLinks = HIDDENLINKS_IGNORE; else goto Output_Error_and_Help_List; } else LYHiddenLinks = HIDDENLINKS_MERGE; } else if (strncmp(argv[0], "-historical", 11) == 0) { if (historical_comments) historical_comments = FALSE; else historical_comments = TRUE; } else if (strncmp(argv[0], "-homepage", 9) == 0) { if (nextarg) { StrAllocCopy(homepage, cp); LYTrimHead(homepage); if (!strncasecomp(homepage, "lynxexec:", 9) || !strncasecomp(homepage, "lynxprog:", 9)) { /* * The original implementations of these schemes expected * white space without hex escaping, and did not check * for hex escaping, so we'll continue to support that, * until that code is redone in conformance with SGML * principles. - FM */ HTUnEscapeSome(homepage, " \r\n\t"); convert_to_spaces(homepage, TRUE); } } } else { goto Output_Error_and_Help_List; } break; case 'i': if (strncmp(argv[0], "-image_links", 12) == 0) { if (clickable_images) clickable_images = FALSE; else clickable_images = TRUE; } else if (strncmp(argv[0], "-index", 6) == 0) { if (nextarg) StrAllocCopy(indexfile, cp); } else if (strncmp(argv[0], "-ismap", 6) == 0) { if (LYNoISMAPifUSEMAP) LYNoISMAPifUSEMAP = FALSE; else LYNoISMAPifUSEMAP = TRUE; } else { goto Output_Error_and_Help_List; } break; case 'l': if (strncmp(argv[0], "-link", 5) == 0) { if (nextarg) ccount = atoi(cp); } else if (strncmp(argv[0], "-localhost", 10) == 0) { local_host_only = TRUE;#if defined(EXEC_LINKS) || defined(EXEC_SCRIPTS) } else if (strncmp(argv[0], "-locexec", 8) == 0) { local_exec_on_local_files = TRUE;#endif /* EXEC_LINKS || EXEC_SCRIPTS */#if defined(USE_HASH) } else if (strncmp(argv[0], "-lss", 4) == 0) { /* * Already read the alternate lynx-style file * so just check whether we need to increment i */ if (nextarg) ; /* do nothing */#endif } else { goto Output_Error_and_Help_List; } break; case 'm': if (strcmp(argv[0], "-mime_header") == 0) { /* * Include mime headers and force source dump. */ keep_mime_headers = TRUE; dump_output_immediately = TRUE; HTOutputFormat = (LYPrependBase ? HTAtom_for("www/download") : HTAtom_for("www/dump")); LYcols=999; } else if (strncmp(argv[0], "-minimal", 8) == 0) { if (minimal_comments) minimal_comments = FALSE; else minimal_comments = TRUE; } else { goto Output_Error_and_Help_List; } break; case 'n': if (strncmp(argv[0], "-newschunksize", 14) == 0) { if (nextarg) { HTNewsChunkSize = atoi(cp); /* * If the new HTNewsChunkSize exceeds the maximum, * increase HTNewsMaxChunk to this size. - FM */ if (HTNewsChunkSize > HTNewsMaxChunk) { HTNewsMaxChunk = HTNewsChunkSize; } } } else if (strncmp(argv[0], "-newsmaxchunk", 13) == 0) { if (nextarg) { HTNewsMaxChunk = atoi(cp); /* * If HTNewsChunkSize exceeds the new maximum, * reduce HTNew
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -