Dillo v3.2.0-88-g47ab7c70
Loading...
Searching...
No Matches
dillo.cc
Go to the documentation of this file.
1/*
2 * Dillo web browser
3 *
4 * Copyright 1999-2007 Jorge Arellano Cid <jcid@dillo.org>
5 * Copyright 2024-2025 Rodrigo Arias Mallo <rodarima@gmail.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20
25#include <stdio.h>
26#include <unistd.h>
27#include <stdlib.h>
28#include <time.h>
29#include <sys/types.h>
30#include <sys/wait.h>
31#include <signal.h>
32#include <locale.h>
33#include <errno.h>
34
35#include <FL/Fl.H>
36#include <FL/Fl_Window.H>
37#include <FL/fl_ask.H>
38#include <FL/fl_draw.H>
39
40#include "msg.h"
41#include "paths.hh"
42#include "uicmd.hh"
43
44#include "prefs.h"
45#include "prefsparser.hh"
46#include "keys.hh"
47#include "bw.h"
48#include "misc.h"
49#include "history.h"
50#include "version.hh"
51
52#include "dns.h"
53#include "web.hh"
54#include "IO/tls.h"
55#include "IO/Url.h"
56#include "IO/mime.h"
57#include "capi.h"
58#include "dicache.h"
59#include "cookies.h"
60#include "actions.h"
61#include "hsts.h"
62#include "domain.h"
63#include "auth.h"
64#include "styleengine.hh"
65
66#include "dw/fltkcore.hh"
67#include "dw/widget.hh"
68#include "dw/textblock.hh"
69#include "dw/table.hh"
70
71static volatile sig_atomic_t sig_reload = 0;
72static volatile sig_atomic_t sig_exit = 0;
73
87
88typedef struct {
89 const char *shortopt;
90 const char *longopt;
91 int opt_argc; /* positive: mandatory, negative: optional */
92 OptID id;
93 const char *help;
94} CLI_options;
95
96static const CLI_options Options[] = {
97 {"-f", "--fullwindow", 0, DILLO_CLI_FULLWINDOW,
98 " -f, --fullwindow Start in full window mode: hide address bar,\n"
99 " navigation buttons, menu, and status bar."},
100 {"-g", "-geometry", 1, DILLO_CLI_GEOMETRY,
101 " -g, -geometry GEO Set initial window position where GEO is\n"
102 " WxH[{+-}X{+-}Y]"},
103 {"-h", "--help", 0, DILLO_CLI_HELP,
104 " -h, --help Display this help text and exit."},
105 {"-l", "--local", 0, DILLO_CLI_LOCAL,
106 " -l, --local Don't load images or stylesheets, or follow\n"
107 " redirections, for these FILEs or URLs."},
108 {"-v", "--version", 0, DILLO_CLI_VERSION,
109 " -v, --version Display version info and exit."},
110 {"-x", "--xid", 1, DILLO_CLI_XID,
111 " -x, --xid XID Open first Dillo window in an existing\n"
112 " window whose window ID is XID."},
113 {NULL, NULL, 0, DILLO_CLI_NONE, NULL}
114};
115
116
117/*
118 * SIGCHLD handling ----------------------------------------------------------
119 */
120
129static void raw_sigchld2(int signum)
130{
131 pid_t pid;
132 int status;
133
134 (void) signum; /* Unused */
135
136 while (1) {
137 pid = waitpid(-1, &status, WNOHANG);
138 if (pid > 0) {
139 if (WIFEXITED(status)) /* normal exit */
140 printf("[dpid]: terminated normally (%d)\n", WEXITSTATUS(status));
141 else if (WIFSIGNALED(status)) /* terminated by signal */
142 printf("[dpid]: terminated by signal %d\n", WTERMSIG(status));
143 } else if (pid == 0 || errno == ECHILD) {
144 break;
145 } else {
146 if (errno == EINTR)
147 continue;
148 perror("waitpid");
149 break;
150 }
151 }
152}
153
154static void handler_usr1(int signum)
155{
156 sig_reload = 1;
157}
158
159static void handler_usr2(int signum)
160{
161 sig_exit = 1;
162}
163
167static void est_sigchld(void)
168{
169 struct sigaction sigact;
170 sigset_t set;
171
172 (void) sigemptyset(&set);
173 sigact.sa_handler = raw_sigchld2; /* our custom handler */
174 sigact.sa_mask = set; /* no additional signal blocks */
175 sigact.sa_flags = SA_NOCLDSTOP; /* ignore stop/resume states */
176 if (sigaction(SIGCHLD, &sigact, NULL) == -1) {
177 perror("sigaction");
178 exit(1);
179 }
180
181 if (signal(SIGUSR1, handler_usr1) == SIG_ERR) {
182 perror("signal failed");
183 exit(1);
184 }
185
186 /* For now we use SIGUSR2 to exit cleanly, so we can run the
187 * automatic HTML test and check that there are no leaks. In the
188 * future we should use a better communication mechanism. This
189 * feature is not documented, as it is intended for testing only. */
190 if (signal(SIGUSR2, handler_usr2) == SIG_ERR) {
191 perror("signal failed");
192 exit(1);
193 }
194}
195
196//----------------------------------------------------------------------------
197
201static void printHelp(const char *cmdname, const CLI_options *options)
202{
203 printf("Usage: %s [OPTION]... [--] [URL|FILE]...\n"
204 "Options:\n", cmdname);
205 while (options && options->help) {
206 printf("%s\n", options->help);
207 options++;
208 }
209 printf(" URL URL to browse.\n"
210 " FILE Local FILE to view.\n"
211 "\n");
212}
213
217static int numOptions(const CLI_options *options)
218{
219 int i, max;
220
221 for (i = 0, max = 0; options[i].shortopt; i++)
222 if (abs(options[i].opt_argc) > max)
223 max = abs(options[i].opt_argc);
224 return max;
225}
226
230static OptID getCmdOption(const CLI_options *options, int argc, char **argv,
231 char **opt_argv, int *idx)
232{
233 typedef enum { O_SEARCH, O_FOUND, O_NOTFOUND, O_DONE } State;
234 OptID opt_id = DILLO_CLI_NONE;
235 int i = 0;
236 State state = O_SEARCH;
237
238 if (*idx >= argc) {
239 state = O_DONE;
240 } else {
241 state = O_NOTFOUND;
242 for (i = 0; options[i].shortopt; i++) {
243 if (strcmp(options[i].shortopt, argv[*idx]) == 0 ||
244 strcmp(options[i].longopt, argv[*idx]) == 0) {
245 state = O_FOUND;
246 ++*idx;
247 break;
248 }
249 }
250 }
251 if (state == O_FOUND) {
252 int n_arg = options[i].opt_argc;
253 opt_id = options[i].id;
254 /* Find the required/optional arguments of the option */
255 for (i = 0; *idx < argc && i < abs(n_arg) && argv[*idx][0] != '-'; i++)
256 opt_argv[i] = argv[(*idx)++];
257 opt_argv[i] = NULL;
258
259 /* Optional arguments have opt_argc < 0 */
260 if (i < n_arg) {
261 fprintf(stderr, "Option %s requires %d argument%s\n",
262 argv[*idx-i-1], n_arg, (n_arg == 1) ? "" : "s");
263 opt_id = DILLO_CLI_ERROR;
264 }
265 }
266 if (state == O_NOTFOUND) {
267 if (strcmp(argv[*idx], "--") == 0)
268 (*idx)++;
269 else if (argv[*idx][0] == '-') {
270 fprintf(stderr, "Command line option \"%s\" not recognized.\n",
271 argv[*idx]);
272 opt_id = DILLO_CLI_ERROR;
273 }
274 }
275 return opt_id;
276}
277
282static void custLabelDraw(const Fl_Label* o, int X, int Y, int W, int H,
283 Fl_Align align)
284{
285 const int interpret_symbols = 0;
286
287 fl_draw_shortcut = 0;
288 fl_font(o->font, o->size);
289 fl_color((Fl_Color)o->color);
290 fl_draw(o->value, X, Y, W, H, align, o->image, interpret_symbols);
291}
292
293static void custLabelMeasure(const Fl_Label* o, int& W, int& H)
294{
295 const int interpret_symbols = 0;
296
297 fl_draw_shortcut = 0;
298 fl_font(o->font, o->size);
299 fl_measure(o->value, W, H, interpret_symbols);
300}
301
302static void custMenuLabelDraw(const Fl_Label* o, int X, int Y, int W, int H,
303 Fl_Align align)
304{
305 const int interpret_symbols = 0;
306
307 fl_draw_shortcut = 1;
308 fl_font(o->font, o->size);
309 fl_color((Fl_Color)o->color);
310 fl_draw(o->value, X, Y, W, H, align, o->image, interpret_symbols);
311}
312
313static void custMenuLabelMeasure(const Fl_Label* o, int& W, int& H)
314{
315 const int interpret_symbols = 0;
316
317 fl_draw_shortcut = 1;
318 fl_font(o->font, o->size);
319 fl_measure(o->value, W, H, interpret_symbols);
320}
321
325static void checkFont(const char *name, const char *type)
326{
328 MSG_WARN("preferred %s font \"%s\" not found.\n", type, name);
329}
330
332{
333 checkFont(prefs.font_sans_serif, "sans-serif");
334 checkFont(prefs.font_serif, "serif");
335 checkFont(prefs.font_monospace, "monospace");
336 checkFont(prefs.font_cursive, "cursive");
337 checkFont(prefs.font_fantasy, "fantasy");
338}
339
344static void setUIColorWdef(Fl_Color idx, int32_t color, Fl_Color default_val)
345{
346 if (color != -1)
347 Fl::set_color(idx, color << 8);
348 else if (default_val != 0xFFFFFFFF)
349 Fl::set_color(idx, default_val);
350}
351
352static void setColors()
353{
354 /* The main background is a special case because Fl::background() will
355 * set the "gray ramp", which is a set of lighter and darker colors based
356 * on the main background and used for box edges and such.
357 */
358 if (prefs.ui_main_bg_color != -1) {
359 uchar r = prefs.ui_main_bg_color >> 16,
360 g = prefs.ui_main_bg_color >> 8 & 0xff,
361 b = prefs.ui_main_bg_color & 0xff;
362
363 Fl::background(r, g, b);
364 }
365
366 setUIColorWdef(FL_BACKGROUND2_COLOR, prefs.ui_text_bg_color, 0xFFFFFFFF);
367 setUIColorWdef(FL_FOREGROUND_COLOR, prefs.ui_fg_color, 0xFFFFFFFF);
368 setUIColorWdef(FL_SELECTION_COLOR, prefs.ui_selection_color,
369 fl_contrast(FL_SELECTION_COLOR, FL_BACKGROUND2_COLOR));
372 fl_lighter(FL_BACKGROUND_COLOR));
374 Fl::get_color(FL_BACKGROUND2_COLOR));
376 Fl::get_color(FL_BACKGROUND_COLOR));
378 Fl::get_color(FL_FOREGROUND_COLOR));
380 Fl::get_color(FL_FOREGROUND_COLOR));
381}
382
386static DilloUrl *makeStartUrl(char *str, bool local)
387{
388 char *url_str, *p;
389 DilloUrl *start_url;
390
391 /* Relative path to a local file? */
392 p = (*str == '/') ? dStrdup(str) :
393 dStrconcat(Paths::getOldWorkingDir(), "/", str, NULL);
394
395 if (access(p, F_OK) == 0) {
396 /* absolute path may have non-URL characters */
397 url_str = a_Misc_escape_chars(p, "% #");
398 start_url = a_Url_new(url_str + 1, "file:/");
399 } else {
400 /* Not a file, filter URL string */
401 url_str = a_Url_string_strip_delimiters(str);
402 start_url = a_Url_new(url_str, NULL);
403 }
404 dFree(p);
405 dFree(url_str);
406
407 if (local)
408 a_Url_set_flags(start_url, URL_FLAGS(start_url) | URL_SpamSafe);
409
410 return start_url;
411}
412
413/*
414 * MAIN
415 */
416int main(int argc, char **argv)
417{
418 uint_t opt_id;
419 uint_t options_got = 0;
420 uint32_t xid = 0;
421 int idx = 1;
425 char **opt_argv;
426 FILE *fp;
427
428 srand((uint_t)(time(0) ^ getpid()));
429
430 // Some OSes exit dillo without this (not GNU/Linux).
431 signal(SIGPIPE, SIG_IGN);
432 // Establish our custom SIGCHLD handler
433 est_sigchld();
434
435 /* Handle command line options */
436 opt_argv = dNew0(char*, numOptions(Options) + 1);
437 while ((opt_id = getCmdOption(Options, argc, argv, opt_argv, &idx))) {
438 options_got |= opt_id;
439 switch (opt_id) {
441 case DILLO_CLI_LOCAL:
442 break;
443 case DILLO_CLI_XID:
444 {
445 char *end;
446 xid = strtol(opt_argv[0], &end, 0);
447 if (*end) {
448 fprintf(stderr, "XID argument \"%s\" not valid.\n",opt_argv[0]);
449 return 2;
450 }
451 break;
452 }
454 if (!a_Misc_parse_geometry(opt_argv[0],&xpos,&ypos,&width,&height)){
455 fprintf(stderr, "geometry argument \"%s\" not valid. Must be of "
456 "the form WxH[{+-}X{+-}Y].\n", opt_argv[0]);
457 return 2;
458 }
459 break;
462 return 0;
463 case DILLO_CLI_HELP:
464 printHelp(argv[0], Options);
465 return 0;
466 default:
467 printHelp(argv[0], Options);
468 return 2;
469 }
470 }
471 dFree(opt_argv);
472
473 // set the default values for the preferences
474 a_Prefs_init();
475
476 // create ~/.dillo if not present
477 Paths::init();
478
479 // initialize default key bindings
480 Keys::init();
481
482 // parse dillorc
483 if ((fp = Paths::getPrefsFP(PATHS_RC_PREFS))) {
484 PrefsParser::parse(fp);
485 }
486 // parse keysrc
487 if ((fp = Paths::getPrefsFP(PATHS_RC_KEYS))) {
488 Keys::parse(fp);
489 }
490 // parse domainrc
492 a_Domain_parse(fp);
493 fclose(fp);
494 }
496
497 // initialize internal modules
498 a_Dpi_init();
499 a_Dns_init();
500 a_Web_init();
501 a_Http_init();
502 a_Tls_init();
503 a_Mime_init();
504 a_Capi_init();
506 a_Bw_init();
510 a_Auth_init();
511 a_UIcmd_init();
513
515
524
525 /* command line options override preferences */
526 if (options_got & DILLO_CLI_FULLWINDOW)
528 if (options_got & DILLO_CLI_GEOMETRY) {
529 prefs.width = width;
530 prefs.height = height;
531 prefs.xpos = xpos;
532 prefs.ypos = ypos;
533 }
534
535 // Sets WM_CLASS hint on X11
536 Fl_Window::default_xclass("dillo");
537
538 Fl::scheme(prefs.theme);
539
540 // Disable drag and drop as it crashes on MacOSX
541 Fl::dnd_text_ops(0);
542
543 setColors();
544
545 if (!prefs.show_ui_tooltip) {
546 Fl::option(Fl::OPTION_SHOW_TOOLTIPS, false);
547 }
548
549 // Disable '@' and '&' interpretation in normal labels.
550 Fl::set_labeltype(FL_NORMAL_LABEL, custLabelDraw, custLabelMeasure);
551
552 // Use to permit '&' interpretation.
553 Fl::set_labeltype(FL_FREE_LABELTYPE,custMenuLabelDraw,custMenuLabelMeasure);
554
556
557 /* use preferred font for UI */
558 Fl_Font defaultFont = dw::fltk::FltkFont::get (prefs.font_sans_serif, 0);
559 Fl::set_font(FL_HELVETICA, defaultFont); // this seems to be the
560 // only way to set the
561 // default font in fltk1.3
562
563 fl_message_title_default("Dillo: Message");
564
565 // Create a new UI/bw pair
566 BrowserWindow *bw = a_UIcmd_browser_window_new(0, 0, xid, NULL);
567
568 /* We need this so that fl_text_extents() in dw/fltkplatform.cc can
569 * work when FLTK is configured without XFT and Dillo is opening
570 * immediately-available URLs from the cmdline (e.g. about:splash).
571 */
572 ((Fl_Widget *)bw->ui)->window()->make_current();
573
574 /* Proxy authentication */
576 const char *passwd = a_UIcmd_get_passwd(prefs.http_proxyuser);
577 if (passwd) {
579 } else {
580 MSG_WARN("Not using proxy authentication.\n");
581 }
582 }
583
584 /* Open URLs/files */
585 const bool local = options_got & DILLO_CLI_LOCAL;
586
587 if (idx == argc) {
588 /* No URLs/files on cmdline. Send startup screen */
589 if (dStrAsciiCasecmp(URL_SCHEME(prefs.start_page), "about") == 0 &&
590 strcmp(URL_PATH(prefs.start_page), "blank") == 0)
591 a_UIcmd_open_url(bw, NULL); // NULL URL focuses location
592 else {
595 }
596 } else {
597 for (int i = idx; i < argc; i++) {
598 DilloUrl *start_url = makeStartUrl(argv[i], local);
599
600 if (i > idx) {
602 /* user must prefer tabs */
603 const int focus = 1;
604 a_UIcmd_open_url_nt(bw, start_url, focus);
605 } else {
606 a_UIcmd_open_url_nw(bw, start_url);
607 }
608 } else {
609 a_UIcmd_open_url(bw, start_url);
610 a_UIcmd_set_location_text(bw, URL_STR(start_url));
611 }
612 a_Url_free(start_url);
613 }
614 }
615
616 /* Don't use, as it can be free()'d */
617 bw = NULL;
618
619 while (Fl::wait() > 0) {
620 if (sig_reload) {
621 sig_reload = 0;
623 } else if (sig_exit) {
624 sig_exit = 0;
626 }
627 }
628
629 /*
630 * Memory deallocating routines
631 * (This can be left to the OS, but we'll do it, with a view to test
632 * and fix our memory management)
633 */
644 Keys::free();
645 Paths::free();
648 /* TODO: auth, css */
649
650 //a_Dpi_dillo_exit();
651 MSG("Dillo: normal exit!\n");
652 return 0;
653}
void a_Actions_init(void)
Definition actions.c:48
void a_Auth_init(void)
Initialize the auth module.
Definition auth.c:59
#define MSG(...)
Definition bookmarks.c:46
int main(void)
Definition bookmarks.c:1613
void a_Bw_init(void)
Initialize global data.
Definition bw.c:36
void a_Cache_freeall(void)
Memory deallocator (only called at exit time)
Definition cache.c:1566
void a_Capi_init(void)
Initialize capi&cache data.
Definition capi.c:81
static void parse(FILE *fp)
Parse the keysrc.
Definition keys.cc:412
static void init()
Initialize the bindings list.
Definition keys.cc:166
static void free()
Free data.
Definition keys.cc:187
static void genAboutKeys(void)
Definition keys.cc:435
static char * getOldWorkingDir(void)
Return the initial current working directory in a string.
Definition paths.cc:64
static void init(void)
Changes current working directory to /tmp and creates ~/.dillo if not exists.
Definition paths.cc:31
static FILE * getPrefsFP(const char *rcFile)
Examines the path for "rcFile" and assign its file pointer to "fp".
Definition paths.cc:80
static void free(void)
Free memory.
Definition paths.cc:72
static void init()
Create the user agent style.
static void setAdjustTableMinWidth(bool adjustTableMinWidth)
Definition table.hh:497
static void setStretchabilityFactor(int stretchabilityFactor)
Definition textblock.cc:201
static void setPenaltyHyphen(int penaltyHyphen)
Definition textblock.cc:175
static void setPenaltyEmDashLeft(int penaltyLeftEmDash)
Definition textblock.cc:185
static void setPenaltyHyphen2(int penaltyHyphen2)
Definition textblock.cc:180
static void setPenaltyEmDashRight2(int penaltyRightEmDash2)
Definition textblock.cc:196
static void setPenaltyEmDashRight(int penaltyRightEmDash)
Definition textblock.cc:191
static void setAdjustMinWidth(bool adjustMinWidth)
Definition widget.hh:463
static bool fontExists(const char *name)
static Fl_Font get(const char *name, int attrs)
unsigned int uint_t
Definition d_size.h:20
void a_Dicache_init(void)
Initialize dicache data.
Definition dicache.c:82
void a_Dicache_freeall(void)
Deallocate memory used by dicache module (Call this one at exit time, with no cache clients queued)
Definition dicache.c:600
static void custLabelMeasure(const Fl_Label *o, int &W, int &H)
Definition dillo.cc:293
static volatile sig_atomic_t sig_exit
Definition dillo.cc:72
static void raw_sigchld2(int signum)
Avoid our children (Dpid) to become zombies.
Definition dillo.cc:129
static void est_sigchld(void)
Establish SIGCHLD handler.
Definition dillo.cc:167
static OptID getCmdOption(const CLI_options *options, int argc, char **argv, char **opt_argv, int *idx)
Get next command line option.
Definition dillo.cc:230
static const CLI_options Options[]
Definition dillo.cc:96
static void custLabelDraw(const Fl_Label *o, int X, int Y, int W, int H, Fl_Align align)
Set FL_NORMAL_LABEL to interpret neither symbols (@) nor shortcuts (&), and FL_FREE_LABELTYPE to inte...
Definition dillo.cc:282
static void handler_usr1(int signum)
Definition dillo.cc:154
static DilloUrl * makeStartUrl(char *str, bool local)
Given a command line argument, build a DilloUrl for it.
Definition dillo.cc:386
OptID
Command line options structure.
Definition dillo.cc:77
@ DILLO_CLI_XID
Definition dillo.cc:79
@ DILLO_CLI_LOCAL
Definition dillo.cc:83
@ DILLO_CLI_NONE
Definition dillo.cc:78
@ DILLO_CLI_FULLWINDOW
Definition dillo.cc:80
@ DILLO_CLI_HELP
Definition dillo.cc:81
@ DILLO_CLI_VERSION
Definition dillo.cc:82
@ DILLO_CLI_GEOMETRY
Definition dillo.cc:84
@ DILLO_CLI_ERROR
Definition dillo.cc:85
static void checkPreferredFonts()
Definition dillo.cc:331
static void printHelp(const char *cmdname, const CLI_options *options)
Print help text generated from the options structure.
Definition dillo.cc:201
static void checkFont(const char *name, const char *type)
Tell the user if default/pref fonts can't be found.
Definition dillo.cc:325
static void setUIColorWdef(Fl_Color idx, int32_t color, Fl_Color default_val)
Set UI color.
Definition dillo.cc:344
static volatile sig_atomic_t sig_reload
Definition dillo.cc:71
static void setColors()
Definition dillo.cc:352
static void custMenuLabelMeasure(const Fl_Label *o, int &W, int &H)
Definition dillo.cc:313
static void custMenuLabelDraw(const Fl_Label *o, int X, int Y, int W, int H, Fl_Align align)
Definition dillo.cc:302
static void handler_usr2(int signum)
Definition dillo.cc:159
static int numOptions(const CLI_options *options)
Return the maximum number of option arguments.
Definition dillo.cc:217
char * dStrconcat(const char *s1,...)
Concatenate a NULL-terminated list of strings.
Definition dlib.c:102
void dFree(void *mem)
Definition dlib.c:68
int dStrAsciiCasecmp(const char *s1, const char *s2)
Definition dlib.c:203
void dLib_show_messages(bool_t show)
Definition dlib.c:904
char * dStrdup(const char *s)
Definition dlib.c:77
#define dNew0(type, count)
Definition dlib.h:63
#define TRUE
Definition dlib.h:35
void a_Dns_init(void)
Initializer function.
Definition dns.c:178
void a_Dns_freeall(void)
Dns memory-deallocation.
Definition dns.c:481
void a_Domain_freeall(void)
Definition domain.c:79
void a_Domain_parse(FILE *fp)
Parse domainrc.
Definition domain.c:31
void a_History_freeall(void)
Free all the memory used by this module.
Definition history.c:152
void a_Hsts_freeall(void)
Definition hsts.c:55
void a_Hsts_init(FILE *preload_file)
Definition hsts.c:357
void a_Http_set_proxy_passwd(const char *str)
Activate entered proxy password for HTTP.
Definition http.c:156
int a_Http_init(void)
Initialize proxy vars and Accept-Language header.
Definition http.c:118
void a_Http_freeall(void)
Deallocate memory used by http module.
Definition http.c:1135
int a_Http_proxy_auth(void)
Tell whether the proxy auth is already set (user:password).
Definition http.c:148
#define MSG_WARN(...)
Definition msg.h:26
#define H(x, y, z)
void a_Mime_init(void)
Initializes Mime module and, sets the supported Mime types.
Definition mime.c:97
int a_Misc_parse_geometry(char *str, int *x, int *y, int *w, int *h)
Parse a geometry string.
Definition misc.c:360
char * a_Misc_escape_chars(const char *str, const char *esc_set)
Escape characters as XX sequences.
Definition misc.c:26
void freeall()
Definition core.hh:34
void freeall()
Definition fltkcore.hh:26
#define PATHS_RC_KEYS
Definition paths.hh:16
#define PATHS_RC_PREFS
Definition paths.hh:15
#define PATHS_HSTS_PRELOAD
Definition paths.hh:18
#define PATHS_RC_DOMAIN
Definition paths.hh:17
DilloPrefs prefs
Global Data.
Definition prefs.c:33
void a_Prefs_freeall(void)
memory-deallocation.
Definition prefs.c:145
void a_Prefs_init(void)
Sets the default settings.
Definition prefs.c:39
#define PREFS_GEOMETRY_DEFAULT_XPOS
Definition prefs.h:24
#define PREFS_GEOMETRY_DEFAULT_YPOS
Definition prefs.h:25
#define PREFS_GEOMETRY_DEFAULT_WIDTH
Definition prefs.h:22
#define PREFS_UI_TAB_ACTIVE_BG_COLOR
Definition prefs.h:29
#define PREFS_UI_TAB_ACTIVE_FG_COLOR
Definition prefs.h:30
#define PREFS_UI_TAB_FG_COLOR
Definition prefs.h:32
#define PREFS_UI_TAB_BG_COLOR
Definition prefs.h:31
#define PREFS_UI_BUTTON_HIGHLIGHT_COLOR
Definition prefs.h:28
#define PREFS_GEOMETRY_DEFAULT_HEIGHT
Definition prefs.h:23
void a_Dpi_init(void)
Definition dpi.c:85
void a_Cookies_init(void)
Initialize the cookies module (The 'disabled' variable is writable only within a_Cookies_init)
Definition cookies.c:117
void a_Cookies_freeall(void)
Flush cookies to disk and free all the memory allocated.
Definition cookies.c:135
Contains the specific data for a single window.
Definition bw.h:27
void * ui
Pointer to the UI object this bw belongs to.
Definition bw.h:29
int32_t ui_tab_fg_color
Definition prefs.h:62
char * font_sans_serif
Definition prefs.h:109
char * font_monospace
Definition prefs.h:112
int32_t ui_button_highlight_color
Definition prefs.h:55
char * font_fantasy
Definition prefs.h:111
int penalty_hyphen_2
Definition prefs.h:124
int xpos
Definition prefs.h:40
int32_t ui_tab_active_bg_color
Definition prefs.h:59
bool_t fullwindow_start
Definition prefs.h:98
int width
Definition prefs.h:38
char * http_proxyuser
Definition prefs.h:45
int ypos
Definition prefs.h:41
char * font_serif
Definition prefs.h:108
int32_t ui_selection_color
Definition prefs.h:58
int32_t ui_fg_color
Definition prefs.h:56
int penalty_em_dash_right
Definition prefs.h:125
int32_t ui_tab_active_fg_color
Definition prefs.h:60
int32_t ui_tab_bg_color
Definition prefs.h:61
int32_t ui_text_bg_color
Definition prefs.h:64
int32_t ui_main_bg_color
Definition prefs.h:57
bool_t adjust_table_min_width
Definition prefs.h:73
DilloUrl * start_page
Definition prefs.h:49
bool_t show_ui_tooltip
Definition prefs.h:67
bool_t adjust_min_width
Definition prefs.h:72
int penalty_em_dash_right_2
Definition prefs.h:125
bool_t show_msg
Definition prefs.h:121
int stretchability_factor
Definition prefs.h:126
char * theme
Definition prefs.h:68
char * font_cursive
Definition prefs.h:110
bool_t middle_click_opens_new_tab
Definition prefs.h:114
int height
Definition prefs.h:39
int penalty_hyphen
Definition prefs.h:124
int penalty_em_dash_left
Definition prefs.h:125
Definition url.h:88
void a_Tls_init(void)
Initialize TLS library.
Definition tls.c:47
void a_Tls_freeall(void)
Clean up the TLS library.
Definition tls.c:117
const char * a_UIcmd_get_passwd(const char *user)
Definition uicmd.cc:1261
void a_UIcmd_reload_all_active()
Definition uicmd.cc:942
BrowserWindow * a_UIcmd_browser_window_new(int ww, int wh, uint32_t xid, const void *vbw)
Definition uicmd.cc:569
void a_UIcmd_open_url_nw(BrowserWindow *bw, const DilloUrl *url)
Definition uicmd.cc:846
void a_UIcmd_close_all_bw(void *)
Definition uicmd.cc:724
void a_UIcmd_open_url(BrowserWindow *bw, const DilloUrl *url)
Definition uicmd.cc:811
void a_UIcmd_set_location_text(void *vbw, const char *text)
Definition uicmd.cc:1546
void a_UIcmd_open_url_nt(void *vbw, const DilloUrl *url, int focus)
Definition uicmd.cc:862
void a_UIcmd_init(void)
Definition uicmd.cc:1076
char * a_Url_string_strip_delimiters(const char *str)
RFC-3986 suggests this stripping when "importing" URLs from other media.
Definition url.c:658
void a_Url_set_flags(DilloUrl *u, int flags)
Set DilloUrl flags.
Definition url.c:527
void a_Url_free(DilloUrl *url)
Free a DilloUrl.
Definition url.c:208
DilloUrl * a_Url_new(const char *url_str, const char *base_url)
Transform (and resolve) an URL string into the respective DilloURL.
Definition url.c:371
#define URL_PATH(u)
Definition url.h:72
#define URL_SpamSafe
Definition url.h:40
#define URL_FLAGS(u)
Definition url.h:79
#define URL_STR(u)
Definition url.h:76
#define URL_SCHEME(u)
Definition url.h:70
void a_Version_print_info(void)
Definition version.cc:152
void a_Web_init(void)
Definition web.cc:38