netsurf: branch master updated. release/3.0-1014-gdb33103
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/db33103fa3d0e7b4623dc...
...commit http://git.netsurf-browser.org/netsurf.git/commit/db33103fa3d0e7b4623dc32...
...tree http://git.netsurf-browser.org/netsurf.git/tree/db33103fa3d0e7b4623dc3217...
The branch, master has been updated
via db33103fa3d0e7b4623dc321792963969e15e683 (commit)
from 829b4fd4546670512f8543c8bc8ed80372566f08 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=db33103fa3d0e7b4623...
commit db33103fa3d0e7b4623dc321792963969e15e683
Author: Vincent Sanders <vince(a)netsurf-browser.org>
Commit: Vincent Sanders <vince(a)netsurf-browser.org>
clean up desktop/gui.h include usage
diff --git a/content/fetchers/resource.c b/content/fetchers/resource.c
index b2791b4..a5c12bb 100644
--- a/content/fetchers/resource.c
+++ b/content/fetchers/resource.c
@@ -41,7 +41,6 @@
#include "content/fetch.h"
#include "content/fetchers/resource.h"
#include "content/urldb.h"
-#include "desktop/gui.h"
#include "desktop/gui_factory.h"
#include "utils/corestrings.h"
#include "utils/nsoption.h"
diff --git a/desktop/browser.c b/desktop/browser.c
index a33c1b6..f46d50e 100644
--- a/desktop/browser.c
+++ b/desktop/browser.c
@@ -45,7 +45,6 @@
#include "desktop/download.h"
#include "desktop/frames.h"
#include "desktop/global_history.h"
-#include "desktop/gui.h"
#include "desktop/gui_factory.h"
#include "desktop/hotlist.h"
#include "desktop/knockout.h"
diff --git a/desktop/browser.h b/desktop/browser.h
index 0ca2e00..d61e6a0 100644
--- a/desktop/browser.h
+++ b/desktop/browser.h
@@ -27,8 +27,8 @@
#include <stdbool.h>
#include "content/content.h"
+#include "content/hlcache.h"
#include "desktop/frame_types.h"
-#include "desktop/gui.h"
#include "desktop/mouse.h"
#include "utils/types.h"
diff --git a/desktop/download.c b/desktop/download.c
index b5427b4..b458f57 100644
--- a/desktop/download.c
+++ b/desktop/download.c
@@ -23,10 +23,10 @@
#include <assert.h>
#include <stdlib.h>
+#include <string.h>
#include "content/llcache.h"
#include "desktop/download.h"
-#include "desktop/gui.h"
#include "desktop/gui_factory.h"
#include "utils/corestrings.h"
#include "utils/http.h"
diff --git a/desktop/frames.c b/desktop/frames.c
index 3f7613f..354c70d 100644
--- a/desktop/frames.c
+++ b/desktop/frames.c
@@ -28,12 +28,12 @@
#include <string.h>
#include <time.h>
#include <math.h>
+
#include "utils/config.h"
#include "content/hlcache.h"
#include "desktop/browser_private.h"
#include "desktop/frames.h"
#include "desktop/local_history.h"
-#include "desktop/gui.h"
#include "desktop/scrollbar.h"
#include "desktop/selection.h"
#include "utils/log.h"
diff --git a/desktop/gui.h b/desktop/gui.h
index da609b1..37066e1 100644
--- a/desktop/gui.h
+++ b/desktop/gui.h
@@ -24,10 +24,13 @@
#define _NETSURF_DESKTOP_GUI_H_
#include <stdbool.h>
+#include <stdlib.h>
-#include "content/hlcache.h"
-#include "desktop/download.h"
+#include "utils/types.h"
#include "utils/errors.h"
+#include "utils/nsurl.h"
+#include "desktop/plot_style.h"
+#include "desktop/mouse.h"
typedef enum {
GUI_SAVE_SOURCE,
@@ -58,6 +61,8 @@ struct gui_download_window;
struct browser_window;
struct form_control;
struct ssl_cert_info;
+struct hlcache_handle;
+struct download_context;
typedef struct nsnsclipboard_styles {
size_t start; /**< Start of run */
@@ -155,7 +160,7 @@ struct gui_window_table {
void (*set_url)(struct gui_window *g, const char *url);
/** set favicon */
- void (*set_icon)(struct gui_window *g, hlcache_handle *icon);
+ void (*set_icon)(struct gui_window *g, struct hlcache_handle *icon);
/**
* Set the status bar of a browser window.
@@ -232,10 +237,10 @@ struct gui_window_table {
/**
* Called when file chooser gadget is activated
*/
- void (*file_gadget_open)(struct gui_window *g, hlcache_handle *hl, struct form_control *gadget);
+ void (*file_gadget_open)(struct gui_window *g, struct hlcache_handle *hl, struct form_control *gadget);
/** object dragged to window*/
- void (*drag_save_object)(struct gui_window *g, hlcache_handle *c, gui_save_type type);
+ void (*drag_save_object)(struct gui_window *g, struct hlcache_handle *c, gui_save_type type);
/** drag selection save */
void (*drag_save_selection)(struct gui_window *g, const char *selection);
@@ -248,7 +253,7 @@ struct gui_window_table {
* function table for download windows
*/
struct gui_download_table {
- struct gui_download_window *(*create)(download_context *ctx, struct gui_window *parent);
+ struct gui_download_window *(*create)(struct download_context *ctx, struct gui_window *parent);
nserror (*data)(struct gui_download_window *dw, const char *data, unsigned int size);
@@ -365,6 +370,31 @@ struct gui_fetch_table {
};
+/**
+ * User interface utf8 characterset conversion routines
+ */
+struct gui_utf8_table {
+ /**
+ * Convert a UTF-8 encoded string into the system local encoding
+ *
+ * \param string The string to convert
+ * \param len The length (in bytes) of the string, or 0
+ * \param result Pointer to location in which to store result
+ * \return An nserror code
+ */
+ nserror (*utf8_to_local)(const char *string, size_t len, char **result);
+
+ /**
+ * Convert a string encoded in the system local encoding to UTF-8
+ *
+ * \param string The string to convert
+ * \param len The length (in bytes) of the string, or 0
+ * \param result Pointer to location in which to store result
+ * \return An nserror code
+ */
+ nserror (*local_to_utf8)(const char *string, size_t len, char **result);
+};
+
/** Graphical user interface browser misc function table
*
* function table implementing GUI interface to miscelaneous browser
@@ -392,7 +422,7 @@ struct gui_browser_table {
* \param ico may be NULL for local calls; then access current
* cache from search_web_ico()
*/
- void (*set_search_ico)(hlcache_handle *ico);
+ void (*set_search_ico)(struct hlcache_handle *ico);
/**
* core has no fetcher for url
@@ -424,7 +454,11 @@ struct gui_browser_table {
*/
struct gui_table {
- /** Browser table */
+ /** Browser table.
+ *
+ * Provides miscellaneous browser functionality. The table
+ * is mandantory and must be provided.
+ */
struct gui_browser_table *browser;
/** Window table */
@@ -438,6 +472,14 @@ struct gui_table {
/** Fetcher table */
struct gui_fetch_table *fetch;
+
+ /** UTF8 table
+ *
+ * Provides for conversion between the gui local character
+ * encoding and utf8. The table optional and may be NULL which
+ * implies the local encoding is utf8.
+ */
+ struct gui_utf8_table *utf8;
};
diff --git a/desktop/gui_factory.c b/desktop/gui_factory.c
index dfe7755..b61fdf0 100644
--- a/desktop/gui_factory.c
+++ b/desktop/gui_factory.c
@@ -16,7 +16,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "desktop/gui.h"
+#include "content/hlcache.h"
+#include "desktop/download.h"
#include "desktop/gui_factory.h"
/** The global GUI interface table */
diff --git a/desktop/local_history.c b/desktop/local_history.c
index d4ecfd3..9829f51 100644
--- a/desktop/local_history.c
+++ b/desktop/local_history.c
@@ -26,12 +26,12 @@
#include <stdlib.h>
#include <string.h>
#include <time.h>
+
#include "content/content.h"
#include "content/hlcache.h"
#include "content/urldb.h"
#include "css/css.h"
#include "desktop/browser.h"
-#include "desktop/gui.h"
#include "desktop/local_history.h"
#include "desktop/plotters.h"
#include "desktop/thumbnail.h"
diff --git a/desktop/search.c b/desktop/search.c
index 3a7c768..4a02f6b 100644
--- a/desktop/search.c
+++ b/desktop/search.c
@@ -29,7 +29,6 @@
#include "content/content.h"
#include "content/hlcache.h"
#include "desktop/browser_private.h"
-#include "desktop/gui.h"
#include "utils/nsoption.h"
#include "desktop/search.h"
#include "desktop/selection.h"
diff --git a/desktop/searchweb.c b/desktop/searchweb.c
index b3f6162..bdcb2ba 100644
--- a/desktop/searchweb.c
+++ b/desktop/searchweb.c
@@ -26,7 +26,6 @@
#include "content/content.h"
#include "content/hlcache.h"
#include "desktop/browser.h"
-#include "desktop/gui.h"
#include "desktop/gui_factory.h"
#include "utils/nsoption.h"
#include "desktop/searchweb.h"
diff --git a/desktop/selection.c b/desktop/selection.c
index 96c7e0c..34292fd 100644
--- a/desktop/selection.c
+++ b/desktop/selection.c
@@ -29,7 +29,6 @@
#include <dom/dom.h>
#include "desktop/browser_private.h"
-#include "desktop/gui.h"
#include "desktop/gui_factory.h"
#include "desktop/mouse.h"
#include "desktop/plotters.h"
diff --git a/desktop/textinput.c b/desktop/textinput.c
index c61b838..fd6ae9f 100644
--- a/desktop/textinput.c
+++ b/desktop/textinput.c
@@ -30,7 +30,6 @@
#include <dom/dom.h>
#include "desktop/browser_private.h"
-#include "desktop/gui.h"
#include "desktop/gui_factory.h"
#include "desktop/mouse.h"
#include "desktop/scrollbar.h"
diff --git a/framebuffer/fetch.c b/framebuffer/fetch.c
index 0c9b90f..f350f36 100644
--- a/framebuffer/fetch.c
+++ b/framebuffer/fetch.c
@@ -22,6 +22,7 @@
#include <stdio.h>
#include <string.h>
+#include <limits.h>
#include "desktop/gui.h"
#include "utils/url.h"
diff --git a/gtk/download.c b/gtk/download.c
index 3d287d4..e49e66e 100644
--- a/gtk/download.c
+++ b/gtk/download.c
@@ -27,10 +27,12 @@
#include "utils/utils.h"
#include "utils/url.h"
#include "utils/messages.h"
+#include "utils/nsoption.h"
+#include "desktop/download.h"
#include "desktop/gui.h"
+
#include "gtk/gui.h"
#include "gtk/scaffolding.h"
-#include "utils/nsoption.h"
#include "gtk/download.h"
#include "gtk/window.h"
#include "gtk/compat.h"
diff --git a/gtk/fetch.c b/gtk/fetch.c
index f4a42b5..0043cd0 100644
--- a/gtk/fetch.c
+++ b/gtk/fetch.c
@@ -20,6 +20,8 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
+#include <ctype.h>
+#include <string.h>
#include "utils/hashtable.h"
#include "utils/url.h"
diff --git a/gtk/scaffolding.h b/gtk/scaffolding.h
index 43eb41b..757da82 100644
--- a/gtk/scaffolding.h
+++ b/gtk/scaffolding.h
@@ -20,9 +20,9 @@
#define NETSURF_GTK_SCAFFOLDING_H 1
#include <gtk/gtk.h>
-//#include <glade/glade.h>
#include <glib.h>
+#include "content/hlcache.h"
#include "desktop/gui.h"
#include "desktop/plotters.h"
#include "gtk/menu.h"
diff --git a/monkey/download.c b/monkey/download.c
index d2e3b4b..721f77d 100644
--- a/monkey/download.c
+++ b/monkey/download.c
@@ -16,11 +16,13 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "desktop/browser.h"
-#include "monkey/browser.h"
+#include <stdio.h>
+
+#include "desktop/gui.h"
+#include "desktop/download.h"
#include "utils/ring.h"
-#include <stdio.h>
+#include "monkey/browser.h"
static uint32_t dwin_ctr = 0;
diff --git a/render/form.c b/render/form.c
index c9d74a1..905401a 100644
--- a/render/form.c
+++ b/render/form.c
@@ -32,12 +32,11 @@
#include <stdio.h>
#include <string.h>
#include <dom/dom.h>
+
#include "content/fetch.h"
#include "content/hlcache.h"
#include "css/css.h"
#include "css/utils.h"
-#include "desktop/browser.h"
-#include "desktop/gui.h"
#include "desktop/mouse.h"
#include "desktop/knockout.h"
#include "desktop/plot_style.h"
diff --git a/render/search.c b/render/search.c
index 895cff0..46ec7d1 100644
--- a/render/search.c
+++ b/render/search.c
@@ -30,7 +30,6 @@
#include "content/content.h"
#include "content/hlcache.h"
-#include "desktop/gui.h"
#include "desktop/selection.h"
#include "render/box.h"
#include "render/html.h"
diff --git a/render/textplain.c b/render/textplain.c
index 5254e6a..b459efc 100644
--- a/render/textplain.c
+++ b/render/textplain.c
@@ -35,7 +35,6 @@
#include "css/css.h"
#include "css/utils.h"
#include "desktop/browser.h"
-#include "desktop/gui.h"
#include "utils/nsoption.h"
#include "desktop/plotters.h"
#include "desktop/search.h"
-----------------------------------------------------------------------
Summary of changes:
content/fetchers/resource.c | 1 -
desktop/browser.c | 1 -
desktop/browser.h | 2 +-
desktop/download.c | 2 +-
desktop/frames.c | 2 +-
desktop/gui.h | 58 +++++++++++++++++++++++++++++++++++++------
desktop/gui_factory.c | 3 +-
desktop/local_history.c | 2 +-
desktop/search.c | 1 -
desktop/searchweb.c | 1 -
desktop/selection.c | 1 -
desktop/textinput.c | 1 -
framebuffer/fetch.c | 1 +
gtk/download.c | 4 ++-
gtk/fetch.c | 2 +
gtk/scaffolding.h | 2 +-
monkey/download.c | 8 +++--
render/form.c | 3 +-
render/search.c | 1 -
render/textplain.c | 1 -
20 files changed, 69 insertions(+), 28 deletions(-)
diff --git a/content/fetchers/resource.c b/content/fetchers/resource.c
index b2791b4..a5c12bb 100644
--- a/content/fetchers/resource.c
+++ b/content/fetchers/resource.c
@@ -41,7 +41,6 @@
#include "content/fetch.h"
#include "content/fetchers/resource.h"
#include "content/urldb.h"
-#include "desktop/gui.h"
#include "desktop/gui_factory.h"
#include "utils/corestrings.h"
#include "utils/nsoption.h"
diff --git a/desktop/browser.c b/desktop/browser.c
index a33c1b6..f46d50e 100644
--- a/desktop/browser.c
+++ b/desktop/browser.c
@@ -45,7 +45,6 @@
#include "desktop/download.h"
#include "desktop/frames.h"
#include "desktop/global_history.h"
-#include "desktop/gui.h"
#include "desktop/gui_factory.h"
#include "desktop/hotlist.h"
#include "desktop/knockout.h"
diff --git a/desktop/browser.h b/desktop/browser.h
index 0ca2e00..d61e6a0 100644
--- a/desktop/browser.h
+++ b/desktop/browser.h
@@ -27,8 +27,8 @@
#include <stdbool.h>
#include "content/content.h"
+#include "content/hlcache.h"
#include "desktop/frame_types.h"
-#include "desktop/gui.h"
#include "desktop/mouse.h"
#include "utils/types.h"
diff --git a/desktop/download.c b/desktop/download.c
index b5427b4..b458f57 100644
--- a/desktop/download.c
+++ b/desktop/download.c
@@ -23,10 +23,10 @@
#include <assert.h>
#include <stdlib.h>
+#include <string.h>
#include "content/llcache.h"
#include "desktop/download.h"
-#include "desktop/gui.h"
#include "desktop/gui_factory.h"
#include "utils/corestrings.h"
#include "utils/http.h"
diff --git a/desktop/frames.c b/desktop/frames.c
index 3f7613f..354c70d 100644
--- a/desktop/frames.c
+++ b/desktop/frames.c
@@ -28,12 +28,12 @@
#include <string.h>
#include <time.h>
#include <math.h>
+
#include "utils/config.h"
#include "content/hlcache.h"
#include "desktop/browser_private.h"
#include "desktop/frames.h"
#include "desktop/local_history.h"
-#include "desktop/gui.h"
#include "desktop/scrollbar.h"
#include "desktop/selection.h"
#include "utils/log.h"
diff --git a/desktop/gui.h b/desktop/gui.h
index da609b1..37066e1 100644
--- a/desktop/gui.h
+++ b/desktop/gui.h
@@ -24,10 +24,13 @@
#define _NETSURF_DESKTOP_GUI_H_
#include <stdbool.h>
+#include <stdlib.h>
-#include "content/hlcache.h"
-#include "desktop/download.h"
+#include "utils/types.h"
#include "utils/errors.h"
+#include "utils/nsurl.h"
+#include "desktop/plot_style.h"
+#include "desktop/mouse.h"
typedef enum {
GUI_SAVE_SOURCE,
@@ -58,6 +61,8 @@ struct gui_download_window;
struct browser_window;
struct form_control;
struct ssl_cert_info;
+struct hlcache_handle;
+struct download_context;
typedef struct nsnsclipboard_styles {
size_t start; /**< Start of run */
@@ -155,7 +160,7 @@ struct gui_window_table {
void (*set_url)(struct gui_window *g, const char *url);
/** set favicon */
- void (*set_icon)(struct gui_window *g, hlcache_handle *icon);
+ void (*set_icon)(struct gui_window *g, struct hlcache_handle *icon);
/**
* Set the status bar of a browser window.
@@ -232,10 +237,10 @@ struct gui_window_table {
/**
* Called when file chooser gadget is activated
*/
- void (*file_gadget_open)(struct gui_window *g, hlcache_handle *hl, struct form_control *gadget);
+ void (*file_gadget_open)(struct gui_window *g, struct hlcache_handle *hl, struct form_control *gadget);
/** object dragged to window*/
- void (*drag_save_object)(struct gui_window *g, hlcache_handle *c, gui_save_type type);
+ void (*drag_save_object)(struct gui_window *g, struct hlcache_handle *c, gui_save_type type);
/** drag selection save */
void (*drag_save_selection)(struct gui_window *g, const char *selection);
@@ -248,7 +253,7 @@ struct gui_window_table {
* function table for download windows
*/
struct gui_download_table {
- struct gui_download_window *(*create)(download_context *ctx, struct gui_window *parent);
+ struct gui_download_window *(*create)(struct download_context *ctx, struct gui_window *parent);
nserror (*data)(struct gui_download_window *dw, const char *data, unsigned int size);
@@ -365,6 +370,31 @@ struct gui_fetch_table {
};
+/**
+ * User interface utf8 characterset conversion routines
+ */
+struct gui_utf8_table {
+ /**
+ * Convert a UTF-8 encoded string into the system local encoding
+ *
+ * \param string The string to convert
+ * \param len The length (in bytes) of the string, or 0
+ * \param result Pointer to location in which to store result
+ * \return An nserror code
+ */
+ nserror (*utf8_to_local)(const char *string, size_t len, char **result);
+
+ /**
+ * Convert a string encoded in the system local encoding to UTF-8
+ *
+ * \param string The string to convert
+ * \param len The length (in bytes) of the string, or 0
+ * \param result Pointer to location in which to store result
+ * \return An nserror code
+ */
+ nserror (*local_to_utf8)(const char *string, size_t len, char **result);
+};
+
/** Graphical user interface browser misc function table
*
* function table implementing GUI interface to miscelaneous browser
@@ -392,7 +422,7 @@ struct gui_browser_table {
* \param ico may be NULL for local calls; then access current
* cache from search_web_ico()
*/
- void (*set_search_ico)(hlcache_handle *ico);
+ void (*set_search_ico)(struct hlcache_handle *ico);
/**
* core has no fetcher for url
@@ -424,7 +454,11 @@ struct gui_browser_table {
*/
struct gui_table {
- /** Browser table */
+ /** Browser table.
+ *
+ * Provides miscellaneous browser functionality. The table
+ * is mandantory and must be provided.
+ */
struct gui_browser_table *browser;
/** Window table */
@@ -438,6 +472,14 @@ struct gui_table {
/** Fetcher table */
struct gui_fetch_table *fetch;
+
+ /** UTF8 table
+ *
+ * Provides for conversion between the gui local character
+ * encoding and utf8. The table optional and may be NULL which
+ * implies the local encoding is utf8.
+ */
+ struct gui_utf8_table *utf8;
};
diff --git a/desktop/gui_factory.c b/desktop/gui_factory.c
index dfe7755..b61fdf0 100644
--- a/desktop/gui_factory.c
+++ b/desktop/gui_factory.c
@@ -16,7 +16,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "desktop/gui.h"
+#include "content/hlcache.h"
+#include "desktop/download.h"
#include "desktop/gui_factory.h"
/** The global GUI interface table */
diff --git a/desktop/local_history.c b/desktop/local_history.c
index d4ecfd3..9829f51 100644
--- a/desktop/local_history.c
+++ b/desktop/local_history.c
@@ -26,12 +26,12 @@
#include <stdlib.h>
#include <string.h>
#include <time.h>
+
#include "content/content.h"
#include "content/hlcache.h"
#include "content/urldb.h"
#include "css/css.h"
#include "desktop/browser.h"
-#include "desktop/gui.h"
#include "desktop/local_history.h"
#include "desktop/plotters.h"
#include "desktop/thumbnail.h"
diff --git a/desktop/search.c b/desktop/search.c
index 3a7c768..4a02f6b 100644
--- a/desktop/search.c
+++ b/desktop/search.c
@@ -29,7 +29,6 @@
#include "content/content.h"
#include "content/hlcache.h"
#include "desktop/browser_private.h"
-#include "desktop/gui.h"
#include "utils/nsoption.h"
#include "desktop/search.h"
#include "desktop/selection.h"
diff --git a/desktop/searchweb.c b/desktop/searchweb.c
index b3f6162..bdcb2ba 100644
--- a/desktop/searchweb.c
+++ b/desktop/searchweb.c
@@ -26,7 +26,6 @@
#include "content/content.h"
#include "content/hlcache.h"
#include "desktop/browser.h"
-#include "desktop/gui.h"
#include "desktop/gui_factory.h"
#include "utils/nsoption.h"
#include "desktop/searchweb.h"
diff --git a/desktop/selection.c b/desktop/selection.c
index 96c7e0c..34292fd 100644
--- a/desktop/selection.c
+++ b/desktop/selection.c
@@ -29,7 +29,6 @@
#include <dom/dom.h>
#include "desktop/browser_private.h"
-#include "desktop/gui.h"
#include "desktop/gui_factory.h"
#include "desktop/mouse.h"
#include "desktop/plotters.h"
diff --git a/desktop/textinput.c b/desktop/textinput.c
index c61b838..fd6ae9f 100644
--- a/desktop/textinput.c
+++ b/desktop/textinput.c
@@ -30,7 +30,6 @@
#include <dom/dom.h>
#include "desktop/browser_private.h"
-#include "desktop/gui.h"
#include "desktop/gui_factory.h"
#include "desktop/mouse.h"
#include "desktop/scrollbar.h"
diff --git a/framebuffer/fetch.c b/framebuffer/fetch.c
index 0c9b90f..f350f36 100644
--- a/framebuffer/fetch.c
+++ b/framebuffer/fetch.c
@@ -22,6 +22,7 @@
#include <stdio.h>
#include <string.h>
+#include <limits.h>
#include "desktop/gui.h"
#include "utils/url.h"
diff --git a/gtk/download.c b/gtk/download.c
index 3d287d4..e49e66e 100644
--- a/gtk/download.c
+++ b/gtk/download.c
@@ -27,10 +27,12 @@
#include "utils/utils.h"
#include "utils/url.h"
#include "utils/messages.h"
+#include "utils/nsoption.h"
+#include "desktop/download.h"
#include "desktop/gui.h"
+
#include "gtk/gui.h"
#include "gtk/scaffolding.h"
-#include "utils/nsoption.h"
#include "gtk/download.h"
#include "gtk/window.h"
#include "gtk/compat.h"
diff --git a/gtk/fetch.c b/gtk/fetch.c
index f4a42b5..0043cd0 100644
--- a/gtk/fetch.c
+++ b/gtk/fetch.c
@@ -20,6 +20,8 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
+#include <ctype.h>
+#include <string.h>
#include "utils/hashtable.h"
#include "utils/url.h"
diff --git a/gtk/scaffolding.h b/gtk/scaffolding.h
index 43eb41b..757da82 100644
--- a/gtk/scaffolding.h
+++ b/gtk/scaffolding.h
@@ -20,9 +20,9 @@
#define NETSURF_GTK_SCAFFOLDING_H 1
#include <gtk/gtk.h>
-//#include <glade/glade.h>
#include <glib.h>
+#include "content/hlcache.h"
#include "desktop/gui.h"
#include "desktop/plotters.h"
#include "gtk/menu.h"
diff --git a/monkey/download.c b/monkey/download.c
index d2e3b4b..721f77d 100644
--- a/monkey/download.c
+++ b/monkey/download.c
@@ -16,11 +16,13 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "desktop/browser.h"
-#include "monkey/browser.h"
+#include <stdio.h>
+
+#include "desktop/gui.h"
+#include "desktop/download.h"
#include "utils/ring.h"
-#include <stdio.h>
+#include "monkey/browser.h"
static uint32_t dwin_ctr = 0;
diff --git a/render/form.c b/render/form.c
index c9d74a1..905401a 100644
--- a/render/form.c
+++ b/render/form.c
@@ -32,12 +32,11 @@
#include <stdio.h>
#include <string.h>
#include <dom/dom.h>
+
#include "content/fetch.h"
#include "content/hlcache.h"
#include "css/css.h"
#include "css/utils.h"
-#include "desktop/browser.h"
-#include "desktop/gui.h"
#include "desktop/mouse.h"
#include "desktop/knockout.h"
#include "desktop/plot_style.h"
diff --git a/render/search.c b/render/search.c
index 895cff0..46ec7d1 100644
--- a/render/search.c
+++ b/render/search.c
@@ -30,7 +30,6 @@
#include "content/content.h"
#include "content/hlcache.h"
-#include "desktop/gui.h"
#include "desktop/selection.h"
#include "render/box.h"
#include "render/html.h"
diff --git a/render/textplain.c b/render/textplain.c
index 5254e6a..b459efc 100644
--- a/render/textplain.c
+++ b/render/textplain.c
@@ -35,7 +35,6 @@
#include "css/css.h"
#include "css/utils.h"
#include "desktop/browser.h"
-#include "desktop/gui.h"
#include "utils/nsoption.h"
#include "desktop/plotters.h"
#include "desktop/search.h"
--
NetSurf Browser
9 years
netsurf: branch stevef/menus updated. release/3.0-1014-g0114cc8
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/0114cc825d8a23ff99ce3...
...commit http://git.netsurf-browser.org/netsurf.git/commit/0114cc825d8a23ff99ce3a6...
...tree http://git.netsurf-browser.org/netsurf.git/tree/0114cc825d8a23ff99ce3a667...
The branch, stevef/menus has been updated
via 0114cc825d8a23ff99ce3a667aebc0ed21b0339f (commit)
via 829b4fd4546670512f8543c8bc8ed80372566f08 (commit)
via 0d2a3618f193d63cc18f098e6490df670f6609ef (commit)
via ab2f5ccb4bf4670f9e943ae739a9afcafca9b108 (commit)
from 849bb5911c6add45c2d46f98bf501f843808571f (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=0114cc825d8a23ff99c...
commit 0114cc825d8a23ff99ce3a667aebc0ed21b0339f
Author: Steve Fryatt <stevef(a)netsurf-browser.org>
Commit: Steve Fryatt <stevef(a)netsurf-browser.org>
Provide a dedicated interface for destroying open menus.
Add ro_gui_menu_destroy(), so that this specific task does not share the same code as the more general task of tidying up after menus have been closed by other means.
The original ro_gui_menu_closed() now simply cleans up from a known (or assumed) closure, without forcing a closure itself.
diff --git a/riscos/menus.c b/riscos/menus.c
index 91232a1..d8e2f2c 100644
--- a/riscos/menus.c
+++ b/riscos/menus.c
@@ -77,7 +77,7 @@ struct menu_definition {
struct menu_definition *next; /**< next menu */
};
-
+static void ro_gui_menu_closed(void);
static void ro_gui_menu_define_menu_add(struct menu_definition *definition,
const struct ns_menu *menu, int depth,
wimp_menu_entry *parent_entry,
@@ -213,6 +213,7 @@ void ro_gui_menu_init(void)
* \param y The y position.
* \param w The window that the menu belongs to.
*/
+
void ro_gui_menu_create(wimp_menu *menu, int x, int y, wimp_w w)
{
os_error *error;
@@ -252,6 +253,7 @@ void ro_gui_menu_create(wimp_menu *menu, int x, int y, wimp_w w)
* \param w window handle
* \param i icon handle
*/
+
void ro_gui_popup_menu(wimp_menu *menu, wimp_w w, wimp_i i)
{
wimp_window_state state;
@@ -286,29 +288,24 @@ void ro_gui_popup_menu(wimp_menu *menu, wimp_w w, wimp_i i)
/**
- * Clean up after a menu has been closed, or forcible close an open menu.
- */
-void ro_gui_menu_closed(void)
+ * Forcibly close any menu or transient dialogue box that is currently open.
+ */
+
+void ro_gui_menu_destroy(void)
{
os_error *error;
- if (current_menu) {
- error = xwimp_create_menu(wimp_CLOSE_MENU, 0, 0);
- if (error) {
- LOG(("xwimp_create_menu: 0x%x: %s",
- error->errnum, error->errmess));
- warn_user("MenuError", error->errmess);
- }
-
- ro_gui_wimp_event_menus_closed(current_menu_window,
- current_menu_icon, current_menu);
+ if (current_menu == NULL)
+ return;
- current_menu = NULL;
+ error = xwimp_create_menu(wimp_CLOSE_MENU, 0, 0);
+ if (error) {
+ LOG(("xwimp_create_menu: 0x%x: %s",
+ error->errnum, error->errmess));
+ warn_user("MenuError", error->errmess);
}
- current_menu_window = NULL;
- current_menu_icon = 0;
- current_menu_open = false;
+ ro_gui_menu_closed();
}
@@ -450,15 +447,25 @@ void ro_gui_menu_warning(wimp_message_menu_warning *warning)
void ro_gui_menu_message_deleted(wimp_message_menus_deleted *deleted)
{
- if (deleted != NULL && deleted->menu == current_menu) {
+ if (deleted != NULL && deleted->menu == current_menu)
+ ro_gui_menu_closed();
+}
+
+
+/**
+ * Clean up after a menu has been closed, or forcibly close an open menu.
+ */
+
+static void ro_gui_menu_closed(void)
+{
+ if (current_menu != NULL)
ro_gui_wimp_event_menus_closed(current_menu_window,
current_menu_icon, current_menu);
- current_menu = NULL;
- current_menu_window = NULL;
- current_menu_icon = 0;
- current_menu_open = false;
- }
+ current_menu = NULL;
+ current_menu_window = NULL;
+ current_menu_icon = 0;
+ current_menu_open = false;
}
diff --git a/riscos/menus.h b/riscos/menus.h
index e2269b7..f49215f 100644
--- a/riscos/menus.h
+++ b/riscos/menus.h
@@ -168,7 +168,7 @@ struct ns_menu {
void ro_gui_menu_init(void);
void ro_gui_menu_create(wimp_menu* menu, int x, int y, wimp_w w);
-void ro_gui_menu_closed(void);
+void ro_gui_menu_destroy(void);
void ro_gui_popup_menu(wimp_menu *menu, wimp_w w, wimp_i i);
void ro_gui_menu_window_changed(wimp_w from, wimp_w to);
void ro_gui_menu_selection(wimp_selection* selection);
diff --git a/riscos/print.c b/riscos/print.c
index 09d4aae..c539f01 100644
--- a/riscos/print.c
+++ b/riscos/print.c
@@ -525,7 +525,7 @@ void ro_print_cleanup(void)
print_text_black = false;
print_prev_message = 0;
print_max_sheets = -1;
- ro_gui_menu_closed();
+ ro_gui_menu_destroy();
ro_gui_dialog_close(dialog_print);
}
diff --git a/riscos/wimp_event.c b/riscos/wimp_event.c
index a84c016..d048b9a 100644
--- a/riscos/wimp_event.c
+++ b/riscos/wimp_event.c
@@ -719,7 +719,7 @@ bool ro_gui_wimp_event_mouse_click(wimp_pointer *pointer)
}
ro_gui_dialog_add_persistent(current_menu_window,
pointer->w);
- ro_gui_menu_closed();
+ ro_gui_menu_destroy();
error = xwimp_open_window(PTR_WIMP_OPEN(&open));
if (error) {
LOG(("xwimp_open_window: 0x%x: %s",
@@ -768,7 +768,7 @@ bool ro_gui_wimp_event_mouse_click(wimp_pointer *pointer)
if (pointer->buttons & wimp_CLICK_SELECT) {
ro_gui_dialog_close(pointer->w);
ro_gui_wimp_event_close_window(pointer->w);
- ro_gui_menu_closed();
+ ro_gui_menu_destroy();
} else {
ro_gui_wimp_event_restore(pointer->w);
}
@@ -850,7 +850,7 @@ void ro_gui_wimp_event_ok_click(struct event_window *window,
if (state & wimp_CLICK_SELECT) {
ro_gui_dialog_close(window->w);
ro_gui_wimp_event_close_window(window->w);
- ro_gui_menu_closed();
+ ro_gui_menu_destroy();
} else {
ro_gui_wimp_event_memorise(window->w);
}
@@ -1045,7 +1045,7 @@ bool ro_gui_wimp_event_keypress(wimp_key *key)
return false;
ro_gui_dialog_close(key->w);
ro_gui_wimp_event_close_window(key->w);
- ro_gui_menu_closed();
+ ro_gui_menu_destroy();
return true;
/* Return performs the OK action */
case wimp_KEY_RETURN:
@@ -1772,7 +1772,7 @@ bool ro_gui_wimp_event_submenu_warning(wimp_w w, wimp_i i, wimp_menu *menu,
}
/**
- * Handle menus being closed. This is called from ro_gui_menu_closed(), in
+ * Handle menus being closed. This is called from the menus modules, in
* every scenario when one of our own menus is open.
*
* \param w the window to owning the menu
diff --git a/riscos/window.c b/riscos/window.c
index 1f70d3d..b7146eb 100644
--- a/riscos/window.c
+++ b/riscos/window.c
@@ -653,7 +653,7 @@ static void gui_window_destroy(struct gui_window *g)
ro_gui_url_complete_close();
ro_gui_dialog_close_persistent(w);
if (current_menu_window == w)
- ro_gui_menu_closed();
+ ro_gui_menu_destroy();
ro_gui_window_remove_update_boxes(g);
/* delete window */
@@ -1393,7 +1393,7 @@ void gui_create_form_select_menu(struct browser_window *bw,
LOG(("xwimp_get_pointer_info: 0x%x: %s",
error->errnum, error->errmess));
warn_user("WimpError", error->errmess);
- ro_gui_menu_closed();
+ ro_gui_menu_destroy();
return;
}
@@ -4810,7 +4810,7 @@ bool ro_gui_window_prepare_form_select_menu(struct browser_window *bw,
option = option->next)
entries++;
if (entries == 0) {
- ro_gui_menu_closed();
+ ro_gui_menu_destroy();
return false;
}
@@ -4834,7 +4834,7 @@ bool ro_gui_window_prepare_form_select_menu(struct browser_window *bw,
gui_form_select_menu = malloc(wimp_SIZEOF_MENU(entries));
if (!gui_form_select_menu) {
warn_user("NoMemory", 0);
- ro_gui_menu_closed();
+ ro_gui_menu_destroy();
return false;
}
err = utf8_to_local_encoding(messages_get("SelectMenu"), 0,
@@ -4844,7 +4844,7 @@ bool ro_gui_window_prepare_form_select_menu(struct browser_window *bw,
assert(err != NSERROR_BAD_ENCODING);
LOG(("utf8_to_local_encoding failed"));
warn_user("NoMemory", 0);
- ro_gui_menu_closed();
+ ro_gui_menu_destroy();
return false;
}
gui_form_select_menu->title_data.indirected_text.text =
@@ -4869,7 +4869,7 @@ bool ro_gui_window_prepare_form_select_menu(struct browser_window *bw,
if (!temp) {
LOG(("cnv_space2nbsp failed"));
warn_user("NoMemory", 0);
- ro_gui_menu_closed();
+ ro_gui_menu_destroy();
return false;
}
@@ -4881,7 +4881,7 @@ bool ro_gui_window_prepare_form_select_menu(struct browser_window *bw,
assert(err != NSERROR_BAD_ENCODING);
LOG(("utf8_to_enc failed"));
warn_user("NoMemory", 0);
- ro_gui_menu_closed();
+ ro_gui_menu_destroy();
return false;
}
-----------------------------------------------------------------------
Summary of changes:
Docs/env.sh | 15 +++++++++++++-
riscos/menus.c | 55 ++++++++++++++++++++++++++++----------------------
riscos/menus.h | 2 +-
riscos/print.c | 2 +-
riscos/wimp_event.c | 10 ++++----
riscos/window.c | 14 ++++++------
6 files changed, 59 insertions(+), 39 deletions(-)
diff --git a/Docs/env.sh b/Docs/env.sh
index 7b5aedd..b1b2b34 100644
--- a/Docs/env.sh
+++ b/Docs/env.sh
@@ -22,7 +22,7 @@ if [ "x${TARGET_WORKSPACE}" = "x" ]; then
fi
if [ "x${USE_CPUS}" = "x" ]; then
- NCPUS=$(grep -c "^processor" /proc/cpuinfo 2>/dev/null)
+ NCPUS=$(getconf _NPROCESSORS_ONLN 2>/dev/null || getconf NPROCESSORS_ONLN 2>/dev/null)
NCPUS="${NCPUS:-1}"
NCPUS=$((NCPUS * 2))
USE_CPUS="-j${NCPUS}"
@@ -55,6 +55,13 @@ NS_DEV_DEB="build-essential pkg-config git gperf"
NS_TOOL_DEB="flex bison libhtml-parser-perl"
NS_GTK_DEB="libgtk2.0-dev libcurl3-dev libpng-dev librsvg2-dev libjpeg-dev libmozjs185-dev"
+# Haiku secondary arch suffix:
+# empty for primary (gcc2 on x86),
+# "_x86" for gcc4 secondary.
+HA=
+# Haiku packages
+NS_DEV_HPKG="curl${HA}_devel libpng${HA}_devel jpeg${HA}_devel openssl${HA}_devel libiconv${HA}_devel expat${HA}_devel pkgconfig${HA} html_parser cmd:getconf"
+
#add target specific libraries
if [ "x${TARGET_ABI}" = "xriscos" ]; then
NS_FRONTEND_LIBS="${NS_FRONTEND_LIBS} ${NS_RISCOS_LIBS}"
@@ -66,6 +73,12 @@ ns-apt-get-install()
sudo apt-get install $(echo ${NS_DEV_DEB} ${NS_TOOL_DEB} ${NS_GTK_DEB})
}
+# pkgman commandline to install necessary dev packages
+ns-pkgman-install()
+{
+ pkgman install $(echo ${NS_DEV_HPKG})
+}
+
# git pull in all repos parameters are passed to git pull
ns-pull()
{
diff --git a/riscos/menus.c b/riscos/menus.c
index 91232a1..d8e2f2c 100644
--- a/riscos/menus.c
+++ b/riscos/menus.c
@@ -77,7 +77,7 @@ struct menu_definition {
struct menu_definition *next; /**< next menu */
};
-
+static void ro_gui_menu_closed(void);
static void ro_gui_menu_define_menu_add(struct menu_definition *definition,
const struct ns_menu *menu, int depth,
wimp_menu_entry *parent_entry,
@@ -213,6 +213,7 @@ void ro_gui_menu_init(void)
* \param y The y position.
* \param w The window that the menu belongs to.
*/
+
void ro_gui_menu_create(wimp_menu *menu, int x, int y, wimp_w w)
{
os_error *error;
@@ -252,6 +253,7 @@ void ro_gui_menu_create(wimp_menu *menu, int x, int y, wimp_w w)
* \param w window handle
* \param i icon handle
*/
+
void ro_gui_popup_menu(wimp_menu *menu, wimp_w w, wimp_i i)
{
wimp_window_state state;
@@ -286,29 +288,24 @@ void ro_gui_popup_menu(wimp_menu *menu, wimp_w w, wimp_i i)
/**
- * Clean up after a menu has been closed, or forcible close an open menu.
- */
-void ro_gui_menu_closed(void)
+ * Forcibly close any menu or transient dialogue box that is currently open.
+ */
+
+void ro_gui_menu_destroy(void)
{
os_error *error;
- if (current_menu) {
- error = xwimp_create_menu(wimp_CLOSE_MENU, 0, 0);
- if (error) {
- LOG(("xwimp_create_menu: 0x%x: %s",
- error->errnum, error->errmess));
- warn_user("MenuError", error->errmess);
- }
-
- ro_gui_wimp_event_menus_closed(current_menu_window,
- current_menu_icon, current_menu);
+ if (current_menu == NULL)
+ return;
- current_menu = NULL;
+ error = xwimp_create_menu(wimp_CLOSE_MENU, 0, 0);
+ if (error) {
+ LOG(("xwimp_create_menu: 0x%x: %s",
+ error->errnum, error->errmess));
+ warn_user("MenuError", error->errmess);
}
- current_menu_window = NULL;
- current_menu_icon = 0;
- current_menu_open = false;
+ ro_gui_menu_closed();
}
@@ -450,15 +447,25 @@ void ro_gui_menu_warning(wimp_message_menu_warning *warning)
void ro_gui_menu_message_deleted(wimp_message_menus_deleted *deleted)
{
- if (deleted != NULL && deleted->menu == current_menu) {
+ if (deleted != NULL && deleted->menu == current_menu)
+ ro_gui_menu_closed();
+}
+
+
+/**
+ * Clean up after a menu has been closed, or forcibly close an open menu.
+ */
+
+static void ro_gui_menu_closed(void)
+{
+ if (current_menu != NULL)
ro_gui_wimp_event_menus_closed(current_menu_window,
current_menu_icon, current_menu);
- current_menu = NULL;
- current_menu_window = NULL;
- current_menu_icon = 0;
- current_menu_open = false;
- }
+ current_menu = NULL;
+ current_menu_window = NULL;
+ current_menu_icon = 0;
+ current_menu_open = false;
}
diff --git a/riscos/menus.h b/riscos/menus.h
index e2269b7..f49215f 100644
--- a/riscos/menus.h
+++ b/riscos/menus.h
@@ -168,7 +168,7 @@ struct ns_menu {
void ro_gui_menu_init(void);
void ro_gui_menu_create(wimp_menu* menu, int x, int y, wimp_w w);
-void ro_gui_menu_closed(void);
+void ro_gui_menu_destroy(void);
void ro_gui_popup_menu(wimp_menu *menu, wimp_w w, wimp_i i);
void ro_gui_menu_window_changed(wimp_w from, wimp_w to);
void ro_gui_menu_selection(wimp_selection* selection);
diff --git a/riscos/print.c b/riscos/print.c
index 09d4aae..c539f01 100644
--- a/riscos/print.c
+++ b/riscos/print.c
@@ -525,7 +525,7 @@ void ro_print_cleanup(void)
print_text_black = false;
print_prev_message = 0;
print_max_sheets = -1;
- ro_gui_menu_closed();
+ ro_gui_menu_destroy();
ro_gui_dialog_close(dialog_print);
}
diff --git a/riscos/wimp_event.c b/riscos/wimp_event.c
index a84c016..d048b9a 100644
--- a/riscos/wimp_event.c
+++ b/riscos/wimp_event.c
@@ -719,7 +719,7 @@ bool ro_gui_wimp_event_mouse_click(wimp_pointer *pointer)
}
ro_gui_dialog_add_persistent(current_menu_window,
pointer->w);
- ro_gui_menu_closed();
+ ro_gui_menu_destroy();
error = xwimp_open_window(PTR_WIMP_OPEN(&open));
if (error) {
LOG(("xwimp_open_window: 0x%x: %s",
@@ -768,7 +768,7 @@ bool ro_gui_wimp_event_mouse_click(wimp_pointer *pointer)
if (pointer->buttons & wimp_CLICK_SELECT) {
ro_gui_dialog_close(pointer->w);
ro_gui_wimp_event_close_window(pointer->w);
- ro_gui_menu_closed();
+ ro_gui_menu_destroy();
} else {
ro_gui_wimp_event_restore(pointer->w);
}
@@ -850,7 +850,7 @@ void ro_gui_wimp_event_ok_click(struct event_window *window,
if (state & wimp_CLICK_SELECT) {
ro_gui_dialog_close(window->w);
ro_gui_wimp_event_close_window(window->w);
- ro_gui_menu_closed();
+ ro_gui_menu_destroy();
} else {
ro_gui_wimp_event_memorise(window->w);
}
@@ -1045,7 +1045,7 @@ bool ro_gui_wimp_event_keypress(wimp_key *key)
return false;
ro_gui_dialog_close(key->w);
ro_gui_wimp_event_close_window(key->w);
- ro_gui_menu_closed();
+ ro_gui_menu_destroy();
return true;
/* Return performs the OK action */
case wimp_KEY_RETURN:
@@ -1772,7 +1772,7 @@ bool ro_gui_wimp_event_submenu_warning(wimp_w w, wimp_i i, wimp_menu *menu,
}
/**
- * Handle menus being closed. This is called from ro_gui_menu_closed(), in
+ * Handle menus being closed. This is called from the menus modules, in
* every scenario when one of our own menus is open.
*
* \param w the window to owning the menu
diff --git a/riscos/window.c b/riscos/window.c
index 1f70d3d..b7146eb 100644
--- a/riscos/window.c
+++ b/riscos/window.c
@@ -653,7 +653,7 @@ static void gui_window_destroy(struct gui_window *g)
ro_gui_url_complete_close();
ro_gui_dialog_close_persistent(w);
if (current_menu_window == w)
- ro_gui_menu_closed();
+ ro_gui_menu_destroy();
ro_gui_window_remove_update_boxes(g);
/* delete window */
@@ -1393,7 +1393,7 @@ void gui_create_form_select_menu(struct browser_window *bw,
LOG(("xwimp_get_pointer_info: 0x%x: %s",
error->errnum, error->errmess));
warn_user("WimpError", error->errmess);
- ro_gui_menu_closed();
+ ro_gui_menu_destroy();
return;
}
@@ -4810,7 +4810,7 @@ bool ro_gui_window_prepare_form_select_menu(struct browser_window *bw,
option = option->next)
entries++;
if (entries == 0) {
- ro_gui_menu_closed();
+ ro_gui_menu_destroy();
return false;
}
@@ -4834,7 +4834,7 @@ bool ro_gui_window_prepare_form_select_menu(struct browser_window *bw,
gui_form_select_menu = malloc(wimp_SIZEOF_MENU(entries));
if (!gui_form_select_menu) {
warn_user("NoMemory", 0);
- ro_gui_menu_closed();
+ ro_gui_menu_destroy();
return false;
}
err = utf8_to_local_encoding(messages_get("SelectMenu"), 0,
@@ -4844,7 +4844,7 @@ bool ro_gui_window_prepare_form_select_menu(struct browser_window *bw,
assert(err != NSERROR_BAD_ENCODING);
LOG(("utf8_to_local_encoding failed"));
warn_user("NoMemory", 0);
- ro_gui_menu_closed();
+ ro_gui_menu_destroy();
return false;
}
gui_form_select_menu->title_data.indirected_text.text =
@@ -4869,7 +4869,7 @@ bool ro_gui_window_prepare_form_select_menu(struct browser_window *bw,
if (!temp) {
LOG(("cnv_space2nbsp failed"));
warn_user("NoMemory", 0);
- ro_gui_menu_closed();
+ ro_gui_menu_destroy();
return false;
}
@@ -4881,7 +4881,7 @@ bool ro_gui_window_prepare_form_select_menu(struct browser_window *bw,
assert(err != NSERROR_BAD_ENCODING);
LOG(("utf8_to_enc failed"));
warn_user("NoMemory", 0);
- ro_gui_menu_closed();
+ ro_gui_menu_destroy();
return false;
}
--
NetSurf Browser
9 years
netsurf-website: branch master updated. 4ab917c38fde28680c48d7b2d846e55817cf1068
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf-website.git/shortlog/4ab917c38fde2...
...commit http://git.netsurf-browser.org/netsurf-website.git/commit/4ab917c38fde286...
...tree http://git.netsurf-browser.org/netsurf-website.git/tree/4ab917c38fde28680...
The branch, master has been updated
via 4ab917c38fde28680c48d7b2d846e55817cf1068 (commit)
from 97d90cf84fc357db6b293a87ddd22d944bd28ca2 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf-website.git/commit/?id=4ab917c38fd...
commit 4ab917c38fde28680c48d7b2d846e55817cf1068
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
Update news.
diff --git a/about/news.en b/about/news.en
index c548ffb..fd03a3c 100644
--- a/about/news.en
+++ b/about/news.en
@@ -58,6 +58,8 @@
<h1>News</h1>
<dl class="news">
+<dt><a href="http://vincentsanders.blogspot.co.uk/2014/01/netsurf-developer-workshop-r...">NetSurf developer workshop report</a> <span>06 Jan 2014</span></dt>
+<dd>The NetSurf core developers gathered in Cambridge at the start of the year, and managed to do a considerable amount of work across various areas of the project. See the <a href="http://vincentsanders.blogspot.co.uk/2014/01/netsurf-developer-workshop-r...">developer workshop report</a> for more details. Thanks to <a href="http://www.collabora.com/">Collabora</a> for hosting the event.</dd>
<dt><a href="http://bugs.netsurf-browser.org/">New bug report system launched</a> <span>17 Dec 2013</span></dt>
<dd>We have created a new bug reporting system and transferred most of the existing reports from the old SourceForge powered bug tracker. Let us know if you have any trouble with the new system. The NetSurf project no longer uses SourceForge, and any issues raised there will go unseen.</dd>
<dt><a href="http://vlists.pepperfish.net/pipermail/netsurf-dev-netsurf-browser.org/20...">LibCSS selection performance boost</a> <span>02 Dec 2013</span></dt>
diff --git a/index.en b/index.en
index 9913a7d..1a55aee 100644
--- a/index.en
+++ b/index.en
@@ -147,12 +147,12 @@
<h2 id="news">Latest news</h2>
<dl class="frontnews">
+<dt><a href="http://vincentsanders.blogspot.co.uk/2014/01/netsurf-developer-workshop-r...">NetSurf developer workshop report</a> <span>06 Jan 2014</span></dt>
+<dd>The NetSurf core developers gathered in Cambridge at the start of the year, and managed to do a considerable amount of work across various areas of the project. See the <a href="http://vincentsanders.blogspot.co.uk/2014/01/netsurf-developer-workshop-r...">developer workshop report</a> for more details. Thanks to <a href="http://www.collabora.com/">Collabora</a> for hosting the event.</dd>
<dt><a href="http://bugs.netsurf-browser.org/">New bug report system launched</a> <span>17 Dec 2013</span></dt>
<dd>We have created a new bug reporting system and transferred most of the existing reports from the old SourceForge powered bug tracker. Let us know if you have any trouble with the new system. The NetSurf project no longer uses SourceForge, and any issues raised there will go unseen.</dd>
<dt><a href="http://vlists.pepperfish.net/pipermail/netsurf-dev-netsurf-browser.org/20...">LibCSS performance boost</a> <span>02 Dec 2013</span></dt>
<dd>A significant optimisation has been made to LibCSS's selection engine performance. This is the code that works out which CSS rules apply to DOM elements, and calculates their computed styles. Recent <a href="http://ci.netsurf-browser.org/builds/">development builds</a> of NetSurf include this improvement.</dd>
-<dt><a href="http://vincentsanders.blogspot.co.uk/2013/11/error-analysis-is-sweet-spot...">Static analysis of NetSurf's codebase</a> <span>22 Nov 2013</span></dt>
-<dd>NetSurf and several of our libraries have recently been added to the <a href="https://scan.coverity.com/">Coverity Scan</a> service for open-source projects. It has enabled us to identify and fix quite a few bugs over a very short period. We also have the Clang static analyser set up as part of our <a href="http://ci.netsurf-browser.org/">CI system</a>. For more information on the utilisation of static analysis by the NetSurf project, take a look at <a href="http://vincentsanders.blogspot.co.uk/2013/11/error-analysis-is-sweet-spot...">this article</a>.</dd>
</dl>
<p class="more"><a href="/about/news" class="seemore">See more news</a></p>
-----------------------------------------------------------------------
Summary of changes:
about/news.en | 2 ++
index.en | 4 ++--
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/about/news.en b/about/news.en
index c548ffb..fd03a3c 100644
--- a/about/news.en
+++ b/about/news.en
@@ -58,6 +58,8 @@
<h1>News</h1>
<dl class="news">
+<dt><a href="http://vincentsanders.blogspot.co.uk/2014/01/netsurf-developer-workshop-r...">NetSurf developer workshop report</a> <span>06 Jan 2014</span></dt>
+<dd>The NetSurf core developers gathered in Cambridge at the start of the year, and managed to do a considerable amount of work across various areas of the project. See the <a href="http://vincentsanders.blogspot.co.uk/2014/01/netsurf-developer-workshop-r...">developer workshop report</a> for more details. Thanks to <a href="http://www.collabora.com/">Collabora</a> for hosting the event.</dd>
<dt><a href="http://bugs.netsurf-browser.org/">New bug report system launched</a> <span>17 Dec 2013</span></dt>
<dd>We have created a new bug reporting system and transferred most of the existing reports from the old SourceForge powered bug tracker. Let us know if you have any trouble with the new system. The NetSurf project no longer uses SourceForge, and any issues raised there will go unseen.</dd>
<dt><a href="http://vlists.pepperfish.net/pipermail/netsurf-dev-netsurf-browser.org/20...">LibCSS selection performance boost</a> <span>02 Dec 2013</span></dt>
diff --git a/index.en b/index.en
index 9913a7d..1a55aee 100644
--- a/index.en
+++ b/index.en
@@ -147,12 +147,12 @@
<h2 id="news">Latest news</h2>
<dl class="frontnews">
+<dt><a href="http://vincentsanders.blogspot.co.uk/2014/01/netsurf-developer-workshop-r...">NetSurf developer workshop report</a> <span>06 Jan 2014</span></dt>
+<dd>The NetSurf core developers gathered in Cambridge at the start of the year, and managed to do a considerable amount of work across various areas of the project. See the <a href="http://vincentsanders.blogspot.co.uk/2014/01/netsurf-developer-workshop-r...">developer workshop report</a> for more details. Thanks to <a href="http://www.collabora.com/">Collabora</a> for hosting the event.</dd>
<dt><a href="http://bugs.netsurf-browser.org/">New bug report system launched</a> <span>17 Dec 2013</span></dt>
<dd>We have created a new bug reporting system and transferred most of the existing reports from the old SourceForge powered bug tracker. Let us know if you have any trouble with the new system. The NetSurf project no longer uses SourceForge, and any issues raised there will go unseen.</dd>
<dt><a href="http://vlists.pepperfish.net/pipermail/netsurf-dev-netsurf-browser.org/20...">LibCSS performance boost</a> <span>02 Dec 2013</span></dt>
<dd>A significant optimisation has been made to LibCSS's selection engine performance. This is the code that works out which CSS rules apply to DOM elements, and calculates their computed styles. Recent <a href="http://ci.netsurf-browser.org/builds/">development builds</a> of NetSurf include this improvement.</dd>
-<dt><a href="http://vincentsanders.blogspot.co.uk/2013/11/error-analysis-is-sweet-spot...">Static analysis of NetSurf's codebase</a> <span>22 Nov 2013</span></dt>
-<dd>NetSurf and several of our libraries have recently been added to the <a href="https://scan.coverity.com/">Coverity Scan</a> service for open-source projects. It has enabled us to identify and fix quite a few bugs over a very short period. We also have the Clang static analyser set up as part of our <a href="http://ci.netsurf-browser.org/">CI system</a>. For more information on the utilisation of static analysis by the NetSurf project, take a look at <a href="http://vincentsanders.blogspot.co.uk/2013/11/error-analysis-is-sweet-spot...">this article</a>.</dd>
</dl>
<p class="more"><a href="/about/news" class="seemore">See more news</a></p>
--
NetSurf website source for *.netsurf-browser.org
9 years
netsurf-website: branch master updated. 97d90cf84fc357db6b293a87ddd22d944bd28ca2
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf-website.git/shortlog/97d90cf84fc35...
...commit http://git.netsurf-browser.org/netsurf-website.git/commit/97d90cf84fc357d...
...tree http://git.netsurf-browser.org/netsurf-website.git/tree/97d90cf84fc357db6...
The branch, master has been updated
via 97d90cf84fc357db6b293a87ddd22d944bd28ca2 (commit)
via 361bf854b161f7eff01cd5b8767da7434820d5e6 (commit)
from c05765b22f0371963f95ac98236f8fa424d438ef (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf-website.git/commit/?id=97d90cf84fc...
commit 97d90cf84fc357db6b293a87ddd22d944bd28ca2
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
Update.
diff --git a/about/team.en b/about/team.en
index 259c490..7685fdb 100644
--- a/about/team.en
+++ b/about/team.en
@@ -57,13 +57,6 @@
<h1>The NetSurf Developers</h1>
-<h2>James Bursa</h2>
-
-<ul>
-<li>First check in: 22 April 2002</li>
-<li>IRC name: zamez</li>
-</ul>
-
<h2>John-Mark Bell</h2>
<p>John-Mark spends most of his time avoiding the layout engine, as he thinks that overexposure to it will result in the early onset of dementia. Over the years, he has contributed to a number of areas of NetSurf – particularly anything that doesn't involve touching any user interface code. He is also responsible for creating many of the project's core libraries.</p>
@@ -75,7 +68,7 @@
<h2>Michael Drake</h2>
-<p>Michael is involved most in developing the layout and rendering engine. He also contributes to other areas of the core code and usually seeks to evade front end work. When he is induced to work on platform specific code, it is typically to address interaction with the core, or to implement, fix, or improve performance of the front end's rendering code.</p>
+<p>Michael is involved most in developing the layout and rendering engine. He wrote the treeview implementation and the current bookmarks, history and cookie managers. He also contributes to other areas of the NetSurf core and project libraries. When he is induced to work on platform specific code, it is typically to address interaction with the core, or to implement, fix, or improve performance of front end rendering code.</p>
<p>He is responsible for most of the project's web site, and has worked on the project graphics and documentation.</p>
@@ -84,19 +77,6 @@
<li>IRC name: tlsa</li>
</ul>
-<h2>Richard Wilson</h2>
-
-<p>When he finds time away from his day job as an international man of mystery, Richard enjoys flailing his arms towards a keyboard and trying to make NetSurf as beautiful as the contours of a Cuban virgin's thighs.</p>
-
-<p>He is responsible for implementing various sections of NetSurf – the ones he'll admit to include GIF, BMP and ICO support, the current frames implementation, minor sections of the CSS and layout code, the hotlist and global history, toolbars and themes, URL auto-completion, buffered rendering, interactive help, the RISC OS GUI and image rendering code, RISC OS image virtual memory / compression, and probably 90% of the bugs.</p>
-
-<p>Unfortunately Richard has had precious little time for development work recently, but an aged RiscPC is his partner when he does.</p>
-
-<ul>
-<li>First check in: 9 March 2004</li>
-<li>IRC name: rjwii</li>
-</ul>
-
<h2>John Tytgat</h2>
<p>John is an occasional NetSurf contributor mostly related to cross-compile build aspects based on his knowledge and involvement in the <a href="http://gccsdk.riscos.info/">GCCSDK</a> project and <a href="http://ro-oslib.sourceforge.net">OSLib</a>. He also contributed the first Unicode related changes in NetSurf.</p>
@@ -108,13 +88,6 @@
<li>IRC name: joty</li>
</ul>
-<h2>Adrian Lees</h2>
-
-<ul>
-<li>First check in: 25 March 2005</li>
-<li>IRC name: adrianl</li>
-</ul>
-
<h2>Daniel Silverstone</h2>
<p>Generally grumpy, occasionally clever, but consistently ginger; Daniel works mostly on the GTK port of NetSurf and in a more airy hand-wavy way on most of the newer libraries which make up the NetSurf project.</p>
@@ -177,9 +150,40 @@
<li>IRC name: sff, stevef</li>
</ul>
-<h2>Sven Weidauer</h2>
+<h2>Previous team members</h2>
+
+<h3>James Bursa</h3>
+
+<p>James was the original developer of NetSurf.</p>
+
+<ul>
+<li>First check in: 22 April 2002</li>
+<li>IRC name: zamez</li>
+</ul>
+
+<h3>Richard Wilson</h3>
+
+<p>When he found time away from his day job as an international man of mystery, Richard enjoyed flailing his arms towards a keyboard and trying to make NetSurf as beautiful as the contours of a Cuban virgin's thighs.</p>
+
+<p>He was responsible for implementing various sections of NetSurf – the ones he'll admit to include GIF, BMP and ICO support, the RISC OS frames implementation, minor sections of the CSS and layout code, the old hotlist and global history, the toolbars and themes, URL auto-completion, buffered rendering, interactive help, the RISC OS GUI and image rendering code, RISC OS image virtual memory / compression, and probably 90% of the bugs.</p>
+
+<p>Unfortunately Richard has had precious little time for development work recently, but an aged RiscPC is his partner when he does.</p>
+
+<ul>
+<li>First check in: 9 March 2004</li>
+<li>IRC name: rjwii</li>
+</ul>
+
+<h3>Adrian Lees</h3>
+
+<ul>
+<li>First check in: 25 March 2005</li>
+<li>IRC name: adrianl</li>
+</ul>
+
+<h3>Sven Weidauer</h3>
-<p>Sven wrote and maintains the Mac OS X front end. He tries to avoid touching the core but knows that he eventually will have to. His main development machine is an iMac running OS X Snow Leopard and he does some testing on an old PPC iBook running Leopard.</p>
+<p>Sven wrote the Mac OS X front end. His main development machine was an iMac running OS X Snow Leopard and he did some testing on an old PPC iBook running Leopard.</p>
<ul>
<li>First check in: 12 January 2011</li>
commitdiff http://git.netsurf-browser.org/netsurf-website.git/commit/?id=361bf854b16...
commit 361bf854b161f7eff01cd5b8767da7434820d5e6
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
Remove Subversion names.
diff --git a/about/team.en b/about/team.en
index c4770d7..259c490 100644
--- a/about/team.en
+++ b/about/team.en
@@ -61,7 +61,7 @@
<ul>
<li>First check in: 22 April 2002</li>
-<li>IRC name: zamez, Source repository name: bursa</li>
+<li>IRC name: zamez</li>
</ul>
<h2>John-Mark Bell</h2>
@@ -70,7 +70,7 @@
<ul>
<li>First check in: 25 May 2003</li>
-<li>IRC name: jmb, Source repository name: jmb</li>
+<li>IRC name: jmb</li>
</ul>
<h2>Michael Drake</h2>
@@ -81,7 +81,7 @@
<ul>
<li>First check in: 26 September 2003</li>
-<li>IRC name: tlsa, Source repository name: tlsa</li>
+<li>IRC name: tlsa</li>
</ul>
<h2>Richard Wilson</h2>
@@ -94,7 +94,7 @@
<ul>
<li>First check in: 9 March 2004</li>
-<li>IRC name: rjwii, Source repository name: rjw</li>
+<li>IRC name: rjwii</li>
</ul>
<h2>John Tytgat</h2>
@@ -105,14 +105,14 @@
<ul>
<li>First check in: 1 May 2004</li>
-<li>IRC name: joty, Source repository name: joty</li>
+<li>IRC name: joty</li>
</ul>
<h2>Adrian Lees</h2>
<ul>
<li>First check in: 25 March 2005</li>
-<li>IRC name: adrianl, Source repository name: adrianl</li>
+<li>IRC name: adrianl</li>
</ul>
<h2>Daniel Silverstone</h2>
@@ -123,7 +123,7 @@
<ul>
<li>First check in: 9 March 2006</li>
-<li>IRC name: Kinnison, Source repository name: dsilvers</li>
+<li>IRC name: Kinnison</li>
</ul>
<h2>Rob Kendrick</h2>
@@ -134,14 +134,14 @@
<ul>
<li>First check in: 13 March 2006</li>
-<li>IRC name: rjek, Source repository name: rjek</li>
+<li>IRC name: rjek</li>
</ul>
<h2>Vincent Sanders</h2>
<ul>
<li>First check in: 8 August 2007</li>
-<li>IRC name: kyllikki, Source repository name: vince</li>
+<li>IRC name: kyllikki</li>
</ul>
<h2>François Revol</h2>
@@ -152,7 +152,7 @@
<ul>
<li>First check in: 3 June 2008</li>
-<li>IRC name: mmu_man, Source repository name: mmu_man</li>
+<li>IRC name: mmu_man</li>
</ul>
<h2>Chris Young</h2>
@@ -163,7 +163,7 @@
<ul>
<li>First check in: 2 August 2008</li>
-<li>Source repository name: chris_y</li>
+<li>IRC name: chris_y</li>
</ul>
<h2>Steve Fryatt</h2>
@@ -174,7 +174,7 @@
<ul>
<li>First check in: 14 February 2010</li>
-<li>IRC name: sff, Source repository name: stevef</li>
+<li>IRC name: sff, stevef</li>
</ul>
<h2>Sven Weidauer</h2>
@@ -183,13 +183,13 @@
<ul>
<li>First check in: 12 January 2011</li>
-<li>IRC name: swdr, Source repository name: swdr</li>
+<li>IRC name: swdr</li>
</ul>
<div class="footer">
-<p>Copyright 2003 - 2011 The NetSurf Developers</p>
+<p>Copyright 2003 - 2014 The NetSurf Developers</p>
</div>
</div>
-----------------------------------------------------------------------
Summary of changes:
about/team.en | 86 +++++++++++++++++++++++++++++---------------------------
1 files changed, 45 insertions(+), 41 deletions(-)
diff --git a/about/team.en b/about/team.en
index c4770d7..7685fdb 100644
--- a/about/team.en
+++ b/about/team.en
@@ -57,44 +57,24 @@
<h1>The NetSurf Developers</h1>
-<h2>James Bursa</h2>
-
-<ul>
-<li>First check in: 22 April 2002</li>
-<li>IRC name: zamez, Source repository name: bursa</li>
-</ul>
-
<h2>John-Mark Bell</h2>
<p>John-Mark spends most of his time avoiding the layout engine, as he thinks that overexposure to it will result in the early onset of dementia. Over the years, he has contributed to a number of areas of NetSurf – particularly anything that doesn't involve touching any user interface code. He is also responsible for creating many of the project's core libraries.</p>
<ul>
<li>First check in: 25 May 2003</li>
-<li>IRC name: jmb, Source repository name: jmb</li>
+<li>IRC name: jmb</li>
</ul>
<h2>Michael Drake</h2>
-<p>Michael is involved most in developing the layout and rendering engine. He also contributes to other areas of the core code and usually seeks to evade front end work. When he is induced to work on platform specific code, it is typically to address interaction with the core, or to implement, fix, or improve performance of the front end's rendering code.</p>
+<p>Michael is involved most in developing the layout and rendering engine. He wrote the treeview implementation and the current bookmarks, history and cookie managers. He also contributes to other areas of the NetSurf core and project libraries. When he is induced to work on platform specific code, it is typically to address interaction with the core, or to implement, fix, or improve performance of front end rendering code.</p>
<p>He is responsible for most of the project's web site, and has worked on the project graphics and documentation.</p>
<ul>
<li>First check in: 26 September 2003</li>
-<li>IRC name: tlsa, Source repository name: tlsa</li>
-</ul>
-
-<h2>Richard Wilson</h2>
-
-<p>When he finds time away from his day job as an international man of mystery, Richard enjoys flailing his arms towards a keyboard and trying to make NetSurf as beautiful as the contours of a Cuban virgin's thighs.</p>
-
-<p>He is responsible for implementing various sections of NetSurf – the ones he'll admit to include GIF, BMP and ICO support, the current frames implementation, minor sections of the CSS and layout code, the hotlist and global history, toolbars and themes, URL auto-completion, buffered rendering, interactive help, the RISC OS GUI and image rendering code, RISC OS image virtual memory / compression, and probably 90% of the bugs.</p>
-
-<p>Unfortunately Richard has had precious little time for development work recently, but an aged RiscPC is his partner when he does.</p>
-
-<ul>
-<li>First check in: 9 March 2004</li>
-<li>IRC name: rjwii, Source repository name: rjw</li>
+<li>IRC name: tlsa</li>
</ul>
<h2>John Tytgat</h2>
@@ -105,14 +85,7 @@
<ul>
<li>First check in: 1 May 2004</li>
-<li>IRC name: joty, Source repository name: joty</li>
-</ul>
-
-<h2>Adrian Lees</h2>
-
-<ul>
-<li>First check in: 25 March 2005</li>
-<li>IRC name: adrianl, Source repository name: adrianl</li>
+<li>IRC name: joty</li>
</ul>
<h2>Daniel Silverstone</h2>
@@ -123,7 +96,7 @@
<ul>
<li>First check in: 9 March 2006</li>
-<li>IRC name: Kinnison, Source repository name: dsilvers</li>
+<li>IRC name: Kinnison</li>
</ul>
<h2>Rob Kendrick</h2>
@@ -134,14 +107,14 @@
<ul>
<li>First check in: 13 March 2006</li>
-<li>IRC name: rjek, Source repository name: rjek</li>
+<li>IRC name: rjek</li>
</ul>
<h2>Vincent Sanders</h2>
<ul>
<li>First check in: 8 August 2007</li>
-<li>IRC name: kyllikki, Source repository name: vince</li>
+<li>IRC name: kyllikki</li>
</ul>
<h2>François Revol</h2>
@@ -152,7 +125,7 @@
<ul>
<li>First check in: 3 June 2008</li>
-<li>IRC name: mmu_man, Source repository name: mmu_man</li>
+<li>IRC name: mmu_man</li>
</ul>
<h2>Chris Young</h2>
@@ -163,7 +136,7 @@
<ul>
<li>First check in: 2 August 2008</li>
-<li>Source repository name: chris_y</li>
+<li>IRC name: chris_y</li>
</ul>
<h2>Steve Fryatt</h2>
@@ -174,22 +147,53 @@
<ul>
<li>First check in: 14 February 2010</li>
-<li>IRC name: sff, Source repository name: stevef</li>
+<li>IRC name: sff, stevef</li>
+</ul>
+
+<h2>Previous team members</h2>
+
+<h3>James Bursa</h3>
+
+<p>James was the original developer of NetSurf.</p>
+
+<ul>
+<li>First check in: 22 April 2002</li>
+<li>IRC name: zamez</li>
+</ul>
+
+<h3>Richard Wilson</h3>
+
+<p>When he found time away from his day job as an international man of mystery, Richard enjoyed flailing his arms towards a keyboard and trying to make NetSurf as beautiful as the contours of a Cuban virgin's thighs.</p>
+
+<p>He was responsible for implementing various sections of NetSurf – the ones he'll admit to include GIF, BMP and ICO support, the RISC OS frames implementation, minor sections of the CSS and layout code, the old hotlist and global history, the toolbars and themes, URL auto-completion, buffered rendering, interactive help, the RISC OS GUI and image rendering code, RISC OS image virtual memory / compression, and probably 90% of the bugs.</p>
+
+<p>Unfortunately Richard has had precious little time for development work recently, but an aged RiscPC is his partner when he does.</p>
+
+<ul>
+<li>First check in: 9 March 2004</li>
+<li>IRC name: rjwii</li>
+</ul>
+
+<h3>Adrian Lees</h3>
+
+<ul>
+<li>First check in: 25 March 2005</li>
+<li>IRC name: adrianl</li>
</ul>
-<h2>Sven Weidauer</h2>
+<h3>Sven Weidauer</h3>
-<p>Sven wrote and maintains the Mac OS X front end. He tries to avoid touching the core but knows that he eventually will have to. His main development machine is an iMac running OS X Snow Leopard and he does some testing on an old PPC iBook running Leopard.</p>
+<p>Sven wrote the Mac OS X front end. His main development machine was an iMac running OS X Snow Leopard and he did some testing on an old PPC iBook running Leopard.</p>
<ul>
<li>First check in: 12 January 2011</li>
-<li>IRC name: swdr, Source repository name: swdr</li>
+<li>IRC name: swdr</li>
</ul>
<div class="footer">
-<p>Copyright 2003 - 2011 The NetSurf Developers</p>
+<p>Copyright 2003 - 2014 The NetSurf Developers</p>
</div>
</div>
--
NetSurf website source for *.netsurf-browser.org
9 years
netsurf: branch master updated. release/3.0-1013-g829b4fd
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/829b4fd4546670512f854...
...commit http://git.netsurf-browser.org/netsurf.git/commit/829b4fd4546670512f8543c...
...tree http://git.netsurf-browser.org/netsurf.git/tree/829b4fd4546670512f8543c8b...
The branch, master has been updated
via 829b4fd4546670512f8543c8bc8ed80372566f08 (commit)
via 849bb5911c6add45c2d46f98bf501f843808571f (commit)
via 654b25ffa1bab41d346f3c55b9257750cd515b78 (commit)
from 0d2a3618f193d63cc18f098e6490df670f6609ef (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=829b4fd4546670512f8...
commit 829b4fd4546670512f8543c8bc8ed80372566f08
Merge: 0d2a361 849bb59
Author: Vincent Sanders <vince(a)netsurf-browser.org>
Commit: Vincent Sanders <vince(a)netsurf-browser.org>
Merge remote-tracking branch 'origin/stevef/menus'
-----------------------------------------------------------------------
Summary of changes:
riscos/gui.c | 3 ++-
riscos/menus.c | 23 +++++++++++++++++++++++
riscos/menus.h | 1 +
riscos/wimp_event.c | 1 -
4 files changed, 26 insertions(+), 2 deletions(-)
diff --git a/riscos/gui.c b/riscos/gui.c
index 69d5b29..e862e93 100644
--- a/riscos/gui.c
+++ b/riscos/gui.c
@@ -1315,7 +1315,8 @@ void ro_gui_user_message(wimp_event_no event, wimp_message *message)
break;
case message_MENUS_DELETED:
- ro_gui_menu_closed();
+ ro_gui_menu_message_deleted((wimp_message_menus_deleted *)
+ &message->data);
break;
case message_CLAIM_ENTITY:
diff --git a/riscos/menus.c b/riscos/menus.c
index 29d5141..91232a1 100644
--- a/riscos/menus.c
+++ b/riscos/menus.c
@@ -118,6 +118,7 @@ wimp_menu *image_quality_menu, *proxy_type_menu, *languages_menu;
/**
* Create menu structures.
*/
+
void ro_gui_menu_init(void)
{
/* image quality menu */
@@ -439,6 +440,28 @@ void ro_gui_menu_warning(wimp_message_menu_warning *warning)
}
}
+
+/**
+ * Handle Message_MenusDeleted, removing our current record of an open menu
+ * if it matches the deleted menu handle.
+ *
+ * \param *deleted The message block.
+ */
+
+void ro_gui_menu_message_deleted(wimp_message_menus_deleted *deleted)
+{
+ if (deleted != NULL && deleted->menu == current_menu) {
+ ro_gui_wimp_event_menus_closed(current_menu_window,
+ current_menu_icon, current_menu);
+
+ current_menu = NULL;
+ current_menu_window = NULL;
+ current_menu_icon = 0;
+ current_menu_open = false;
+ }
+}
+
+
/**
* Update the current menu by sending it a Menu Prepare event through wimp_event
* and then reopening it if the contents has changed.
diff --git a/riscos/menus.h b/riscos/menus.h
index 033b011..e2269b7 100644
--- a/riscos/menus.h
+++ b/riscos/menus.h
@@ -173,6 +173,7 @@ void ro_gui_popup_menu(wimp_menu *menu, wimp_w w, wimp_i i);
void ro_gui_menu_window_changed(wimp_w from, wimp_w to);
void ro_gui_menu_selection(wimp_selection* selection);
void ro_gui_menu_warning(wimp_message_menu_warning *warning);
+void ro_gui_menu_message_deleted(wimp_message_menus_deleted *deleted);
void ro_gui_menu_refresh(wimp_menu *menu);
void ro_gui_menu_init_structure(wimp_menu *menu, int entries);
const char *ro_gui_menu_find_menu_entry_key(wimp_menu *menu,
diff --git a/riscos/wimp_event.c b/riscos/wimp_event.c
index 1811498..a84c016 100644
--- a/riscos/wimp_event.c
+++ b/riscos/wimp_event.c
@@ -720,7 +720,6 @@ bool ro_gui_wimp_event_mouse_click(wimp_pointer *pointer)
ro_gui_dialog_add_persistent(current_menu_window,
pointer->w);
ro_gui_menu_closed();
- gui_poll(true);
error = xwimp_open_window(PTR_WIMP_OPEN(&open));
if (error) {
LOG(("xwimp_open_window: 0x%x: %s",
--
NetSurf Browser
9 years
netsurf: branch master updated. release/3.0-1010-g0d2a361
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/0d2a3618f193d63cc18f0...
...commit http://git.netsurf-browser.org/netsurf.git/commit/0d2a3618f193d63cc18f098...
...tree http://git.netsurf-browser.org/netsurf.git/tree/0d2a3618f193d63cc18f098e6...
The branch, master has been updated
via 0d2a3618f193d63cc18f098e6490df670f6609ef (commit)
via ab2f5ccb4bf4670f9e943ae739a9afcafca9b108 (commit)
from 7cb0619fe8c39d189dbcfa4ecbd0db573ff250e6 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=0d2a3618f193d63cc18...
commit 0d2a3618f193d63cc18f098e6490df670f6609ef
Author: François Revol <revol(a)free.fr>
Commit: Vincent Sanders <vince(a)netsurf-browser.org>
env.sh: Add ns-pkgman-install to install Haiku dev packages
It is now provided as a specific package.
diff --git a/Docs/env.sh b/Docs/env.sh
index 734bc34..b1b2b34 100644
--- a/Docs/env.sh
+++ b/Docs/env.sh
@@ -55,6 +55,13 @@ NS_DEV_DEB="build-essential pkg-config git gperf"
NS_TOOL_DEB="flex bison libhtml-parser-perl"
NS_GTK_DEB="libgtk2.0-dev libcurl3-dev libpng-dev librsvg2-dev libjpeg-dev libmozjs185-dev"
+# Haiku secondary arch suffix:
+# empty for primary (gcc2 on x86),
+# "_x86" for gcc4 secondary.
+HA=
+# Haiku packages
+NS_DEV_HPKG="curl${HA}_devel libpng${HA}_devel jpeg${HA}_devel openssl${HA}_devel libiconv${HA}_devel expat${HA}_devel pkgconfig${HA} html_parser cmd:getconf"
+
#add target specific libraries
if [ "x${TARGET_ABI}" = "xriscos" ]; then
NS_FRONTEND_LIBS="${NS_FRONTEND_LIBS} ${NS_RISCOS_LIBS}"
@@ -66,6 +73,12 @@ ns-apt-get-install()
sudo apt-get install $(echo ${NS_DEV_DEB} ${NS_TOOL_DEB} ${NS_GTK_DEB})
}
+# pkgman commandline to install necessary dev packages
+ns-pkgman-install()
+{
+ pkgman install $(echo ${NS_DEV_HPKG})
+}
+
# git pull in all repos parameters are passed to git pull
ns-pull()
{
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=ab2f5ccb4bf4670f9e9...
commit ab2f5ccb4bf4670f9e943ae739a9afcafca9b108
Author: François Revol <revol(a)free.fr>
Commit: Vincent Sanders <vince(a)netsurf-browser.org>
env.sh: Use a more portable way of counting online processors
getconf _NPROCESSORS_ONLN should be available on Linux, FreeBSD
and OSX at least:
http://linux.die.net/man/1/getconf
https://developer.apple.com/library/mac/documentation/Darwin/Reference/Ma...
getconf NPROCESSORS_ONLN is BSD variant which Haiku provides.
One might want to handle Solaris too some day...
cf. https://gist.github.com/jj1bdx/5746298
diff --git a/Docs/env.sh b/Docs/env.sh
index 7b5aedd..734bc34 100644
--- a/Docs/env.sh
+++ b/Docs/env.sh
@@ -22,7 +22,7 @@ if [ "x${TARGET_WORKSPACE}" = "x" ]; then
fi
if [ "x${USE_CPUS}" = "x" ]; then
- NCPUS=$(grep -c "^processor" /proc/cpuinfo 2>/dev/null)
+ NCPUS=$(getconf _NPROCESSORS_ONLN 2>/dev/null || getconf NPROCESSORS_ONLN 2>/dev/null)
NCPUS="${NCPUS:-1}"
NCPUS=$((NCPUS * 2))
USE_CPUS="-j${NCPUS}"
-----------------------------------------------------------------------
Summary of changes:
Docs/env.sh | 15 ++++++++++++++-
1 files changed, 14 insertions(+), 1 deletions(-)
diff --git a/Docs/env.sh b/Docs/env.sh
index 7b5aedd..b1b2b34 100644
--- a/Docs/env.sh
+++ b/Docs/env.sh
@@ -22,7 +22,7 @@ if [ "x${TARGET_WORKSPACE}" = "x" ]; then
fi
if [ "x${USE_CPUS}" = "x" ]; then
- NCPUS=$(grep -c "^processor" /proc/cpuinfo 2>/dev/null)
+ NCPUS=$(getconf _NPROCESSORS_ONLN 2>/dev/null || getconf NPROCESSORS_ONLN 2>/dev/null)
NCPUS="${NCPUS:-1}"
NCPUS=$((NCPUS * 2))
USE_CPUS="-j${NCPUS}"
@@ -55,6 +55,13 @@ NS_DEV_DEB="build-essential pkg-config git gperf"
NS_TOOL_DEB="flex bison libhtml-parser-perl"
NS_GTK_DEB="libgtk2.0-dev libcurl3-dev libpng-dev librsvg2-dev libjpeg-dev libmozjs185-dev"
+# Haiku secondary arch suffix:
+# empty for primary (gcc2 on x86),
+# "_x86" for gcc4 secondary.
+HA=
+# Haiku packages
+NS_DEV_HPKG="curl${HA}_devel libpng${HA}_devel jpeg${HA}_devel openssl${HA}_devel libiconv${HA}_devel expat${HA}_devel pkgconfig${HA} html_parser cmd:getconf"
+
#add target specific libraries
if [ "x${TARGET_ABI}" = "xriscos" ]; then
NS_FRONTEND_LIBS="${NS_FRONTEND_LIBS} ${NS_RISCOS_LIBS}"
@@ -66,6 +73,12 @@ ns-apt-get-install()
sudo apt-get install $(echo ${NS_DEV_DEB} ${NS_TOOL_DEB} ${NS_GTK_DEB})
}
+# pkgman commandline to install necessary dev packages
+ns-pkgman-install()
+{
+ pkgman install $(echo ${NS_DEV_HPKG})
+}
+
# git pull in all repos parameters are passed to git pull
ns-pull()
{
--
NetSurf Browser
9 years
netsurf: branch stevef/menus created. release/3.0-1010-g849bb59
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/849bb5911c6add45c2d46...
...commit http://git.netsurf-browser.org/netsurf.git/commit/849bb5911c6add45c2d46f9...
...tree http://git.netsurf-browser.org/netsurf.git/tree/849bb5911c6add45c2d46f98b...
The branch, stevef/menus has been created
at 849bb5911c6add45c2d46f98bf501f843808571f (commit)
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=849bb5911c6add45c2d...
commit 849bb5911c6add45c2d46f98bf501f843808571f
Author: Steve Fryatt <stevef(a)netsurf-browser.org>
Commit: Steve Fryatt <stevef(a)netsurf-browser.org>
Don't poll when converting a menu to a dialogue, as the resulting Message_MenusDeleted no longer kills any newly-opened menus.
diff --git a/riscos/wimp_event.c b/riscos/wimp_event.c
index 1811498..a84c016 100644
--- a/riscos/wimp_event.c
+++ b/riscos/wimp_event.c
@@ -720,7 +720,6 @@ bool ro_gui_wimp_event_mouse_click(wimp_pointer *pointer)
ro_gui_dialog_add_persistent(current_menu_window,
pointer->w);
ro_gui_menu_closed();
- gui_poll(true);
error = xwimp_open_window(PTR_WIMP_OPEN(&open));
if (error) {
LOG(("xwimp_open_window: 0x%x: %s",
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=654b25ffa1bab41d346...
commit 654b25ffa1bab41d346f3c55b9257750cd515b78
Author: Steve Fryatt <stevef(a)netsurf-browser.org>
Commit: Steve Fryatt <stevef(a)netsurf-browser.org>
Improve handling of Message_MenusDeleted so that we don't close whatever menu tree is open at the time.
diff --git a/riscos/gui.c b/riscos/gui.c
index 69d5b29..e862e93 100644
--- a/riscos/gui.c
+++ b/riscos/gui.c
@@ -1315,7 +1315,8 @@ void ro_gui_user_message(wimp_event_no event, wimp_message *message)
break;
case message_MENUS_DELETED:
- ro_gui_menu_closed();
+ ro_gui_menu_message_deleted((wimp_message_menus_deleted *)
+ &message->data);
break;
case message_CLAIM_ENTITY:
diff --git a/riscos/menus.c b/riscos/menus.c
index 29d5141..91232a1 100644
--- a/riscos/menus.c
+++ b/riscos/menus.c
@@ -118,6 +118,7 @@ wimp_menu *image_quality_menu, *proxy_type_menu, *languages_menu;
/**
* Create menu structures.
*/
+
void ro_gui_menu_init(void)
{
/* image quality menu */
@@ -439,6 +440,28 @@ void ro_gui_menu_warning(wimp_message_menu_warning *warning)
}
}
+
+/**
+ * Handle Message_MenusDeleted, removing our current record of an open menu
+ * if it matches the deleted menu handle.
+ *
+ * \param *deleted The message block.
+ */
+
+void ro_gui_menu_message_deleted(wimp_message_menus_deleted *deleted)
+{
+ if (deleted != NULL && deleted->menu == current_menu) {
+ ro_gui_wimp_event_menus_closed(current_menu_window,
+ current_menu_icon, current_menu);
+
+ current_menu = NULL;
+ current_menu_window = NULL;
+ current_menu_icon = 0;
+ current_menu_open = false;
+ }
+}
+
+
/**
* Update the current menu by sending it a Menu Prepare event through wimp_event
* and then reopening it if the contents has changed.
diff --git a/riscos/menus.h b/riscos/menus.h
index 033b011..e2269b7 100644
--- a/riscos/menus.h
+++ b/riscos/menus.h
@@ -173,6 +173,7 @@ void ro_gui_popup_menu(wimp_menu *menu, wimp_w w, wimp_i i);
void ro_gui_menu_window_changed(wimp_w from, wimp_w to);
void ro_gui_menu_selection(wimp_selection* selection);
void ro_gui_menu_warning(wimp_message_menu_warning *warning);
+void ro_gui_menu_message_deleted(wimp_message_menus_deleted *deleted);
void ro_gui_menu_refresh(wimp_menu *menu);
void ro_gui_menu_init_structure(wimp_menu *menu, int entries);
const char *ro_gui_menu_find_menu_entry_key(wimp_menu *menu,
-----------------------------------------------------------------------
--
NetSurf Browser
9 years
netsurf: branch master updated. release/3.0-1008-g7cb0619
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/7cb0619fe8c39d189dbcf...
...commit http://git.netsurf-browser.org/netsurf.git/commit/7cb0619fe8c39d189dbcfa4...
...tree http://git.netsurf-browser.org/netsurf.git/tree/7cb0619fe8c39d189dbcfa4ec...
The branch, master has been updated
via 7cb0619fe8c39d189dbcfa4ecbd0db573ff250e6 (commit)
from 654da2ffb5abf2afe9532f1d0cb77ed88f8a97cc (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=7cb0619fe8c39d189db...
commit 7cb0619fe8c39d189dbcfa4ecbd0db573ff250e6
Author: Vincent Sanders <vince(a)kyllikki.org>
Commit: Vincent Sanders <vince(a)kyllikki.org>
fix dumb typos from utf8 error return refactor
diff --git a/framebuffer/font_internal.c b/framebuffer/font_internal.c
index d13ba00..1eed006 100644
--- a/framebuffer/font_internal.c
+++ b/framebuffer/font_internal.c
@@ -59,7 +59,7 @@ fb_get_font(const plot_font_style_t *fstyle)
}
}
-nserror_ret utf8_to_font_encoding(const struct fb_font_desc* font,
+nserror utf8_to_font_encoding(const struct fb_font_desc* font,
const char *string,
size_t len,
char **result)
diff --git a/riscos/ucstables.c b/riscos/ucstables.c
index 4754bac..b9f196d 100644
--- a/riscos/ucstables.c
+++ b/riscos/ucstables.c
@@ -645,7 +645,7 @@ nserror utf8_from_local_encoding(const char *string, size_t len, char **result)
(3 * SPECIAL_CHUNK_SIZE));
if (!temp) {
free(*result);
- return NSERRO_NOMEM;
+ return NSERROR_NOMEM;
}
*result = temp;
-----------------------------------------------------------------------
Summary of changes:
framebuffer/font_internal.c | 2 +-
riscos/ucstables.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/framebuffer/font_internal.c b/framebuffer/font_internal.c
index d13ba00..1eed006 100644
--- a/framebuffer/font_internal.c
+++ b/framebuffer/font_internal.c
@@ -59,7 +59,7 @@ fb_get_font(const plot_font_style_t *fstyle)
}
}
-nserror_ret utf8_to_font_encoding(const struct fb_font_desc* font,
+nserror utf8_to_font_encoding(const struct fb_font_desc* font,
const char *string,
size_t len,
char **result)
diff --git a/riscos/ucstables.c b/riscos/ucstables.c
index 4754bac..b9f196d 100644
--- a/riscos/ucstables.c
+++ b/riscos/ucstables.c
@@ -645,7 +645,7 @@ nserror utf8_from_local_encoding(const char *string, size_t len, char **result)
(3 * SPECIAL_CHUNK_SIZE));
if (!temp) {
free(*result);
- return NSERRO_NOMEM;
+ return NSERROR_NOMEM;
}
*result = temp;
--
NetSurf Browser
9 years
netsurf: branch master updated. release/3.0-1007-g654da2f
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/654da2ffb5abf2afe9532...
...commit http://git.netsurf-browser.org/netsurf.git/commit/654da2ffb5abf2afe9532f1...
...tree http://git.netsurf-browser.org/netsurf.git/tree/654da2ffb5abf2afe9532f1d0...
The branch, master has been updated
via 654da2ffb5abf2afe9532f1d0cb77ed88f8a97cc (commit)
from 4b760c7e499e2f5cb1d06242d5f186e14e94496a (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=654da2ffb5abf2afe95...
commit 654da2ffb5abf2afe9532f1d0cb77ed88f8a97cc
Author: Vincent Sanders <vince(a)netsurf-browser.org>
Commit: Vincent Sanders <vince(a)netsurf-browser.org>
move utf8 conversion routines to use nserror instead of their own error enum
diff --git a/amiga/clipboard.c b/amiga/clipboard.c
index 8df441e..d39e89e 100644
--- a/amiga/clipboard.c
+++ b/amiga/clipboard.c
@@ -246,7 +246,7 @@ static void gui_set_clipboard(const char *buffer, size_t length,
if(nsoption_bool(clipboard_write_utf8)) {
WriteChunkBytes(iffh, buffer, length);
} else {
- if(utf8_to_local_encoding(buffer, length, &text) == UTF8_CONVERT_OK) {
+ if(utf8_to_local_encoding(buffer, length, &text) == NSERROR_OK) {
char *p;
p = text;
diff --git a/amiga/font.c b/amiga/font.c
index 36c8104..3430a4e 100755
--- a/amiga/font.c
+++ b/amiga/font.c
@@ -212,7 +212,7 @@ bool nsfont_position_in_string(const plot_font_style_t *fstyle,
ULONG emwidth = (ULONG)NSA_FONT_EMWIDTH(fstyle->size);
int32 tempx;
- if(utf8_to_enc(string,"UTF-16",length,(char **)&utf16) != UTF8_CONVERT_OK) return false;
+ if(utf8_to_enc(string,"UTF-16",length,(char **)&utf16) != NSERROR_OK) return false;
outf16 = utf16;
if(!(ofont = ami_open_outline_font(fstyle, 0))) return false;
@@ -301,7 +301,7 @@ bool nsfont_split(const plot_font_style_t *fstyle,
int32 tempx = 0;
ULONG emwidth = (ULONG)NSA_FONT_EMWIDTH(fstyle->size);
- if(utf8_to_enc((char *)string,"UTF-16",length,(char **)&utf16) != UTF8_CONVERT_OK) return false;
+ if(utf8_to_enc((char *)string,"UTF-16",length,(char **)&utf16) != NSERROR_OK) return false;
outf16 = utf16;
if(!(ofont = ami_open_outline_font(fstyle, 0))) return false;
@@ -732,7 +732,7 @@ ULONG ami_unicode_text(struct RastPort *rp, const char *string, ULONG length,
if(!string || string[0]=='\0') return 0;
if(!length) return 0;
- if(utf8_to_enc(string,"UTF-16",length,(char **)&utf16) != UTF8_CONVERT_OK) return 0;
+ if(utf8_to_enc(string,"UTF-16",length,(char **)&utf16) != NSERROR_OK) return 0;
outf16 = utf16;
if(!(ofont = ami_open_outline_font(fstyle, 0))) return 0;
diff --git a/amiga/utf8.c b/amiga/utf8.c
index a620ac1..d182492 100755
--- a/amiga/utf8.c
+++ b/amiga/utf8.c
@@ -34,7 +34,7 @@ char *ami_utf8_easy(const char *string)
{
char *localtext;
- if(utf8_to_local_encoding(string,strlen(string),&localtext) == UTF8_CONVERT_OK)
+ if(utf8_to_local_encoding(string,strlen(string),&localtext) == NSERROR_OK)
{
return localtext;
}
@@ -48,7 +48,7 @@ char *ami_to_utf8_easy(const char *string)
{
char *localtext;
- if(utf8_from_local_encoding(string,strlen(string),&localtext) == UTF8_CONVERT_OK)
+ if(utf8_from_local_encoding(string,strlen(string),&localtext) == NSERROR_OK)
{
return localtext;
}
@@ -58,8 +58,7 @@ char *ami_to_utf8_easy(const char *string)
}
}
-utf8_convert_ret utf8_from_local_encoding(const char *string, size_t len,
- char **result)
+nserror utf8_from_local_encoding(const char *string, size_t len, char **result)
{
const char *encname = "ISO-8859-1";
@@ -73,8 +72,7 @@ utf8_convert_ret utf8_from_local_encoding(const char *string, size_t len,
return utf8_from_enc(string,encname,len,result,NULL);
}
-utf8_convert_ret utf8_to_local_encoding(const char *string, size_t len,
- char **result)
+nserror utf8_to_local_encoding(const char *string, size_t len, char **result)
{
const char *encname = "ISO-8859-1";
diff --git a/atari/encoding.c b/atari/encoding.c
index 0212d51..626f57a 100644
--- a/atari/encoding.c
+++ b/atari/encoding.c
@@ -21,23 +21,21 @@
/* TODO: this need a rework..., encoding to atari st doesn|t always work.
( gui_add_to_clipboard...) */
-utf8_convert_ret utf8_to_local_encoding(const char *string,
+nserror utf8_to_local_encoding(const char *string,
size_t len,
char **result)
{
- utf8_convert_ret r;
+ nserror r;
r = utf8_to_enc(string, "ATARIST", len, result);
- if(r != UTF8_CONVERT_OK) {
+ if(r != NSERROR_OK) {
r = utf8_to_enc(string, "UTF-8", len, result);
- assert( r == UTF8_CONVERT_OK );
+ assert( r == NSERROR_OK );
}
return r;
}
-utf8_convert_ret utf8_from_local_encoding(const char *string,
- size_t len,
- char **result)
+nserror utf8_from_local_encoding(const char *string, size_t len, char **result)
{
return utf8_from_enc(string, "ATARIST", len, result, NULL);
}
diff --git a/atari/gui.c b/atari/gui.c
index f1f557e..af5e1f8 100644
--- a/atari/gui.c
+++ b/atari/gui.c
@@ -326,7 +326,7 @@ static void gui_window_set_title(struct gui_window *gw, const char *title)
int l;
char * conv;
l = strlen(title)+1;
- if (utf8_to_local_encoding(title, l-1, &conv) == UTF8_CONVERT_OK ) {
+ if (utf8_to_local_encoding(title, l-1, &conv) == NSERROR_OK ) {
l = MIN((uint32_t)atari_sysinfo.aes_max_win_title_len, strlen(conv));
if(gw->title == NULL)
gw->title = malloc(l);
@@ -699,16 +699,16 @@ static void gui_get_clipboard(char **buffer, size_t *length)
// clipboard is in atari encoding, convert it to utf8:
char *utf8 = NULL;
- utf8_convert_ret ret;
+ nserror ret;
clip_len = strlen(clip);
if (clip_len > 0) {
ret = utf8_to_local_encoding(clip, clip_len, &utf8);
- if (ret == UTF8_CONVERT_OK && utf8 != NULL) {
+ if (ret == NSERROR_OK && utf8 != NULL) {
*buffer = utf8;
*length = strlen(utf8);
} else {
- assert(ret == UTF8_CONVERT_OK && utf8 != NULL);
+ assert(ret == NSERROR_OK && utf8 != NULL);
}
}
@@ -731,14 +731,14 @@ static void gui_set_clipboard(const char *buffer, size_t length,
// convert utf8 input to atari encoding:
- utf8_convert_ret ret;
+ nserror ret;
char *clip = NULL;
ret = utf8_to_local_encoding(buffer,length, &clip);
- if (ret == UTF8_CONVERT_OK) {
+ if (ret == NSERROR_OK) {
scrap_txt_write(clip);
} else {
- assert(ret == UTF8_CONVERT_OK);
+ assert(ret == NSERROR_OK);
}
free(clip);
}
diff --git a/atari/plot/font_internal.c b/atari/plot/font_internal.c
index 2b0025a..e3c806c 100644
--- a/atari/plot/font_internal.c
+++ b/atari/plot/font_internal.c
@@ -72,7 +72,7 @@ fb_get_font(const plot_font_style_t *fstyle)
}
}
-static utf8_convert_ret utf8_to_font_encoding(const struct fb_font_desc* font,
+static nserror utf8_to_font_encoding(const struct fb_font_desc* font,
const char *string,
size_t len,
char **result)
diff --git a/atari/plot/font_vdi.c b/atari/plot/font_vdi.c
index 340759f..0c914b8 100755
--- a/atari/plot/font_vdi.c
+++ b/atari/plot/font_vdi.c
@@ -267,7 +267,7 @@ static int text( FONT_PLOTTER self, int x, int y, const char *text, size_t leng
short fx=0;
GRECT canvas;
char *lstr = NULL;
- assert( utf8_to_local_encoding(text, length, &lstr) == UTF8_CONVERT_OK);
+ assert( utf8_to_local_encoding(text, length, &lstr) == NSERROR_OK);
assert( lstr != NULL );
int slen = strlen(lstr);
diff --git a/atari/rootwin.c b/atari/rootwin.c
index 0f3413c..8942263 100755
--- a/atari/rootwin.c
+++ b/atari/rootwin.c
@@ -1510,15 +1510,15 @@ static void on_file_dropped(ROOTWIN *rootwin, short msg[8])
mx+sx, my+sy,
NULL);
if(processed == true) {
- utf8_convert_ret ret;
+ nserror ret;
char *utf8_fn;
ret = utf8_from_local_encoding(buff, 0, &utf8_fn);
- if (ret != UTF8_CONVERT_OK) {
+ if (ret != NSERROR_OK) {
free(buff);
/* A bad encoding should never happen */
LOG(("utf8_from_local_encoding failed"));
- assert(ret != UTF8_CONVERT_BADENC);
+ assert(ret != NSERROR_BAD_ENCODING);
/* no memory */
goto error;
}
diff --git a/atari/toolbar.c b/atari/toolbar.c
index fd9051d..8044d16 100644
--- a/atari/toolbar.c
+++ b/atari/toolbar.c
@@ -740,11 +740,11 @@ bool toolbar_key_input(struct s_toolbar *tb, short nkc)
int clip_length = strlen( clip );
if ( clip_length > 0 ) {
char *utf8;
- utf8_convert_ret res;
+ nserror res;
/* Clipboard is in local encoding so
* convert to UTF8 */
res = utf8_from_local_encoding( clip, clip_length, &utf8 );
- if ( res == UTF8_CONVERT_OK ) {
+ if ( res == NSERROR_OK ) {
toolbar_set_url(tb, utf8);
free(utf8);
ret = true;
diff --git a/beos/gui.cpp b/beos/gui.cpp
index 05e0637..97117e0 100644
--- a/beos/gui.cpp
+++ b/beos/gui.cpp
@@ -964,8 +964,7 @@ static void nsbeos_create_ssl_verify_window(struct browser_window *bw,
}
-utf8_convert_ret utf8_to_local_encoding(const char *string, size_t len,
- char **result)
+nserror utf8_to_local_encoding(const char *string, size_t len, char **result)
{
assert(string && result);
@@ -974,13 +973,12 @@ utf8_convert_ret utf8_to_local_encoding(const char *string, size_t len,
*result = strndup(string, len);
if (!(*result))
- return UTF8_CONVERT_NOMEM;
+ return NSERROR_NOMEM;
- return UTF8_CONVERT_OK;
+ return NSERROR_OK;
}
-utf8_convert_ret utf8_from_local_encoding(const char *string, size_t len,
- char **result)
+nserror utf8_from_local_encoding(const char *string, size_t len, char **result)
{
assert(string && result);
@@ -989,9 +987,9 @@ utf8_convert_ret utf8_from_local_encoding(const char *string, size_t len,
*result = strndup(string, len);
if (!(*result))
- return UTF8_CONVERT_NOMEM;
+ return NSERROR_NOMEM;
- return UTF8_CONVERT_OK;
+ return NSERROR_OK;
}
static char *path_to_url(const char *path)
diff --git a/cocoa/utf8.m b/cocoa/utf8.m
index 2ec8298..7b69918 100644
--- a/cocoa/utf8.m
+++ b/cocoa/utf8.m
@@ -20,21 +20,20 @@
#import "utils/utf8.h"
-utf8_convert_ret utf8_to_local_encoding(const char *string, size_t len,
+nserror utf8_to_local_encoding(const char *string, size_t len,
char **result)
{
NSCParameterAssert( NULL != result );
char *newString = malloc( len + 1 );
- if (NULL == newString) return UTF8_CONVERT_NOMEM;
+ if (NULL == newString) return NSERROR_NOMEM;
memcpy( newString, string, len );
newString[len] = 0;
*result = newString;
- return UTF8_CONVERT_OK;
+ return NSERROR_OK;
}
-utf8_convert_ret utf8_from_local_encoding(const char *string, size_t len,
- char **result)
+nserror utf8_from_local_encoding(const char *string, size_t len, char **result)
{
/* same function, local encoding = UTF-8 */
return utf8_to_local_encoding( string, len, result );
diff --git a/desktop/global_history.c b/desktop/global_history.c
index e8d99ef..9d0e47e 100644
--- a/desktop/global_history.c
+++ b/desktop/global_history.c
@@ -828,21 +828,21 @@ static nserror global_history_export_enter_cb(void *ctx, void *node_data,
enum treeview_node_type type, bool *abort)
{
struct treeview_export_walk_ctx *tw = ctx;
+ nserror ret;
if (type == TREE_NODE_ENTRY) {
struct global_history_entry *e = node_data;
- utf8_convert_ret ret;
char *t_text;
char *u_text;
ret = utf8_to_html(e->data[GH_TITLE].value, "iso-8859-1",
e->data[GH_TITLE].value_len, &t_text);
- if (ret != UTF8_CONVERT_OK)
+ if (ret != NSERROR_OK)
return NSERROR_SAVE_FAILED;
ret = utf8_to_html(e->data[GH_URL].value, "iso-8859-1",
e->data[GH_URL].value_len, &u_text);
- if (ret != UTF8_CONVERT_OK) {
+ if (ret != NSERROR_OK) {
free(t_text);
return NSERROR_SAVE_FAILED;
}
@@ -855,12 +855,11 @@ static nserror global_history_export_enter_cb(void *ctx, void *node_data,
} else if (type == TREE_NODE_FOLDER) {
struct global_history_folder *f = node_data;
- utf8_convert_ret ret;
char *f_text;
ret = utf8_to_html(f->data.value, "iso-8859-1",
f->data.value_len, &f_text);
- if (ret != UTF8_CONVERT_OK)
+ if (ret != NSERROR_OK)
return NSERROR_SAVE_FAILED;
fprintf(tw->fp, "<li><h4>%s</h4>\n<ul>\n", f_text);
diff --git a/desktop/hotlist.c b/desktop/hotlist.c
index 01fabc2..219a348 100644
--- a/desktop/hotlist.c
+++ b/desktop/hotlist.c
@@ -879,21 +879,21 @@ static nserror hotlist_export_enter_cb(void *ctx, void *node_data,
enum treeview_node_type type, bool *abort)
{
struct treeview_export_walk_ctx *tw = ctx;
+ nserror ret;
if (type == TREE_NODE_ENTRY) {
struct hotlist_entry *e = node_data;
- utf8_convert_ret ret;
char *t_text;
char *u_text;
ret = utf8_to_html(e->data[HL_TITLE].value, "iso-8859-1",
e->data[HL_TITLE].value_len, &t_text);
- if (ret != UTF8_CONVERT_OK)
+ if (ret != NSERROR_OK)
return NSERROR_SAVE_FAILED;
ret = utf8_to_html(e->data[HL_URL].value, "iso-8859-1",
e->data[HL_URL].value_len, &u_text);
- if (ret != UTF8_CONVERT_OK) {
+ if (ret != NSERROR_OK) {
free(t_text);
return NSERROR_SAVE_FAILED;
}
@@ -906,12 +906,11 @@ static nserror hotlist_export_enter_cb(void *ctx, void *node_data,
} else if (type == TREE_NODE_FOLDER) {
struct hotlist_folder *f = node_data;
- utf8_convert_ret ret;
char *f_text;
ret = utf8_to_html(f->data.value, "iso-8859-1",
f->data.value_len, &f_text);
- if (ret != UTF8_CONVERT_OK)
+ if (ret != NSERROR_OK)
return NSERROR_SAVE_FAILED;
if (f == hl_ctx.default_folder) {
diff --git a/desktop/save_complete.c b/desktop/save_complete.c
index da87a65..99b1ac4 100644
--- a/desktop/save_complete.c
+++ b/desktop/save_complete.c
@@ -547,7 +547,6 @@ static bool save_complete_rewrite_url_value(save_complete_ctx *ctx,
hlcache_handle *content;
char *escaped;
nserror error;
- utf8_convert_ret ret;
error = nsurl_join(ctx->base, value, &url);
if (error == NSERROR_NOMEM)
@@ -562,11 +561,11 @@ static bool save_complete_rewrite_url_value(save_complete_ctx *ctx,
fprintf(ctx->fp, "\"%p\"", content);
} else {
/* no match found */
- ret = utf8_to_html(nsurl_access(url), "UTF-8",
+ error = utf8_to_html(nsurl_access(url), "UTF-8",
nsurl_length(url), &escaped);
nsurl_unref(url);
- if (ret != UTF8_CONVERT_OK)
+ if (error != NSERROR_OK)
return false;
fprintf(ctx->fp, "\"%s\"", escaped);
@@ -574,8 +573,8 @@ static bool save_complete_rewrite_url_value(save_complete_ctx *ctx,
free(escaped);
}
} else {
- ret = utf8_to_html(value, "UTF-8", value_len, &escaped);
- if (ret != UTF8_CONVERT_OK)
+ error = utf8_to_html(value, "UTF-8", value_len, &escaped);
+ if (error != NSERROR_OK)
return false;
fprintf(ctx->fp, "\"%s\"", escaped);
@@ -590,10 +589,10 @@ static bool save_complete_write_value(save_complete_ctx *ctx,
const char *value, size_t value_len)
{
char *escaped;
- utf8_convert_ret ret;
+ nserror ret;
ret = utf8_to_html(value, "UTF-8", value_len, &escaped);
- if (ret != UTF8_CONVERT_OK)
+ if (ret != NSERROR_OK)
return false;
fprintf(ctx->fp, "\"%s\"", escaped);
@@ -919,7 +918,7 @@ static bool save_complete_node_handler(dom_node *node,
save_complete_ctx *ctx = ctxin;
dom_node_type type;
dom_exception error;
- utf8_convert_ret ret;
+ nserror ret;
error = dom_node_get_node_type(node, &type);
if (error != DOM_NO_ERR)
@@ -953,7 +952,7 @@ static bool save_complete_node_handler(dom_node *node,
ret = utf8_to_html(text_data, "UTF-8",
text_len, &escaped);
- if (ret != UTF8_CONVERT_OK)
+ if (ret != NSERROR_OK)
return false;
fwrite(escaped, sizeof(*escaped),
diff --git a/desktop/save_text.c b/desktop/save_text.c
index 92cf32a..38f8c53 100644
--- a/desktop/save_text.c
+++ b/desktop/save_text.c
@@ -58,7 +58,7 @@ void save_as_text(hlcache_handle *c, char *path)
struct save_text_state save = { NULL, 0, 0 };
save_text_whitespace before = WHITESPACE_NONE;
bool first = true;
- utf8_convert_ret ret;
+ nserror ret;
char *result;
if (!c || content_get_type(c) != CONTENT_HTML) {
@@ -72,7 +72,7 @@ void save_as_text(hlcache_handle *c, char *path)
ret = utf8_to_local_encoding(save.block, save.length, &result);
free(save.block);
- if (ret != UTF8_CONVERT_OK) {
+ if (ret != NSERROR_OK) {
LOG(("failed to convert to local encoding, return %d", ret));
return;
}
diff --git a/framebuffer/font_freetype.c b/framebuffer/font_freetype.c
index 521a5bc..eb7278c 100644
--- a/framebuffer/font_freetype.c
+++ b/framebuffer/font_freetype.c
@@ -75,27 +75,27 @@ enum fb_face_e {
static fb_faceid_t *fb_faces[FB_FACE_COUNT];
-utf8_convert_ret utf8_to_local_encoding(const char *string,
+nserror utf8_to_local_encoding(const char *string,
size_t len,
char **result)
{
return utf8_to_enc(string, "UTF-8", len, result);
}
-utf8_convert_ret utf8_from_local_encoding(const char *string,
+nserror utf8_from_local_encoding(const char *string,
size_t len,
char **result)
{
*result = malloc(len + 1);
if (*result == NULL) {
- return UTF8_CONVERT_NOMEM;
+ return NSERROR_NOMEM;
}
memcpy(*result, string, len);
(*result)[len] = '\0';
- return UTF8_CONVERT_OK;
+ return NSERROR_OK;
}
/* map cache manager handle to face id */
diff --git a/framebuffer/font_internal.c b/framebuffer/font_internal.c
index dc1b358..d13ba00 100644
--- a/framebuffer/font_internal.c
+++ b/framebuffer/font_internal.c
@@ -59,7 +59,7 @@ fb_get_font(const plot_font_style_t *fstyle)
}
}
-utf8_convert_ret utf8_to_font_encoding(const struct fb_font_desc* font,
+nserror_ret utf8_to_font_encoding(const struct fb_font_desc* font,
const char *string,
size_t len,
char **result)
@@ -68,7 +68,7 @@ utf8_convert_ret utf8_to_font_encoding(const struct fb_font_desc* font,
}
-utf8_convert_ret utf8_to_local_encoding(const char *string,
+nserror utf8_to_local_encoding(const char *string,
size_t len,
char **result)
{
@@ -76,20 +76,20 @@ utf8_convert_ret utf8_to_local_encoding(const char *string,
}
-utf8_convert_ret utf8_from_local_encoding(const char *string,
+nserror utf8_from_local_encoding(const char *string,
size_t len,
char **result)
{
*result = malloc(len + 1);
if (*result == NULL) {
- return UTF8_CONVERT_NOMEM;
+ return NSERROR_NOMEM;
}
memcpy(*result, string, len);
(*result)[len] = '\0';
- return UTF8_CONVERT_OK;
+ return NSERROR_OK;
}
static bool nsfont_width(const plot_font_style_t *fstyle,
diff --git a/framebuffer/font_internal.h b/framebuffer/font_internal.h
index 5b0f30b..6b6de2f 100644
--- a/framebuffer/font_internal.h
+++ b/framebuffer/font_internal.h
@@ -33,7 +33,7 @@ extern const struct fb_font_desc font_italic_bold;
extern const struct fb_font_desc* fb_get_font(const plot_font_style_t *fstyle);
-extern utf8_convert_ret utf8_to_font_encoding(const struct fb_font_desc* font,
+extern nserror utf8_to_font_encoding(const struct fb_font_desc* font,
const char *string,
size_t len,
char **result);
diff --git a/gtk/dialogs/source.c b/gtk/dialogs/source.c
index a7c9815..a32bce6 100644
--- a/gtk/dialogs/source.c
+++ b/gtk/dialogs/source.c
@@ -169,16 +169,16 @@ void nsgtk_source_dialog_init(GtkWindow *parent, struct browser_window *bw)
source_data = content_get_source_data(bw->current_content,
&source_size);
- utf8_convert_ret r = utf8_from_enc(
+ nserror r = utf8_from_enc(
source_data,
html_get_encoding(bw->current_content),
source_size,
&data,
&data_len);
- if (r == UTF8_CONVERT_NOMEM) {
+ if (r == NSERROR_NOMEM) {
warn_user("NoMemory",0);
return;
- } else if (r == UTF8_CONVERT_BADENC) {
+ } else if (r == NSERROR_BAD_ENCODING) {
warn_user("EncNotRec",0);
return;
}
@@ -270,7 +270,7 @@ void nsgtk_source_tab_init(GtkWindow *parent, struct browser_window *bw)
size_t ndata_len;
nsurl *url;
nserror error;
- utf8_convert_ret r;
+ nserror r;
gchar *filename;
char *fileurl;
gint handle;
@@ -283,10 +283,10 @@ void nsgtk_source_tab_init(GtkWindow *parent, struct browser_window *bw)
source_size,
&ndata,
&ndata_len);
- if (r == UTF8_CONVERT_NOMEM) {
+ if (r == NSERROR_NOMEM) {
warn_user("NoMemory",0);
return;
- } else if (r == UTF8_CONVERT_BADENC) {
+ } else if (r == NSERROR_BAD_ENCODING) {
warn_user("EncNotRec",0);
return;
}
diff --git a/gtk/gui.c b/gtk/gui.c
index ad80e89..c885ad3 100644
--- a/gtk/gui.c
+++ b/gtk/gui.c
@@ -788,8 +788,7 @@ gboolean nsgtk_ssl_delete_event(GtkWidget *w, GdkEvent *event, gpointer data)
return FALSE;
}
-utf8_convert_ret utf8_to_local_encoding(const char *string, size_t len,
- char **result)
+nserror utf8_to_local_encoding(const char *string, size_t len, char **result)
{
assert(string && result);
@@ -798,14 +797,13 @@ utf8_convert_ret utf8_to_local_encoding(const char *string, size_t len,
*result = strndup(string, len);
if (!(*result))
- return UTF8_CONVERT_NOMEM;
+ return NSERROR_NOMEM;
- return UTF8_CONVERT_OK;
+ return NSERROR_OK;
}
-utf8_convert_ret utf8_from_local_encoding(const char *string, size_t len,
- char **result)
+nserror utf8_from_local_encoding(const char *string, size_t len, char **result)
{
assert(string && result);
@@ -814,9 +812,9 @@ utf8_convert_ret utf8_from_local_encoding(const char *string, size_t len,
*result = strndup(string, len);
if (!(*result))
- return UTF8_CONVERT_NOMEM;
+ return NSERROR_NOMEM;
- return UTF8_CONVERT_OK;
+ return NSERROR_OK;
}
diff --git a/monkey/utils.c b/monkey/utils.c
index 88776a9..742c300 100644
--- a/monkey/utils.c
+++ b/monkey/utils.c
@@ -38,20 +38,16 @@ void die(const char * const error)
exit(EXIT_FAILURE);
}
-utf8_convert_ret
-utf8_to_local_encoding(const char *string, size_t len,
- char **result)
+nserror utf8_to_local_encoding(const char *string, size_t len, char **result)
{
*result = strndup(string, len);
- return (*result == NULL) ? UTF8_CONVERT_NOMEM : UTF8_CONVERT_OK;
+ return (*result == NULL) ? NSERROR_NOMEM : NSERROR_OK;
}
-utf8_convert_ret
-utf8_from_local_encoding(const char *string, size_t len,
- char **result)
+nserror utf8_from_local_encoding(const char *string, size_t len, char **result)
{
*result = strndup(string, len);
- return (*result == NULL) ? UTF8_CONVERT_NOMEM : UTF8_CONVERT_OK;
+ return (*result == NULL) ? NSERROR_NOMEM : NSERROR_OK;
}
diff --git a/render/form.c b/render/form.c
index 32c38be..c9d74a1 100644
--- a/render/form.c
+++ b/render/form.c
@@ -992,7 +992,7 @@ char *form_acceptable_charset(struct form *form)
char *form_encode_item(const char *item, uint32_t len, const char *charset,
const char *fallback)
{
- utf8_convert_ret err;
+ nserror err;
char *ret = NULL;
char cset[256];
@@ -1002,19 +1002,19 @@ char *form_encode_item(const char *item, uint32_t len, const char *charset,
snprintf(cset, sizeof cset, "%s//TRANSLIT", charset);
err = utf8_to_enc(item, cset, 0, &ret);
- if (err == UTF8_CONVERT_BADENC) {
+ if (err == NSERROR_BAD_ENCODING) {
/* charset not understood, try without transliteration */
snprintf(cset, sizeof cset, "%s", charset);
err = utf8_to_enc(item, cset, len, &ret);
- if (err == UTF8_CONVERT_BADENC) {
+ if (err == NSERROR_BAD_ENCODING) {
/* nope, try fallback charset (if any) */
if (fallback) {
snprintf(cset, sizeof cset,
"%s//TRANSLIT", fallback);
err = utf8_to_enc(item, cset, 0, &ret);
- if (err == UTF8_CONVERT_BADENC) {
+ if (err == NSERROR_BAD_ENCODING) {
/* and without transliteration */
snprintf(cset, sizeof cset,
"%s", fallback);
@@ -1022,11 +1022,11 @@ char *form_encode_item(const char *item, uint32_t len, const char *charset,
}
}
- if (err == UTF8_CONVERT_BADENC) {
+ if (err == NSERROR_BAD_ENCODING) {
/* that also failed, use 8859-1 */
err = utf8_to_enc(item, "ISO-8859-1//TRANSLIT",
0, &ret);
- if (err == UTF8_CONVERT_BADENC) {
+ if (err == NSERROR_BAD_ENCODING) {
/* and without transliteration */
err = utf8_to_enc(item, "ISO-8859-1",
0, &ret);
@@ -1034,7 +1034,7 @@ char *form_encode_item(const char *item, uint32_t len, const char *charset,
}
}
}
- if (err == UTF8_CONVERT_NOMEM) {
+ if (err == NSERROR_NOMEM) {
return NULL;
}
diff --git a/render/html.c b/render/html.c
index 0a7ab24..bd23aac 100644
--- a/render/html.c
+++ b/render/html.c
@@ -1765,14 +1765,14 @@ static void html__dom_user_data_handler(dom_node_operation operation,
static void html__set_file_gadget_filename(struct content *c,
struct form_control *gadget, const char *fn)
{
- utf8_convert_ret ret;
+ nserror ret;
char *utf8_fn, *oldfile = NULL;
html_content *html = (html_content *)c;
struct box *file_box = gadget->box;
ret = utf8_from_local_encoding(fn,0, &utf8_fn);
- if (ret != UTF8_CONVERT_OK) {
- assert(ret != UTF8_CONVERT_BADENC);
+ if (ret != NSERROR_OK) {
+ assert(ret != NSERROR_BAD_ENCODING);
LOG(("utf8_from_local_encoding failed"));
/* Load was for us - just no memory */
return;
@@ -1874,7 +1874,7 @@ static bool html_drop_file_at_point(struct content *c, int x, int y, char *file)
FILE *fp = NULL;
char *buffer;
char *utf8_buff;
- utf8_convert_ret ret;
+ nserror ret;
unsigned int size;
int bx, by;
@@ -1916,9 +1916,9 @@ static bool html_drop_file_at_point(struct content *c, int x, int y, char *file)
/* Convert to UTF-8 */
ret = utf8_from_local_encoding(buffer, file_len, &utf8_buff);
- if (ret != UTF8_CONVERT_OK) {
+ if (ret != NSERROR_OK) {
/* bad encoding shouldn't happen */
- assert(ret != UTF8_CONVERT_BADENC);
+ assert(ret != NSERROR_BAD_ENCODING);
LOG(("utf8_from_local_encoding failed"));
free(buffer);
warn_user("NoMemory", NULL);
diff --git a/riscos/download.c b/riscos/download.c
index d0149b6..526f301 100644
--- a/riscos/download.c
+++ b/riscos/download.c
@@ -228,7 +228,7 @@ static struct gui_download_window *gui_download_window_create(download_context *
os_error *error;
url_func_result res;
char *local_path;
- utf8_convert_ret err;
+ nserror err;
size_t i, last_dot;
dw = malloc(sizeof *dw);
@@ -376,9 +376,9 @@ static struct gui_download_window *gui_download_window_create(download_context *
filename);
err = utf8_to_local_encoding(dw->path, 0, &local_path);
- if (err != UTF8_CONVERT_OK) {
+ if (err != NSERROR_OK) {
/* badenc should never happen */
- assert(err != UTF8_CONVERT_BADENC);
+ assert(err !=NSERROR_BAD_ENCODING);
LOG(("utf8_to_local_encoding failed"));
warn_user("NoMemory", 0);
free(dw);
@@ -588,7 +588,7 @@ void ro_gui_download_update_status(struct gui_download_window *dw)
os_error *error;
int width;
char *local_status;
- utf8_convert_ret err;
+ nserror err;
gettimeofday(&t, 0);
dt = (t.tv_sec + 0.000001 * t.tv_usec) - (dw->last_time.tv_sec +
@@ -622,9 +622,9 @@ void ro_gui_download_update_status(struct gui_download_window *dw)
/* convert to local encoding */
err = utf8_to_local_encoding(
messages_get("Download"), 0, &local_status);
- if (err != UTF8_CONVERT_OK) {
+ if (err != NSERROR_OK) {
/* badenc should never happen */
- assert(err != UTF8_CONVERT_BADENC);
+ assert(err != NSERROR_BAD_ENCODING);
/* hide nomem error */
snprintf(dw->status, sizeof dw->status,
messages_get("Download"),
@@ -645,9 +645,9 @@ void ro_gui_download_update_status(struct gui_download_window *dw)
err = utf8_to_local_encoding(
messages_get("DownloadU"), 0, &local_status);
- if (err != UTF8_CONVERT_OK) {
+ if (err != NSERROR_OK) {
/* badenc should never happen */
- assert(err != UTF8_CONVERT_BADENC);
+ assert(err != NSERROR_BAD_ENCODING);
/* hide nomem error */
snprintf(dw->status, sizeof dw->status,
messages_get("DownloadU"),
@@ -673,9 +673,9 @@ void ro_gui_download_update_status(struct gui_download_window *dw)
err = utf8_to_local_encoding(messages_get("Downloaded"), 0,
&local_status);
- if (err != UTF8_CONVERT_OK) {
+ if (err != NSERROR_OK) {
/* badenc should never happen */
- assert(err != UTF8_CONVERT_BADENC);
+ assert(err != NSERROR_BAD_ENCODING);
/* hide nomem error */
snprintf(dw->status, sizeof dw->status,
messages_get("Downloaded"),
diff --git a/riscos/gui/url_bar.c b/riscos/gui/url_bar.c
index d764740..681824d 100644
--- a/riscos/gui/url_bar.c
+++ b/riscos/gui/url_bar.c
@@ -956,12 +956,12 @@ void ro_gui_url_bar_set_url(struct url_bar *url_bar, const char *url,
*/
if (is_utf8) {
- utf8_convert_ret err;
+ nserror err;
err = utf8_to_local_encoding(url, 0, &local_text);
- if (err != UTF8_CONVERT_OK) {
+ if (err != NSERROR_OK) {
/* A bad encoding should never happen, so assert this */
- assert(err != UTF8_CONVERT_BADENC);
+ assert(err != NSERROR_BAD_ENCODING);
LOG(("utf8_to_enc failed"));
/* Paranoia */
local_text = NULL;
diff --git a/riscos/help.c b/riscos/help.c
index 14d34af..9da52f3 100644
--- a/riscos/help.c
+++ b/riscos/help.c
@@ -225,7 +225,7 @@ static void ro_gui_interactive_help_broadcast(wimp_message *message,
char *base_token;
char *local_token;
os_error *error;
- utf8_convert_ret err;
+ nserror err;
/* start off with an empty reply */
reply = (help_full_message_reply *)message;
@@ -255,9 +255,9 @@ static void ro_gui_interactive_help_broadcast(wimp_message *message,
/* convert to local encoding */
err = utf8_to_local_encoding(translated_token, 0,
&local_token);
- if (err != UTF8_CONVERT_OK) {
+ if (err != NSERROR_OK) {
/* badenc should never happen */
- assert(err != UTF8_CONVERT_BADENC);
+ assert(err != NSERROR_BAD_ENCODING);
/* simply use UTF-8 string */
strncpy(reply->reply, translated_token, 235);
}
diff --git a/riscos/menus.c b/riscos/menus.c
index e51fc34..29d5141 100644
--- a/riscos/menus.c
+++ b/riscos/menus.c
@@ -875,8 +875,7 @@ bool ro_gui_menu_translate(struct menu_definition *menu)
int alphabet;
struct menu_definition_entry *entry;
char *translated;
- utf8_convert_ret err;
-
+ nserror err;
/* read current alphabet */
error = xosbyte1(osbyte_ALPHABET_NUMBER, 127, 0, &alphabet);
@@ -895,8 +894,8 @@ bool ro_gui_menu_translate(struct menu_definition *menu)
free(menu->menu->title_data.indirected_text.text);
err = utf8_to_local_encoding(messages_get(menu->title_key),
0, &translated);
- if (err != UTF8_CONVERT_OK) {
- assert(err != UTF8_CONVERT_BADENC);
+ if (err != NSERROR_OK) {
+ assert(err != NSERROR_BAD_ENCODING);
LOG(("utf8_to_enc failed"));
return false;
}
@@ -912,8 +911,8 @@ bool ro_gui_menu_translate(struct menu_definition *menu)
free(entry->menu_entry->data.indirected_text.text);
err = utf8_to_local_encoding(messages_get(entry->entry_key),
0, &translated);
- if (err != UTF8_CONVERT_OK) {
- assert(err != UTF8_CONVERT_BADENC);
+ if (err != NSERROR_OK) {
+ assert(err != NSERROR_BAD_ENCODING);
LOG(("utf8_to_enc failed"));
return false;
}
diff --git a/riscos/query.c b/riscos/query.c
index 6401ad2..2268494 100644
--- a/riscos/query.c
+++ b/riscos/query.c
@@ -150,7 +150,7 @@ query_id query_user_xy(const char *query, const char *detail,
int len;
int tx;
char *local_text = NULL;
- utf8_convert_ret err;
+ nserror err;
qw = malloc(sizeof(struct gui_query_window));
if (!qw) {
@@ -171,8 +171,8 @@ query_id query_user_xy(const char *query, const char *detail,
/* set the text of the 'Yes' button and size accordingly */
err = utf8_to_local_encoding(yes, 0, &local_text);
- if (err != UTF8_CONVERT_OK) {
- assert(err != UTF8_CONVERT_BADENC);
+ if (err != NSERROR_OK) {
+ assert(err != NSERROR_BAD_ENCODING);
LOG(("utf8_to_local_encoding_failed"));
local_text = NULL;
}
@@ -201,8 +201,8 @@ query_id query_user_xy(const char *query, const char *detail,
/* set the text of the 'No' button and size accordingly */
err = utf8_to_local_encoding(no, 0, &local_text);
- if (err != UTF8_CONVERT_OK) {
- assert(err != UTF8_CONVERT_BADENC);
+ if (err != NSERROR_OK) {
+ assert(err != NSERROR_BAD_ENCODING);
LOG(("utf8_to_local_encoding_failed"));
local_text = NULL;
}
diff --git a/riscos/save.c b/riscos/save.c
index 59222c4..cc12344 100644
--- a/riscos/save.c
+++ b/riscos/save.c
@@ -614,7 +614,7 @@ static void ro_gui_save_drag_end(wimp_dragged *drag, void *data)
os_error *error;
char *dp, *ep;
char *local_name = NULL;
- utf8_convert_ret err;
+ nserror err;
if (dragbox_active)
ro_gui_drag_box_cancel();
@@ -651,9 +651,9 @@ static void ro_gui_save_drag_end(wimp_dragged *drag, void *data)
/* saving directly from browser window, choose a
* name based upon the URL */
err = utf8_to_local_encoding(save_leafname, 0, &local_name);
- if (err != UTF8_CONVERT_OK) {
+ if (err != NSERROR_OK) {
/* badenc should never happen */
- assert(err != UTF8_CONVERT_BADENC);
+ assert(err != NSERROR_BAD_ENCODING);
local_name = NULL;
}
name = local_name ? local_name : save_leafname;
@@ -1216,7 +1216,7 @@ void ro_gui_save_set_state(hlcache_handle *h, gui_save_type save_type,
const char *name = gui_save_table[save_type].name;
bool done = false;
char *nice = NULL;
- utf8_convert_ret err;
+ nserror err;
char *local_name;
size_t i;
@@ -1270,9 +1270,9 @@ void ro_gui_save_set_state(hlcache_handle *h, gui_save_type save_type,
leaf_buf[leaf_len - 1] = 0;
err = utf8_to_local_encoding(name, 0, &local_name);
- if (err != UTF8_CONVERT_OK) {
+ if (err != NSERROR_OK) {
/* badenc should never happen */
- assert(err != UTF8_CONVERT_BADENC);
+ assert(err != NSERROR_BAD_ENCODING);
local_name = NULL;
}
diff --git a/riscos/textselection.c b/riscos/textselection.c
index 73b5246..c070754 100644
--- a/riscos/textselection.c
+++ b/riscos/textselection.c
@@ -391,7 +391,7 @@ bool ro_gui_selection_prepare_paste_dataload(
FILE *fp;
long size;
char *local_cb;
- utf8_convert_ret ret;
+ nserror ret;
/* Ignore messages that aren't for us */
if (dataxfer->your_ref == 0 || dataxfer->your_ref != paste_prev_message)
@@ -410,7 +410,7 @@ bool ro_gui_selection_prepare_paste_dataload(
ret = utf8_from_local_encoding(local_cb, size,
&clipboard);
- if (ret == UTF8_CONVERT_OK) {
+ if (ret == NSERROR_OK) {
clip_length = strlen(clipboard);
}
@@ -509,13 +509,13 @@ void ro_gui_selection_data_request(wimp_full_message_data_request *req)
bool ro_gui_save_clipboard(const char *path)
{
char *local_cb;
- utf8_convert_ret ret;
+ nserror ret;
os_error *error;
assert(clip_length > 0 && clipboard);
ret = utf8_to_local_encoding(clipboard, clip_length, &local_cb);
- if (ret != UTF8_CONVERT_OK) {
+ if (ret != NSERROR_OK) {
warn_user("SaveError", "Could not convert");
return false;
}
diff --git a/riscos/ucstables.c b/riscos/ucstables.c
index 970caf1..4754bac 100644
--- a/riscos/ucstables.c
+++ b/riscos/ucstables.c
@@ -446,17 +446,16 @@ static const struct special {
* \param string The string to convert
* \param len The length (in bytes) of the string, or 0
* \param result Pointer to location in which to store result
- * \return The appropriate utf8_convert_ret value
+ * \return An nserror code
*/
-utf8_convert_ret utf8_to_local_encoding(const char *string, size_t len,
- char **result)
+nserror utf8_to_local_encoding(const char *string, size_t len, char **result)
{
os_error *error;
int alphabet, i;
size_t off, prev_off;
char *temp, *cur_pos;
const char *enc;
- utf8_convert_ret err;
+ nserror err;
assert(string);
assert(result);
@@ -473,7 +472,7 @@ utf8_convert_ret utf8_to_local_encoding(const char *string, size_t len,
/* UTF-8 -> simply copy string */
if (alphabet == 111 /* UTF-8 */) {
*result = strndup(string, len);
- return UTF8_CONVERT_OK;
+ return NSERROR_OK;
}
/* get encoding name */
@@ -485,7 +484,7 @@ utf8_convert_ret utf8_to_local_encoding(const char *string, size_t len,
/* create output buffer */
*(result) = malloc(len + 1);
if (!(*result))
- return UTF8_CONVERT_NOMEM;
+ return NSERROR_NOMEM;
*(*result) = '\0';
prev_off = 0;
@@ -508,10 +507,10 @@ utf8_convert_ret utf8_to_local_encoding(const char *string, size_t len,
if (off - prev_off > 0) {
err = utf8_to_enc(string + prev_off, enc,
off - prev_off, &temp);
- if (err != UTF8_CONVERT_OK) {
- assert(err != UTF8_CONVERT_BADENC);
+ if (err != NSERROR_OK) {
+ assert(err != NSERROR_BAD_ENCODING);
free(*result);
- return UTF8_CONVERT_NOMEM;
+ return NSERROR_NOMEM;
}
strcat(cur_pos, temp);
@@ -533,10 +532,10 @@ utf8_convert_ret utf8_to_local_encoding(const char *string, size_t len,
if (prev_off < len) {
err = utf8_to_enc(string + prev_off, enc, len - prev_off,
&temp);
- if (err != UTF8_CONVERT_OK) {
- assert(err != UTF8_CONVERT_BADENC);
+ if (err != NSERROR_OK) {
+ assert(err != NSERROR_BAD_ENCODING);
free(*result);
- return UTF8_CONVERT_NOMEM;
+ return NSERROR_NOMEM;
}
strcat(cur_pos, temp);
@@ -544,7 +543,7 @@ utf8_convert_ret utf8_to_local_encoding(const char *string, size_t len,
free(temp);
}
- return UTF8_CONVERT_OK;
+ return NSERROR_OK;
}
/**
@@ -553,10 +552,9 @@ utf8_convert_ret utf8_to_local_encoding(const char *string, size_t len,
* \param string The string to convert
* \param len The length (in bytes) of the string, or 0
* \param result Pointer to location in which to store result
- * \return The appropriate utf8_convert_ret value
+ * \return An nserror code
*/
-utf8_convert_ret utf8_from_local_encoding(const char *string, size_t len,
- char **result)
+nserror utf8_from_local_encoding(const char *string, size_t len, char **result)
{
os_error *error;
int alphabet, i, num_specials = 0, result_alloc;
@@ -564,7 +562,7 @@ utf8_convert_ret utf8_from_local_encoding(const char *string, size_t len,
size_t off, prev_off, cur_off;
char *temp;
const char *enc;
- utf8_convert_ret err;
+ nserror err;
assert(string && result);
@@ -581,10 +579,10 @@ utf8_convert_ret utf8_from_local_encoding(const char *string, size_t len,
if (alphabet == 111 /* UTF-8 */) {
temp = strndup(string, len);
if (!temp)
- return UTF8_CONVERT_NOMEM;
+ return NSERROR_NOMEM;
*result = temp;
- return UTF8_CONVERT_OK;
+ return NSERROR_OK;
}
/* get encoding name */
@@ -598,7 +596,7 @@ utf8_convert_ret utf8_from_local_encoding(const char *string, size_t len,
*(result) = malloc(result_alloc);
if (!(*result))
- return UTF8_CONVERT_NOMEM;
+ return NSERROR_NOMEM;
*(*result) = '\0';
prev_off = 0;
@@ -619,11 +617,11 @@ utf8_convert_ret utf8_from_local_encoding(const char *string, size_t len,
if (off - prev_off > 0) {
err = utf8_from_enc(string + prev_off, enc,
off - prev_off, &temp, NULL);
- if (err != UTF8_CONVERT_OK) {
- assert(err != UTF8_CONVERT_BADENC);
+ if (err != NSERROR_OK) {
+ assert(err != NSERROR_BAD_ENCODING);
LOG(("utf8_from_enc failed"));
free(*result);
- return UTF8_CONVERT_NOMEM;
+ return NSERROR_NOMEM;
}
strcat((*result) + cur_off, temp);
@@ -647,7 +645,7 @@ utf8_convert_ret utf8_from_local_encoding(const char *string, size_t len,
(3 * SPECIAL_CHUNK_SIZE));
if (!temp) {
free(*result);
- return UTF8_CONVERT_NOMEM;
+ return NSERRO_NOMEM;
}
*result = temp;
@@ -661,11 +659,11 @@ utf8_convert_ret utf8_from_local_encoding(const char *string, size_t len,
if (prev_off < len) {
err = utf8_from_enc(string + prev_off, enc, len - prev_off,
&temp, NULL);
- if (err != UTF8_CONVERT_OK) {
- assert(err != UTF8_CONVERT_BADENC);
+ if (err != NSERROR_OK) {
+ assert(err != NSERROR_BAD_ENCODING);
LOG(("utf8_from_enc failed"));
free(*result);
- return UTF8_CONVERT_NOMEM;
+ return NSERROR_NOMEM;
}
strcat((*result) + cur_off, temp);
@@ -680,9 +678,9 @@ utf8_convert_ret utf8_from_local_encoding(const char *string, size_t len,
if (!temp) {
LOG(("realloc failed"));
free(*result);
- return UTF8_CONVERT_NOMEM;
+ return NSERROR_NOMEM;
}
*result = temp;
- return UTF8_CONVERT_OK;
+ return NSERROR_OK;
}
diff --git a/riscos/wimp.c b/riscos/wimp.c
index 87860ad..2e48891 100644
--- a/riscos/wimp.c
+++ b/riscos/wimp.c
@@ -273,12 +273,12 @@ void ro_gui_set_icon_string(wimp_w w, wimp_i i, const char *text, bool is_utf8)
unsigned int button_type;
if (is_utf8) {
- utf8_convert_ret err;
+ nserror err;
/* convert text to local encoding */
err = utf8_to_local_encoding(text, 0, &local_text);
- if (err != UTF8_CONVERT_OK) {
+ if (err != NSERROR_OK) {
/* A bad encoding should never happen, so assert this */
- assert(err != UTF8_CONVERT_BADENC);
+ assert(err != NSERROR_BAD_ENCODING);
LOG(("utf8_to_enc failed"));
/* Paranoia */
local_text = NULL;
@@ -677,7 +677,7 @@ void ro_gui_set_window_title(wimp_w w, const char *text)
wimp_window_info_base window;
os_error *error;
char *title_local_enc;
- utf8_convert_ret err;
+ nserror err;
/* Get the window details
*/
@@ -692,10 +692,10 @@ void ro_gui_set_window_title(wimp_w w, const char *text)
/* convert text to local encoding */
err = utf8_to_local_encoding(text, 0, &title_local_enc);
- if (err != UTF8_CONVERT_OK) {
+ if (err != NSERROR_OK) {
/* A bad encoding should never happen,
* so assert this */
- assert(err != UTF8_CONVERT_BADENC);
+ assert(err != NSERROR_BAD_ENCODING);
LOG(("utf8_to_enc failed"));
return;
}
diff --git a/riscos/window.c b/riscos/window.c
index 2221425..1f70d3d 100644
--- a/riscos/window.c
+++ b/riscos/window.c
@@ -4621,7 +4621,7 @@ bool ro_gui_window_import_text(struct gui_window *g, const char *filename)
os_error *error;
char *buf, *utf8_buf, *sp;
int size;
- utf8_convert_ret ret;
+ nserror ret;
const char *ep;
char *p;
@@ -4656,9 +4656,9 @@ bool ro_gui_window_import_text(struct gui_window *g, const char *filename)
}
ret = utf8_from_local_encoding(buf, size, &utf8_buf);
- if (ret != UTF8_CONVERT_OK) {
+ if (ret != NSERROR_OK) {
/* bad encoding shouldn't happen */
- assert(ret != UTF8_CONVERT_BADENC);
+ assert(ret != NSERROR_BAD_ENCODING);
LOG(("utf8_from_local_encoding failed"));
free(buf);
warn_user("NoMemory", NULL);
@@ -4802,7 +4802,7 @@ bool ro_gui_window_prepare_form_select_menu(struct browser_window *bw,
char *text_convert, *temp;
struct form_option *option;
bool reopen = true;
- utf8_convert_ret err;
+ nserror err;
assert(control);
@@ -4839,9 +4839,9 @@ bool ro_gui_window_prepare_form_select_menu(struct browser_window *bw,
}
err = utf8_to_local_encoding(messages_get("SelectMenu"), 0,
&text_convert);
- if (err != UTF8_CONVERT_OK) {
+ if (err != NSERROR_OK) {
/* badenc should never happen */
- assert(err != UTF8_CONVERT_BADENC);
+ assert(err != NSERROR_BAD_ENCODING);
LOG(("utf8_to_local_encoding failed"));
warn_user("NoMemory", 0);
ro_gui_menu_closed();
@@ -4875,10 +4875,10 @@ bool ro_gui_window_prepare_form_select_menu(struct browser_window *bw,
err = utf8_to_local_encoding(temp,
0, &text_convert);
- if (err != UTF8_CONVERT_OK) {
+ if (err != NSERROR_OK) {
/* A bad encoding should never happen,
* so assert this */
- assert(err != UTF8_CONVERT_BADENC);
+ assert(err != NSERROR_BAD_ENCODING);
LOG(("utf8_to_enc failed"));
warn_user("NoMemory", 0);
ro_gui_menu_closed();
diff --git a/utils/utf8.c b/utils/utf8.c
index 8e9587d..ab7bbae 100644
--- a/utils/utf8.c
+++ b/utils/utf8.c
@@ -33,23 +33,14 @@
#include "utils/log.h"
#include "utils/utf8.h"
-/**
- * Convert a UTF-8 multibyte sequence into a single UCS4 character
- *
- * Encoding of UCS values outside the UTF-16 plane has been removed from
- * RFC3629. This function conforms to RFC2279, however.
- *
- * \param s_in The sequence to process
- * \param l Length of sequence
- * \return UCS4 character
- */
+/* exported interface documented in utils/utf8.h */
uint32_t utf8_to_ucs4(const char *s_in, size_t l)
{
uint32_t ucs4;
size_t len;
parserutils_error perror;
- perror = parserutils_charset_utf8_to_ucs4((const uint8_t *) s_in, l,
+ perror = parserutils_charset_utf8_to_ucs4((const uint8_t *) s_in, l,
&ucs4, &len);
if (perror != PARSERUTILS_OK)
ucs4 = 0xfffd;
@@ -57,16 +48,7 @@ uint32_t utf8_to_ucs4(const char *s_in, size_t l)
return ucs4;
}
-/**
- * Convert a single UCS4 character into a UTF-8 multibyte sequence
- *
- * Encoding of UCS values outside the UTF-16 plane has been removed from
- * RFC3629. This function conforms to RFC2279, however.
- *
- * \param c The character to process (0 <= c <= 0x7FFFFFFF)
- * \param s Pointer to 6 byte long output buffer
- * \return Length of multibyte sequence
- */
+/* exported interface documented in utils/utf8.h */
size_t utf8_from_ucs4(uint32_t c, char *s)
{
uint8_t *in = (uint8_t *) s;
@@ -84,24 +66,13 @@ size_t utf8_from_ucs4(uint32_t c, char *s)
return 6 - len;
}
-/**
- * Calculate the length (in characters) of a NULL-terminated UTF-8 string
- *
- * \param s The string
- * \return Length of string
- */
+/* exported interface documented in utils/utf8.h */
size_t utf8_length(const char *s)
{
return utf8_bounded_length(s, strlen(s));
}
-/**
- * Calculated the length (in characters) of a bounded UTF-8 string
- *
- * \param s The string
- * \param l Maximum length of input (in bytes)
- * \return Length of string, in characters
- */
+/* exported interface documented in utils/utf8.h */
size_t utf8_bounded_length(const char *s, size_t l)
{
size_t len;
@@ -114,14 +85,7 @@ size_t utf8_bounded_length(const char *s, size_t l)
return len;
}
-/**
- * Calculate the length (in bytes) of a bounded UTF-8 string
- *
- * \param s The string
- * \param l Maximum length of input (in bytes)
- * \param c Maximum number of characters to measure
- * \return Length of string, in bytes
- */
+/* exported interface documented in utils/utf8.h */
size_t utf8_bounded_byte_length(const char *s, size_t l, size_t c)
{
size_t len = 0;
@@ -132,12 +96,7 @@ size_t utf8_bounded_byte_length(const char *s, size_t l, size_t c)
return len;
}
-/**
- * Calculate the length (in bytes) of a UTF-8 character
- *
- * \param s Pointer to start of character
- * \return Length of character, in bytes
- */
+/* exported interface documented in utils/utf8.h */
size_t utf8_char_byte_length(const char *s)
{
size_t len;
@@ -150,13 +109,7 @@ size_t utf8_char_byte_length(const char *s)
return len;
}
-/**
- * Find previous legal UTF-8 char in string
- *
- * \param s The string
- * \param o Offset in the string to start at
- * \return Offset of first byte of previous legal character
- */
+/* exported interface documented in utils/utf8.h */
size_t utf8_prev(const char *s, size_t o)
{
uint32_t prev;
@@ -168,20 +121,13 @@ size_t utf8_prev(const char *s, size_t o)
return prev;
}
-/**
- * Find next legal UTF-8 char in string
- *
- * \param s The string
- * \param l Maximum offset in string
- * \param o Offset in the string to start at
- * \return Offset of first byte of next legal character
- */
+/* exported interface documented in utils/utf8.h */
size_t utf8_next(const char *s, size_t l, size_t o)
{
uint32_t next;
parserutils_error perror;
- perror = parserutils_charset_utf8_next((const uint8_t *) s, l, o,
+ perror = parserutils_charset_utf8_next((const uint8_t *) s, l, o,
&next);
assert(perror == PARSERUTILS_OK);
@@ -202,16 +148,16 @@ static inline void utf8_clear_cd_cache(void)
last_cd.cd = 0;
}
-/**
- * Finalise the UTF-8 library
- */
-void utf8_finalise(void)
+/* exported interface documented in utils/utf8.h */
+nserror utf8_finalise(void)
{
if (last_cd.cd != 0)
iconv_close(last_cd.cd);
/* paranoia follows */
utf8_clear_cd_cache();
+
+ return NSERROR_OK;
}
@@ -224,11 +170,16 @@ void utf8_finalise(void)
* \param to The encoding name to convert to
* \param result Pointer to location in which to store result.
* \param result_len Pointer to location in which to store result length.
- * \return Appropriate utf8_convert_ret value
+ * \return NSERROR_OK for no error, NSERROR_NOMEM on allocation error,
+ * NSERROR_BAD_ENCODING for a bad character encoding
*/
-static utf8_convert_ret utf8_convert(const char *string, size_t len,
- const char *from, const char *to,
- char **result, size_t *result_len)
+static nserror
+utf8_convert(const char *string,
+ size_t len,
+ const char *from,
+ const char *to,
+ char **result,
+ size_t *result_len)
{
iconv_t cd;
char *temp, *out, *in;
@@ -237,16 +188,16 @@ static utf8_convert_ret utf8_convert(const char *string, size_t len,
assert(string && from && to && result);
if (string[0] == '\0') {
- /* On AmigaOS, iconv() returns an error if we pass an
- * empty string. This prevents iconv() being called as
+ /* On AmigaOS, iconv() returns an error if we pass an
+ * empty string. This prevents iconv() being called as
* there is no conversion necessary anyway. */
*result = strdup("");
if (!(*result)) {
*result = NULL;
- return UTF8_CONVERT_NOMEM;
+ return NSERROR_NOMEM;
}
- return UTF8_CONVERT_OK;
+ return NSERROR_OK;
}
if (strcasecmp(from, to) == 0) {
@@ -255,10 +206,10 @@ static utf8_convert_ret utf8_convert(const char *string, size_t len,
*(result) = strndup(string, slen);
if (!(*result)) {
*(result) = NULL;
- return UTF8_CONVERT_NOMEM;
+ return NSERROR_NOMEM;
}
- return UTF8_CONVERT_OK;
+ return NSERROR_OK;
}
in = (char *)string;
@@ -274,9 +225,9 @@ static utf8_convert_ret utf8_convert(const char *string, size_t len,
cd = iconv_open(to, from);
if (cd == (iconv_t)-1) {
if (errno == EINVAL)
- return UTF8_CONVERT_BADENC;
+ return NSERROR_BAD_ENCODING;
/* default to no memory */
- return UTF8_CONVERT_NOMEM;
+ return NSERROR_NOMEM;
}
/* close the last cd - we don't care if this fails */
@@ -297,8 +248,9 @@ static utf8_convert_ret utf8_convert(const char *string, size_t len,
rlen = slen * 4 + 4;
temp = out = malloc(rlen);
- if (!out)
- return UTF8_CONVERT_NOMEM;
+ if (!out) {
+ return NSERROR_NOMEM;
+ }
/* perform conversion */
if (iconv(cd, (void *) &in, &slen, &out, &rlen) == (size_t)-1) {
@@ -312,14 +264,14 @@ static utf8_convert_ret utf8_convert(const char *string, size_t len,
* a) Insufficiently large output buffer
* b) Invalid input byte sequence
* c) Incomplete input sequence */
- return UTF8_CONVERT_NOMEM;
+ return NSERROR_NOMEM;
}
*(result) = realloc(temp, out - temp + 4);
if (!(*result)) {
free(temp);
*(result) = NULL; /* for sanity's sake */
- return UTF8_CONVERT_NOMEM;
+ return NSERROR_NOMEM;
}
/* NULL terminate - needs 4 characters as we may have
@@ -330,42 +282,32 @@ static utf8_convert_ret utf8_convert(const char *string, size_t len,
*result_len = (out - temp);
}
- return UTF8_CONVERT_OK;
+ return NSERROR_OK;
}
-/**
- * Convert a UTF8 string into the named encoding
- *
- * \param string The NULL-terminated string to convert
- * \param encname The encoding name (suitable for passing to iconv)
- * \param len Length of input string to consider (in bytes), or 0
- * \param result Pointer to location to store result (allocated on heap)
- * \return Appropriate utf8_convert_ret value
- */
-utf8_convert_ret utf8_to_enc(const char *string, const char *encname,
+/* exported interface documented in utils/utf8.h */
+nserror utf8_to_enc(const char *string, const char *encname,
size_t len, char **result)
{
return utf8_convert(string, len, "UTF-8", encname, result, NULL);
}
-/**
- * Convert a string in the named encoding into a UTF-8 string
- *
- * \param string The NULL-terminated string to convert
- * \param encname The encoding name (suitable for passing to iconv)
- * \param len Length of input string to consider (in bytes), or 0
- * \param result Pointer to location to store result (allocated on heap)
- * \return Appropriate utf8_convert_ret value
- */
-utf8_convert_ret utf8_from_enc(const char *string, const char *encname,
+/* exported interface documented in utils/utf8.h */
+nserror utf8_from_enc(const char *string, const char *encname,
size_t len, char **result, size_t *result_len)
{
return utf8_convert(string, len, encname, "UTF-8", result, result_len);
}
-static utf8_convert_ret utf8_convert_html_chunk(iconv_t cd,
- const char *chunk, size_t inlen,
- char **out, size_t *outlen)
+/**
+ * convert a chunk of html data
+ */
+static nserror
+utf8_convert_html_chunk(iconv_t cd,
+ const char *chunk,
+ size_t inlen,
+ char **out,
+ size_t *outlen)
{
size_t ret, esclen;
uint32_t ucs4;
@@ -377,7 +319,7 @@ static utf8_convert_ret utf8_convert_html_chunk(iconv_t cd,
break;
if (errno != EILSEQ)
- return UTF8_CONVERT_NOMEM;
+ return NSERROR_NOMEM;
ucs4 = utf8_to_ucs4(chunk, inlen);
esclen = snprintf(escape, sizeof(escape), "&#x%06x;", ucs4);
@@ -385,34 +327,25 @@ static utf8_convert_ret utf8_convert_html_chunk(iconv_t cd,
ret = iconv(cd, (void *) &pescape, &esclen,
(void *) out, outlen);
if (ret == (size_t) -1)
- return UTF8_CONVERT_NOMEM;
+ return NSERROR_NOMEM;
esclen = utf8_next(chunk, inlen, 0);
chunk += esclen;
inlen -= esclen;
}
- return UTF8_CONVERT_OK;
+ return NSERROR_OK;
}
-/**
- * Convert a UTF-8 encoded string into a string of the given encoding,
- * applying HTML escape sequences where necessary.
- *
- * \param string String to convert (NUL-terminated)
- * \param encname Name of encoding to convert to
- * \param len Length, in bytes, of the input string, or 0
- * \param result Pointer to location to receive result
- * \return Appropriate utf8_convert_ret value
- */
-utf8_convert_ret utf8_to_html(const char *string, const char *encname,
- size_t len, char **result)
+/* exported interface documented in utils/utf8.h */
+nserror
+utf8_to_html(const char *string, const char *encname, size_t len, char **result)
{
iconv_t cd;
const char *in;
char *out, *origout;
size_t off, prev_off, inlen, outlen, origoutlen, esclen;
- utf8_convert_ret ret;
+ nserror ret;
char *pescape, escape[11];
if (len == 0)
@@ -425,15 +358,14 @@ utf8_convert_ret utf8_to_html(const char *string, const char *encname,
sizeof(last_cd.to)) == 0 &&
last_cd.cd != 0) {
cd = last_cd.cd;
- }
- else {
+ } else {
/* no match, so create a new cd */
cd = iconv_open(encname, "UTF-8");
if (cd == (iconv_t) -1) {
if (errno == EINVAL)
- return UTF8_CONVERT_BADENC;
+ return NSERROR_BAD_ENCODING;
/* default to no memory */
- return UTF8_CONVERT_NOMEM;
+ return NSERROR_NOMEM;
}
/* close the last cd - we don't care if this fails */
@@ -446,8 +378,8 @@ utf8_convert_ret utf8_to_html(const char *string, const char *encname,
last_cd.cd = cd;
}
- /* Worst case is ASCII -> UCS4, with all characters escaped:
- * "&#xYYYYYY;", thus each input character may become a string
+ /* Worst case is ASCII -> UCS4, with all characters escaped:
+ * "&#xYYYYYY;", thus each input character may become a string
* of 10 UCS4 characters, each 4 bytes in length, plus four for
* terminating the string */
origoutlen = outlen = len * 10 * 4 + 4;
@@ -455,7 +387,7 @@ utf8_convert_ret utf8_to_html(const char *string, const char *encname,
if (out == NULL) {
iconv_close(cd);
utf8_clear_cd_cache();
- return UTF8_CONVERT_NOMEM;
+ return NSERROR_NOMEM;
}
/* Process input in chunks between characters we must escape */
@@ -470,7 +402,7 @@ utf8_convert_ret utf8_to_html(const char *string, const char *encname,
inlen = off - prev_off;
ret = utf8_convert_html_chunk(cd, in, inlen,
&out, &outlen);
- if (ret != UTF8_CONVERT_OK) {
+ if (ret != NSERROR_OK) {
free(origout);
iconv_close(cd);
utf8_clear_cd_cache();
@@ -484,7 +416,7 @@ utf8_convert_ret utf8_to_html(const char *string, const char *encname,
pescape = escape;
ret = utf8_convert_html_chunk(cd, pescape, esclen,
&out, &outlen);
- if (ret != UTF8_CONVERT_OK) {
+ if (ret != NSERROR_OK) {
free(origout);
iconv_close(cd);
utf8_clear_cd_cache();
@@ -502,7 +434,7 @@ utf8_convert_ret utf8_to_html(const char *string, const char *encname,
in = string + prev_off;
inlen = len - prev_off;
ret = utf8_convert_html_chunk(cd, in, inlen, &out, &outlen);
- if (ret != UTF8_CONVERT_OK) {
+ if (ret != NSERROR_OK) {
free(origout);
iconv_close(cd);
utf8_clear_cd_cache();
@@ -518,30 +450,22 @@ utf8_convert_ret utf8_to_html(const char *string, const char *encname,
*result = realloc(origout, origoutlen - outlen);
if (*result == NULL) {
free(origout);
- return UTF8_CONVERT_NOMEM;
+ return NSERROR_NOMEM;
}
- return UTF8_CONVERT_OK;
+ return NSERROR_OK;
}
-
-/**
- * Save the given utf8 text to a file, converting to local encoding.
- *
- * \param utf8_text text to save to file
- * \param path pathname to save to
- * \return true iff the save succeeded
- */
-
+/* exported interface documented in utils/utf8.h */
bool utf8_save_text(const char *utf8_text, const char *path)
{
- utf8_convert_ret ret;
+ nserror ret;
char *conv;
FILE *out;
ret = utf8_to_local_encoding(utf8_text, strlen(utf8_text), &conv);
- if (ret != UTF8_CONVERT_OK) {
+ if (ret != NSERROR_OK) {
LOG(("failed to convert to local encoding, return %d", ret));
return false;
}
@@ -562,5 +486,3 @@ bool utf8_save_text(const char *utf8_text, const char *path)
return false;
}
-
-
diff --git a/utils/utf8.h b/utils/utf8.h
index 68d42d3..7c450b5 100644
--- a/utils/utf8.h
+++ b/utils/utf8.h
@@ -26,40 +26,144 @@
#include <stdbool.h>
#include <stdint.h>
-typedef enum {
- UTF8_CONVERT_OK,
- UTF8_CONVERT_NOMEM,
- UTF8_CONVERT_BADENC
-} utf8_convert_ret;
+#include "utils/errors.h"
+/**
+ * Convert a UTF-8 multibyte sequence into a single UCS4 character
+ *
+ * Encoding of UCS values outside the UTF-16 plane has been removed from
+ * RFC3629. This function conforms to RFC2279, however.
+ *
+ * \param s_in The sequence to process
+ * \param l Length of sequence
+ * \return UCS4 character
+ */
uint32_t utf8_to_ucs4(const char *s, size_t l);
+
+/**
+ * Convert a single UCS4 character into a UTF-8 multibyte sequence
+ *
+ * Encoding of UCS values outside the UTF-16 plane has been removed from
+ * RFC3629. This function conforms to RFC2279, however.
+ *
+ * \param c The character to process (0 <= c <= 0x7FFFFFFF)
+ * \param s Pointer to 6 byte long output buffer
+ * \return Length of multibyte sequence
+ */
size_t utf8_from_ucs4(uint32_t c, char *s);
+
+/**
+ * Calculate the length (in characters) of a NULL-terminated UTF-8 string
+ *
+ * \param s The string
+ * \return Length of string
+ */
size_t utf8_length(const char *s);
+
+/**
+ * Calculated the length (in characters) of a bounded UTF-8 string
+ *
+ * \param s The string
+ * \param l Maximum length of input (in bytes)
+ * \return Length of string, in characters
+ */
size_t utf8_bounded_length(const char *s, size_t l);
+
+/**
+ * Calculate the length (in bytes) of a bounded UTF-8 string
+ *
+ * \param s The string
+ * \param l Maximum length of input (in bytes)
+ * \param c Maximum number of characters to measure
+ * \return Length of string, in bytes
+ */
size_t utf8_bounded_byte_length(const char *s, size_t l, size_t c);
+/**
+ * Calculate the length (in bytes) of a UTF-8 character
+ *
+ * \param s Pointer to start of character
+ * \return Length of character, in bytes
+ */
size_t utf8_char_byte_length(const char *s);
+
+/**
+ * Find previous legal UTF-8 char in string
+ *
+ * \param s The string
+ * \param o Offset in the string to start at
+ * \return Offset of first byte of previous legal character
+ */
size_t utf8_prev(const char *s, size_t o);
+
+/**
+ * Find next legal UTF-8 char in string
+ *
+ * \param s The string
+ * \param l Maximum offset in string
+ * \param o Offset in the string to start at
+ * \return Offset of first byte of next legal character
+ */
size_t utf8_next(const char *s, size_t l, size_t o);
-utf8_convert_ret utf8_to_enc(const char *string, const char *encname,
+
+/**
+ * Convert a UTF8 string into the named encoding
+ *
+ * \param string The NULL-terminated string to convert
+ * \param encname The encoding name (suitable for passing to iconv)
+ * \param len Length of input string to consider (in bytes), or 0
+ * \param result Pointer to location to store result (allocated on heap)
+ * \return standard nserror value
+ */
+nserror utf8_to_enc(const char *string, const char *encname,
size_t len, char **result);
-utf8_convert_ret utf8_from_enc(const char *string, const char *encname,
+
+/**
+ * Convert a string in the named encoding into a UTF-8 string
+ *
+ * \param string The NULL-terminated string to convert
+ * \param encname The encoding name (suitable for passing to iconv)
+ * \param len Length of input string to consider (in bytes), or 0
+ * \param result Pointer to location to store result (allocated on heap)
+ * \return standard nserror value
+ */
+nserror utf8_from_enc(const char *string, const char *encname,
size_t len, char **result, size_t *result_len);
-utf8_convert_ret utf8_to_html(const char *string, const char *encname,
+/**
+ * Convert a UTF-8 encoded string into a string of the given encoding,
+ * applying HTML escape sequences where necessary.
+ *
+ * \param string String to convert (NUL-terminated)
+ * \param encname Name of encoding to convert to
+ * \param len Length, in bytes, of the input string, or 0
+ * \param result Pointer to location to receive result
+ * \return standard nserror code
+ */
+nserror utf8_to_html(const char *string, const char *encname,
size_t len, char **result);
+/**
+ * Save the given utf8 text to a file, converting to local encoding.
+ *
+ * \param utf8_text text to save to file
+ * \param path pathname to save to
+ * \return true iff the save succeeded
+ */
bool utf8_save_text(const char *utf8_text, const char *path);
+
+/**
+ * Finalise the UTF-8 library
+ */
+nserror utf8_finalise(void);
+
/* These two are platform specific */
-utf8_convert_ret utf8_to_local_encoding(const char *string, size_t len,
- char **result);
-utf8_convert_ret utf8_from_local_encoding(const char *string, size_t len,
- char **result);
+nserror utf8_to_local_encoding(const char *string, size_t len, char **result);
+nserror utf8_from_local_encoding(const char *string, size_t len, char **result);
-void utf8_finalise(void);
#endif
diff --git a/windows/font.c b/windows/font.c
index c99cec7..98269a3 100644
--- a/windows/font.c
+++ b/windows/font.c
@@ -35,7 +35,7 @@
#include "windows/gui.h"
#include "windows/plot.h"
-utf8_convert_ret utf8_to_font_encoding(const struct font_desc* font,
+nserror utf8_to_font_encoding(const struct font_desc* font,
const char *string,
size_t len,
char **result)
@@ -43,14 +43,14 @@ utf8_convert_ret utf8_to_font_encoding(const struct font_desc* font,
return utf8_to_enc(string, font->encoding, len, result);
}
-utf8_convert_ret utf8_to_local_encoding(const char *string,
+nserror utf8_to_local_encoding(const char *string,
size_t len,
char **result)
{
return utf8_to_enc(string, "UCS-2", len, result);
}
-utf8_convert_ret utf8_from_local_encoding(const char *string, size_t len,
+nserror utf8_from_local_encoding(const char *string, size_t len,
char **result)
{
assert(string && result);
@@ -60,9 +60,9 @@ utf8_convert_ret utf8_from_local_encoding(const char *string, size_t len,
*result = strndup(string, len);
if (!(*result))
- return UTF8_CONVERT_NOMEM;
+ return NSERROR_NOMEM;
- return UTF8_CONVERT_OK;
+ return NSERROR_OK;
}
HFONT get_font(const plot_font_style_t *style)
diff --git a/windows/font.h b/windows/font.h
index 4bd100f..45428fe 100644
--- a/windows/font.h
+++ b/windows/font.h
@@ -29,7 +29,7 @@ struct font_desc {
const char *encoding;
};
-extern utf8_convert_ret utf8_to_font_encoding(const struct font_desc* font,
+extern nserror utf8_to_font_encoding(const struct font_desc* font,
const char *string,
size_t len,
char **result);
-----------------------------------------------------------------------
Summary of changes:
amiga/clipboard.c | 2 +-
amiga/font.c | 6 +-
amiga/utf8.c | 10 +-
atari/encoding.c | 12 +--
atari/gui.c | 14 ++--
atari/plot/font_internal.c | 2 +-
atari/plot/font_vdi.c | 2 +-
atari/rootwin.c | 6 +-
atari/toolbar.c | 4 +-
beos/gui.cpp | 14 +--
cocoa/utf8.m | 9 +-
desktop/global_history.c | 9 +-
desktop/hotlist.c | 9 +-
desktop/save_complete.c | 17 ++--
desktop/save_text.c | 4 +-
framebuffer/font_freetype.c | 8 +-
framebuffer/font_internal.c | 10 +-
framebuffer/font_internal.h | 2 +-
gtk/dialogs/source.c | 12 +-
gtk/gui.c | 14 +--
monkey/utils.c | 12 +--
render/form.c | 14 ++--
render/html.c | 12 +-
riscos/download.c | 20 ++--
riscos/gui/url_bar.c | 6 +-
riscos/help.c | 6 +-
riscos/menus.c | 11 +-
riscos/query.c | 10 +-
riscos/save.c | 12 +-
riscos/textselection.c | 8 +-
riscos/ucstables.c | 56 +++++------
riscos/wimp.c | 12 +-
riscos/window.c | 16 ++--
utils/utf8.c | 220 ++++++++++++++-----------------------------
utils/utf8.h | 130 +++++++++++++++++++++++---
windows/font.c | 10 +-
windows/font.h | 2 +-
37 files changed, 365 insertions(+), 358 deletions(-)
diff --git a/amiga/clipboard.c b/amiga/clipboard.c
index 8df441e..d39e89e 100644
--- a/amiga/clipboard.c
+++ b/amiga/clipboard.c
@@ -246,7 +246,7 @@ static void gui_set_clipboard(const char *buffer, size_t length,
if(nsoption_bool(clipboard_write_utf8)) {
WriteChunkBytes(iffh, buffer, length);
} else {
- if(utf8_to_local_encoding(buffer, length, &text) == UTF8_CONVERT_OK) {
+ if(utf8_to_local_encoding(buffer, length, &text) == NSERROR_OK) {
char *p;
p = text;
diff --git a/amiga/font.c b/amiga/font.c
index 36c8104..3430a4e 100755
--- a/amiga/font.c
+++ b/amiga/font.c
@@ -212,7 +212,7 @@ bool nsfont_position_in_string(const plot_font_style_t *fstyle,
ULONG emwidth = (ULONG)NSA_FONT_EMWIDTH(fstyle->size);
int32 tempx;
- if(utf8_to_enc(string,"UTF-16",length,(char **)&utf16) != UTF8_CONVERT_OK) return false;
+ if(utf8_to_enc(string,"UTF-16",length,(char **)&utf16) != NSERROR_OK) return false;
outf16 = utf16;
if(!(ofont = ami_open_outline_font(fstyle, 0))) return false;
@@ -301,7 +301,7 @@ bool nsfont_split(const plot_font_style_t *fstyle,
int32 tempx = 0;
ULONG emwidth = (ULONG)NSA_FONT_EMWIDTH(fstyle->size);
- if(utf8_to_enc((char *)string,"UTF-16",length,(char **)&utf16) != UTF8_CONVERT_OK) return false;
+ if(utf8_to_enc((char *)string,"UTF-16",length,(char **)&utf16) != NSERROR_OK) return false;
outf16 = utf16;
if(!(ofont = ami_open_outline_font(fstyle, 0))) return false;
@@ -732,7 +732,7 @@ ULONG ami_unicode_text(struct RastPort *rp, const char *string, ULONG length,
if(!string || string[0]=='\0') return 0;
if(!length) return 0;
- if(utf8_to_enc(string,"UTF-16",length,(char **)&utf16) != UTF8_CONVERT_OK) return 0;
+ if(utf8_to_enc(string,"UTF-16",length,(char **)&utf16) != NSERROR_OK) return 0;
outf16 = utf16;
if(!(ofont = ami_open_outline_font(fstyle, 0))) return 0;
diff --git a/amiga/utf8.c b/amiga/utf8.c
index a620ac1..d182492 100755
--- a/amiga/utf8.c
+++ b/amiga/utf8.c
@@ -34,7 +34,7 @@ char *ami_utf8_easy(const char *string)
{
char *localtext;
- if(utf8_to_local_encoding(string,strlen(string),&localtext) == UTF8_CONVERT_OK)
+ if(utf8_to_local_encoding(string,strlen(string),&localtext) == NSERROR_OK)
{
return localtext;
}
@@ -48,7 +48,7 @@ char *ami_to_utf8_easy(const char *string)
{
char *localtext;
- if(utf8_from_local_encoding(string,strlen(string),&localtext) == UTF8_CONVERT_OK)
+ if(utf8_from_local_encoding(string,strlen(string),&localtext) == NSERROR_OK)
{
return localtext;
}
@@ -58,8 +58,7 @@ char *ami_to_utf8_easy(const char *string)
}
}
-utf8_convert_ret utf8_from_local_encoding(const char *string, size_t len,
- char **result)
+nserror utf8_from_local_encoding(const char *string, size_t len, char **result)
{
const char *encname = "ISO-8859-1";
@@ -73,8 +72,7 @@ utf8_convert_ret utf8_from_local_encoding(const char *string, size_t len,
return utf8_from_enc(string,encname,len,result,NULL);
}
-utf8_convert_ret utf8_to_local_encoding(const char *string, size_t len,
- char **result)
+nserror utf8_to_local_encoding(const char *string, size_t len, char **result)
{
const char *encname = "ISO-8859-1";
diff --git a/atari/encoding.c b/atari/encoding.c
index 0212d51..626f57a 100644
--- a/atari/encoding.c
+++ b/atari/encoding.c
@@ -21,23 +21,21 @@
/* TODO: this need a rework..., encoding to atari st doesn|t always work.
( gui_add_to_clipboard...) */
-utf8_convert_ret utf8_to_local_encoding(const char *string,
+nserror utf8_to_local_encoding(const char *string,
size_t len,
char **result)
{
- utf8_convert_ret r;
+ nserror r;
r = utf8_to_enc(string, "ATARIST", len, result);
- if(r != UTF8_CONVERT_OK) {
+ if(r != NSERROR_OK) {
r = utf8_to_enc(string, "UTF-8", len, result);
- assert( r == UTF8_CONVERT_OK );
+ assert( r == NSERROR_OK );
}
return r;
}
-utf8_convert_ret utf8_from_local_encoding(const char *string,
- size_t len,
- char **result)
+nserror utf8_from_local_encoding(const char *string, size_t len, char **result)
{
return utf8_from_enc(string, "ATARIST", len, result, NULL);
}
diff --git a/atari/gui.c b/atari/gui.c
index f1f557e..af5e1f8 100644
--- a/atari/gui.c
+++ b/atari/gui.c
@@ -326,7 +326,7 @@ static void gui_window_set_title(struct gui_window *gw, const char *title)
int l;
char * conv;
l = strlen(title)+1;
- if (utf8_to_local_encoding(title, l-1, &conv) == UTF8_CONVERT_OK ) {
+ if (utf8_to_local_encoding(title, l-1, &conv) == NSERROR_OK ) {
l = MIN((uint32_t)atari_sysinfo.aes_max_win_title_len, strlen(conv));
if(gw->title == NULL)
gw->title = malloc(l);
@@ -699,16 +699,16 @@ static void gui_get_clipboard(char **buffer, size_t *length)
// clipboard is in atari encoding, convert it to utf8:
char *utf8 = NULL;
- utf8_convert_ret ret;
+ nserror ret;
clip_len = strlen(clip);
if (clip_len > 0) {
ret = utf8_to_local_encoding(clip, clip_len, &utf8);
- if (ret == UTF8_CONVERT_OK && utf8 != NULL) {
+ if (ret == NSERROR_OK && utf8 != NULL) {
*buffer = utf8;
*length = strlen(utf8);
} else {
- assert(ret == UTF8_CONVERT_OK && utf8 != NULL);
+ assert(ret == NSERROR_OK && utf8 != NULL);
}
}
@@ -731,14 +731,14 @@ static void gui_set_clipboard(const char *buffer, size_t length,
// convert utf8 input to atari encoding:
- utf8_convert_ret ret;
+ nserror ret;
char *clip = NULL;
ret = utf8_to_local_encoding(buffer,length, &clip);
- if (ret == UTF8_CONVERT_OK) {
+ if (ret == NSERROR_OK) {
scrap_txt_write(clip);
} else {
- assert(ret == UTF8_CONVERT_OK);
+ assert(ret == NSERROR_OK);
}
free(clip);
}
diff --git a/atari/plot/font_internal.c b/atari/plot/font_internal.c
index 2b0025a..e3c806c 100644
--- a/atari/plot/font_internal.c
+++ b/atari/plot/font_internal.c
@@ -72,7 +72,7 @@ fb_get_font(const plot_font_style_t *fstyle)
}
}
-static utf8_convert_ret utf8_to_font_encoding(const struct fb_font_desc* font,
+static nserror utf8_to_font_encoding(const struct fb_font_desc* font,
const char *string,
size_t len,
char **result)
diff --git a/atari/plot/font_vdi.c b/atari/plot/font_vdi.c
index 340759f..0c914b8 100755
--- a/atari/plot/font_vdi.c
+++ b/atari/plot/font_vdi.c
@@ -267,7 +267,7 @@ static int text( FONT_PLOTTER self, int x, int y, const char *text, size_t leng
short fx=0;
GRECT canvas;
char *lstr = NULL;
- assert( utf8_to_local_encoding(text, length, &lstr) == UTF8_CONVERT_OK);
+ assert( utf8_to_local_encoding(text, length, &lstr) == NSERROR_OK);
assert( lstr != NULL );
int slen = strlen(lstr);
diff --git a/atari/rootwin.c b/atari/rootwin.c
index 0f3413c..8942263 100755
--- a/atari/rootwin.c
+++ b/atari/rootwin.c
@@ -1510,15 +1510,15 @@ static void on_file_dropped(ROOTWIN *rootwin, short msg[8])
mx+sx, my+sy,
NULL);
if(processed == true) {
- utf8_convert_ret ret;
+ nserror ret;
char *utf8_fn;
ret = utf8_from_local_encoding(buff, 0, &utf8_fn);
- if (ret != UTF8_CONVERT_OK) {
+ if (ret != NSERROR_OK) {
free(buff);
/* A bad encoding should never happen */
LOG(("utf8_from_local_encoding failed"));
- assert(ret != UTF8_CONVERT_BADENC);
+ assert(ret != NSERROR_BAD_ENCODING);
/* no memory */
goto error;
}
diff --git a/atari/toolbar.c b/atari/toolbar.c
index fd9051d..8044d16 100644
--- a/atari/toolbar.c
+++ b/atari/toolbar.c
@@ -740,11 +740,11 @@ bool toolbar_key_input(struct s_toolbar *tb, short nkc)
int clip_length = strlen( clip );
if ( clip_length > 0 ) {
char *utf8;
- utf8_convert_ret res;
+ nserror res;
/* Clipboard is in local encoding so
* convert to UTF8 */
res = utf8_from_local_encoding( clip, clip_length, &utf8 );
- if ( res == UTF8_CONVERT_OK ) {
+ if ( res == NSERROR_OK ) {
toolbar_set_url(tb, utf8);
free(utf8);
ret = true;
diff --git a/beos/gui.cpp b/beos/gui.cpp
index 05e0637..97117e0 100644
--- a/beos/gui.cpp
+++ b/beos/gui.cpp
@@ -964,8 +964,7 @@ static void nsbeos_create_ssl_verify_window(struct browser_window *bw,
}
-utf8_convert_ret utf8_to_local_encoding(const char *string, size_t len,
- char **result)
+nserror utf8_to_local_encoding(const char *string, size_t len, char **result)
{
assert(string && result);
@@ -974,13 +973,12 @@ utf8_convert_ret utf8_to_local_encoding(const char *string, size_t len,
*result = strndup(string, len);
if (!(*result))
- return UTF8_CONVERT_NOMEM;
+ return NSERROR_NOMEM;
- return UTF8_CONVERT_OK;
+ return NSERROR_OK;
}
-utf8_convert_ret utf8_from_local_encoding(const char *string, size_t len,
- char **result)
+nserror utf8_from_local_encoding(const char *string, size_t len, char **result)
{
assert(string && result);
@@ -989,9 +987,9 @@ utf8_convert_ret utf8_from_local_encoding(const char *string, size_t len,
*result = strndup(string, len);
if (!(*result))
- return UTF8_CONVERT_NOMEM;
+ return NSERROR_NOMEM;
- return UTF8_CONVERT_OK;
+ return NSERROR_OK;
}
static char *path_to_url(const char *path)
diff --git a/cocoa/utf8.m b/cocoa/utf8.m
index 2ec8298..7b69918 100644
--- a/cocoa/utf8.m
+++ b/cocoa/utf8.m
@@ -20,21 +20,20 @@
#import "utils/utf8.h"
-utf8_convert_ret utf8_to_local_encoding(const char *string, size_t len,
+nserror utf8_to_local_encoding(const char *string, size_t len,
char **result)
{
NSCParameterAssert( NULL != result );
char *newString = malloc( len + 1 );
- if (NULL == newString) return UTF8_CONVERT_NOMEM;
+ if (NULL == newString) return NSERROR_NOMEM;
memcpy( newString, string, len );
newString[len] = 0;
*result = newString;
- return UTF8_CONVERT_OK;
+ return NSERROR_OK;
}
-utf8_convert_ret utf8_from_local_encoding(const char *string, size_t len,
- char **result)
+nserror utf8_from_local_encoding(const char *string, size_t len, char **result)
{
/* same function, local encoding = UTF-8 */
return utf8_to_local_encoding( string, len, result );
diff --git a/desktop/global_history.c b/desktop/global_history.c
index e8d99ef..9d0e47e 100644
--- a/desktop/global_history.c
+++ b/desktop/global_history.c
@@ -828,21 +828,21 @@ static nserror global_history_export_enter_cb(void *ctx, void *node_data,
enum treeview_node_type type, bool *abort)
{
struct treeview_export_walk_ctx *tw = ctx;
+ nserror ret;
if (type == TREE_NODE_ENTRY) {
struct global_history_entry *e = node_data;
- utf8_convert_ret ret;
char *t_text;
char *u_text;
ret = utf8_to_html(e->data[GH_TITLE].value, "iso-8859-1",
e->data[GH_TITLE].value_len, &t_text);
- if (ret != UTF8_CONVERT_OK)
+ if (ret != NSERROR_OK)
return NSERROR_SAVE_FAILED;
ret = utf8_to_html(e->data[GH_URL].value, "iso-8859-1",
e->data[GH_URL].value_len, &u_text);
- if (ret != UTF8_CONVERT_OK) {
+ if (ret != NSERROR_OK) {
free(t_text);
return NSERROR_SAVE_FAILED;
}
@@ -855,12 +855,11 @@ static nserror global_history_export_enter_cb(void *ctx, void *node_data,
} else if (type == TREE_NODE_FOLDER) {
struct global_history_folder *f = node_data;
- utf8_convert_ret ret;
char *f_text;
ret = utf8_to_html(f->data.value, "iso-8859-1",
f->data.value_len, &f_text);
- if (ret != UTF8_CONVERT_OK)
+ if (ret != NSERROR_OK)
return NSERROR_SAVE_FAILED;
fprintf(tw->fp, "<li><h4>%s</h4>\n<ul>\n", f_text);
diff --git a/desktop/hotlist.c b/desktop/hotlist.c
index 01fabc2..219a348 100644
--- a/desktop/hotlist.c
+++ b/desktop/hotlist.c
@@ -879,21 +879,21 @@ static nserror hotlist_export_enter_cb(void *ctx, void *node_data,
enum treeview_node_type type, bool *abort)
{
struct treeview_export_walk_ctx *tw = ctx;
+ nserror ret;
if (type == TREE_NODE_ENTRY) {
struct hotlist_entry *e = node_data;
- utf8_convert_ret ret;
char *t_text;
char *u_text;
ret = utf8_to_html(e->data[HL_TITLE].value, "iso-8859-1",
e->data[HL_TITLE].value_len, &t_text);
- if (ret != UTF8_CONVERT_OK)
+ if (ret != NSERROR_OK)
return NSERROR_SAVE_FAILED;
ret = utf8_to_html(e->data[HL_URL].value, "iso-8859-1",
e->data[HL_URL].value_len, &u_text);
- if (ret != UTF8_CONVERT_OK) {
+ if (ret != NSERROR_OK) {
free(t_text);
return NSERROR_SAVE_FAILED;
}
@@ -906,12 +906,11 @@ static nserror hotlist_export_enter_cb(void *ctx, void *node_data,
} else if (type == TREE_NODE_FOLDER) {
struct hotlist_folder *f = node_data;
- utf8_convert_ret ret;
char *f_text;
ret = utf8_to_html(f->data.value, "iso-8859-1",
f->data.value_len, &f_text);
- if (ret != UTF8_CONVERT_OK)
+ if (ret != NSERROR_OK)
return NSERROR_SAVE_FAILED;
if (f == hl_ctx.default_folder) {
diff --git a/desktop/save_complete.c b/desktop/save_complete.c
index da87a65..99b1ac4 100644
--- a/desktop/save_complete.c
+++ b/desktop/save_complete.c
@@ -547,7 +547,6 @@ static bool save_complete_rewrite_url_value(save_complete_ctx *ctx,
hlcache_handle *content;
char *escaped;
nserror error;
- utf8_convert_ret ret;
error = nsurl_join(ctx->base, value, &url);
if (error == NSERROR_NOMEM)
@@ -562,11 +561,11 @@ static bool save_complete_rewrite_url_value(save_complete_ctx *ctx,
fprintf(ctx->fp, "\"%p\"", content);
} else {
/* no match found */
- ret = utf8_to_html(nsurl_access(url), "UTF-8",
+ error = utf8_to_html(nsurl_access(url), "UTF-8",
nsurl_length(url), &escaped);
nsurl_unref(url);
- if (ret != UTF8_CONVERT_OK)
+ if (error != NSERROR_OK)
return false;
fprintf(ctx->fp, "\"%s\"", escaped);
@@ -574,8 +573,8 @@ static bool save_complete_rewrite_url_value(save_complete_ctx *ctx,
free(escaped);
}
} else {
- ret = utf8_to_html(value, "UTF-8", value_len, &escaped);
- if (ret != UTF8_CONVERT_OK)
+ error = utf8_to_html(value, "UTF-8", value_len, &escaped);
+ if (error != NSERROR_OK)
return false;
fprintf(ctx->fp, "\"%s\"", escaped);
@@ -590,10 +589,10 @@ static bool save_complete_write_value(save_complete_ctx *ctx,
const char *value, size_t value_len)
{
char *escaped;
- utf8_convert_ret ret;
+ nserror ret;
ret = utf8_to_html(value, "UTF-8", value_len, &escaped);
- if (ret != UTF8_CONVERT_OK)
+ if (ret != NSERROR_OK)
return false;
fprintf(ctx->fp, "\"%s\"", escaped);
@@ -919,7 +918,7 @@ static bool save_complete_node_handler(dom_node *node,
save_complete_ctx *ctx = ctxin;
dom_node_type type;
dom_exception error;
- utf8_convert_ret ret;
+ nserror ret;
error = dom_node_get_node_type(node, &type);
if (error != DOM_NO_ERR)
@@ -953,7 +952,7 @@ static bool save_complete_node_handler(dom_node *node,
ret = utf8_to_html(text_data, "UTF-8",
text_len, &escaped);
- if (ret != UTF8_CONVERT_OK)
+ if (ret != NSERROR_OK)
return false;
fwrite(escaped, sizeof(*escaped),
diff --git a/desktop/save_text.c b/desktop/save_text.c
index 92cf32a..38f8c53 100644
--- a/desktop/save_text.c
+++ b/desktop/save_text.c
@@ -58,7 +58,7 @@ void save_as_text(hlcache_handle *c, char *path)
struct save_text_state save = { NULL, 0, 0 };
save_text_whitespace before = WHITESPACE_NONE;
bool first = true;
- utf8_convert_ret ret;
+ nserror ret;
char *result;
if (!c || content_get_type(c) != CONTENT_HTML) {
@@ -72,7 +72,7 @@ void save_as_text(hlcache_handle *c, char *path)
ret = utf8_to_local_encoding(save.block, save.length, &result);
free(save.block);
- if (ret != UTF8_CONVERT_OK) {
+ if (ret != NSERROR_OK) {
LOG(("failed to convert to local encoding, return %d", ret));
return;
}
diff --git a/framebuffer/font_freetype.c b/framebuffer/font_freetype.c
index 521a5bc..eb7278c 100644
--- a/framebuffer/font_freetype.c
+++ b/framebuffer/font_freetype.c
@@ -75,27 +75,27 @@ enum fb_face_e {
static fb_faceid_t *fb_faces[FB_FACE_COUNT];
-utf8_convert_ret utf8_to_local_encoding(const char *string,
+nserror utf8_to_local_encoding(const char *string,
size_t len,
char **result)
{
return utf8_to_enc(string, "UTF-8", len, result);
}
-utf8_convert_ret utf8_from_local_encoding(const char *string,
+nserror utf8_from_local_encoding(const char *string,
size_t len,
char **result)
{
*result = malloc(len + 1);
if (*result == NULL) {
- return UTF8_CONVERT_NOMEM;
+ return NSERROR_NOMEM;
}
memcpy(*result, string, len);
(*result)[len] = '\0';
- return UTF8_CONVERT_OK;
+ return NSERROR_OK;
}
/* map cache manager handle to face id */
diff --git a/framebuffer/font_internal.c b/framebuffer/font_internal.c
index dc1b358..d13ba00 100644
--- a/framebuffer/font_internal.c
+++ b/framebuffer/font_internal.c
@@ -59,7 +59,7 @@ fb_get_font(const plot_font_style_t *fstyle)
}
}
-utf8_convert_ret utf8_to_font_encoding(const struct fb_font_desc* font,
+nserror_ret utf8_to_font_encoding(const struct fb_font_desc* font,
const char *string,
size_t len,
char **result)
@@ -68,7 +68,7 @@ utf8_convert_ret utf8_to_font_encoding(const struct fb_font_desc* font,
}
-utf8_convert_ret utf8_to_local_encoding(const char *string,
+nserror utf8_to_local_encoding(const char *string,
size_t len,
char **result)
{
@@ -76,20 +76,20 @@ utf8_convert_ret utf8_to_local_encoding(const char *string,
}
-utf8_convert_ret utf8_from_local_encoding(const char *string,
+nserror utf8_from_local_encoding(const char *string,
size_t len,
char **result)
{
*result = malloc(len + 1);
if (*result == NULL) {
- return UTF8_CONVERT_NOMEM;
+ return NSERROR_NOMEM;
}
memcpy(*result, string, len);
(*result)[len] = '\0';
- return UTF8_CONVERT_OK;
+ return NSERROR_OK;
}
static bool nsfont_width(const plot_font_style_t *fstyle,
diff --git a/framebuffer/font_internal.h b/framebuffer/font_internal.h
index 5b0f30b..6b6de2f 100644
--- a/framebuffer/font_internal.h
+++ b/framebuffer/font_internal.h
@@ -33,7 +33,7 @@ extern const struct fb_font_desc font_italic_bold;
extern const struct fb_font_desc* fb_get_font(const plot_font_style_t *fstyle);
-extern utf8_convert_ret utf8_to_font_encoding(const struct fb_font_desc* font,
+extern nserror utf8_to_font_encoding(const struct fb_font_desc* font,
const char *string,
size_t len,
char **result);
diff --git a/gtk/dialogs/source.c b/gtk/dialogs/source.c
index a7c9815..a32bce6 100644
--- a/gtk/dialogs/source.c
+++ b/gtk/dialogs/source.c
@@ -169,16 +169,16 @@ void nsgtk_source_dialog_init(GtkWindow *parent, struct browser_window *bw)
source_data = content_get_source_data(bw->current_content,
&source_size);
- utf8_convert_ret r = utf8_from_enc(
+ nserror r = utf8_from_enc(
source_data,
html_get_encoding(bw->current_content),
source_size,
&data,
&data_len);
- if (r == UTF8_CONVERT_NOMEM) {
+ if (r == NSERROR_NOMEM) {
warn_user("NoMemory",0);
return;
- } else if (r == UTF8_CONVERT_BADENC) {
+ } else if (r == NSERROR_BAD_ENCODING) {
warn_user("EncNotRec",0);
return;
}
@@ -270,7 +270,7 @@ void nsgtk_source_tab_init(GtkWindow *parent, struct browser_window *bw)
size_t ndata_len;
nsurl *url;
nserror error;
- utf8_convert_ret r;
+ nserror r;
gchar *filename;
char *fileurl;
gint handle;
@@ -283,10 +283,10 @@ void nsgtk_source_tab_init(GtkWindow *parent, struct browser_window *bw)
source_size,
&ndata,
&ndata_len);
- if (r == UTF8_CONVERT_NOMEM) {
+ if (r == NSERROR_NOMEM) {
warn_user("NoMemory",0);
return;
- } else if (r == UTF8_CONVERT_BADENC) {
+ } else if (r == NSERROR_BAD_ENCODING) {
warn_user("EncNotRec",0);
return;
}
diff --git a/gtk/gui.c b/gtk/gui.c
index ad80e89..c885ad3 100644
--- a/gtk/gui.c
+++ b/gtk/gui.c
@@ -788,8 +788,7 @@ gboolean nsgtk_ssl_delete_event(GtkWidget *w, GdkEvent *event, gpointer data)
return FALSE;
}
-utf8_convert_ret utf8_to_local_encoding(const char *string, size_t len,
- char **result)
+nserror utf8_to_local_encoding(const char *string, size_t len, char **result)
{
assert(string && result);
@@ -798,14 +797,13 @@ utf8_convert_ret utf8_to_local_encoding(const char *string, size_t len,
*result = strndup(string, len);
if (!(*result))
- return UTF8_CONVERT_NOMEM;
+ return NSERROR_NOMEM;
- return UTF8_CONVERT_OK;
+ return NSERROR_OK;
}
-utf8_convert_ret utf8_from_local_encoding(const char *string, size_t len,
- char **result)
+nserror utf8_from_local_encoding(const char *string, size_t len, char **result)
{
assert(string && result);
@@ -814,9 +812,9 @@ utf8_convert_ret utf8_from_local_encoding(const char *string, size_t len,
*result = strndup(string, len);
if (!(*result))
- return UTF8_CONVERT_NOMEM;
+ return NSERROR_NOMEM;
- return UTF8_CONVERT_OK;
+ return NSERROR_OK;
}
diff --git a/monkey/utils.c b/monkey/utils.c
index 88776a9..742c300 100644
--- a/monkey/utils.c
+++ b/monkey/utils.c
@@ -38,20 +38,16 @@ void die(const char * const error)
exit(EXIT_FAILURE);
}
-utf8_convert_ret
-utf8_to_local_encoding(const char *string, size_t len,
- char **result)
+nserror utf8_to_local_encoding(const char *string, size_t len, char **result)
{
*result = strndup(string, len);
- return (*result == NULL) ? UTF8_CONVERT_NOMEM : UTF8_CONVERT_OK;
+ return (*result == NULL) ? NSERROR_NOMEM : NSERROR_OK;
}
-utf8_convert_ret
-utf8_from_local_encoding(const char *string, size_t len,
- char **result)
+nserror utf8_from_local_encoding(const char *string, size_t len, char **result)
{
*result = strndup(string, len);
- return (*result == NULL) ? UTF8_CONVERT_NOMEM : UTF8_CONVERT_OK;
+ return (*result == NULL) ? NSERROR_NOMEM : NSERROR_OK;
}
diff --git a/render/form.c b/render/form.c
index 32c38be..c9d74a1 100644
--- a/render/form.c
+++ b/render/form.c
@@ -992,7 +992,7 @@ char *form_acceptable_charset(struct form *form)
char *form_encode_item(const char *item, uint32_t len, const char *charset,
const char *fallback)
{
- utf8_convert_ret err;
+ nserror err;
char *ret = NULL;
char cset[256];
@@ -1002,19 +1002,19 @@ char *form_encode_item(const char *item, uint32_t len, const char *charset,
snprintf(cset, sizeof cset, "%s//TRANSLIT", charset);
err = utf8_to_enc(item, cset, 0, &ret);
- if (err == UTF8_CONVERT_BADENC) {
+ if (err == NSERROR_BAD_ENCODING) {
/* charset not understood, try without transliteration */
snprintf(cset, sizeof cset, "%s", charset);
err = utf8_to_enc(item, cset, len, &ret);
- if (err == UTF8_CONVERT_BADENC) {
+ if (err == NSERROR_BAD_ENCODING) {
/* nope, try fallback charset (if any) */
if (fallback) {
snprintf(cset, sizeof cset,
"%s//TRANSLIT", fallback);
err = utf8_to_enc(item, cset, 0, &ret);
- if (err == UTF8_CONVERT_BADENC) {
+ if (err == NSERROR_BAD_ENCODING) {
/* and without transliteration */
snprintf(cset, sizeof cset,
"%s", fallback);
@@ -1022,11 +1022,11 @@ char *form_encode_item(const char *item, uint32_t len, const char *charset,
}
}
- if (err == UTF8_CONVERT_BADENC) {
+ if (err == NSERROR_BAD_ENCODING) {
/* that also failed, use 8859-1 */
err = utf8_to_enc(item, "ISO-8859-1//TRANSLIT",
0, &ret);
- if (err == UTF8_CONVERT_BADENC) {
+ if (err == NSERROR_BAD_ENCODING) {
/* and without transliteration */
err = utf8_to_enc(item, "ISO-8859-1",
0, &ret);
@@ -1034,7 +1034,7 @@ char *form_encode_item(const char *item, uint32_t len, const char *charset,
}
}
}
- if (err == UTF8_CONVERT_NOMEM) {
+ if (err == NSERROR_NOMEM) {
return NULL;
}
diff --git a/render/html.c b/render/html.c
index 0a7ab24..bd23aac 100644
--- a/render/html.c
+++ b/render/html.c
@@ -1765,14 +1765,14 @@ static void html__dom_user_data_handler(dom_node_operation operation,
static void html__set_file_gadget_filename(struct content *c,
struct form_control *gadget, const char *fn)
{
- utf8_convert_ret ret;
+ nserror ret;
char *utf8_fn, *oldfile = NULL;
html_content *html = (html_content *)c;
struct box *file_box = gadget->box;
ret = utf8_from_local_encoding(fn,0, &utf8_fn);
- if (ret != UTF8_CONVERT_OK) {
- assert(ret != UTF8_CONVERT_BADENC);
+ if (ret != NSERROR_OK) {
+ assert(ret != NSERROR_BAD_ENCODING);
LOG(("utf8_from_local_encoding failed"));
/* Load was for us - just no memory */
return;
@@ -1874,7 +1874,7 @@ static bool html_drop_file_at_point(struct content *c, int x, int y, char *file)
FILE *fp = NULL;
char *buffer;
char *utf8_buff;
- utf8_convert_ret ret;
+ nserror ret;
unsigned int size;
int bx, by;
@@ -1916,9 +1916,9 @@ static bool html_drop_file_at_point(struct content *c, int x, int y, char *file)
/* Convert to UTF-8 */
ret = utf8_from_local_encoding(buffer, file_len, &utf8_buff);
- if (ret != UTF8_CONVERT_OK) {
+ if (ret != NSERROR_OK) {
/* bad encoding shouldn't happen */
- assert(ret != UTF8_CONVERT_BADENC);
+ assert(ret != NSERROR_BAD_ENCODING);
LOG(("utf8_from_local_encoding failed"));
free(buffer);
warn_user("NoMemory", NULL);
diff --git a/riscos/download.c b/riscos/download.c
index d0149b6..526f301 100644
--- a/riscos/download.c
+++ b/riscos/download.c
@@ -228,7 +228,7 @@ static struct gui_download_window *gui_download_window_create(download_context *
os_error *error;
url_func_result res;
char *local_path;
- utf8_convert_ret err;
+ nserror err;
size_t i, last_dot;
dw = malloc(sizeof *dw);
@@ -376,9 +376,9 @@ static struct gui_download_window *gui_download_window_create(download_context *
filename);
err = utf8_to_local_encoding(dw->path, 0, &local_path);
- if (err != UTF8_CONVERT_OK) {
+ if (err != NSERROR_OK) {
/* badenc should never happen */
- assert(err != UTF8_CONVERT_BADENC);
+ assert(err !=NSERROR_BAD_ENCODING);
LOG(("utf8_to_local_encoding failed"));
warn_user("NoMemory", 0);
free(dw);
@@ -588,7 +588,7 @@ void ro_gui_download_update_status(struct gui_download_window *dw)
os_error *error;
int width;
char *local_status;
- utf8_convert_ret err;
+ nserror err;
gettimeofday(&t, 0);
dt = (t.tv_sec + 0.000001 * t.tv_usec) - (dw->last_time.tv_sec +
@@ -622,9 +622,9 @@ void ro_gui_download_update_status(struct gui_download_window *dw)
/* convert to local encoding */
err = utf8_to_local_encoding(
messages_get("Download"), 0, &local_status);
- if (err != UTF8_CONVERT_OK) {
+ if (err != NSERROR_OK) {
/* badenc should never happen */
- assert(err != UTF8_CONVERT_BADENC);
+ assert(err != NSERROR_BAD_ENCODING);
/* hide nomem error */
snprintf(dw->status, sizeof dw->status,
messages_get("Download"),
@@ -645,9 +645,9 @@ void ro_gui_download_update_status(struct gui_download_window *dw)
err = utf8_to_local_encoding(
messages_get("DownloadU"), 0, &local_status);
- if (err != UTF8_CONVERT_OK) {
+ if (err != NSERROR_OK) {
/* badenc should never happen */
- assert(err != UTF8_CONVERT_BADENC);
+ assert(err != NSERROR_BAD_ENCODING);
/* hide nomem error */
snprintf(dw->status, sizeof dw->status,
messages_get("DownloadU"),
@@ -673,9 +673,9 @@ void ro_gui_download_update_status(struct gui_download_window *dw)
err = utf8_to_local_encoding(messages_get("Downloaded"), 0,
&local_status);
- if (err != UTF8_CONVERT_OK) {
+ if (err != NSERROR_OK) {
/* badenc should never happen */
- assert(err != UTF8_CONVERT_BADENC);
+ assert(err != NSERROR_BAD_ENCODING);
/* hide nomem error */
snprintf(dw->status, sizeof dw->status,
messages_get("Downloaded"),
diff --git a/riscos/gui/url_bar.c b/riscos/gui/url_bar.c
index d764740..681824d 100644
--- a/riscos/gui/url_bar.c
+++ b/riscos/gui/url_bar.c
@@ -956,12 +956,12 @@ void ro_gui_url_bar_set_url(struct url_bar *url_bar, const char *url,
*/
if (is_utf8) {
- utf8_convert_ret err;
+ nserror err;
err = utf8_to_local_encoding(url, 0, &local_text);
- if (err != UTF8_CONVERT_OK) {
+ if (err != NSERROR_OK) {
/* A bad encoding should never happen, so assert this */
- assert(err != UTF8_CONVERT_BADENC);
+ assert(err != NSERROR_BAD_ENCODING);
LOG(("utf8_to_enc failed"));
/* Paranoia */
local_text = NULL;
diff --git a/riscos/help.c b/riscos/help.c
index 14d34af..9da52f3 100644
--- a/riscos/help.c
+++ b/riscos/help.c
@@ -225,7 +225,7 @@ static void ro_gui_interactive_help_broadcast(wimp_message *message,
char *base_token;
char *local_token;
os_error *error;
- utf8_convert_ret err;
+ nserror err;
/* start off with an empty reply */
reply = (help_full_message_reply *)message;
@@ -255,9 +255,9 @@ static void ro_gui_interactive_help_broadcast(wimp_message *message,
/* convert to local encoding */
err = utf8_to_local_encoding(translated_token, 0,
&local_token);
- if (err != UTF8_CONVERT_OK) {
+ if (err != NSERROR_OK) {
/* badenc should never happen */
- assert(err != UTF8_CONVERT_BADENC);
+ assert(err != NSERROR_BAD_ENCODING);
/* simply use UTF-8 string */
strncpy(reply->reply, translated_token, 235);
}
diff --git a/riscos/menus.c b/riscos/menus.c
index e51fc34..29d5141 100644
--- a/riscos/menus.c
+++ b/riscos/menus.c
@@ -875,8 +875,7 @@ bool ro_gui_menu_translate(struct menu_definition *menu)
int alphabet;
struct menu_definition_entry *entry;
char *translated;
- utf8_convert_ret err;
-
+ nserror err;
/* read current alphabet */
error = xosbyte1(osbyte_ALPHABET_NUMBER, 127, 0, &alphabet);
@@ -895,8 +894,8 @@ bool ro_gui_menu_translate(struct menu_definition *menu)
free(menu->menu->title_data.indirected_text.text);
err = utf8_to_local_encoding(messages_get(menu->title_key),
0, &translated);
- if (err != UTF8_CONVERT_OK) {
- assert(err != UTF8_CONVERT_BADENC);
+ if (err != NSERROR_OK) {
+ assert(err != NSERROR_BAD_ENCODING);
LOG(("utf8_to_enc failed"));
return false;
}
@@ -912,8 +911,8 @@ bool ro_gui_menu_translate(struct menu_definition *menu)
free(entry->menu_entry->data.indirected_text.text);
err = utf8_to_local_encoding(messages_get(entry->entry_key),
0, &translated);
- if (err != UTF8_CONVERT_OK) {
- assert(err != UTF8_CONVERT_BADENC);
+ if (err != NSERROR_OK) {
+ assert(err != NSERROR_BAD_ENCODING);
LOG(("utf8_to_enc failed"));
return false;
}
diff --git a/riscos/query.c b/riscos/query.c
index 6401ad2..2268494 100644
--- a/riscos/query.c
+++ b/riscos/query.c
@@ -150,7 +150,7 @@ query_id query_user_xy(const char *query, const char *detail,
int len;
int tx;
char *local_text = NULL;
- utf8_convert_ret err;
+ nserror err;
qw = malloc(sizeof(struct gui_query_window));
if (!qw) {
@@ -171,8 +171,8 @@ query_id query_user_xy(const char *query, const char *detail,
/* set the text of the 'Yes' button and size accordingly */
err = utf8_to_local_encoding(yes, 0, &local_text);
- if (err != UTF8_CONVERT_OK) {
- assert(err != UTF8_CONVERT_BADENC);
+ if (err != NSERROR_OK) {
+ assert(err != NSERROR_BAD_ENCODING);
LOG(("utf8_to_local_encoding_failed"));
local_text = NULL;
}
@@ -201,8 +201,8 @@ query_id query_user_xy(const char *query, const char *detail,
/* set the text of the 'No' button and size accordingly */
err = utf8_to_local_encoding(no, 0, &local_text);
- if (err != UTF8_CONVERT_OK) {
- assert(err != UTF8_CONVERT_BADENC);
+ if (err != NSERROR_OK) {
+ assert(err != NSERROR_BAD_ENCODING);
LOG(("utf8_to_local_encoding_failed"));
local_text = NULL;
}
diff --git a/riscos/save.c b/riscos/save.c
index 59222c4..cc12344 100644
--- a/riscos/save.c
+++ b/riscos/save.c
@@ -614,7 +614,7 @@ static void ro_gui_save_drag_end(wimp_dragged *drag, void *data)
os_error *error;
char *dp, *ep;
char *local_name = NULL;
- utf8_convert_ret err;
+ nserror err;
if (dragbox_active)
ro_gui_drag_box_cancel();
@@ -651,9 +651,9 @@ static void ro_gui_save_drag_end(wimp_dragged *drag, void *data)
/* saving directly from browser window, choose a
* name based upon the URL */
err = utf8_to_local_encoding(save_leafname, 0, &local_name);
- if (err != UTF8_CONVERT_OK) {
+ if (err != NSERROR_OK) {
/* badenc should never happen */
- assert(err != UTF8_CONVERT_BADENC);
+ assert(err != NSERROR_BAD_ENCODING);
local_name = NULL;
}
name = local_name ? local_name : save_leafname;
@@ -1216,7 +1216,7 @@ void ro_gui_save_set_state(hlcache_handle *h, gui_save_type save_type,
const char *name = gui_save_table[save_type].name;
bool done = false;
char *nice = NULL;
- utf8_convert_ret err;
+ nserror err;
char *local_name;
size_t i;
@@ -1270,9 +1270,9 @@ void ro_gui_save_set_state(hlcache_handle *h, gui_save_type save_type,
leaf_buf[leaf_len - 1] = 0;
err = utf8_to_local_encoding(name, 0, &local_name);
- if (err != UTF8_CONVERT_OK) {
+ if (err != NSERROR_OK) {
/* badenc should never happen */
- assert(err != UTF8_CONVERT_BADENC);
+ assert(err != NSERROR_BAD_ENCODING);
local_name = NULL;
}
diff --git a/riscos/textselection.c b/riscos/textselection.c
index 73b5246..c070754 100644
--- a/riscos/textselection.c
+++ b/riscos/textselection.c
@@ -391,7 +391,7 @@ bool ro_gui_selection_prepare_paste_dataload(
FILE *fp;
long size;
char *local_cb;
- utf8_convert_ret ret;
+ nserror ret;
/* Ignore messages that aren't for us */
if (dataxfer->your_ref == 0 || dataxfer->your_ref != paste_prev_message)
@@ -410,7 +410,7 @@ bool ro_gui_selection_prepare_paste_dataload(
ret = utf8_from_local_encoding(local_cb, size,
&clipboard);
- if (ret == UTF8_CONVERT_OK) {
+ if (ret == NSERROR_OK) {
clip_length = strlen(clipboard);
}
@@ -509,13 +509,13 @@ void ro_gui_selection_data_request(wimp_full_message_data_request *req)
bool ro_gui_save_clipboard(const char *path)
{
char *local_cb;
- utf8_convert_ret ret;
+ nserror ret;
os_error *error;
assert(clip_length > 0 && clipboard);
ret = utf8_to_local_encoding(clipboard, clip_length, &local_cb);
- if (ret != UTF8_CONVERT_OK) {
+ if (ret != NSERROR_OK) {
warn_user("SaveError", "Could not convert");
return false;
}
diff --git a/riscos/ucstables.c b/riscos/ucstables.c
index 970caf1..4754bac 100644
--- a/riscos/ucstables.c
+++ b/riscos/ucstables.c
@@ -446,17 +446,16 @@ static const struct special {
* \param string The string to convert
* \param len The length (in bytes) of the string, or 0
* \param result Pointer to location in which to store result
- * \return The appropriate utf8_convert_ret value
+ * \return An nserror code
*/
-utf8_convert_ret utf8_to_local_encoding(const char *string, size_t len,
- char **result)
+nserror utf8_to_local_encoding(const char *string, size_t len, char **result)
{
os_error *error;
int alphabet, i;
size_t off, prev_off;
char *temp, *cur_pos;
const char *enc;
- utf8_convert_ret err;
+ nserror err;
assert(string);
assert(result);
@@ -473,7 +472,7 @@ utf8_convert_ret utf8_to_local_encoding(const char *string, size_t len,
/* UTF-8 -> simply copy string */
if (alphabet == 111 /* UTF-8 */) {
*result = strndup(string, len);
- return UTF8_CONVERT_OK;
+ return NSERROR_OK;
}
/* get encoding name */
@@ -485,7 +484,7 @@ utf8_convert_ret utf8_to_local_encoding(const char *string, size_t len,
/* create output buffer */
*(result) = malloc(len + 1);
if (!(*result))
- return UTF8_CONVERT_NOMEM;
+ return NSERROR_NOMEM;
*(*result) = '\0';
prev_off = 0;
@@ -508,10 +507,10 @@ utf8_convert_ret utf8_to_local_encoding(const char *string, size_t len,
if (off - prev_off > 0) {
err = utf8_to_enc(string + prev_off, enc,
off - prev_off, &temp);
- if (err != UTF8_CONVERT_OK) {
- assert(err != UTF8_CONVERT_BADENC);
+ if (err != NSERROR_OK) {
+ assert(err != NSERROR_BAD_ENCODING);
free(*result);
- return UTF8_CONVERT_NOMEM;
+ return NSERROR_NOMEM;
}
strcat(cur_pos, temp);
@@ -533,10 +532,10 @@ utf8_convert_ret utf8_to_local_encoding(const char *string, size_t len,
if (prev_off < len) {
err = utf8_to_enc(string + prev_off, enc, len - prev_off,
&temp);
- if (err != UTF8_CONVERT_OK) {
- assert(err != UTF8_CONVERT_BADENC);
+ if (err != NSERROR_OK) {
+ assert(err != NSERROR_BAD_ENCODING);
free(*result);
- return UTF8_CONVERT_NOMEM;
+ return NSERROR_NOMEM;
}
strcat(cur_pos, temp);
@@ -544,7 +543,7 @@ utf8_convert_ret utf8_to_local_encoding(const char *string, size_t len,
free(temp);
}
- return UTF8_CONVERT_OK;
+ return NSERROR_OK;
}
/**
@@ -553,10 +552,9 @@ utf8_convert_ret utf8_to_local_encoding(const char *string, size_t len,
* \param string The string to convert
* \param len The length (in bytes) of the string, or 0
* \param result Pointer to location in which to store result
- * \return The appropriate utf8_convert_ret value
+ * \return An nserror code
*/
-utf8_convert_ret utf8_from_local_encoding(const char *string, size_t len,
- char **result)
+nserror utf8_from_local_encoding(const char *string, size_t len, char **result)
{
os_error *error;
int alphabet, i, num_specials = 0, result_alloc;
@@ -564,7 +562,7 @@ utf8_convert_ret utf8_from_local_encoding(const char *string, size_t len,
size_t off, prev_off, cur_off;
char *temp;
const char *enc;
- utf8_convert_ret err;
+ nserror err;
assert(string && result);
@@ -581,10 +579,10 @@ utf8_convert_ret utf8_from_local_encoding(const char *string, size_t len,
if (alphabet == 111 /* UTF-8 */) {
temp = strndup(string, len);
if (!temp)
- return UTF8_CONVERT_NOMEM;
+ return NSERROR_NOMEM;
*result = temp;
- return UTF8_CONVERT_OK;
+ return NSERROR_OK;
}
/* get encoding name */
@@ -598,7 +596,7 @@ utf8_convert_ret utf8_from_local_encoding(const char *string, size_t len,
*(result) = malloc(result_alloc);
if (!(*result))
- return UTF8_CONVERT_NOMEM;
+ return NSERROR_NOMEM;
*(*result) = '\0';
prev_off = 0;
@@ -619,11 +617,11 @@ utf8_convert_ret utf8_from_local_encoding(const char *string, size_t len,
if (off - prev_off > 0) {
err = utf8_from_enc(string + prev_off, enc,
off - prev_off, &temp, NULL);
- if (err != UTF8_CONVERT_OK) {
- assert(err != UTF8_CONVERT_BADENC);
+ if (err != NSERROR_OK) {
+ assert(err != NSERROR_BAD_ENCODING);
LOG(("utf8_from_enc failed"));
free(*result);
- return UTF8_CONVERT_NOMEM;
+ return NSERROR_NOMEM;
}
strcat((*result) + cur_off, temp);
@@ -647,7 +645,7 @@ utf8_convert_ret utf8_from_local_encoding(const char *string, size_t len,
(3 * SPECIAL_CHUNK_SIZE));
if (!temp) {
free(*result);
- return UTF8_CONVERT_NOMEM;
+ return NSERRO_NOMEM;
}
*result = temp;
@@ -661,11 +659,11 @@ utf8_convert_ret utf8_from_local_encoding(const char *string, size_t len,
if (prev_off < len) {
err = utf8_from_enc(string + prev_off, enc, len - prev_off,
&temp, NULL);
- if (err != UTF8_CONVERT_OK) {
- assert(err != UTF8_CONVERT_BADENC);
+ if (err != NSERROR_OK) {
+ assert(err != NSERROR_BAD_ENCODING);
LOG(("utf8_from_enc failed"));
free(*result);
- return UTF8_CONVERT_NOMEM;
+ return NSERROR_NOMEM;
}
strcat((*result) + cur_off, temp);
@@ -680,9 +678,9 @@ utf8_convert_ret utf8_from_local_encoding(const char *string, size_t len,
if (!temp) {
LOG(("realloc failed"));
free(*result);
- return UTF8_CONVERT_NOMEM;
+ return NSERROR_NOMEM;
}
*result = temp;
- return UTF8_CONVERT_OK;
+ return NSERROR_OK;
}
diff --git a/riscos/wimp.c b/riscos/wimp.c
index 87860ad..2e48891 100644
--- a/riscos/wimp.c
+++ b/riscos/wimp.c
@@ -273,12 +273,12 @@ void ro_gui_set_icon_string(wimp_w w, wimp_i i, const char *text, bool is_utf8)
unsigned int button_type;
if (is_utf8) {
- utf8_convert_ret err;
+ nserror err;
/* convert text to local encoding */
err = utf8_to_local_encoding(text, 0, &local_text);
- if (err != UTF8_CONVERT_OK) {
+ if (err != NSERROR_OK) {
/* A bad encoding should never happen, so assert this */
- assert(err != UTF8_CONVERT_BADENC);
+ assert(err != NSERROR_BAD_ENCODING);
LOG(("utf8_to_enc failed"));
/* Paranoia */
local_text = NULL;
@@ -677,7 +677,7 @@ void ro_gui_set_window_title(wimp_w w, const char *text)
wimp_window_info_base window;
os_error *error;
char *title_local_enc;
- utf8_convert_ret err;
+ nserror err;
/* Get the window details
*/
@@ -692,10 +692,10 @@ void ro_gui_set_window_title(wimp_w w, const char *text)
/* convert text to local encoding */
err = utf8_to_local_encoding(text, 0, &title_local_enc);
- if (err != UTF8_CONVERT_OK) {
+ if (err != NSERROR_OK) {
/* A bad encoding should never happen,
* so assert this */
- assert(err != UTF8_CONVERT_BADENC);
+ assert(err != NSERROR_BAD_ENCODING);
LOG(("utf8_to_enc failed"));
return;
}
diff --git a/riscos/window.c b/riscos/window.c
index 2221425..1f70d3d 100644
--- a/riscos/window.c
+++ b/riscos/window.c
@@ -4621,7 +4621,7 @@ bool ro_gui_window_import_text(struct gui_window *g, const char *filename)
os_error *error;
char *buf, *utf8_buf, *sp;
int size;
- utf8_convert_ret ret;
+ nserror ret;
const char *ep;
char *p;
@@ -4656,9 +4656,9 @@ bool ro_gui_window_import_text(struct gui_window *g, const char *filename)
}
ret = utf8_from_local_encoding(buf, size, &utf8_buf);
- if (ret != UTF8_CONVERT_OK) {
+ if (ret != NSERROR_OK) {
/* bad encoding shouldn't happen */
- assert(ret != UTF8_CONVERT_BADENC);
+ assert(ret != NSERROR_BAD_ENCODING);
LOG(("utf8_from_local_encoding failed"));
free(buf);
warn_user("NoMemory", NULL);
@@ -4802,7 +4802,7 @@ bool ro_gui_window_prepare_form_select_menu(struct browser_window *bw,
char *text_convert, *temp;
struct form_option *option;
bool reopen = true;
- utf8_convert_ret err;
+ nserror err;
assert(control);
@@ -4839,9 +4839,9 @@ bool ro_gui_window_prepare_form_select_menu(struct browser_window *bw,
}
err = utf8_to_local_encoding(messages_get("SelectMenu"), 0,
&text_convert);
- if (err != UTF8_CONVERT_OK) {
+ if (err != NSERROR_OK) {
/* badenc should never happen */
- assert(err != UTF8_CONVERT_BADENC);
+ assert(err != NSERROR_BAD_ENCODING);
LOG(("utf8_to_local_encoding failed"));
warn_user("NoMemory", 0);
ro_gui_menu_closed();
@@ -4875,10 +4875,10 @@ bool ro_gui_window_prepare_form_select_menu(struct browser_window *bw,
err = utf8_to_local_encoding(temp,
0, &text_convert);
- if (err != UTF8_CONVERT_OK) {
+ if (err != NSERROR_OK) {
/* A bad encoding should never happen,
* so assert this */
- assert(err != UTF8_CONVERT_BADENC);
+ assert(err != NSERROR_BAD_ENCODING);
LOG(("utf8_to_enc failed"));
warn_user("NoMemory", 0);
ro_gui_menu_closed();
diff --git a/utils/utf8.c b/utils/utf8.c
index 8e9587d..ab7bbae 100644
--- a/utils/utf8.c
+++ b/utils/utf8.c
@@ -33,23 +33,14 @@
#include "utils/log.h"
#include "utils/utf8.h"
-/**
- * Convert a UTF-8 multibyte sequence into a single UCS4 character
- *
- * Encoding of UCS values outside the UTF-16 plane has been removed from
- * RFC3629. This function conforms to RFC2279, however.
- *
- * \param s_in The sequence to process
- * \param l Length of sequence
- * \return UCS4 character
- */
+/* exported interface documented in utils/utf8.h */
uint32_t utf8_to_ucs4(const char *s_in, size_t l)
{
uint32_t ucs4;
size_t len;
parserutils_error perror;
- perror = parserutils_charset_utf8_to_ucs4((const uint8_t *) s_in, l,
+ perror = parserutils_charset_utf8_to_ucs4((const uint8_t *) s_in, l,
&ucs4, &len);
if (perror != PARSERUTILS_OK)
ucs4 = 0xfffd;
@@ -57,16 +48,7 @@ uint32_t utf8_to_ucs4(const char *s_in, size_t l)
return ucs4;
}
-/**
- * Convert a single UCS4 character into a UTF-8 multibyte sequence
- *
- * Encoding of UCS values outside the UTF-16 plane has been removed from
- * RFC3629. This function conforms to RFC2279, however.
- *
- * \param c The character to process (0 <= c <= 0x7FFFFFFF)
- * \param s Pointer to 6 byte long output buffer
- * \return Length of multibyte sequence
- */
+/* exported interface documented in utils/utf8.h */
size_t utf8_from_ucs4(uint32_t c, char *s)
{
uint8_t *in = (uint8_t *) s;
@@ -84,24 +66,13 @@ size_t utf8_from_ucs4(uint32_t c, char *s)
return 6 - len;
}
-/**
- * Calculate the length (in characters) of a NULL-terminated UTF-8 string
- *
- * \param s The string
- * \return Length of string
- */
+/* exported interface documented in utils/utf8.h */
size_t utf8_length(const char *s)
{
return utf8_bounded_length(s, strlen(s));
}
-/**
- * Calculated the length (in characters) of a bounded UTF-8 string
- *
- * \param s The string
- * \param l Maximum length of input (in bytes)
- * \return Length of string, in characters
- */
+/* exported interface documented in utils/utf8.h */
size_t utf8_bounded_length(const char *s, size_t l)
{
size_t len;
@@ -114,14 +85,7 @@ size_t utf8_bounded_length(const char *s, size_t l)
return len;
}
-/**
- * Calculate the length (in bytes) of a bounded UTF-8 string
- *
- * \param s The string
- * \param l Maximum length of input (in bytes)
- * \param c Maximum number of characters to measure
- * \return Length of string, in bytes
- */
+/* exported interface documented in utils/utf8.h */
size_t utf8_bounded_byte_length(const char *s, size_t l, size_t c)
{
size_t len = 0;
@@ -132,12 +96,7 @@ size_t utf8_bounded_byte_length(const char *s, size_t l, size_t c)
return len;
}
-/**
- * Calculate the length (in bytes) of a UTF-8 character
- *
- * \param s Pointer to start of character
- * \return Length of character, in bytes
- */
+/* exported interface documented in utils/utf8.h */
size_t utf8_char_byte_length(const char *s)
{
size_t len;
@@ -150,13 +109,7 @@ size_t utf8_char_byte_length(const char *s)
return len;
}
-/**
- * Find previous legal UTF-8 char in string
- *
- * \param s The string
- * \param o Offset in the string to start at
- * \return Offset of first byte of previous legal character
- */
+/* exported interface documented in utils/utf8.h */
size_t utf8_prev(const char *s, size_t o)
{
uint32_t prev;
@@ -168,20 +121,13 @@ size_t utf8_prev(const char *s, size_t o)
return prev;
}
-/**
- * Find next legal UTF-8 char in string
- *
- * \param s The string
- * \param l Maximum offset in string
- * \param o Offset in the string to start at
- * \return Offset of first byte of next legal character
- */
+/* exported interface documented in utils/utf8.h */
size_t utf8_next(const char *s, size_t l, size_t o)
{
uint32_t next;
parserutils_error perror;
- perror = parserutils_charset_utf8_next((const uint8_t *) s, l, o,
+ perror = parserutils_charset_utf8_next((const uint8_t *) s, l, o,
&next);
assert(perror == PARSERUTILS_OK);
@@ -202,16 +148,16 @@ static inline void utf8_clear_cd_cache(void)
last_cd.cd = 0;
}
-/**
- * Finalise the UTF-8 library
- */
-void utf8_finalise(void)
+/* exported interface documented in utils/utf8.h */
+nserror utf8_finalise(void)
{
if (last_cd.cd != 0)
iconv_close(last_cd.cd);
/* paranoia follows */
utf8_clear_cd_cache();
+
+ return NSERROR_OK;
}
@@ -224,11 +170,16 @@ void utf8_finalise(void)
* \param to The encoding name to convert to
* \param result Pointer to location in which to store result.
* \param result_len Pointer to location in which to store result length.
- * \return Appropriate utf8_convert_ret value
+ * \return NSERROR_OK for no error, NSERROR_NOMEM on allocation error,
+ * NSERROR_BAD_ENCODING for a bad character encoding
*/
-static utf8_convert_ret utf8_convert(const char *string, size_t len,
- const char *from, const char *to,
- char **result, size_t *result_len)
+static nserror
+utf8_convert(const char *string,
+ size_t len,
+ const char *from,
+ const char *to,
+ char **result,
+ size_t *result_len)
{
iconv_t cd;
char *temp, *out, *in;
@@ -237,16 +188,16 @@ static utf8_convert_ret utf8_convert(const char *string, size_t len,
assert(string && from && to && result);
if (string[0] == '\0') {
- /* On AmigaOS, iconv() returns an error if we pass an
- * empty string. This prevents iconv() being called as
+ /* On AmigaOS, iconv() returns an error if we pass an
+ * empty string. This prevents iconv() being called as
* there is no conversion necessary anyway. */
*result = strdup("");
if (!(*result)) {
*result = NULL;
- return UTF8_CONVERT_NOMEM;
+ return NSERROR_NOMEM;
}
- return UTF8_CONVERT_OK;
+ return NSERROR_OK;
}
if (strcasecmp(from, to) == 0) {
@@ -255,10 +206,10 @@ static utf8_convert_ret utf8_convert(const char *string, size_t len,
*(result) = strndup(string, slen);
if (!(*result)) {
*(result) = NULL;
- return UTF8_CONVERT_NOMEM;
+ return NSERROR_NOMEM;
}
- return UTF8_CONVERT_OK;
+ return NSERROR_OK;
}
in = (char *)string;
@@ -274,9 +225,9 @@ static utf8_convert_ret utf8_convert(const char *string, size_t len,
cd = iconv_open(to, from);
if (cd == (iconv_t)-1) {
if (errno == EINVAL)
- return UTF8_CONVERT_BADENC;
+ return NSERROR_BAD_ENCODING;
/* default to no memory */
- return UTF8_CONVERT_NOMEM;
+ return NSERROR_NOMEM;
}
/* close the last cd - we don't care if this fails */
@@ -297,8 +248,9 @@ static utf8_convert_ret utf8_convert(const char *string, size_t len,
rlen = slen * 4 + 4;
temp = out = malloc(rlen);
- if (!out)
- return UTF8_CONVERT_NOMEM;
+ if (!out) {
+ return NSERROR_NOMEM;
+ }
/* perform conversion */
if (iconv(cd, (void *) &in, &slen, &out, &rlen) == (size_t)-1) {
@@ -312,14 +264,14 @@ static utf8_convert_ret utf8_convert(const char *string, size_t len,
* a) Insufficiently large output buffer
* b) Invalid input byte sequence
* c) Incomplete input sequence */
- return UTF8_CONVERT_NOMEM;
+ return NSERROR_NOMEM;
}
*(result) = realloc(temp, out - temp + 4);
if (!(*result)) {
free(temp);
*(result) = NULL; /* for sanity's sake */
- return UTF8_CONVERT_NOMEM;
+ return NSERROR_NOMEM;
}
/* NULL terminate - needs 4 characters as we may have
@@ -330,42 +282,32 @@ static utf8_convert_ret utf8_convert(const char *string, size_t len,
*result_len = (out - temp);
}
- return UTF8_CONVERT_OK;
+ return NSERROR_OK;
}
-/**
- * Convert a UTF8 string into the named encoding
- *
- * \param string The NULL-terminated string to convert
- * \param encname The encoding name (suitable for passing to iconv)
- * \param len Length of input string to consider (in bytes), or 0
- * \param result Pointer to location to store result (allocated on heap)
- * \return Appropriate utf8_convert_ret value
- */
-utf8_convert_ret utf8_to_enc(const char *string, const char *encname,
+/* exported interface documented in utils/utf8.h */
+nserror utf8_to_enc(const char *string, const char *encname,
size_t len, char **result)
{
return utf8_convert(string, len, "UTF-8", encname, result, NULL);
}
-/**
- * Convert a string in the named encoding into a UTF-8 string
- *
- * \param string The NULL-terminated string to convert
- * \param encname The encoding name (suitable for passing to iconv)
- * \param len Length of input string to consider (in bytes), or 0
- * \param result Pointer to location to store result (allocated on heap)
- * \return Appropriate utf8_convert_ret value
- */
-utf8_convert_ret utf8_from_enc(const char *string, const char *encname,
+/* exported interface documented in utils/utf8.h */
+nserror utf8_from_enc(const char *string, const char *encname,
size_t len, char **result, size_t *result_len)
{
return utf8_convert(string, len, encname, "UTF-8", result, result_len);
}
-static utf8_convert_ret utf8_convert_html_chunk(iconv_t cd,
- const char *chunk, size_t inlen,
- char **out, size_t *outlen)
+/**
+ * convert a chunk of html data
+ */
+static nserror
+utf8_convert_html_chunk(iconv_t cd,
+ const char *chunk,
+ size_t inlen,
+ char **out,
+ size_t *outlen)
{
size_t ret, esclen;
uint32_t ucs4;
@@ -377,7 +319,7 @@ static utf8_convert_ret utf8_convert_html_chunk(iconv_t cd,
break;
if (errno != EILSEQ)
- return UTF8_CONVERT_NOMEM;
+ return NSERROR_NOMEM;
ucs4 = utf8_to_ucs4(chunk, inlen);
esclen = snprintf(escape, sizeof(escape), "&#x%06x;", ucs4);
@@ -385,34 +327,25 @@ static utf8_convert_ret utf8_convert_html_chunk(iconv_t cd,
ret = iconv(cd, (void *) &pescape, &esclen,
(void *) out, outlen);
if (ret == (size_t) -1)
- return UTF8_CONVERT_NOMEM;
+ return NSERROR_NOMEM;
esclen = utf8_next(chunk, inlen, 0);
chunk += esclen;
inlen -= esclen;
}
- return UTF8_CONVERT_OK;
+ return NSERROR_OK;
}
-/**
- * Convert a UTF-8 encoded string into a string of the given encoding,
- * applying HTML escape sequences where necessary.
- *
- * \param string String to convert (NUL-terminated)
- * \param encname Name of encoding to convert to
- * \param len Length, in bytes, of the input string, or 0
- * \param result Pointer to location to receive result
- * \return Appropriate utf8_convert_ret value
- */
-utf8_convert_ret utf8_to_html(const char *string, const char *encname,
- size_t len, char **result)
+/* exported interface documented in utils/utf8.h */
+nserror
+utf8_to_html(const char *string, const char *encname, size_t len, char **result)
{
iconv_t cd;
const char *in;
char *out, *origout;
size_t off, prev_off, inlen, outlen, origoutlen, esclen;
- utf8_convert_ret ret;
+ nserror ret;
char *pescape, escape[11];
if (len == 0)
@@ -425,15 +358,14 @@ utf8_convert_ret utf8_to_html(const char *string, const char *encname,
sizeof(last_cd.to)) == 0 &&
last_cd.cd != 0) {
cd = last_cd.cd;
- }
- else {
+ } else {
/* no match, so create a new cd */
cd = iconv_open(encname, "UTF-8");
if (cd == (iconv_t) -1) {
if (errno == EINVAL)
- return UTF8_CONVERT_BADENC;
+ return NSERROR_BAD_ENCODING;
/* default to no memory */
- return UTF8_CONVERT_NOMEM;
+ return NSERROR_NOMEM;
}
/* close the last cd - we don't care if this fails */
@@ -446,8 +378,8 @@ utf8_convert_ret utf8_to_html(const char *string, const char *encname,
last_cd.cd = cd;
}
- /* Worst case is ASCII -> UCS4, with all characters escaped:
- * "&#xYYYYYY;", thus each input character may become a string
+ /* Worst case is ASCII -> UCS4, with all characters escaped:
+ * "&#xYYYYYY;", thus each input character may become a string
* of 10 UCS4 characters, each 4 bytes in length, plus four for
* terminating the string */
origoutlen = outlen = len * 10 * 4 + 4;
@@ -455,7 +387,7 @@ utf8_convert_ret utf8_to_html(const char *string, const char *encname,
if (out == NULL) {
iconv_close(cd);
utf8_clear_cd_cache();
- return UTF8_CONVERT_NOMEM;
+ return NSERROR_NOMEM;
}
/* Process input in chunks between characters we must escape */
@@ -470,7 +402,7 @@ utf8_convert_ret utf8_to_html(const char *string, const char *encname,
inlen = off - prev_off;
ret = utf8_convert_html_chunk(cd, in, inlen,
&out, &outlen);
- if (ret != UTF8_CONVERT_OK) {
+ if (ret != NSERROR_OK) {
free(origout);
iconv_close(cd);
utf8_clear_cd_cache();
@@ -484,7 +416,7 @@ utf8_convert_ret utf8_to_html(const char *string, const char *encname,
pescape = escape;
ret = utf8_convert_html_chunk(cd, pescape, esclen,
&out, &outlen);
- if (ret != UTF8_CONVERT_OK) {
+ if (ret != NSERROR_OK) {
free(origout);
iconv_close(cd);
utf8_clear_cd_cache();
@@ -502,7 +434,7 @@ utf8_convert_ret utf8_to_html(const char *string, const char *encname,
in = string + prev_off;
inlen = len - prev_off;
ret = utf8_convert_html_chunk(cd, in, inlen, &out, &outlen);
- if (ret != UTF8_CONVERT_OK) {
+ if (ret != NSERROR_OK) {
free(origout);
iconv_close(cd);
utf8_clear_cd_cache();
@@ -518,30 +450,22 @@ utf8_convert_ret utf8_to_html(const char *string, const char *encname,
*result = realloc(origout, origoutlen - outlen);
if (*result == NULL) {
free(origout);
- return UTF8_CONVERT_NOMEM;
+ return NSERROR_NOMEM;
}
- return UTF8_CONVERT_OK;
+ return NSERROR_OK;
}
-
-/**
- * Save the given utf8 text to a file, converting to local encoding.
- *
- * \param utf8_text text to save to file
- * \param path pathname to save to
- * \return true iff the save succeeded
- */
-
+/* exported interface documented in utils/utf8.h */
bool utf8_save_text(const char *utf8_text, const char *path)
{
- utf8_convert_ret ret;
+ nserror ret;
char *conv;
FILE *out;
ret = utf8_to_local_encoding(utf8_text, strlen(utf8_text), &conv);
- if (ret != UTF8_CONVERT_OK) {
+ if (ret != NSERROR_OK) {
LOG(("failed to convert to local encoding, return %d", ret));
return false;
}
@@ -562,5 +486,3 @@ bool utf8_save_text(const char *utf8_text, const char *path)
return false;
}
-
-
diff --git a/utils/utf8.h b/utils/utf8.h
index 68d42d3..7c450b5 100644
--- a/utils/utf8.h
+++ b/utils/utf8.h
@@ -26,40 +26,144 @@
#include <stdbool.h>
#include <stdint.h>
-typedef enum {
- UTF8_CONVERT_OK,
- UTF8_CONVERT_NOMEM,
- UTF8_CONVERT_BADENC
-} utf8_convert_ret;
+#include "utils/errors.h"
+/**
+ * Convert a UTF-8 multibyte sequence into a single UCS4 character
+ *
+ * Encoding of UCS values outside the UTF-16 plane has been removed from
+ * RFC3629. This function conforms to RFC2279, however.
+ *
+ * \param s_in The sequence to process
+ * \param l Length of sequence
+ * \return UCS4 character
+ */
uint32_t utf8_to_ucs4(const char *s, size_t l);
+
+/**
+ * Convert a single UCS4 character into a UTF-8 multibyte sequence
+ *
+ * Encoding of UCS values outside the UTF-16 plane has been removed from
+ * RFC3629. This function conforms to RFC2279, however.
+ *
+ * \param c The character to process (0 <= c <= 0x7FFFFFFF)
+ * \param s Pointer to 6 byte long output buffer
+ * \return Length of multibyte sequence
+ */
size_t utf8_from_ucs4(uint32_t c, char *s);
+
+/**
+ * Calculate the length (in characters) of a NULL-terminated UTF-8 string
+ *
+ * \param s The string
+ * \return Length of string
+ */
size_t utf8_length(const char *s);
+
+/**
+ * Calculated the length (in characters) of a bounded UTF-8 string
+ *
+ * \param s The string
+ * \param l Maximum length of input (in bytes)
+ * \return Length of string, in characters
+ */
size_t utf8_bounded_length(const char *s, size_t l);
+
+/**
+ * Calculate the length (in bytes) of a bounded UTF-8 string
+ *
+ * \param s The string
+ * \param l Maximum length of input (in bytes)
+ * \param c Maximum number of characters to measure
+ * \return Length of string, in bytes
+ */
size_t utf8_bounded_byte_length(const char *s, size_t l, size_t c);
+/**
+ * Calculate the length (in bytes) of a UTF-8 character
+ *
+ * \param s Pointer to start of character
+ * \return Length of character, in bytes
+ */
size_t utf8_char_byte_length(const char *s);
+
+/**
+ * Find previous legal UTF-8 char in string
+ *
+ * \param s The string
+ * \param o Offset in the string to start at
+ * \return Offset of first byte of previous legal character
+ */
size_t utf8_prev(const char *s, size_t o);
+
+/**
+ * Find next legal UTF-8 char in string
+ *
+ * \param s The string
+ * \param l Maximum offset in string
+ * \param o Offset in the string to start at
+ * \return Offset of first byte of next legal character
+ */
size_t utf8_next(const char *s, size_t l, size_t o);
-utf8_convert_ret utf8_to_enc(const char *string, const char *encname,
+
+/**
+ * Convert a UTF8 string into the named encoding
+ *
+ * \param string The NULL-terminated string to convert
+ * \param encname The encoding name (suitable for passing to iconv)
+ * \param len Length of input string to consider (in bytes), or 0
+ * \param result Pointer to location to store result (allocated on heap)
+ * \return standard nserror value
+ */
+nserror utf8_to_enc(const char *string, const char *encname,
size_t len, char **result);
-utf8_convert_ret utf8_from_enc(const char *string, const char *encname,
+
+/**
+ * Convert a string in the named encoding into a UTF-8 string
+ *
+ * \param string The NULL-terminated string to convert
+ * \param encname The encoding name (suitable for passing to iconv)
+ * \param len Length of input string to consider (in bytes), or 0
+ * \param result Pointer to location to store result (allocated on heap)
+ * \return standard nserror value
+ */
+nserror utf8_from_enc(const char *string, const char *encname,
size_t len, char **result, size_t *result_len);
-utf8_convert_ret utf8_to_html(const char *string, const char *encname,
+/**
+ * Convert a UTF-8 encoded string into a string of the given encoding,
+ * applying HTML escape sequences where necessary.
+ *
+ * \param string String to convert (NUL-terminated)
+ * \param encname Name of encoding to convert to
+ * \param len Length, in bytes, of the input string, or 0
+ * \param result Pointer to location to receive result
+ * \return standard nserror code
+ */
+nserror utf8_to_html(const char *string, const char *encname,
size_t len, char **result);
+/**
+ * Save the given utf8 text to a file, converting to local encoding.
+ *
+ * \param utf8_text text to save to file
+ * \param path pathname to save to
+ * \return true iff the save succeeded
+ */
bool utf8_save_text(const char *utf8_text, const char *path);
+
+/**
+ * Finalise the UTF-8 library
+ */
+nserror utf8_finalise(void);
+
/* These two are platform specific */
-utf8_convert_ret utf8_to_local_encoding(const char *string, size_t len,
- char **result);
-utf8_convert_ret utf8_from_local_encoding(const char *string, size_t len,
- char **result);
+nserror utf8_to_local_encoding(const char *string, size_t len, char **result);
+nserror utf8_from_local_encoding(const char *string, size_t len, char **result);
-void utf8_finalise(void);
#endif
diff --git a/windows/font.c b/windows/font.c
index c99cec7..98269a3 100644
--- a/windows/font.c
+++ b/windows/font.c
@@ -35,7 +35,7 @@
#include "windows/gui.h"
#include "windows/plot.h"
-utf8_convert_ret utf8_to_font_encoding(const struct font_desc* font,
+nserror utf8_to_font_encoding(const struct font_desc* font,
const char *string,
size_t len,
char **result)
@@ -43,14 +43,14 @@ utf8_convert_ret utf8_to_font_encoding(const struct font_desc* font,
return utf8_to_enc(string, font->encoding, len, result);
}
-utf8_convert_ret utf8_to_local_encoding(const char *string,
+nserror utf8_to_local_encoding(const char *string,
size_t len,
char **result)
{
return utf8_to_enc(string, "UCS-2", len, result);
}
-utf8_convert_ret utf8_from_local_encoding(const char *string, size_t len,
+nserror utf8_from_local_encoding(const char *string, size_t len,
char **result)
{
assert(string && result);
@@ -60,9 +60,9 @@ utf8_convert_ret utf8_from_local_encoding(const char *string, size_t len,
*result = strndup(string, len);
if (!(*result))
- return UTF8_CONVERT_NOMEM;
+ return NSERROR_NOMEM;
- return UTF8_CONVERT_OK;
+ return NSERROR_OK;
}
HFONT get_font(const plot_font_style_t *style)
diff --git a/windows/font.h b/windows/font.h
index 4bd100f..45428fe 100644
--- a/windows/font.h
+++ b/windows/font.h
@@ -29,7 +29,7 @@ struct font_desc {
const char *encoding;
};
-extern utf8_convert_ret utf8_to_font_encoding(const struct font_desc* font,
+extern nserror utf8_to_font_encoding(const struct font_desc* font,
const char *string,
size_t len,
char **result);
--
NetSurf Browser
9 years
netsurf: branch master updated. release/3.0-1006-g4b760c7
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/4b760c7e499e2f5cb1d06...
...commit http://git.netsurf-browser.org/netsurf.git/commit/4b760c7e499e2f5cb1d0624...
...tree http://git.netsurf-browser.org/netsurf.git/tree/4b760c7e499e2f5cb1d06242d...
The branch, master has been updated
via 4b760c7e499e2f5cb1d06242d5f186e14e94496a (commit)
via 443d6f3e04682f3112162d2ddf7c67224652e424 (commit)
from 27fdcb90f2b9ecaeea39f1c673d7978deaeb1d53 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=4b760c7e499e2f5cb1d...
commit 4b760c7e499e2f5cb1d06242d5f186e14e94496a
Author: François Revol <revol(a)free.fr>
Commit: François Revol <revol(a)free.fr>
beos: Fix build
Add missing header due to moved function.
diff --git a/beos/fetch_rsrc.cpp b/beos/fetch_rsrc.cpp
index c52cafe..08fc0c7 100644
--- a/beos/fetch_rsrc.cpp
+++ b/beos/fetch_rsrc.cpp
@@ -44,6 +44,7 @@ extern "C" {
#include "utils/base64.h"
}
#include "beos/fetch_rsrc.h"
+#include "beos/filetype.h"
#include "beos/gui.h"
#include <image.h>
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=443d6f3e04682f31121...
commit 443d6f3e04682f3112162d2ddf7c67224652e424
Author: François Revol <revol(a)free.fr>
Commit: François Revol <revol(a)free.fr>
beos: Account for change in atomic_add() prototype in Haiku
Since the scheduler branch merge, atomic_add() takes a pointer
to int32, doesn't require the target to be volatile anymore.
diff --git a/beos/window.cpp b/beos/window.cpp
index 0040a1d..5009c26 100644
--- a/beos/window.cpp
+++ b/beos/window.cpp
@@ -80,7 +80,7 @@ struct gui_window {
// those are the last queued event of their kind,
// we can safely drop others and avoid wasting cpu.
// number of pending resizes
- vint32 pending_resizes;
+ int32 pending_resizes;
// accumulated rects of pending redraws
//volatile BMessage *lastRedraw;
// UNUSED YET
-----------------------------------------------------------------------
Summary of changes:
beos/fetch_rsrc.cpp | 1 +
beos/window.cpp | 2 +-
2 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/beos/fetch_rsrc.cpp b/beos/fetch_rsrc.cpp
index c52cafe..08fc0c7 100644
--- a/beos/fetch_rsrc.cpp
+++ b/beos/fetch_rsrc.cpp
@@ -44,6 +44,7 @@ extern "C" {
#include "utils/base64.h"
}
#include "beos/fetch_rsrc.h"
+#include "beos/filetype.h"
#include "beos/gui.h"
#include <image.h>
diff --git a/beos/window.cpp b/beos/window.cpp
index 0040a1d..5009c26 100644
--- a/beos/window.cpp
+++ b/beos/window.cpp
@@ -80,7 +80,7 @@ struct gui_window {
// those are the last queued event of their kind,
// we can safely drop others and avoid wasting cpu.
// number of pending resizes
- vint32 pending_resizes;
+ int32 pending_resizes;
// accumulated rects of pending redraws
//volatile BMessage *lastRedraw;
// UNUSED YET
--
NetSurf Browser
9 years