1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-12-04 14:46:47 -05:00

[options] 0 (option_flags) -> OPT_ZERO

This commit is contained in:
Witold Filipczyk 2022-01-15 20:10:37 +01:00
parent a7c6fb2ab9
commit b434b11309
25 changed files with 379 additions and 378 deletions

View File

@ -77,43 +77,43 @@ enum led_option {
static union option_info led_options[] = { static union option_info led_options[] = {
INIT_OPT_TREE("ui", N_("Clock"), INIT_OPT_TREE("ui", N_("Clock"),
"clock", 0, N_("Digital clock in the status bar.")), "clock", OPT_ZERO, N_("Digital clock in the status bar.")),
INIT_OPT_BOOL("ui.clock", N_("Enable"), INIT_OPT_BOOL("ui.clock", N_("Enable"),
"enable", 0, 0, "enable", OPT_ZERO, 0,
N_("Whether to display a digital clock in the status bar.")), N_("Whether to display a digital clock in the status bar.")),
INIT_OPT_STRING("ui.clock", N_("Format"), INIT_OPT_STRING("ui.clock", N_("Format"),
"format", 0, "[%H:%M]", "format", OPT_ZERO, "[%H:%M]",
N_("Format string for the digital clock. See the strftime(3) " N_("Format string for the digital clock. See the strftime(3) "
"manpage for details.")), "manpage for details.")),
/* Compatibility alias. Added: 2004-04-22, 0.9.CVS. */ /* Compatibility alias. Added: 2004-04-22, 0.9.CVS. */
INIT_OPT_ALIAS("ui.timer", "clock", 0, "ui.clock"), INIT_OPT_ALIAS("ui.timer", "clock", OPT_ZERO, "ui.clock"),
INIT_OPT_BOOL("ui", N_("Show IP"), INIT_OPT_BOOL("ui", N_("Show IP"),
"show_ip", 0, 0, "show_ip", OPT_ZERO, 0,
N_("Whether to display IP of the document in the status bar.")), N_("Whether to display IP of the document in the status bar.")),
INIT_OPT_TREE("ui", N_("Temperature"), INIT_OPT_TREE("ui", N_("Temperature"),
"temperature", 0, N_("Temperature of CPU.")), "temperature", OPT_ZERO, N_("Temperature of CPU.")),
INIT_OPT_BOOL("ui.temperature", N_("Enable"), INIT_OPT_BOOL("ui.temperature", N_("Enable"),
"enable", 0, 0, "enable", OPT_ZERO, 0,
N_("Whether to display temperature of the CPU in the status bar.")), N_("Whether to display temperature of the CPU in the status bar.")),
INIT_OPT_STRING("ui.temperature", N_("Filename"), INIT_OPT_STRING("ui.temperature", N_("Filename"),
"filename", 0, "/sys/class/thermal/thermal_zone0/temp", "filename", OPT_ZERO, "/sys/class/thermal/thermal_zone0/temp",
N_("Filename to see temperature.")), N_("Filename to see temperature.")),
INIT_OPT_TREE("ui", N_("LEDs"), INIT_OPT_TREE("ui", N_("LEDs"),
"leds", 0, "leds", OPT_ZERO,
N_("LEDs (visual indicators) options.")), N_("LEDs (visual indicators) options.")),
INIT_OPT_BOOL("ui.leds", N_("Enable"), INIT_OPT_BOOL("ui.leds", N_("Enable"),
"enable", 0, 1, "enable", OPT_ZERO, 1,
N_("Enable LEDs. These visual indicators will inform you " N_("Enable LEDs. These visual indicators will inform you "
"about various states.")), "about various states.")),

View File

@ -46,19 +46,19 @@ static struct bookmark *bm_snapshot_last_folder;
static union option_info bookmark_options_info[] = { static union option_info bookmark_options_info[] = {
INIT_OPT_TREE("", N_("Bookmarks"), INIT_OPT_TREE("", N_("Bookmarks"),
"bookmarks", 0, "bookmarks", OPT_ZERO,
N_("Bookmark options.")), N_("Bookmark options.")),
#ifdef CONFIG_XBEL_BOOKMARKS #ifdef CONFIG_XBEL_BOOKMARKS
INIT_OPT_INT("bookmarks", N_("File format"), INIT_OPT_INT("bookmarks", N_("File format"),
"file_format", 0, 0, 1, 0, "file_format", OPT_ZERO, 0, 1, 0,
N_("File format for bookmarks (affects both reading and " N_("File format for bookmarks (affects both reading and "
"saving):\n" "saving):\n"
"0 is the default native ELinks format\n" "0 is the default native ELinks format\n"
"1 is XBEL universal XML bookmarks format")), "1 is XBEL universal XML bookmarks format")),
#else #else
INIT_OPT_INT("bookmarks", N_("File format"), INIT_OPT_INT("bookmarks", N_("File format"),
"file_format", 0, 0, 1, 0, "file_format", OPT_ZERO, 0, 1, 0,
N_("File format for bookmarks (affects both reading and " N_("File format for bookmarks (affects both reading and "
"saving):\n" "saving):\n"
"0 is the default native ELinks format\n" "0 is the default native ELinks format\n"
@ -66,14 +66,14 @@ static union option_info bookmark_options_info[] = {
#endif #endif
INIT_OPT_BOOL("bookmarks", N_("Save folder state"), INIT_OPT_BOOL("bookmarks", N_("Save folder state"),
"folder_state", 0, 1, "folder_state", OPT_ZERO, 1,
N_("When saving bookmarks also store whether folders are " N_("When saving bookmarks also store whether folders are "
"expanded or not, so the look of the bookmark dialog is " "expanded or not, so the look of the bookmark dialog is "
"kept across ELinks sessions. If disabled all folders will " "kept across ELinks sessions. If disabled all folders will "
"appear unexpanded next time ELinks is run.")), "appear unexpanded next time ELinks is run.")),
INIT_OPT_BOOL("ui.sessions", N_("Periodic snapshotting"), INIT_OPT_BOOL("ui.sessions", N_("Periodic snapshotting"),
"snapshot", 0, 0, "snapshot", OPT_ZERO, 0,
N_("Automatically save a snapshot of all tabs periodically. " N_("Automatically save a snapshot of all tabs periodically. "
"This will periodically bookmark the tabs of each terminal " "This will periodically bookmark the tabs of each terminal "
"in a separate folder for recovery after a crash.\n" "in a separate folder for recovery after a crash.\n"

View File

@ -791,11 +791,11 @@ printconfigdump_cmd(struct option *option, char ***argv, int *argc)
union option_info cmdline_options_info[] = { union option_info cmdline_options_info[] = {
/* [gettext_accelerator_context(IGNORE)] */ /* [gettext_accelerator_context(IGNORE)] */
INIT_OPT_BOOL("", N_("Load config also for slave instances"), INIT_OPT_BOOL("", N_("Load config also for slave instances"),
"always-load-config", 0, 0, "always-load-config", OPT_ZERO, 0,
N_("Load config also for slave instances. Slower, but more robust.")), N_("Load config also for slave instances. Slower, but more robust.")),
INIT_OPT_BOOL("", N_("Restrict to anonymous mode"), INIT_OPT_BOOL("", N_("Restrict to anonymous mode"),
"anonymous", 0, 0, "anonymous", OPT_ZERO, 0,
N_("Restricts ELinks so it can run on an anonymous account. " N_("Restricts ELinks so it can run on an anonymous account. "
"Local file browsing, downloads, and modification of options " "Local file browsing, downloads, and modification of options "
"will be disabled. Execution of viewers is allowed, but " "will be disabled. Execution of viewers is allowed, but "
@ -803,79 +803,79 @@ union option_info cmdline_options_info[] = {
"modified.")), "modified.")),
INIT_OPT_BOOL("", N_("Autosubmit first form"), INIT_OPT_BOOL("", N_("Autosubmit first form"),
"auto-submit", 0, 0, "auto-submit", OPT_ZERO, 0,
N_("Automatically submit the first form in the given URLs.")), N_("Automatically submit the first form in the given URLs.")),
INIT_OPT_INT("", N_("Clone internal session with given ID"), INIT_OPT_INT("", N_("Clone internal session with given ID"),
"base-session", 0, 0, INT_MAX, 0, "base-session", OPT_ZERO, 0, INT_MAX, 0,
N_("Used internally when opening ELinks instances in new " N_("Used internally when opening ELinks instances in new "
"windows. The ID maps to information that will be used when " "windows. The ID maps to information that will be used when "
"creating the new instance. You don't want to use it.")), "creating the new instance. You don't want to use it.")),
INIT_OPT_STRING("", N_("Use a specific local IP address"), INIT_OPT_STRING("", N_("Use a specific local IP address"),
"bind-address", 0, "", "bind-address", OPT_ZERO, "",
N_("Use a specific local IP address")), N_("Use a specific local IP address")),
INIT_OPT_STRING("", N_("Use a specific local IPv6 address"), INIT_OPT_STRING("", N_("Use a specific local IPv6 address"),
"bind-address-ipv6", 0, "", "bind-address-ipv6", OPT_ZERO, "",
N_("Use a specific local IPv6 address")), N_("Use a specific local IPv6 address")),
INIT_OPT_COMMAND("", NULL, "confdir", OPT_HIDDEN, redir_cmd, NULL), INIT_OPT_COMMAND("", NULL, "confdir", OPT_HIDDEN, redir_cmd, NULL),
INIT_OPT_STRING("", N_("Name of directory with configuration file"), INIT_OPT_STRING("", N_("Name of directory with configuration file"),
"config-dir", 0, "", "config-dir", OPT_ZERO, "",
N_("Path of the directory ELinks will read and write its " N_("Path of the directory ELinks will read and write its "
"config and runtime state files to instead of ~/.elinks. " "config and runtime state files to instead of ~/.elinks. "
"If the path does not begin with a '/' it is assumed to be " "If the path does not begin with a '/' it is assumed to be "
"relative to your HOME directory.")), "relative to your HOME directory.")),
INIT_OPT_COMMAND("", N_("Print default configuration file to stdout"), INIT_OPT_COMMAND("", N_("Print default configuration file to stdout"),
"config-dump", 0, printconfigdump_cmd, "config-dump", OPT_ZERO, printconfigdump_cmd,
N_("Print a configuration file with options set to the " N_("Print a configuration file with options set to the "
"built-in defaults to stdout.")), "built-in defaults to stdout.")),
INIT_OPT_COMMAND("", NULL, "conffile", OPT_HIDDEN, redir_cmd, NULL), INIT_OPT_COMMAND("", NULL, "conffile", OPT_HIDDEN, redir_cmd, NULL),
INIT_OPT_STRING("", N_("Name of configuration file"), INIT_OPT_STRING("", N_("Name of configuration file"),
"config-file", 0, "elinks.conf", "config-file", OPT_ZERO, "elinks.conf",
N_("Name of the configuration file that all configuration " N_("Name of the configuration file that all configuration "
"options will be read from and written to. It should be " "options will be read from and written to. It should be "
"relative to config-dir.")), "relative to config-dir.")),
INIT_OPT_COMMAND("", N_("Print help for configuration options"), INIT_OPT_COMMAND("", N_("Print help for configuration options"),
"config-help", 0, printhelp_cmd, "config-help", OPT_ZERO, printhelp_cmd,
N_("Print help for configuration options and exit.")), N_("Print help for configuration options and exit.")),
INIT_OPT_CMDALIAS("", N_("MIME type assumed for unknown document types"), INIT_OPT_CMDALIAS("", N_("MIME type assumed for unknown document types"),
"default-mime-type", 0, "mime.default_type", "default-mime-type", OPT_ZERO, "mime.default_type",
N_("The default MIME type used for documents of unknown " N_("The default MIME type used for documents of unknown "
"type.")), "type.")),
INIT_OPT_BOOL("", N_("Ignore user-defined keybindings"), INIT_OPT_BOOL("", N_("Ignore user-defined keybindings"),
"default-keys", 0, 0, "default-keys", OPT_ZERO, 0,
N_("When set, all keybindings from configuration files will " N_("When set, all keybindings from configuration files will "
"be ignored. It forces use of default keybindings and will " "be ignored. It forces use of default keybindings and will "
"reset user-defined ones on save.")), "reset user-defined ones on save.")),
INIT_OPT_BOOL("", N_("Print formatted versions of given URLs to stdout"), INIT_OPT_BOOL("", N_("Print formatted versions of given URLs to stdout"),
"dump", 0, 0, "dump", OPT_ZERO, 0,
N_("Print formatted plain-text versions of given URLs to " N_("Print formatted plain-text versions of given URLs to "
"stdout.")), "stdout.")),
INIT_OPT_CMDALIAS("", N_("Codepage to use with -dump"), INIT_OPT_CMDALIAS("", N_("Codepage to use with -dump"),
"dump-charset", 0, "document.dump.codepage", "dump-charset", OPT_ZERO, "document.dump.codepage",
N_("Codepage used when formatting dump output.")), N_("Codepage used when formatting dump output.")),
INIT_OPT_CMDALIAS("", N_("Color mode used with -dump"), INIT_OPT_CMDALIAS("", N_("Color mode used with -dump"),
"dump-color-mode", 0, "document.dump.color_mode", "dump-color-mode", OPT_ZERO, "document.dump.color_mode",
N_("Color mode used with -dump.")), N_("Color mode used with -dump.")),
INIT_OPT_CMDALIAS("", N_("Width of document formatted with -dump"), INIT_OPT_CMDALIAS("", N_("Width of document formatted with -dump"),
"dump-width", 0, "document.dump.width", "dump-width", OPT_ZERO, "document.dump.width",
N_("Width of the dump output.")), N_("Width of the dump output.")),
INIT_OPT_COMMAND("", N_("Evaluate configuration file directive"), INIT_OPT_COMMAND("", N_("Evaluate configuration file directive"),
"eval", 0, eval_cmd, "eval", OPT_ZERO, eval_cmd,
N_("Specify configuration file directives on the command-line " N_("Specify configuration file directives on the command-line "
"which will be evaluated after all configuration files has " "which will be evaluated after all configuration files has "
"been read. Example usage:\n" "been read. Example usage:\n"
@ -883,52 +883,52 @@ union option_info cmdline_options_info[] = {
/* lynx compatibility */ /* lynx compatibility */
INIT_OPT_COMMAND("", N_("Interpret documents of unknown types as HTML"), INIT_OPT_COMMAND("", N_("Interpret documents of unknown types as HTML"),
"force-html", 0, forcehtml_cmd, "force-html", OPT_ZERO, forcehtml_cmd,
N_("Makes ELinks assume documents of unknown types are HTML. " N_("Makes ELinks assume documents of unknown types are HTML. "
"Useful when using ELinks as an external viewer from MUAs. " "Useful when using ELinks as an external viewer from MUAs. "
"This is equivalent to -default-mime-type text/html.")), "This is equivalent to -default-mime-type text/html.")),
/* XXX: -?, -h and -help share the same caption and should be kept in /* XXX: -?, -h and -help share the same caption and should be kept in
* the current order for usage help printing to be ok */ * the current order for usage help printing to be ok */
INIT_OPT_COMMAND("", NULL, "?", 0, printhelp_cmd, NULL), INIT_OPT_COMMAND("", NULL, "?", OPT_ZERO, printhelp_cmd, NULL),
INIT_OPT_COMMAND("", NULL, "h", 0, printhelp_cmd, NULL), INIT_OPT_COMMAND("", NULL, "h", OPT_ZERO, printhelp_cmd, NULL),
INIT_OPT_COMMAND("", N_("Print usage help and exit"), INIT_OPT_COMMAND("", N_("Print usage help and exit"),
"help", 0, printhelp_cmd, "help", OPT_ZERO, printhelp_cmd,
N_("Print usage help and exit.")), N_("Print usage help and exit.")),
INIT_OPT_BOOL("", N_("Only permit local connections"), INIT_OPT_BOOL("", N_("Only permit local connections"),
"localhost", 0, 0, "localhost", OPT_ZERO, 0,
N_("Restricts ELinks to work offline and only connect to " N_("Restricts ELinks to work offline and only connect to "
"servers with local addresses (ie. 127.0.0.1). No connections " "servers with local addresses (ie. 127.0.0.1). No connections "
"to remote servers will be permitted.")), "to remote servers will be permitted.")),
INIT_OPT_COMMAND("", N_("Print detailed usage help and exit"), INIT_OPT_COMMAND("", N_("Print detailed usage help and exit"),
"long-help", 0, printhelp_cmd, "long-help", OPT_ZERO, printhelp_cmd,
N_("Print detailed usage help and exit.")), N_("Print detailed usage help and exit.")),
INIT_OPT_COMMAND("", N_("Look up specified host"), INIT_OPT_COMMAND("", N_("Look up specified host"),
"lookup", 0, lookup_cmd, "lookup", OPT_ZERO, lookup_cmd,
N_("Look up specified host and print all DNS resolved IP " N_("Look up specified host and print all DNS resolved IP "
"addresses.")), "addresses.")),
INIT_OPT_BOOL("", N_("Run as separate instance"), INIT_OPT_BOOL("", N_("Run as separate instance"),
"no-connect", 0, 0, "no-connect", OPT_ZERO, 0,
N_("Run ELinks as a separate instance instead of connecting " N_("Run ELinks as a separate instance instead of connecting "
"to an existing instance. Note that normally no runtime state " "to an existing instance. Note that normally no runtime state "
"files (bookmarks, history, etc.) are written to the disk " "files (bookmarks, history, etc.) are written to the disk "
"when this option is used. See also -touch-files.")), "when this option is used. See also -touch-files.")),
INIT_OPT_BOOL("", N_("Disable use of files in ~/.elinks"), INIT_OPT_BOOL("", N_("Disable use of files in ~/.elinks"),
"no-home", 0, 0, "no-home", OPT_ZERO, 0,
N_("Disables creation and use of files in the user specific " N_("Disables creation and use of files in the user specific "
"home configuration directory (~/.elinks). It forces default " "home configuration directory (~/.elinks). It forces default "
"configuration values to be used and disables saving of " "configuration values to be used and disables saving of "
"runtime state files.")), "runtime state files.")),
INIT_OPT_BOOL("", N_("Disable libevent"), INIT_OPT_BOOL("", N_("Disable libevent"),
"no-libevent", 0, 0, "no-libevent", OPT_ZERO, 0,
N_("Disables libevent.")), N_("Disables libevent.")),
INIT_OPT_CMDALIAS("", N_("Disable link numbering in dump output"), INIT_OPT_CMDALIAS("", N_("Disable link numbering in dump output"),
@ -945,7 +945,7 @@ union option_info cmdline_options_info[] = {
"Note that this really affects only -dump, nothing else.")), "Note that this really affects only -dump, nothing else.")),
INIT_OPT_COMMAND("", N_("Control an already running ELinks"), INIT_OPT_COMMAND("", N_("Control an already running ELinks"),
"remote", 0, remote_cmd, "remote", OPT_ZERO, remote_cmd,
N_("Control a remote ELinks instance by passing commands to " N_("Control a remote ELinks instance by passing commands to "
"it. The option takes an additional argument containing the " "it. The option takes an additional argument containing the "
"method which should be invoked and any parameters that " "method which should be invoked and any parameters that "
@ -967,7 +967,7 @@ union option_info cmdline_options_info[] = {
"\txfeDoCommand(openBrowser) : open new window")), "\txfeDoCommand(openBrowser) : open new window")),
INIT_OPT_INT("", N_("Connect to session ring with given ID"), INIT_OPT_INT("", N_("Connect to session ring with given ID"),
"session-ring", 0, 0, INT_MAX, 0, "session-ring", OPT_ZERO, 0, INT_MAX, 0,
N_("ID of session ring this ELinks session should connect to. " N_("ID of session ring this ELinks session should connect to. "
"ELinks works in so-called session rings, whereby all " "ELinks works in so-called session rings, whereby all "
"instances of ELinks are interconnected and share state " "instances of ELinks are interconnected and share state "
@ -987,25 +987,25 @@ union option_info cmdline_options_info[] = {
"is used. See also -touch-files.")), "is used. See also -touch-files.")),
INIT_OPT_BOOL("", N_("Print the source of given URLs to stdout"), INIT_OPT_BOOL("", N_("Print the source of given URLs to stdout"),
"source", 0, 0, "source", OPT_ZERO, 0,
N_("Print given URLs in source form to stdout.")), N_("Print given URLs in source form to stdout.")),
INIT_OPT_COMMAND("", NULL, "stdin", OPT_HIDDEN, redir_cmd, NULL), INIT_OPT_COMMAND("", NULL, "stdin", OPT_HIDDEN, redir_cmd, NULL),
INIT_OPT_BOOL("", N_("Whether to use terminfo"), INIT_OPT_BOOL("", N_("Whether to use terminfo"),
"terminfo", 0, 0, "terminfo", OPT_ZERO, 0,
N_("When enabled, terminfo ncurses functions will be used " N_("When enabled, terminfo ncurses functions will be used "
"instead of hardcoded sequences.")), "instead of hardcoded sequences.")),
INIT_OPT_BOOL("", N_("Touch files in ~/.elinks when running with -no-connect/-session-ring"), INIT_OPT_BOOL("", N_("Touch files in ~/.elinks when running with -no-connect/-session-ring"),
"touch-files", 0, 0, "touch-files", OPT_ZERO, 0,
N_("When enabled, runtime state files (bookmarks, history, " N_("When enabled, runtime state files (bookmarks, history, "
"etc.) are written to disk, even when -no-connect or " "etc.) are written to disk, even when -no-connect or "
"-session-ring is used. The option has no effect if not used " "-session-ring is used. The option has no effect if not used "
"in conjunction with any of these options.")), "in conjunction with any of these options.")),
INIT_OPT_INT("", N_("Verbose level"), INIT_OPT_INT("", N_("Verbose level"),
"verbose", 0, 0, VERBOSE_LEVELS - 1, VERBOSE_WARNINGS, "verbose", OPT_ZERO, 0, VERBOSE_LEVELS - 1, VERBOSE_WARNINGS,
N_("The verbose level controls what messages are shown at " N_("The verbose level controls what messages are shown at "
"start up and while running:\n" "start up and while running:\n"
"\t0 means only show serious errors\n" "\t0 means only show serious errors\n"
@ -1013,7 +1013,7 @@ union option_info cmdline_options_info[] = {
"\t2 means show all messages")), "\t2 means show all messages")),
INIT_OPT_COMMAND("", N_("Print version information and exit"), INIT_OPT_COMMAND("", N_("Print version information and exit"),
"version", 0, version_cmd, "version", OPT_ZERO, version_cmd,
N_("Print ELinks version information and exit.")), N_("Print ELinks version information and exit.")),
NULL_OPTION_INFO, NULL_OPTION_INFO,

View File

@ -63,7 +63,7 @@ static INIT_LIST_OF(struct option, options_root_tree);
static struct option options_root = INIT_OPTION( static struct option options_root = INIT_OPTION(
/* name: */ "", /* name: */ "",
/* flags: */ 0, /* flags: */ OPT_ZERO,
/* type: */ OPT_TREE, /* type: */ OPT_TREE,
/* min, max: */ 0, 0, /* min, max: */ 0, 0,
/* value: */ &options_root_tree, /* value: */ &options_root_tree,
@ -977,7 +977,7 @@ void
init_options(void) init_options(void)
{ {
cmdline_options = add_opt_tree_tree(&options_root, "", "", cmdline_options = add_opt_tree_tree(&options_root, "", "",
"cmdline", 0, ""); "cmdline", OPT_ZERO, "");
register_options(cmdline_options_info, cmdline_options); register_options(cmdline_options_info, cmdline_options);
config_options = add_opt_tree_tree(&options_root, "", "", config_options = add_opt_tree_tree(&options_root, "", "",
@ -1294,7 +1294,7 @@ register_options(union option_info info[], struct option *tree)
{ {
int i; int i;
static const struct option zero = INIT_OPTION( static const struct option zero = INIT_OPTION(
NULL, 0, 0, 0, 0, 0, NULL, NULL); NULL, OPT_ZERO, 0, 0, 0, 0, NULL, NULL);
/* To let unregister_options() correctly find the end of the /* To let unregister_options() correctly find the end of the
* info[] array, this loop must convert every element from * info[] array, this loop must convert every element from

View File

@ -20,6 +20,7 @@ extern "C" {
/** Flags used in the option.flags bitmask */ /** Flags used in the option.flags bitmask */
enum option_flags { enum option_flags {
OPT_ZERO = 0,
/** The option is hidden - it serves for internal purposes, never is /** The option is hidden - it serves for internal purposes, never is
* read, never is written, never is displayed, never is crawled through * read, never is written, never is displayed, never is crawled through
* etc. */ * etc. */
@ -483,7 +484,7 @@ extern void unregister_options(union option_info info[], struct option *tree);
/*! @relates option_info */ /*! @relates option_info */
#define NULL_OPTION_INFO \ #define NULL_OPTION_INFO \
{{ NULL, NULL, NULL, NULL, 0, \ {{ NULL, NULL, NULL, NULL, OPT_ZERO, \
0, 0, 0, 0, NULL, NULL }} 0, 0, 0, 0, NULL, NULL }}
/*! @relates option_info */ /*! @relates option_info */

File diff suppressed because it is too large Load Diff

View File

@ -85,11 +85,11 @@ enum cookies_option {
static union option_info cookies_options[] = { static union option_info cookies_options[] = {
INIT_OPT_TREE("", N_("Cookies"), INIT_OPT_TREE("", N_("Cookies"),
"cookies", 0, "cookies", OPT_ZERO,
N_("Cookies options.")), N_("Cookies options.")),
INIT_OPT_INT("cookies", N_("Accept policy"), INIT_OPT_INT("cookies", N_("Accept policy"),
"accept_policy", 0, "accept_policy", OPT_ZERO,
COOKIES_ACCEPT_NONE, COOKIES_ACCEPT_ALL, COOKIES_ACCEPT_ALL, COOKIES_ACCEPT_NONE, COOKIES_ACCEPT_ALL, COOKIES_ACCEPT_ALL,
N_("Cookies accepting policy:\n" N_("Cookies accepting policy:\n"
"0 is accept no cookies\n" "0 is accept no cookies\n"
@ -97,7 +97,7 @@ static union option_info cookies_options[] = {
"2 is accept all cookies")), "2 is accept all cookies")),
INIT_OPT_INT("cookies", N_("Maximum age"), INIT_OPT_INT("cookies", N_("Maximum age"),
"max_age", 0, -1, 10000, -1, "max_age", OPT_ZERO, -1, 10000, -1,
N_("Cookie maximum age (in days):\n" N_("Cookie maximum age (in days):\n"
"-1 is use cookie's expiration date if any\n" "-1 is use cookie's expiration date if any\n"
"0 is force expiration at the end of session, ignoring\n" "0 is force expiration at the end of session, ignoring\n"
@ -106,7 +106,7 @@ static union option_info cookies_options[] = {
" given number of days")), " given number of days")),
INIT_OPT_BOOL("cookies", N_("Paranoid security"), INIT_OPT_BOOL("cookies", N_("Paranoid security"),
"paranoid_security", 0, 0, "paranoid_security", OPT_ZERO, 0,
N_("When enabled, we'll require three dots in cookies domain " N_("When enabled, we'll require three dots in cookies domain "
"for all non-international domains (instead of just two " "for all non-international domains (instead of just two "
"dots). Some countries have generic second level domains " "dots). Some countries have generic second level domains "
@ -115,12 +115,12 @@ static union option_info cookies_options[] = {
"Note, it is off by default as it breaks a lot of sites.")), "Note, it is off by default as it breaks a lot of sites.")),
INIT_OPT_BOOL("cookies", N_("Saving"), INIT_OPT_BOOL("cookies", N_("Saving"),
"save", 0, 1, "save", OPT_ZERO, 1,
N_("Whether cookies should be loaded from and saved to " N_("Whether cookies should be loaded from and saved to "
"disk.")), "disk.")),
INIT_OPT_BOOL("cookies", N_("Resaving"), INIT_OPT_BOOL("cookies", N_("Resaving"),
"resave", 0, 1, "resave", OPT_ZERO, 1,
N_("Save cookies after each change in cookies list? " N_("Save cookies after each change in cookies list? "
"No effect when cookie saving (cookies.save) is off.")), "No effect when cookie saving (cookies.save) is off.")),

View File

@ -33,25 +33,25 @@ union option_info css_options_info[] = {
"documents.")), "documents.")),
INIT_OPT_BOOL("document.css", N_("Enable CSS"), INIT_OPT_BOOL("document.css", N_("Enable CSS"),
"enable", 0, 1, "enable", OPT_ZERO, 1,
N_("Enable adding of CSS style info to documents.")), N_("Enable adding of CSS style info to documents.")),
INIT_OPT_BOOL("document.css", N_("Ignore \"display: none\""), INIT_OPT_BOOL("document.css", N_("Ignore \"display: none\""),
"ignore_display_none", 0, 1, "ignore_display_none", OPT_ZERO, 1,
N_("When enabled, elements are rendered, even when their " N_("When enabled, elements are rendered, even when their "
"display property has the value \"none\". Because ELinks's " "display property has the value \"none\". Because ELinks's "
"CSS support is still very incomplete, this setting can " "CSS support is still very incomplete, this setting can "
"improve the way that some documents are rendered.")), "improve the way that some documents are rendered.")),
INIT_OPT_BOOL("document.css", N_("Import external style sheets"), INIT_OPT_BOOL("document.css", N_("Import external style sheets"),
"import", 0, 1, "import", OPT_ZERO, 1,
N_("When enabled any external style sheets that are imported " N_("When enabled any external style sheets that are imported "
"from either CSS itself using the @import keyword or from the " "from either CSS itself using the @import keyword or from the "
"HTML using <link> tags in the document header will also be " "HTML using <link> tags in the document header will also be "
"downloaded.")), "downloaded.")),
INIT_OPT_STRING("document.css", N_("Default style sheet"), INIT_OPT_STRING("document.css", N_("Default style sheet"),
"stylesheet", 0, "", "stylesheet", OPT_ZERO, "",
N_("The path to the file containing the default user defined " N_("The path to the file containing the default user defined "
"Cascading Style Sheet. It can be used to control the basic " "Cascading Style Sheet. It can be used to control the basic "
"layout of HTML documents. The path is assumed to be relative " "layout of HTML documents. The path is assumed to be relative "
@ -60,7 +60,7 @@ union option_info css_options_info[] = {
"Leave as \"\" to use built-in document styling.")), "Leave as \"\" to use built-in document styling.")),
INIT_OPT_STRING("document.css", N_("Media types"), INIT_OPT_STRING("document.css", N_("Media types"),
"media", 0, "tty", "media", OPT_ZERO, "tty",
N_("CSS media types that ELinks claims to support, separated " N_("CSS media types that ELinks claims to support, separated "
"with commas. The \"all\" type is implied. Currently, only " "with commas. The \"all\" type is implied. Currently, only "
"ASCII characters work reliably here. See CSS2 section 7: " "ASCII characters work reliably here. See CSS2 section 7: "

View File

@ -58,32 +58,32 @@ std::map<struct timer *, bool> map_timer;
static union option_info ecmascript_options[] = { static union option_info ecmascript_options[] = {
INIT_OPT_TREE("", N_("ECMAScript"), INIT_OPT_TREE("", N_("ECMAScript"),
"ecmascript", 0, "ecmascript", OPT_ZERO,
N_("ECMAScript options.")), N_("ECMAScript options.")),
INIT_OPT_BOOL("ecmascript", N_("Enable"), INIT_OPT_BOOL("ecmascript", N_("Enable"),
"enable", 0, 0, "enable", OPT_ZERO, 0,
N_("Whether to run those scripts inside of documents.")), N_("Whether to run those scripts inside of documents.")),
INIT_OPT_BOOL("ecmascript", N_("Console log"), INIT_OPT_BOOL("ecmascript", N_("Console log"),
"enable_console_log", 0, 0, "enable_console_log", OPT_ZERO, 0,
N_("When enabled logs will be appended to ~/.elinks/console.log.")), N_("When enabled logs will be appended to ~/.elinks/console.log.")),
INIT_OPT_BOOL("ecmascript", N_("Script error reporting"), INIT_OPT_BOOL("ecmascript", N_("Script error reporting"),
"error_reporting", 0, 0, "error_reporting", OPT_ZERO, 0,
N_("Open a message box when a script reports an error.")), N_("Open a message box when a script reports an error.")),
INIT_OPT_BOOL("ecmascript", N_("Ignore <noscript> content"), INIT_OPT_BOOL("ecmascript", N_("Ignore <noscript> content"),
"ignore_noscript", 0, 0, "ignore_noscript", OPT_ZERO, 0,
N_("Whether to ignore content enclosed by the <noscript> tag " N_("Whether to ignore content enclosed by the <noscript> tag "
"when ECMAScript is enabled.")), "when ECMAScript is enabled.")),
INIT_OPT_INT("ecmascript", N_("Maximum execution time"), INIT_OPT_INT("ecmascript", N_("Maximum execution time"),
"max_exec_time", 0, 1, 3600, 5, "max_exec_time", OPT_ZERO, 1, 3600, 5,
N_("Maximum execution time in seconds for a script.")), N_("Maximum execution time in seconds for a script.")),
INIT_OPT_BOOL("ecmascript", N_("Pop-up window blocking"), INIT_OPT_BOOL("ecmascript", N_("Pop-up window blocking"),
"block_window_opening", 0, 0, "block_window_opening", OPT_ZERO, 0,
N_("Whether to disallow scripts to open new windows or tabs.")), N_("Whether to disallow scripts to open new windows or tabs.")),
NULL_OPTION_INFO, NULL_OPTION_INFO,

View File

@ -34,7 +34,7 @@
static union option_info forms_history_options[] = { static union option_info forms_history_options[] = {
INIT_OPT_BOOL("document.browse.forms", N_("Show form history dialog"), INIT_OPT_BOOL("document.browse.forms", N_("Show form history dialog"),
"show_formhist", 0, 0, "show_formhist", OPT_ZERO, 0,
N_("Ask if a login form should be saved to file or not. " N_("Ask if a login form should be saved to file or not. "
"This option only disables the dialog, already saved login " "This option only disables the dialog, already saved login "
"forms are unaffected.")), "forms are unaffected.")),

View File

@ -56,26 +56,26 @@ enum global_history_options {
static union option_info global_history_options[] = { static union option_info global_history_options[] = {
INIT_OPT_TREE("document.history", N_("Global history"), INIT_OPT_TREE("document.history", N_("Global history"),
"global", 0, "global", OPT_ZERO,
N_("Global history options.")), N_("Global history options.")),
INIT_OPT_BOOL("document.history.global", N_("Enable"), INIT_OPT_BOOL("document.history.global", N_("Enable"),
"enable", 0, 1, "enable", OPT_ZERO, 1,
N_("Enable global history (\"history of all pages " N_("Enable global history (\"history of all pages "
"visited\").")), "visited\").")),
INIT_OPT_INT("document.history.global", N_("Maximum number of entries"), INIT_OPT_INT("document.history.global", N_("Maximum number of entries"),
"max_items", 0, 1, INT_MAX, 1024, "max_items", OPT_ZERO, 1, INT_MAX, 1024,
N_("Maximum number of entries in the global history.")), N_("Maximum number of entries in the global history.")),
INIT_OPT_INT("document.history.global", N_("Display style"), INIT_OPT_INT("document.history.global", N_("Display style"),
"display_type", 0, 0, 1, 0, "display_type", OPT_ZERO, 0, 1, 0,
N_("What to display in global history dialog:\n" N_("What to display in global history dialog:\n"
"0 is URLs\n" "0 is URLs\n"
"1 is page titles")), "1 is page titles")),
/* Compatibility alias: added by jonas at 2004-07-16, 0.9.CVS. */ /* Compatibility alias: added by jonas at 2004-07-16, 0.9.CVS. */
INIT_OPT_ALIAS("document.history.global", "write_interval", 0, INIT_OPT_ALIAS("document.history.global", "write_interval", OPT_ZERO,
"infofiles.save_interval"), "infofiles.save_interval"),
NULL_OPTION_INFO, NULL_OPTION_INFO,

View File

@ -37,7 +37,7 @@ static union option_info default_mime_options[] = {
"('*' is used here in place of '.').")), "('*' is used here in place of '.').")),
INIT_OPT_STRING("mime.type._template_", NULL, INIT_OPT_STRING("mime.type._template_", NULL,
"_template_", 0, "", "_template_", OPT_ZERO, "",
N_("Handler matching this MIME-type name " N_("Handler matching this MIME-type name "
"('*' is used here in place of '.').")), "('*' is used here in place of '.').")),
@ -58,20 +58,20 @@ static union option_info default_mime_options[] = {
N_("Description of this handler.")), N_("Description of this handler.")),
INIT_OPT_TREE("mime.handler._template_", NULL, INIT_OPT_TREE("mime.handler._template_", NULL,
"_template_", 0, "_template_", OPT_ZERO,
N_("System-specific handler description " N_("System-specific handler description "
"(ie. unix, unix-xwin, ...).")), "(ie. unix, unix-xwin, ...).")),
INIT_OPT_BOOL("mime.handler._template_._template_", N_("Ask before opening"), INIT_OPT_BOOL("mime.handler._template_._template_", N_("Ask before opening"),
"ask", 0, 1, "ask", OPT_ZERO, 1,
N_("Ask before opening.")), N_("Ask before opening.")),
INIT_OPT_BOOL("mime.handler._template_._template_", N_("Block terminal"), INIT_OPT_BOOL("mime.handler._template_._template_", N_("Block terminal"),
"block", 0, 1, "block", OPT_ZERO, 1,
N_("Block the terminal when the handler is running.")), N_("Block the terminal when the handler is running.")),
INIT_OPT_STRING("mime.handler._template_._template_", N_("Program"), INIT_OPT_STRING("mime.handler._template_._template_", N_("Program"),
"program", 0, "", "program", OPT_ZERO, "",
/* xgettext:no-c-format */ /* xgettext:no-c-format */
N_("External viewer for this file type. " N_("External viewer for this file type. "
"'%f' in this string will be substituted by a file name, " "'%f' in this string will be substituted by a file name, "
@ -84,12 +84,12 @@ static union option_info default_mime_options[] = {
N_("Extension <-> MIME type association.")), N_("Extension <-> MIME type association.")),
INIT_OPT_STRING("mime.extension", NULL, INIT_OPT_STRING("mime.extension", NULL,
"_template_", 0, "", "_template_", OPT_ZERO, "",
N_("MIME-type matching this file extension " N_("MIME-type matching this file extension "
"('*' is used here in place of '.').")), "('*' is used here in place of '.').")),
#define INIT_OPT_MIME_EXTENSION(extension, type) \ #define INIT_OPT_MIME_EXTENSION(extension, type) \
INIT_OPT_STRING("mime.extension", NULL, extension, 0, type, NULL) INIT_OPT_STRING("mime.extension", NULL, extension, OPT_ZERO, type, NULL)
INIT_OPT_MIME_EXTENSION("gif", "image/gif"), INIT_OPT_MIME_EXTENSION("gif", "image/gif"),
INIT_OPT_MIME_EXTENSION("jpg", "image/jpg"), INIT_OPT_MIME_EXTENSION("jpg", "image/jpg"),

View File

@ -87,24 +87,24 @@ enum mailcap_option {
static union option_info mailcap_options[] = { static union option_info mailcap_options[] = {
INIT_OPT_TREE("mime", N_("Mailcap"), INIT_OPT_TREE("mime", N_("Mailcap"),
"mailcap", 0, "mailcap", OPT_ZERO,
N_("Options for mailcap support.")), N_("Options for mailcap support.")),
INIT_OPT_BOOL("mime.mailcap", N_("Enable"), INIT_OPT_BOOL("mime.mailcap", N_("Enable"),
"enable", 0, 1, "enable", OPT_ZERO, 1,
N_("Enable mailcap support.")), N_("Enable mailcap support.")),
INIT_OPT_STRING("mime.mailcap", N_("Path"), INIT_OPT_STRING("mime.mailcap", N_("Path"),
"path", 0, DEFAULT_MAILCAP_PATH, "path", OPT_ZERO, DEFAULT_MAILCAP_PATH,
N_("Mailcap search path. Colon-separated list of files. " N_("Mailcap search path. Colon-separated list of files. "
"Leave as \"\" to use MAILCAP environment variable instead.")), "Leave as \"\" to use MAILCAP environment variable instead.")),
INIT_OPT_BOOL("mime.mailcap", N_("Ask before opening"), INIT_OPT_BOOL("mime.mailcap", N_("Ask before opening"),
"ask", 0, 1, "ask", OPT_ZERO, 1,
N_("Ask before using the handlers defined by mailcap.")), N_("Ask before using the handlers defined by mailcap.")),
INIT_OPT_INT("mime.mailcap", N_("Type query string"), INIT_OPT_INT("mime.mailcap", N_("Type query string"),
"description", 0, 0, 2, 0, "description", OPT_ZERO, 0, 2, 0,
N_("Type of description to show in \"what to do with " N_("Type of description to show in \"what to do with "
"this file\" query dialog:\n" "this file\" query dialog:\n"
"0 is show \"mailcap\"\n" "0 is show \"mailcap\"\n"
@ -113,7 +113,7 @@ static union option_info mailcap_options[] = {
" \"mailcap\" otherwise")), " \"mailcap\" otherwise")),
INIT_OPT_BOOL("mime.mailcap", N_("Prioritize entries by file"), INIT_OPT_BOOL("mime.mailcap", N_("Prioritize entries by file"),
"prioritize", 0, 1, "prioritize", OPT_ZERO, 1,
N_("Prioritize entries by the order of the files in " N_("Prioritize entries by the order of the files in "
"the mailcap path. This means that wildcard entries " "the mailcap path. This means that wildcard entries "
"(like: image/*) will also be checked before deciding " "(like: image/*) will also be checked before deciding "

View File

@ -44,17 +44,17 @@ enum mimetypes_option {
/* Keep options in alphabetical order. */ /* Keep options in alphabetical order. */
static union option_info mimetypes_options[] = { static union option_info mimetypes_options[] = {
INIT_OPT_TREE("mime", N_("Mimetypes files"), INIT_OPT_TREE("mime", N_("Mimetypes files"),
"mimetypes", 0, "mimetypes", OPT_ZERO,
N_("Options for the support of mime.types files. These files " N_("Options for the support of mime.types files. These files "
"can be used to find the content type of a URL by looking at " "can be used to find the content type of a URL by looking at "
"the extension of the file name.")), "the extension of the file name.")),
INIT_OPT_BOOL("mime.mimetypes", N_("Enable"), INIT_OPT_BOOL("mime.mimetypes", N_("Enable"),
"enable", 0, 1, "enable", OPT_ZERO, 1,
N_("Enable mime.types support.")), N_("Enable mime.types support.")),
INIT_OPT_STRING("mime.mimetypes", N_("Path"), INIT_OPT_STRING("mime.mimetypes", N_("Path"),
"path", 0, DEFAULT_MIMETYPES_PATH, "path", OPT_ZERO, DEFAULT_MIMETYPES_PATH,
N_("The search path for mime.types files. " N_("The search path for mime.types files. "
"Colon-separated list of files.")), "Colon-separated list of files.")),

View File

@ -40,7 +40,7 @@ static union option_info mime_options[] = {
N_("MIME-related options (handlers of various MIME types).")), N_("MIME-related options (handlers of various MIME types).")),
INIT_OPT_STRING("mime", N_("Default MIME-type"), INIT_OPT_STRING("mime", N_("Default MIME-type"),
"default_type", 0, DEFAULT_MIME_TYPE, "default_type", OPT_ZERO, DEFAULT_MIME_TYPE,
N_("Document MIME-type to assume by default " N_("Document MIME-type to assume by default "
"(when we are unable to guess it properly " "(when we are unable to guess it properly "
"from known information about the document).")), "from known information about the document).")),

View File

@ -126,12 +126,12 @@ done_openssl(struct module *module)
static union option_info openssl_options[] = { static union option_info openssl_options[] = {
INIT_OPT_BOOL("connection.ssl", N_("Verify certificates"), INIT_OPT_BOOL("connection.ssl", N_("Verify certificates"),
"cert_verify", 0, 1, "cert_verify", OPT_ZERO, 1,
N_("Verify the peer's SSL certificate. Note that this " N_("Verify the peer's SSL certificate. Note that this "
"needs extensive configuration of OpenSSL by the user.")), "needs extensive configuration of OpenSSL by the user.")),
INIT_OPT_BOOL("connection.ssl", N_("Use HTTPS by default"), INIT_OPT_BOOL("connection.ssl", N_("Use HTTPS by default"),
"https_by_default", 0, 0, "https_by_default", OPT_ZERO, 0,
N_("Use HTTPS when a URL scheme is not provided.")), N_("Use HTTPS when a URL scheme is not provided.")),
INIT_OPT_TREE("connection.ssl", N_("Client Certificates"), INIT_OPT_TREE("connection.ssl", N_("Client Certificates"),
@ -139,13 +139,13 @@ static union option_info openssl_options[] = {
N_("X509 client certificate options.")), N_("X509 client certificate options.")),
INIT_OPT_BOOL("connection.ssl.client_cert", N_("Enable"), INIT_OPT_BOOL("connection.ssl.client_cert", N_("Enable"),
"enable", 0, 0, "enable", OPT_ZERO, 0,
N_("Enable or not the sending of X509 client certificates " N_("Enable or not the sending of X509 client certificates "
"to servers which request them.")), "to servers which request them.")),
#ifdef CONFIG_NSS_COMPAT_OSSL #ifdef CONFIG_NSS_COMPAT_OSSL
INIT_OPT_STRING("connection.ssl.client_cert", N_("Certificate nickname"), INIT_OPT_STRING("connection.ssl.client_cert", N_("Certificate nickname"),
"nickname", 0, "", "nickname", OPT_ZERO, "",
N_("The nickname of the client certificate stored in NSS " N_("The nickname of the client certificate stored in NSS "
"database. If this value is unset, the nickname from " "database. If this value is unset, the nickname from "
"the X509_CLIENT_CERT variable is used instead. If you " "the X509_CLIENT_CERT variable is used instead. If you "
@ -159,7 +159,7 @@ static union option_info openssl_options[] = {
"with Mozilla browsers.")), "with Mozilla browsers.")),
#else #else
INIT_OPT_STRING("connection.ssl.client_cert", N_("Certificate File"), INIT_OPT_STRING("connection.ssl.client_cert", N_("Certificate File"),
"file", 0, "", "file", OPT_ZERO, "",
N_("The location of a file containing the client certificate " N_("The location of a file containing the client certificate "
"and unencrypted private key in PEM format. If unset, the " "and unencrypted private key in PEM format. If unset, the "
"file pointed to by the X509_CLIENT_CERT variable is used " "file pointed to by the X509_CLIENT_CERT variable is used "
@ -261,12 +261,12 @@ done_gnutls(struct module *module)
static union option_info gnutls_options[] = { static union option_info gnutls_options[] = {
INIT_OPT_BOOL("connection.ssl", N_("Verify certificates"), INIT_OPT_BOOL("connection.ssl", N_("Verify certificates"),
"cert_verify", 0, 0, "cert_verify", OPT_ZERO, 0,
N_("Verify the peer's SSL certificate. If you enable " N_("Verify the peer's SSL certificate. If you enable "
"this, set also \"Trusted CA file\".")), "this, set also \"Trusted CA file\".")),
INIT_OPT_BOOL("connection.ssl", N_("Use HTTPS by default"), INIT_OPT_BOOL("connection.ssl", N_("Use HTTPS by default"),
"https_by_default", 0, 0, "https_by_default", OPT_ZERO, 0,
N_("Use HTTPS when a URL scheme is not provided.")), N_("Use HTTPS when a URL scheme is not provided.")),
/* The default value of the following option points to a file /* The default value of the following option points to a file
@ -278,7 +278,7 @@ static union option_info gnutls_options[] = {
* suit their systems. * suit their systems.
* TODO: If the file name is relative, look in elinks_home? */ * TODO: If the file name is relative, look in elinks_home? */
INIT_OPT_STRING("connection.ssl", N_("Trusted CA file"), INIT_OPT_STRING("connection.ssl", N_("Trusted CA file"),
"trusted_ca_file", 0, "trusted_ca_file", OPT_ZERO,
#ifdef HAVE_GNUTLS_CERTIFICATE_SET_X509_SYSTEM_TRUST #ifdef HAVE_GNUTLS_CERTIFICATE_SET_X509_SYSTEM_TRUST
"", "",
#else #else
@ -297,12 +297,12 @@ static union option_info gnutls_options[] = {
N_("X509 client certificate options.")), N_("X509 client certificate options.")),
INIT_OPT_BOOL("connection.ssl.client_cert", N_("Enable"), INIT_OPT_BOOL("connection.ssl.client_cert", N_("Enable"),
"enable", 0, 0, "enable", OPT_ZERO, 0,
N_("Enable or not the sending of X509 client certificates " N_("Enable or not the sending of X509 client certificates "
"to servers which request them.")), "to servers which request them.")),
INIT_OPT_STRING("connection.ssl.client_cert", N_("Certificate File"), INIT_OPT_STRING("connection.ssl.client_cert", N_("Certificate File"),
"file", 0, "", "file", OPT_ZERO, "",
N_("The location of a file containing the client certificate " N_("The location of a file containing the client certificate "
"and unencrypted private key in PEM format. If unset, the " "and unencrypted private key in PEM format. If unset, the "
"file pointed to by the X509_CLIENT_CERT variable is used " "file pointed to by the X509_CLIENT_CERT variable is used "

View File

@ -28,7 +28,7 @@
static union option_info bittorrent_protocol_options[] = { static union option_info bittorrent_protocol_options[] = {
INIT_OPT_TREE("protocol", N_("BitTorrent"), INIT_OPT_TREE("protocol", N_("BitTorrent"),
"bittorrent", 0, "bittorrent", OPT_ZERO,
N_("BitTorrent specific options.")), N_("BitTorrent specific options.")),
/* ****************************************************************** */ /* ****************************************************************** */
@ -36,15 +36,15 @@ static union option_info bittorrent_protocol_options[] = {
/* ****************************************************************** */ /* ****************************************************************** */
INIT_OPT_TREE("protocol.bittorrent", N_("Port range"), INIT_OPT_TREE("protocol.bittorrent", N_("Port range"),
"ports", 0, "ports", OPT_ZERO,
N_("Port range allowed to be used for listening on.")), N_("Port range allowed to be used for listening on.")),
INIT_OPT_INT("protocol.bittorrent.ports", N_("Minimum port"), INIT_OPT_INT("protocol.bittorrent.ports", N_("Minimum port"),
"min", 0, LOWEST_PORT, HIGHEST_PORT, 6881, "min", OPT_ZERO, LOWEST_PORT, HIGHEST_PORT, 6881,
N_("The minimum port to try and listen on.")), N_("The minimum port to try and listen on.")),
INIT_OPT_INT("protocol.bittorrent.ports", N_("Maximum port"), INIT_OPT_INT("protocol.bittorrent.ports", N_("Maximum port"),
"max", 0, LOWEST_PORT, HIGHEST_PORT, 6999, "max", OPT_ZERO, LOWEST_PORT, HIGHEST_PORT, 6999,
N_("The maximum port to try and listen on.")), N_("The maximum port to try and listen on.")),
@ -53,30 +53,30 @@ static union option_info bittorrent_protocol_options[] = {
/* ****************************************************************** */ /* ****************************************************************** */
INIT_OPT_TREE("protocol.bittorrent", N_("Tracker"), INIT_OPT_TREE("protocol.bittorrent", N_("Tracker"),
"tracker", 0, "tracker", OPT_ZERO,
N_("Tracker options.")), N_("Tracker options.")),
INIT_OPT_BOOL("protocol.bittorrent.tracker", N_("Use compact tracker format"), INIT_OPT_BOOL("protocol.bittorrent.tracker", N_("Use compact tracker format"),
"compact", 0, 0, "compact", OPT_ZERO, 0,
N_("Whether to request that the tracker returns peer info " N_("Whether to request that the tracker returns peer info "
"in compact format. Note, the compact format only supports " "in compact format. Note, the compact format only supports "
"IPv4 addresses.")), "IPv4 addresses.")),
INIT_OPT_INT("protocol.bittorrent.tracker", N_("Tracker announce interval"), INIT_OPT_INT("protocol.bittorrent.tracker", N_("Tracker announce interval"),
"interval", 0, 0, INT_MAX, 0, "interval", OPT_ZERO, 0, INT_MAX, 0,
N_("The number of seconds to wait between periodically " N_("The number of seconds to wait between periodically "
"contacting the tracker for announcing progress and " "contacting the tracker for announcing progress and "
"requesting more peers. Set to zero to use the interval " "requesting more peers. Set to zero to use the interval "
"requested by the tracker.")), "requested by the tracker.")),
INIT_OPT_STRING("protocol.bittorrent.tracker", N_("IP-address to announce"), INIT_OPT_STRING("protocol.bittorrent.tracker", N_("IP-address to announce"),
"ip_address", 0, "", "ip_address", OPT_ZERO, "",
N_("What IP address to report to the tracker. If set to \"\" " N_("What IP address to report to the tracker. If set to \"\" "
"no IP address will be sent and the tracker will " "no IP address will be sent and the tracker will "
"automatically determine an appropriate IP address.")), "automatically determine an appropriate IP address.")),
INIT_OPT_STRING("protocol.bittorrent.tracker", N_("User identification string"), INIT_OPT_STRING("protocol.bittorrent.tracker", N_("User identification string"),
"key", 0, "", "key", OPT_ZERO, "",
N_("An additional identification that is not shared with any " N_("An additional identification that is not shared with any "
"users. It is intended to allow a client to prove their " "users. It is intended to allow a client to prove their "
"identity should their IP address change. It is an optional " "identity should their IP address change. It is an optional "
@ -84,12 +84,12 @@ static union option_info bittorrent_protocol_options[] = {
"If set to \"\" no user key will be sent to the tracker.")), "If set to \"\" no user key will be sent to the tracker.")),
INIT_OPT_INT("protocol.bittorrent.tracker", N_("Maximum number of peers to request"), INIT_OPT_INT("protocol.bittorrent.tracker", N_("Maximum number of peers to request"),
"numwant", 0, 0, INT_MAX, 50, "numwant", OPT_ZERO, 0, INT_MAX, 50,
N_("The maximum number of peers to request from the tracker. " N_("The maximum number of peers to request from the tracker. "
"Set to 0 to use the server default.")), "Set to 0 to use the server default.")),
INIT_OPT_INT("protocol.bittorrent.tracker", N_("Minimum peers to skip rerequesting"), INIT_OPT_INT("protocol.bittorrent.tracker", N_("Minimum peers to skip rerequesting"),
"min_skip_size", 0, 0, INT_MAX, 20, "min_skip_size", OPT_ZERO, 0, INT_MAX, 20,
N_("The minimum number of peers to have in the current peer " N_("The minimum number of peers to have in the current peer "
"info pool before skipping requesting of more peers. I.e. " "info pool before skipping requesting of more peers. I.e. "
"setting numwant to zero. Set to 0 to not have any limit.")), "setting numwant to zero. Set to 0 to not have any limit.")),
@ -100,11 +100,11 @@ static union option_info bittorrent_protocol_options[] = {
/* ****************************************************************** */ /* ****************************************************************** */
INIT_OPT_TREE("protocol.bittorrent", N_("Peer-wire"), INIT_OPT_TREE("protocol.bittorrent", N_("Peer-wire"),
"peerwire", 0, "peerwire", OPT_ZERO,
N_("Lowlevel peer-wire options.")), N_("Lowlevel peer-wire options.")),
INIT_OPT_INT("protocol.bittorrent.peerwire", N_("Maximum number of peer connections"), INIT_OPT_INT("protocol.bittorrent.peerwire", N_("Maximum number of peer connections"),
"connections", 0, 1, INT_MAX, 55, "connections", OPT_ZERO, 1, INT_MAX, 55,
N_("The maximum number of allowed connections to both active " N_("The maximum number of allowed connections to both active "
"and non-active peers. By increasing the number of allowed " "and non-active peers. By increasing the number of allowed "
"connections, the chance of finding good peers to download " "connections, the chance of finding good peers to download "
@ -113,29 +113,29 @@ static union option_info bittorrent_protocol_options[] = {
"connections will be closed.")), "connections will be closed.")),
INIT_OPT_INT("protocol.bittorrent.peerwire", N_("Maximum peer message length"), INIT_OPT_INT("protocol.bittorrent.peerwire", N_("Maximum peer message length"),
"max_message_length", 0, 1, INT_MAX, BITTORRENT_MESSAGE_MAX_SIZE, "max_message_length", OPT_ZERO, 1, INT_MAX, BITTORRENT_MESSAGE_MAX_SIZE,
N_("The maximum length of messages to accept over the wire. " N_("The maximum length of messages to accept over the wire. "
"Larger values will cause the connection to be dropped.")), "Larger values will cause the connection to be dropped.")),
INIT_OPT_INT("protocol.bittorrent.peerwire", N_("Maximum allowed request length"), INIT_OPT_INT("protocol.bittorrent.peerwire", N_("Maximum allowed request length"),
"max_request_length", 0, 1, INT_MAX, BITTORRENT_REQUEST_ACCEPT_LENGTH, "max_request_length", OPT_ZERO, 1, INT_MAX, BITTORRENT_REQUEST_ACCEPT_LENGTH,
N_("The maximum length to allow for incoming requests. " N_("The maximum length to allow for incoming requests. "
"Larger requests will cause the connection to be dropped.")), "Larger requests will cause the connection to be dropped.")),
INIT_OPT_INT("protocol.bittorrent.peerwire", N_("Length of requests"), INIT_OPT_INT("protocol.bittorrent.peerwire", N_("Length of requests"),
"request_length", 0, 1, INT_MAX, BITTORRENT_REQUEST_LENGTH, "request_length", OPT_ZERO, 1, INT_MAX, BITTORRENT_REQUEST_LENGTH,
N_("How many bytes to query for per request. This is " N_("How many bytes to query for per request. This is "
"complementary to the max_request_length option. " "complementary to the max_request_length option. "
"If the configured length is bigger than the piece length " "If the configured length is bigger than the piece length "
"it will be truncated.")), "it will be truncated.")),
INIT_OPT_INT("protocol.bittorrent.peerwire", N_("Peer inactivity timeout"), INIT_OPT_INT("protocol.bittorrent.peerwire", N_("Peer inactivity timeout"),
"timeout", 0, 0, INT_MAX, 300, "timeout", OPT_ZERO, 0, INT_MAX, 300,
N_("The number of seconds to wait before closing a socket on " N_("The number of seconds to wait before closing a socket on "
"which nothing has been received or sent.")), "which nothing has been received or sent.")),
INIT_OPT_INT("protocol.bittorrent.peerwire", N_("Maximum peer pool size"), INIT_OPT_INT("protocol.bittorrent.peerwire", N_("Maximum peer pool size"),
"pool_size", 0, 0, INT_MAX, 55, "pool_size", OPT_ZERO, 0, INT_MAX, 55,
N_("Maximum number of items in the peer pool. The peer pool " N_("Maximum number of items in the peer pool. The peer pool "
"contains information used for establishing connections to " "contains information used for establishing connections to "
"new peers.\n" "new peers.\n"
@ -148,7 +148,7 @@ static union option_info bittorrent_protocol_options[] = {
/* ****************************************************************** */ /* ****************************************************************** */
INIT_OPT_INT("protocol.bittorrent", N_("Maximum piece cache size"), INIT_OPT_INT("protocol.bittorrent", N_("Maximum piece cache size"),
"piece_cache_size", 0, 0, INT_MAX, 1024 * 1024, "piece_cache_size", OPT_ZERO, 0, INT_MAX, 1024 * 1024,
N_("The maximum amount of memory used to hold recently " N_("The maximum amount of memory used to hold recently "
"downloaded pieces.\n" "downloaded pieces.\n"
"\n" "\n"
@ -160,7 +160,7 @@ static union option_info bittorrent_protocol_options[] = {
#if 0 #if 0
INIT_OPT_STRING("protocol.bittorrent", N_("Sharing rate"), INIT_OPT_STRING("protocol.bittorrent", N_("Sharing rate"),
"sharing_rate", 0, "1.0", "sharing_rate", OPT_ZERO, "1.0",
N_("The minimum sharing rate to achieve before stop seeding. " N_("The minimum sharing rate to achieve before stop seeding. "
"The sharing rate is computed as the number of uploaded bytes " "The sharing rate is computed as the number of uploaded bytes "
"divided with the number of downloaded bytes. The value " "divided with the number of downloaded bytes. The value "
@ -169,23 +169,23 @@ static union option_info bittorrent_protocol_options[] = {
"set to 0.0 to have unlimited sharing rate.")), "set to 0.0 to have unlimited sharing rate.")),
#endif #endif
INIT_OPT_INT("protocol.bittorrent", N_("Maximum number of uploads"), INIT_OPT_INT("protocol.bittorrent", N_("Maximum number of uploads"),
"max_uploads", 0, 0, INT_MAX, 7, "max_uploads", OPT_ZERO, 0, INT_MAX, 7,
N_("The maximum number of uploads to allow at once.")), N_("The maximum number of uploads to allow at once.")),
/* The number of uploads to fill out to with extra optimistic unchokes */ /* The number of uploads to fill out to with extra optimistic unchokes */
INIT_OPT_INT("protocol.bittorrent", N_("Minimum number of uploads"), INIT_OPT_INT("protocol.bittorrent", N_("Minimum number of uploads"),
"min_uploads", 0, 0, INT_MAX, 2, "min_uploads", OPT_ZERO, 0, INT_MAX, 2,
N_("The minimum number of uploads which should at least " N_("The minimum number of uploads which should at least "
"be used for new connections.")), "be used for new connections.")),
#if 0 #if 0
INIT_OPT_INT("protocol.bittorrent", N_("Keepalive interval"), INIT_OPT_INT("protocol.bittorrent", N_("Keepalive interval"),
"keepalive_interval", 0, 0, INT_MAX, 120, "keepalive_interval", OPT_ZERO, 0, INT_MAX, 120,
N_("The number of seconds to pause between sending keepalive " N_("The number of seconds to pause between sending keepalive "
"messages.")), "messages.")),
#endif #endif
INIT_OPT_INT("protocol.bittorrent", N_("Number of pending requests"), INIT_OPT_INT("protocol.bittorrent", N_("Number of pending requests"),
"request_queue_size", 0, 1, INT_MAX, 5, "request_queue_size", OPT_ZERO, 1, INT_MAX, 5,
N_("How many piece requests to continuously keep in queue. " N_("How many piece requests to continuously keep in queue. "
"Pipelining of requests is essential to saturate connections " "Pipelining of requests is essential to saturate connections "
"and get a good connection performance and thus a faster " "and get a good connection performance and thus a faster "
@ -196,12 +196,12 @@ static union option_info bittorrent_protocol_options[] = {
#if 0 #if 0
/* Bram uses 30 seconds here. */ /* Bram uses 30 seconds here. */
INIT_OPT_INT("protocol.bittorrent", N_("Peer snubbing interval"), INIT_OPT_INT("protocol.bittorrent", N_("Peer snubbing interval"),
"snubbing_interval", 0, 0, INT_MAX, 30, "snubbing_interval", OPT_ZERO, 0, INT_MAX, 30,
N_("The number of seconds to wait for file data before " N_("The number of seconds to wait for file data before "
"assuming the peer has been snubbed.")), "assuming the peer has been snubbed.")),
#endif #endif
INIT_OPT_INT("protocol.bittorrent", N_("Peer choke interval"), INIT_OPT_INT("protocol.bittorrent", N_("Peer choke interval"),
"choke_interval", 0, 0, INT_MAX, BITTORRENT_DEFAULT_CHOKE_INTERVAL, "choke_interval", OPT_ZERO, 0, INT_MAX, BITTORRENT_DEFAULT_CHOKE_INTERVAL,
N_("The number of seconds between updating the connection " N_("The number of seconds between updating the connection "
"state and most importantly choke and unchoke peer " "state and most importantly choke and unchoke peer "
"connections. The choke period should be big enough for newly " "connections. The choke period should be big enough for newly "
@ -209,12 +209,12 @@ static union option_info bittorrent_protocol_options[] = {
"allow freeriders too much room for stealing bandwidth.")), "allow freeriders too much room for stealing bandwidth.")),
INIT_OPT_INT("protocol.bittorrent", N_("Rarest first piece selection cutoff"), INIT_OPT_INT("protocol.bittorrent", N_("Rarest first piece selection cutoff"),
"rarest_first_cutoff", 0, 0, INT_MAX, 4, "rarest_first_cutoff", OPT_ZERO, 0, INT_MAX, 4,
N_("The number of pieces to obtain before switching piece " N_("The number of pieces to obtain before switching piece "
"selection strategy from random to rarest first.")), "selection strategy from random to rarest first.")),
INIT_OPT_BOOL("protocol.bittorrent", N_("Allow blacklisting"), INIT_OPT_BOOL("protocol.bittorrent", N_("Allow blacklisting"),
"allow_blacklist", 0, 1, "allow_blacklist", OPT_ZERO, 1,
N_("Allow blacklisting of buggy peers.")), N_("Allow blacklisting of buggy peers.")),
NULL_OPTION_INFO, NULL_OPTION_INFO,

View File

@ -42,16 +42,16 @@
static union option_info cgi_options[] = { static union option_info cgi_options[] = {
INIT_OPT_TREE("protocol.file", N_("Local CGI"), INIT_OPT_TREE("protocol.file", N_("Local CGI"),
"cgi", 0, "cgi", OPT_ZERO,
N_("Local CGI specific options.")), N_("Local CGI specific options.")),
INIT_OPT_STRING("protocol.file.cgi", N_("Path"), INIT_OPT_STRING("protocol.file.cgi", N_("Path"),
"path", 0, "", "path", OPT_ZERO, "",
N_("Colon separated list of directories, " N_("Colon separated list of directories, "
"where CGI scripts are stored.")), "where CGI scripts are stored.")),
INIT_OPT_BOOL("protocol.file.cgi", N_("Allow local CGI"), INIT_OPT_BOOL("protocol.file.cgi", N_("Allow local CGI"),
"policy", 0, 0, "policy", OPT_ZERO, 0,
N_("Whether to execute local CGI scripts.")), N_("Whether to execute local CGI scripts.")),
NULL_OPTION_INFO, NULL_OPTION_INFO,
}; };

View File

@ -43,22 +43,22 @@
static union option_info file_options[] = { static union option_info file_options[] = {
INIT_OPT_TREE("protocol", N_("Local files"), INIT_OPT_TREE("protocol", N_("Local files"),
"file", 0, "file", OPT_ZERO,
N_("Options specific to local browsing.")), N_("Options specific to local browsing.")),
INIT_OPT_BOOL("protocol.file", N_("Allow reading special files"), INIT_OPT_BOOL("protocol.file", N_("Allow reading special files"),
"allow_special_files", 0, 0, "allow_special_files", OPT_ZERO, 0,
N_("Whether to allow reading from non-regular files. " N_("Whether to allow reading from non-regular files. "
"Note this can be dangerous; reading /dev/urandom or " "Note this can be dangerous; reading /dev/urandom or "
"/dev/zero can ruin your day!")), "/dev/zero can ruin your day!")),
INIT_OPT_BOOL("protocol.file", N_("Show hidden files in directory listing"), INIT_OPT_BOOL("protocol.file", N_("Show hidden files in directory listing"),
"show_hidden_files", 0, 1, "show_hidden_files", OPT_ZERO, 1,
N_("When set to false, files with name starting with a dot " N_("When set to false, files with name starting with a dot "
"will be hidden in local directory listings.")), "will be hidden in local directory listings.")),
INIT_OPT_BOOL("protocol.file", N_("Try encoding extensions"), INIT_OPT_BOOL("protocol.file", N_("Try encoding extensions"),
"try_encoding_extensions", 0, 1, "try_encoding_extensions", OPT_ZERO, 1,
N_("When set, if we can't open a file named 'filename', " N_("When set, if we can't open a file named 'filename', "
"we'll try to open 'filename' with some encoding extension " "we'll try to open 'filename' with some encoding extension "
"appended (ie. 'filename.gz'); it depends on the supported " "appended (ie. 'filename.gz'); it depends on the supported "

View File

@ -54,30 +54,30 @@
union option_info ftp_options[] = { union option_info ftp_options[] = {
INIT_OPT_TREE("protocol", N_("FTP"), INIT_OPT_TREE("protocol", N_("FTP"),
"ftp", 0, "ftp", OPT_ZERO,
N_("FTP specific options.")), N_("FTP specific options.")),
INIT_OPT_TREE("protocol.ftp", N_("Proxy configuration"), INIT_OPT_TREE("protocol.ftp", N_("Proxy configuration"),
"proxy", 0, "proxy", OPT_ZERO,
N_("FTP proxy configuration.")), N_("FTP proxy configuration.")),
INIT_OPT_STRING("protocol.ftp.proxy", N_("Host and port-number"), INIT_OPT_STRING("protocol.ftp.proxy", N_("Host and port-number"),
"host", 0, "", "host", OPT_ZERO, "",
N_("Host and port-number (host:port) of the FTP proxy, " N_("Host and port-number (host:port) of the FTP proxy, "
"or blank. If it's blank, FTP_PROXY environment variable " "or blank. If it's blank, FTP_PROXY environment variable "
"is checked as well.")), "is checked as well.")),
INIT_OPT_STRING("protocol.ftp", N_("Anonymous password"), INIT_OPT_STRING("protocol.ftp", N_("Anonymous password"),
"anon_passwd", 0, "some@host.domain", "anon_passwd", OPT_ZERO, "some@host.domain",
N_("FTP anonymous password to be sent.")), N_("FTP anonymous password to be sent.")),
INIT_OPT_BOOL("protocol.ftp", N_("Use passive mode (IPv4)"), INIT_OPT_BOOL("protocol.ftp", N_("Use passive mode (IPv4)"),
"use_pasv", 0, 1, "use_pasv", OPT_ZERO, 1,
N_("Use PASV instead of PORT (passive vs active mode, " N_("Use PASV instead of PORT (passive vs active mode, "
"IPv4 only).")), "IPv4 only).")),
#ifdef CONFIG_IPV6 #ifdef CONFIG_IPV6
INIT_OPT_BOOL("protocol.ftp", N_("Use passive mode (IPv6)"), INIT_OPT_BOOL("protocol.ftp", N_("Use passive mode (IPv6)"),
"use_epsv", 0, 0, "use_epsv", OPT_ZERO, 0,
N_("Use EPSV instead of EPRT (passive vs active mode, " N_("Use EPSV instead of EPRT (passive vs active mode, "
"IPv6 only).")), "IPv6 only).")),
#endif /* CONFIG_IPV6 */ #endif /* CONFIG_IPV6 */

View File

@ -72,59 +72,59 @@ static char *accept_charset = NULL;
static union option_info http_options[] = { static union option_info http_options[] = {
INIT_OPT_TREE("protocol", N_("HTTP"), INIT_OPT_TREE("protocol", N_("HTTP"),
"http", 0, "http", OPT_ZERO,
N_("HTTP-specific options.")), N_("HTTP-specific options.")),
INIT_OPT_TREE("protocol.http", N_("Server bug workarounds"), INIT_OPT_TREE("protocol.http", N_("Server bug workarounds"),
"bugs", 0, "bugs", OPT_ZERO,
N_("Server-side HTTP bugs workarounds.")), N_("Server-side HTTP bugs workarounds.")),
INIT_OPT_BOOL("protocol.http.bugs", N_("Do not send Accept-Charset"), INIT_OPT_BOOL("protocol.http.bugs", N_("Do not send Accept-Charset"),
"accept_charset", 0, 1, "accept_charset", OPT_ZERO, 1,
N_("The Accept-Charset header is quite long and sending it " N_("The Accept-Charset header is quite long and sending it "
"can trigger bugs in some rarely found servers.")), "can trigger bugs in some rarely found servers.")),
INIT_OPT_BOOL("protocol.http.bugs", N_("Allow blacklisting"), INIT_OPT_BOOL("protocol.http.bugs", N_("Allow blacklisting"),
"allow_blacklist", 0, 1, "allow_blacklist", OPT_ZERO, 1,
N_("Allow blacklisting of buggy servers.")), N_("Allow blacklisting of buggy servers.")),
INIT_OPT_BOOL("protocol.http.bugs", N_("Broken 302 redirects"), INIT_OPT_BOOL("protocol.http.bugs", N_("Broken 302 redirects"),
"broken_302_redirect", 0, 1, "broken_302_redirect", OPT_ZERO, 1,
N_("Broken 302 redirect (violates RFC but compatible with " N_("Broken 302 redirect (violates RFC but compatible with "
"Netscape). This is a problem for a lot of web discussion " "Netscape). This is a problem for a lot of web discussion "
"boards and the like. If they will do strange things to you, " "boards and the like. If they will do strange things to you, "
"try to play with this.")), "try to play with this.")),
INIT_OPT_BOOL("protocol.http.bugs", N_("No keepalive after POST requests"), INIT_OPT_BOOL("protocol.http.bugs", N_("No keepalive after POST requests"),
"post_no_keepalive", 0, 0, "post_no_keepalive", OPT_ZERO, 0,
N_("Disable keepalive connection after POST request.")), N_("Disable keepalive connection after POST request.")),
INIT_OPT_BOOL("protocol.http.bugs", N_("Use HTTP/1.0"), INIT_OPT_BOOL("protocol.http.bugs", N_("Use HTTP/1.0"),
"http10", 0, 0, "http10", OPT_ZERO, 0,
N_("Use HTTP/1.0 protocol instead of HTTP/1.1.")), N_("Use HTTP/1.0 protocol instead of HTTP/1.1.")),
INIT_OPT_TREE("protocol.http", N_("Proxy configuration"), INIT_OPT_TREE("protocol.http", N_("Proxy configuration"),
"proxy", 0, "proxy", OPT_ZERO,
N_("HTTP proxy configuration.")), N_("HTTP proxy configuration.")),
INIT_OPT_STRING("protocol.http.proxy", N_("Host and port-number"), INIT_OPT_STRING("protocol.http.proxy", N_("Host and port-number"),
"host", 0, "", "host", OPT_ZERO, "",
N_("Host and port-number (host:port) of the HTTP proxy, " N_("Host and port-number (host:port) of the HTTP proxy, "
"or blank. If it's blank, HTTP_PROXY environment variable " "or blank. If it's blank, HTTP_PROXY environment variable "
"is checked as well.")), "is checked as well.")),
INIT_OPT_STRING("protocol.http.proxy", N_("Username"), INIT_OPT_STRING("protocol.http.proxy", N_("Username"),
"user", 0, "", "user", OPT_ZERO, "",
N_("Proxy authentication username.")), N_("Proxy authentication username.")),
INIT_OPT_STRING("protocol.http.proxy", N_("Password"), INIT_OPT_STRING("protocol.http.proxy", N_("Password"),
"passwd", 0, "", "passwd", OPT_ZERO, "",
N_("Proxy authentication password.")), N_("Proxy authentication password.")),
INIT_OPT_TREE("protocol.http", N_("Referer sending"), INIT_OPT_TREE("protocol.http", N_("Referer sending"),
"referer", 0, "referer", OPT_ZERO,
N_("HTTP referer sending options. HTTP referer is a special " N_("HTTP referer sending options. HTTP referer is a special "
"header sent in the HTTP requests, which is supposed to " "header sent in the HTTP requests, which is supposed to "
"contain the previous page visited by the browser." "contain the previous page visited by the browser."
@ -134,7 +134,7 @@ static union option_info http_options[] = {
"to a security problem on some badly designed web pages.")), "to a security problem on some badly designed web pages.")),
INIT_OPT_INT("protocol.http.referer", N_("Policy"), INIT_OPT_INT("protocol.http.referer", N_("Policy"),
"policy", 0, "policy", OPT_ZERO,
REFERER_NONE, REFERER_TRUE, REFERER_TRUE, REFERER_NONE, REFERER_TRUE, REFERER_TRUE,
N_("Mode of sending HTTP referer:\n" N_("Mode of sending HTTP referer:\n"
"0 is send no referer\n" "0 is send no referer\n"
@ -143,16 +143,16 @@ static union option_info http_options[] = {
"3 is send previous URL as referer (correct, but insecure)")), "3 is send previous URL as referer (correct, but insecure)")),
INIT_OPT_STRING("protocol.http.referer", N_("Fake referer URL"), INIT_OPT_STRING("protocol.http.referer", N_("Fake referer URL"),
"fake", 0, "", "fake", OPT_ZERO, "",
N_("Fake referer to be sent when policy is 2.")), N_("Fake referer to be sent when policy is 2.")),
INIT_OPT_STRING("protocol.http", N_("Send Accept-Language header"), INIT_OPT_STRING("protocol.http", N_("Send Accept-Language header"),
"accept_language", 0, "", "accept_language", OPT_ZERO, "",
N_("Send Accept-Language header.")), N_("Send Accept-Language header.")),
INIT_OPT_BOOL("protocol.http", N_("Use UI language as Accept-Language"), INIT_OPT_BOOL("protocol.http", N_("Use UI language as Accept-Language"),
"accept_ui_language", 0, 1, "accept_ui_language", OPT_ZERO, 1,
N_("Request localised versions of documents from web-servers " N_("Request localised versions of documents from web-servers "
"(using the Accept-Language header) using the language " "(using the Accept-Language header) using the language "
"you have configured for ELinks' user-interface (this also " "you have configured for ELinks' user-interface (this also "
@ -171,7 +171,7 @@ static union option_info http_options[] = {
* or perhaps even blacklist the server for compression and retry. * or perhaps even blacklist the server for compression and retry.
* Until that has been implemented, disable compression by default. */ * Until that has been implemented, disable compression by default. */
INIT_OPT_BOOL("protocol.http", N_("Enable on-the-fly compression"), INIT_OPT_BOOL("protocol.http", N_("Enable on-the-fly compression"),
"compression", 0, 0, "compression", OPT_ZERO, 0,
N_("If enabled, the capability to receive compressed content " N_("If enabled, the capability to receive compressed content "
"(gzip and/or bzip2) is announced to the server, which " "(gzip and/or bzip2) is announced to the server, which "
"usually sends the reply compressed, thus saving some " "usually sends the reply compressed, thus saving some "
@ -186,7 +186,7 @@ static union option_info http_options[] = {
"see Help -> About.")), "see Help -> About.")),
INIT_OPT_BOOL("protocol.http", N_("Activate HTTP TRACE debugging"), INIT_OPT_BOOL("protocol.http", N_("Activate HTTP TRACE debugging"),
"trace", 0, 0, "trace", OPT_ZERO, 0,
N_("If active, all HTTP requests are sent with TRACE as " N_("If active, all HTTP requests are sent with TRACE as "
"their method rather than GET or POST. This is useful for " "their method rather than GET or POST. This is useful for "
"debugging of both ELinks and various server-side scripts " "debugging of both ELinks and various server-side scripts "
@ -196,7 +196,7 @@ static union option_info http_options[] = {
/* OSNews.com is supposed to be relying on the textmode token, at least. */ /* OSNews.com is supposed to be relying on the textmode token, at least. */
INIT_OPT_STRING("protocol.http", N_("User-agent identification"), INIT_OPT_STRING("protocol.http", N_("User-agent identification"),
"user_agent", 0, "ELinks/%v (textmode; %s; %t-%b)", "user_agent", OPT_ZERO, "ELinks/%v (textmode; %s; %t-%b)",
N_("Change the User Agent ID. That means identification " N_("Change the User Agent ID. That means identification "
"string, which is sent to HTTP server when a document is " "string, which is sent to HTTP server when a document is "
"requested. The 'textmode' token in the first field is our " "requested. The 'textmode' token in the first field is our "
@ -216,15 +216,15 @@ static union option_info http_options[] = {
INIT_OPT_TREE("protocol", N_("HTTPS"), INIT_OPT_TREE("protocol", N_("HTTPS"),
"https", 0, "https", OPT_ZERO,
N_("HTTPS-specific options.")), N_("HTTPS-specific options.")),
INIT_OPT_TREE("protocol.https", N_("Proxy configuration"), INIT_OPT_TREE("protocol.https", N_("Proxy configuration"),
"proxy", 0, "proxy", OPT_ZERO,
N_("HTTPS proxy configuration.")), N_("HTTPS proxy configuration.")),
INIT_OPT_STRING("protocol.https.proxy", N_("Host and port-number"), INIT_OPT_STRING("protocol.https.proxy", N_("Host and port-number"),
"host", 0, "", "host", OPT_ZERO, "",
N_("Host and port-number (host:port) of the HTTPS CONNECT " N_("Host and port-number (host:port) of the HTTPS CONNECT "
"proxy, or blank. If it's blank, HTTPS_PROXY environment " "proxy, or blank. If it's blank, HTTPS_PROXY environment "
"variable is checked as well.")), "variable is checked as well.")),

View File

@ -30,17 +30,17 @@ enum nntp_protocol_option {
static union option_info nntp_protocol_options[] = { static union option_info nntp_protocol_options[] = {
INIT_OPT_TREE("protocol", N_("NNTP"), INIT_OPT_TREE("protocol", N_("NNTP"),
"nntp", 0, "nntp", OPT_ZERO,
N_("NNTP and news specific options.")), N_("NNTP and news specific options.")),
INIT_OPT_STRING("protocol.nntp", N_("Default news server"), INIT_OPT_STRING("protocol.nntp", N_("Default news server"),
"server", 0, "", "server", OPT_ZERO, "",
N_("Used when resolving news: URIs. " N_("Used when resolving news: URIs. "
"If set to the empty string the value of the NNTPSERVER " "If set to the empty string the value of the NNTPSERVER "
"environment variable will be used.")), "environment variable will be used.")),
INIT_OPT_STRING("protocol.nntp", N_("Message header entries"), INIT_OPT_STRING("protocol.nntp", N_("Message header entries"),
"header_entries", 0, NNTP_HEADER_ENTRIES, "header_entries", OPT_ZERO, NNTP_HEADER_ENTRIES,
N_("Comma separated list of which entries in the article " N_("Comma separated list of which entries in the article "
"header to show. E.g. 'Subject' and 'From'. " "header to show. E.g. 'Subject' and 'From'. "
"All header entries can be read in the header info dialog.")), "All header entries can be read in the header info dialog.")),

View File

@ -279,7 +279,7 @@ static union option_info protocol_options[] = {
N_("Protocol specific options.")), N_("Protocol specific options.")),
INIT_OPT_STRING("protocol", N_("No-proxy domains"), INIT_OPT_STRING("protocol", N_("No-proxy domains"),
"no_proxy", 0, "", "no_proxy", OPT_ZERO, "",
N_("Comma separated list of domains for which the proxy " N_("Comma separated list of domains for which the proxy "
"(HTTP/FTP) should be disabled. Optionally, a port can be " "(HTTP/FTP) should be disabled. Optionally, a port can be "
"specified for some domains as well. If it's blank, " "specified for some domains as well. If it's blank, "

View File

@ -52,14 +52,14 @@ static union option_info uri_rewrite_options[] = {
"keywords.")), "keywords.")),
INIT_OPT_BOOL("protocol.rewrite", N_("Enable dumb prefixes"), INIT_OPT_BOOL("protocol.rewrite", N_("Enable dumb prefixes"),
"enable-dumb", 0, 1, "enable-dumb", OPT_ZERO, 1,
N_("Enable dumb prefixes - simple URI abbreviations which " N_("Enable dumb prefixes - simple URI abbreviations which "
"can be written to the Goto URL dialog instead of actual URIs " "can be written to the Goto URL dialog instead of actual URIs "
"- i.e. if you write 'elinks' there, you are directed to " "- i.e. if you write 'elinks' there, you are directed to "
"http://elinks.cz/.")), "http://elinks.cz/.")),
INIT_OPT_BOOL("protocol.rewrite", N_("Enable smart prefixes"), INIT_OPT_BOOL("protocol.rewrite", N_("Enable smart prefixes"),
"enable-smart", 0, 1, "enable-smart", OPT_ZERO, 1,
N_("Enable smart prefixes - URI templates triggered by " N_("Enable smart prefixes - URI templates triggered by "
"writing given abbreviation to the Goto URL dialog followed " "writing given abbreviation to the Goto URL dialog followed "
"by a list of arguments from which the actual URI is composed " "by a list of arguments from which the actual URI is composed "
@ -71,7 +71,7 @@ static union option_info uri_rewrite_options[] = {
N_("Dumb prefixes, see enable-dumb description for details.")), N_("Dumb prefixes, see enable-dumb description for details.")),
INIT_OPT_STRING("protocol.rewrite.dumb", NULL, INIT_OPT_STRING("protocol.rewrite.dumb", NULL,
"_template_", 0, "", "_template_", OPT_ZERO, "",
/* xgettext:no-c-format */ /* xgettext:no-c-format */
N_("Replacement URI for this dumbprefix:\n" N_("Replacement URI for this dumbprefix:\n"
"%c in the string means the current URL\n" "%c in the string means the current URL\n"
@ -85,7 +85,7 @@ static union option_info uri_rewrite_options[] = {
/* TODO: In some rare occations current link URI and referrer might /* TODO: In some rare occations current link URI and referrer might
* also be useful and dare I mention some kind of proxy argument. --jonas */ * also be useful and dare I mention some kind of proxy argument. --jonas */
INIT_OPT_STRING("protocol.rewrite.smart", NULL, INIT_OPT_STRING("protocol.rewrite.smart", NULL,
"_template_", 0, "", "_template_", OPT_ZERO, "",
/* xgettext:no-c-format */ /* xgettext:no-c-format */
N_("Replacement URI for this smartprefix:\n" N_("Replacement URI for this smartprefix:\n"
"%c in the string means the current URL\n" "%c in the string means the current URL\n"
@ -94,7 +94,7 @@ static union option_info uri_rewrite_options[] = {
"%% in the string means '%'")), "%% in the string means '%'")),
INIT_OPT_STRING("protocol.rewrite", N_("Default template"), INIT_OPT_STRING("protocol.rewrite", N_("Default template"),
"default_template", 0, "", "default_template", OPT_ZERO, "",
/* xgettext:no-c-format */ /* xgettext:no-c-format */
N_("Default URI template used when the string entered in " N_("Default URI template used when the string entered in "
"the goto dialog does not appear to be a URI or a filename " "the goto dialog does not appear to be a URI or a filename "
@ -110,7 +110,7 @@ static union option_info uri_rewrite_options[] = {
"%% in the template means '%'.")), "%% in the template means '%'.")),
#define INIT_OPT_DUMB_PREFIX(prefix, uri) \ #define INIT_OPT_DUMB_PREFIX(prefix, uri) \
INIT_OPT_STRING("protocol.rewrite.dumb", NULL, prefix, 0, uri, NULL) INIT_OPT_STRING("protocol.rewrite.dumb", NULL, prefix, OPT_ZERO, uri, NULL)
INIT_OPT_DUMB_PREFIX("elinks", ELINKS_WEBSITE_URL), INIT_OPT_DUMB_PREFIX("elinks", ELINKS_WEBSITE_URL),
INIT_OPT_DUMB_PREFIX("documentation", ELINKS_DOC_URL), INIT_OPT_DUMB_PREFIX("documentation", ELINKS_DOC_URL),
@ -136,7 +136,7 @@ static union option_info uri_rewrite_options[] = {
INIT_OPT_DUMB_PREFIX("vcss", "https://jigsaw.w3.org/css-validator/validator?uri=%c"), INIT_OPT_DUMB_PREFIX("vcss", "https://jigsaw.w3.org/css-validator/validator?uri=%c"),
#define INIT_OPT_SMART_PREFIX(prefix, uri) \ #define INIT_OPT_SMART_PREFIX(prefix, uri) \
INIT_OPT_STRING("protocol.rewrite.smart", NULL, prefix, 0, uri, NULL) INIT_OPT_STRING("protocol.rewrite.smart", NULL, prefix, OPT_ZERO, uri, NULL)
INIT_OPT_SMART_PREFIX("arc", "https://web.archive.org/web/*/%s"), INIT_OPT_SMART_PREFIX("arc", "https://web.archive.org/web/*/%s"),
INIT_OPT_SMART_PREFIX("aur", "https://aur.archlinux.org/packages/?K=%s"), INIT_OPT_SMART_PREFIX("aur", "https://aur.archlinux.org/packages/?K=%s"),

View File

@ -49,7 +49,7 @@ static union option_info user_protocol_options[] = {
"unix-xwin).")), "unix-xwin).")),
INIT_OPT_STRING("protocol.user._template_", NULL, INIT_OPT_STRING("protocol.user._template_", NULL,
"_template_", 0, "", "_template_", OPT_ZERO, "",
N_("Handler (external program) for this protocol and system.\n" N_("Handler (external program) for this protocol and system.\n"
"%f in the string means file name to include form data from\n" "%f in the string means file name to include form data from\n"
"%h in the string means hostname (or email address)\n" "%h in the string means hostname (or email address)\n"
@ -59,7 +59,7 @@ static union option_info user_protocol_options[] = {
"%u in the string means the whole URL")), "%u in the string means the whole URL")),
#define INIT_OPT_USER_PROTOCOL(scheme, system, cmd) \ #define INIT_OPT_USER_PROTOCOL(scheme, system, cmd) \
INIT_OPT_STRING("protocol.user." scheme, NULL, system, 0, cmd, NULL) INIT_OPT_STRING("protocol.user." scheme, NULL, system, OPT_ZERO, cmd, NULL)
#ifndef CONFIG_GOPHER #ifndef CONFIG_GOPHER
INIT_OPT_USER_PROTOCOL("gopher", "unix", DEFAULT_AC_OPT_GOPHER), INIT_OPT_USER_PROTOCOL("gopher", "unix", DEFAULT_AC_OPT_GOPHER),