From aa5090c85b6890f79d340ad2de6219237f2d6c4c Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Mon, 30 May 2016 11:20:15 +0100 Subject: move utf8 header into public API --- desktop/gui_factory.c | 2 +- desktop/gui_utf8.h | 53 ----------------------------------- desktop/save_text.c | 2 +- frontends/amiga/utf8.c | 2 +- frontends/atari/encoding.c | 2 +- frontends/framebuffer/font_freetype.c | 2 +- frontends/framebuffer/font_internal.c | 2 +- frontends/riscos/ucstables.c | 2 +- frontends/windows/font.c | 2 +- include/netsurf/utf8.h | 53 +++++++++++++++++++++++++++++++++++ render/html.c | 2 +- utils/utf8.c | 2 +- 12 files changed, 63 insertions(+), 63 deletions(-) delete mode 100644 desktop/gui_utf8.h create mode 100644 include/netsurf/utf8.h diff --git a/desktop/gui_factory.c b/desktop/gui_factory.c index d917a3542..db675a7be 100644 --- a/desktop/gui_factory.c +++ b/desktop/gui_factory.c @@ -36,7 +36,7 @@ #include "netsurf/window.h" #include "netsurf/search.h" #include "netsurf/clipboard.h" -#include "desktop/gui_utf8.h" +#include "netsurf/utf8.h" #include "desktop/gui_layout.h" #include "desktop/netsurf.h" diff --git a/desktop/gui_utf8.h b/desktop/gui_utf8.h deleted file mode 100644 index c40c4c1b3..000000000 --- a/desktop/gui_utf8.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright 2014 Vincent Sanders - * - * This file is part of NetSurf, http://www.netsurf-browser.org/ - * - * NetSurf is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License. - * - * NetSurf is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -/** - * \file - * - * Interface to platform-specific utf8 operations. - */ - -#ifndef _NETSURF_DESKTOP_GUI_UTF8_H_ -#define _NETSURF_DESKTOP_GUI_UTF8_H_ - -/** - * 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); -}; - -#endif diff --git a/desktop/save_text.c b/desktop/save_text.c index 81c3db604..dee1c91e8 100644 --- a/desktop/save_text.c +++ b/desktop/save_text.c @@ -36,7 +36,7 @@ #include "render/box.h" #include "render/html.h" -#include "desktop/gui_utf8.h" +#include "netsurf/utf8.h" #include "desktop/gui_internal.h" #include "desktop/save_text.h" diff --git a/frontends/amiga/utf8.c b/frontends/amiga/utf8.c index 91d7c90c0..24af8c8b9 100755 --- a/frontends/amiga/utf8.c +++ b/frontends/amiga/utf8.c @@ -25,7 +25,7 @@ #include "utils/nsoption.h" #include "utils/utf8.h" -#include "desktop/gui_utf8.h" +#include "netsurf/utf8.h" #include "amiga/utf8.h" diff --git a/frontends/atari/encoding.c b/frontends/atari/encoding.c index 9a16cbd4e..5997cb0f0 100644 --- a/frontends/atari/encoding.c +++ b/frontends/atari/encoding.c @@ -19,7 +19,7 @@ #include #include "utils/errors.h" -#include "desktop/gui_utf8.h" +#include "netsurf/utf8.h" #include "atari/encoding.h" diff --git a/frontends/framebuffer/font_freetype.c b/frontends/framebuffer/font_freetype.c index 7756ae77b..d1ac9ed4b 100644 --- a/frontends/framebuffer/font_freetype.c +++ b/frontends/framebuffer/font_freetype.c @@ -27,7 +27,7 @@ #include "utils/utf8.h" #include "utils/log.h" #include "utils/nsoption.h" -#include "desktop/gui_utf8.h" +#include "netsurf/utf8.h" #include "desktop/gui_layout.h" #include "desktop/browser.h" diff --git a/frontends/framebuffer/font_internal.c b/frontends/framebuffer/font_internal.c index 7578e641a..9b1585889 100644 --- a/frontends/framebuffer/font_internal.c +++ b/frontends/framebuffer/font_internal.c @@ -24,7 +24,7 @@ #include "utils/nsoption.h" #include "utils/utf8.h" -#include "desktop/gui_utf8.h" +#include "netsurf/utf8.h" #include "desktop/gui_layout.h" #include "framebuffer/gui.h" diff --git a/frontends/riscos/ucstables.c b/frontends/riscos/ucstables.c index 7ac685df2..8e538ef95 100644 --- a/frontends/riscos/ucstables.c +++ b/frontends/riscos/ucstables.c @@ -32,7 +32,7 @@ #include "utils/log.h" #include "utils/utf8.h" #include "utils/utils.h" -#include "desktop/gui_utf8.h" +#include "netsurf/utf8.h" #include "riscos/ucstables.h" diff --git a/frontends/windows/font.c b/frontends/windows/font.c index f67205a6f..8af7ea6db 100644 --- a/frontends/windows/font.c +++ b/frontends/windows/font.c @@ -31,7 +31,7 @@ #include "utils/nsoption.h" #include "utils/utf8.h" #include "desktop/gui_layout.h" -#include "desktop/gui_utf8.h" +#include "netsurf/utf8.h" #include "windows/font.h" diff --git a/include/netsurf/utf8.h b/include/netsurf/utf8.h new file mode 100644 index 000000000..c40c4c1b3 --- /dev/null +++ b/include/netsurf/utf8.h @@ -0,0 +1,53 @@ +/* + * Copyright 2014 Vincent Sanders + * + * This file is part of NetSurf, http://www.netsurf-browser.org/ + * + * NetSurf is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * NetSurf is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file + * + * Interface to platform-specific utf8 operations. + */ + +#ifndef _NETSURF_DESKTOP_GUI_UTF8_H_ +#define _NETSURF_DESKTOP_GUI_UTF8_H_ + +/** + * 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); +}; + +#endif diff --git a/render/html.c b/render/html.c index 5090b6f41..479307577 100644 --- a/render/html.c +++ b/render/html.c @@ -49,7 +49,7 @@ #include "netsurf/bitmap.h" #include "javascript/js.h" #include "desktop/browser.h" -#include "desktop/gui_utf8.h" +#include "netsurf/utf8.h" #include "desktop/gui_layout.h" #include "desktop/gui_misc.h" #include "desktop/gui_internal.h" diff --git a/utils/utf8.c b/utils/utf8.c index b1871b2d2..5c930cd13 100644 --- a/utils/utf8.c +++ b/utils/utf8.c @@ -32,7 +32,7 @@ #include "utils/log.h" #include "utils/utf8.h" -#include "desktop/gui_utf8.h" +#include "netsurf/utf8.h" #include "desktop/gui_internal.h" -- cgit v1.2.3