summaryrefslogtreecommitdiff
path: root/desktop/options.h
diff options
context:
space:
mode:
authorVincent Sanders <vince@netsurf-browser.org>2011-02-20 21:04:53 +0000
committerVincent Sanders <vince@netsurf-browser.org>2011-02-20 21:04:53 +0000
commit675a07083acbfd276c4d80fbf5df4d18fb8e5742 (patch)
tree1640f3d772b95090a403d15cf9d9e8633eb6da43 /desktop/options.h
parent2668db202427c2b89d15ef0b91dfe0d173350b4e (diff)
downloadnetsurf-675a07083acbfd276c4d80fbf5df4d18fb8e5742.tar.gz
netsurf-675a07083acbfd276c4d80fbf5df4d18fb8e5742.tar.bz2
add options display to about: scheme
svn path=/trunk/netsurf/; revision=11733
Diffstat (limited to 'desktop/options.h')
-rw-r--r--desktop/options.h48
1 files changed, 45 insertions, 3 deletions
diff --git a/desktop/options.h b/desktop/options.h
index 5231322ad..c75ba18a8 100644
--- a/desktop/options.h
+++ b/desktop/options.h
@@ -36,10 +36,12 @@
#define _NETSURF_DESKTOP_OPTIONS_H_
#include <stdbool.h>
+#include <stdio.h>
#include "desktop/plot_style.h"
-enum { OPTION_HTTP_PROXY_AUTH_NONE = 0, OPTION_HTTP_PROXY_AUTH_BASIC = 1,
- OPTION_HTTP_PROXY_AUTH_NTLM = 2 };
+enum { OPTION_HTTP_PROXY_AUTH_NONE = 0,
+ OPTION_HTTP_PROXY_AUTH_BASIC = 1,
+ OPTION_HTTP_PROXY_AUTH_NTLM = 2 };
extern bool option_http_proxy;
extern char *option_http_proxy_host;
@@ -143,8 +145,48 @@ extern colour option_sys_colour_WindowFrame;
extern colour option_sys_colour_WindowText;
+/**
+ * Read options from a file.
+ *
+ * \param path name of file to read options from
+ *
+ * Option variables corresponding to lines in the file are updated. Missing
+ * options are unchanged. If the file fails to open, options are unchanged.
+ */
void options_read(const char *path);
+
+/**
+ * Save options to a file.
+ *
+ * \param path name of file to write options to
+ *
+ * Errors are ignored.
+ */
void options_write(const char *path);
-void options_dump(void);
+
+/**
+ * Dump user options to stream
+ *
+ * \param outf output stream to dump options to.
+ */
+void options_dump(FILE *outf);
+
+/**
+ * Fill a buffer with an option using a format.
+ *
+ * The format string is copied into the output buffer with the
+ * following replaced:
+ * %k - The options key
+ * %t - The options type
+ * %V - value - HTML type formatting
+ * %v - value - plain formatting
+ *
+ * \param string The buffer in which to place teh results.
+ * \param size The size of the string buffer.
+ * \param option The opaque option number.
+ * \param fmt The format string.
+ * \return The number of bytes written to \a string or -1 on error
+ */
+int snoptionf(char *string, size_t size, unsigned int option, const char *fmt);
#endif