ELinks 0.18.0
options.c File Reference
#include <ctype.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include "elinks.h"
#include "bfu/dialog.h"
#include "cache/cache.h"
#include "config/conf.h"
#include "config/dialogs.h"
#include "config/domain.h"
#include "config/home.h"
#include "config/options.h"
#include "config/opttypes.h"
#include "dialogs/status.h"
#include "document/document.h"
#include "globhist/globhist.h"
#include "intl/charsets.h"
#include "intl/libintl.h"
#include "main/main.h"
#include "main/select.h"
#include "network/connection.h"
#include "session/session.h"
#include "terminal/color.h"
#include "terminal/screen.h"
#include "terminal/terminal.h"
#include "util/color.h"
#include "util/error.h"
#include "util/memory.h"
#include "util/string.h"
#include "viewer/text/draw.h"
#include "config/options.inc"
Include dependency graph for options.c:

Macros

#define bad_punct(c)

Functions

static void add_opt_rec (struct option *, const char *, struct option *)
static void free_options_tree (struct option list *, int recursive)
static void check_caption (char *caption)
static void check_description (char *desc)
struct optionget_option_shadow (struct option *option, struct option *tree, struct option *shadow_tree)
 Return the shadow option in shadow_tree of option in tree.
static void register_autocreated_options (void)
 Some default pre-autocreated options.
static int change_hook_cache (struct session *ses, struct option *current, struct option *changed)
static int change_hook_connection (struct session *ses, struct option *current, struct option *changed)
static int change_hook_html (struct session *ses, struct option *current, struct option *changed)
static int change_hook_insert_mode (struct session *ses, struct option *current, struct option *changed)
static int change_hook_active_link (struct session *ses, struct option *current, struct option *changed)
static int change_hook_terminal (struct session *ses, struct option *current, struct option *changed)
static int change_hook_ui (struct session *ses, struct option *current, struct option *changed)
static int change_hook_ui_double_esc (struct session *ses, struct option *current, struct option *changed)
static int change_hook_stemplate (struct session *ses, struct option *current, struct option *changed)
static int change_hook_language (struct session *ses, struct option *current, struct option *changed)
void init_options (void)
void done_options (void)
void update_options_visibility (void)
 Update the visibility of the box item of each option in config_options to honour the value of config.show_template.
void toggle_option (struct session *ses, struct option *option)
void call_change_hooks (struct session *ses, struct option *current, struct option *option)
void option_changed (struct session *ses, struct option *option)
int get_https_by_default (void)
const char * get_default_protocol (void)
color_mode_T get_color_mode (struct option *term_spec)

Variables

int ui_double_esc
static struct option list options_root_tree = { D_LIST_HEAD_EL(options_root_tree) }
static struct option options_root
struct optionconfig_options
struct optioncmdline_options
static int no_autocreate = 0
union option_info cmdline_options_info []
static const struct change_hook_info change_hooks []

Macro Definition Documentation

◆ bad_punct

#define bad_punct ( c)
Value:
(c != ')' && c != '>' && !isquote(c) && ispunct(c))
#define isquote(c)
Definition string.h:79

Function Documentation

◆ add_opt_rec()

void add_opt_rec ( struct option * ,
const char * ,
struct option *  )
related

◆ call_change_hooks()

void call_change_hooks ( struct session * ses,
struct option * current,
struct option * option )
related

◆ change_hook_active_link()

int change_hook_active_link ( struct session * ses,
struct option * current,
struct option * changed )
static

◆ change_hook_cache()

int change_hook_cache ( struct session * ses,
struct option * current,
struct option * changed )
static

◆ change_hook_connection()

int change_hook_connection ( struct session * ses,
struct option * current,
struct option * changed )
static

◆ change_hook_html()

int change_hook_html ( struct session * ses,
struct option * current,
struct option * changed )
static

◆ change_hook_insert_mode()

int change_hook_insert_mode ( struct session * ses,
struct option * current,
struct option * changed )
static

◆ change_hook_language()

int change_hook_language ( struct session * ses,
struct option * current,
struct option * changed )
static

◆ change_hook_stemplate()

int change_hook_stemplate ( struct session * ses,
struct option * current,
struct option * changed )
static

◆ change_hook_terminal()

int change_hook_terminal ( struct session * ses,
struct option * current,
struct option * changed )
static

◆ change_hook_ui()

int change_hook_ui ( struct session * ses,
struct option * current,
struct option * changed )
static

◆ change_hook_ui_double_esc()

int change_hook_ui_double_esc ( struct session * ses,
struct option * current,
struct option * changed )
static

◆ check_caption()

void check_caption ( char * caption)
static

◆ check_description()

void check_description ( char * desc)
static

◆ done_options()

void done_options ( void )

◆ free_options_tree()

void free_options_tree ( struct option list * ,
int recursive )
related

◆ get_color_mode()

color_mode_T get_color_mode ( struct option * term_spec)

◆ get_default_protocol()

const char * get_default_protocol ( void )

◆ get_https_by_default()

int get_https_by_default ( void )

◆ get_option_shadow()

struct option * get_option_shadow ( struct option * option,
struct option * tree,
struct option * shadow_tree )

Return the shadow option in shadow_tree of option in tree.

If option isn't yet shadowed in shadow_tree, shadow it (i.e. create a copy in shadow_tree) along with any ancestors that aren't shadowed.

◆ init_options()

void init_options ( void )

◆ option_changed()

void option_changed ( struct session * ses,
struct option * option )
related

◆ register_autocreated_options()

void register_autocreated_options ( void )
inlinestatic

Some default pre-autocreated options.

Doh.

◆ toggle_option()

void toggle_option ( struct session * ses,
struct option * option )
related

◆ update_options_visibility()

void update_options_visibility ( void )

Update the visibility of the box item of each option in config_options to honour the value of config.show_template.

Variable Documentation

◆ change_hooks

const struct change_hook_info change_hooks[]
static
Initial value:
= {
{ "config.show_template", change_hook_stemplate },
{ "connection", change_hook_connection },
{ "document.browse", change_hook_html },
{ "document.browse.forms.insert_mode",
{ "document.browse.links.active_link",
{ "document.cache", change_hook_cache },
{ "document.codepage", change_hook_html },
{ "document.colors", change_hook_html },
{ "document.html", change_hook_html },
{ "document.plain", change_hook_html },
{ "terminal", change_hook_terminal },
{ "ui.double_esc", change_hook_ui_double_esc },
{ "ui.language", change_hook_language },
{ "ui", change_hook_ui },
{ NULL, NULL },
}
static int change_hook_ui(struct session *ses, struct option *current, struct option *changed)
Definition options.c:881
static int change_hook_active_link(struct session *ses, struct option *current, struct option *changed)
Definition options.c:867
static int change_hook_cache(struct session *ses, struct option *current, struct option *changed)
Definition options.c:838
static int change_hook_terminal(struct session *ses, struct option *current, struct option *changed)
Definition options.c:874
static int change_hook_language(struct session *ses, struct option *current, struct option *changed)
Definition options.c:963
static int change_hook_stemplate(struct session *ses, struct option *current, struct option *changed)
Definition options.c:956
static int change_hook_html(struct session *ses, struct option *current, struct option *changed)
Definition options.c:852
static int change_hook_insert_mode(struct session *ses, struct option *current, struct option *changed)
Definition options.c:860
static int change_hook_connection(struct session *ses, struct option *current, struct option *changed)
Definition options.c:845
static int change_hook_ui_double_esc(struct session *ses, struct option *current, struct option *changed)
Definition options.c:888
#define NULL
Definition explodename.c:35

◆ cmdline_options

struct option* cmdline_options

◆ cmdline_options_info

union option_info cmdline_options_info[]
extern

◆ config_options

struct option* config_options

◆ no_autocreate

int no_autocreate = 0
static

◆ options_root

struct option options_root
static
Initial value:
= INIT_OPTION(
"",
0, 0,
"",
)
static struct option list options_root_tree
Definition options.c:70
@ OPT_TREE
Definition options.h:118
@ OPT_ZERO
Definition options.h:23

◆ options_root_tree

struct option list options_root_tree = { D_LIST_HEAD_EL(options_root_tree) }
static

◆ ui_double_esc

int ui_double_esc
extern