summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2004-01-05 02:10:59 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2004-01-05 02:10:59 +0000
commit62245d13ec60e3c0fc78221f0a8f754f33c2b6a1 (patch)
tree5bbe5b8a63941c2d3b7f71fc53ceedcbc1d92cd6 /utils
parent91e767cdfa11225dd370471892000e107bb06726 (diff)
downloadnetsurf-62245d13ec60e3c0fc78221f0a8f754f33c2b6a1.tar.gz
netsurf-62245d13ec60e3c0fc78221f0a8f754f33c2b6a1.tar.bz2
[project @ 2004-01-05 02:10:59 by jmb]
Add ability to turn off browser features in build. This may be useful when hunting down bugs. svn path=/import/netsurf/; revision=480
Diffstat (limited to 'utils')
-rw-r--r--utils/config.h44
-rw-r--r--utils/utils.c11
2 files changed, 53 insertions, 2 deletions
diff --git a/utils/config.h b/utils/config.h
new file mode 100644
index 000000000..c26ed3f50
--- /dev/null
+++ b/utils/config.h
@@ -0,0 +1,44 @@
+/*
+ * This file is part of NetSurf, http://netsurf.sourceforge.net/
+ * Licensed under the GNU General Public License,
+ * http://www.opensource.org/licenses/gpl-license
+ * Copyright 2003 John M Bell <jmb202@ecs.soton.ac.uk>
+ */
+
+#ifndef _NETSURF_UTILS_CONFIG_H_
+#define _NETSURF_UTILS_CONFIG_H_
+
+/* This file toggles build options on and off.
+ * Simply undefine a symbol to turn the relevant feature off.
+ */
+
+/* Image renderering modules */
+#define WITH_DRAW
+#define WITH_GIF
+#define WITH_JPEG
+#define WITH_PNG
+#define WITH_SPRITE
+
+/* Plugin module */
+#define WITH_PLUGIN
+
+/* Frames */
+#undef WITH_FRAMES
+
+/* HTTP Auth */
+#define WITH_AUTH
+
+/* Cookies */
+#define WITH_COOKIES
+
+/* About page */
+#define WITH_ABOUT
+
+/* Acorn URI protocol support */
+#define WITH_URI
+
+/* ANT URL protocol support */
+#define WITH_URL
+
+#endif
+
diff --git a/utils/utils.c b/utils/utils.c
index 149324f29..c887edc36 100644
--- a/utils/utils.c
+++ b/utils/utils.c
@@ -18,6 +18,7 @@
#include <time.h>
#include "libxml/encoding.h"
#include "libxml/uri.h"
+#include "netsurf/utils/config.h"
#ifdef riscos
#include "netsurf/riscos/about.h"
#include "netsurf/riscos/constdata.h"
@@ -208,15 +209,20 @@ char *url_join(char *rel_url, char *base_url)
* It simplifies the code it the other places too (they just
* call this as usual, then we handle it here).
*/
+#ifdef WITH_ABOUT
if (strcasecmp(rel_url, "about:") == 0) {
about_create();
return xstrdup(ABOUT_URL);
}
+#ifdef WITH_COOKIES
else if (strcasecmp(rel_url, "about:cookies") == 0) {
cookie_create();
return xstrdup(COOKIE_URL);
}
- else if (strcasecmp(rel_url, "help:") == 0) {
+#endif
+ else
+#endif
+ if (strcasecmp(rel_url, "help:") == 0) {
return xstrdup(HELP_URL);
}
else if (strcasecmp(rel_url, "home:") == 0) {
@@ -324,7 +330,7 @@ void regcomp_wrapper(regex_t *preg, const char *regex, int cflags)
* libcurl /really/ should do this for us.
* This gets called every time a window is closed or NetSurf is quit.
*/
-
+#ifdef WITH_COOKIES
void clean_cookiejar(void) {
FILE *fp;
@@ -389,3 +395,4 @@ void clean_cookiejar(void) {
xfree(cookies);
}
+#endif