Gitweb links:
...log
http://git.netsurf-browser.org/netsurf.git/shortlog/ebe1b0511444e82830e8d...
...commit
http://git.netsurf-browser.org/netsurf.git/commit/ebe1b0511444e82830e8de2...
...tree
http://git.netsurf-browser.org/netsurf.git/tree/ebe1b0511444e82830e8de239...
The branch, master has been updated
via ebe1b0511444e82830e8de239c34c6817817fba8 (commit)
via 2352bea1534c5cfe13018cbc04b9026f5dda60f7 (commit)
from 567390f59da4e9ae0adc3fc22b1be4ebbf6b7b62 (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=ebe1b0511444e82830e...
commit ebe1b0511444e82830e8de239c34c6817817fba8
Author: Vincent Sanders <vince(a)kyllikki.org>
Commit: Vincent Sanders <vince(a)kyllikki.org>
improve desktop text search header usage
remove unecessary inclusion of desktop search header in content
header which has knock on effect of not having ctype or string
system headers dragged in unecessarily.
Futher this highlighted use of ctype API where internal ascii
processing ought to be used.
diff --git a/content/content.c b/content/content.c
index f72f3d4..ae4718f 100644
--- a/content/content.c
+++ b/content/content.c
@@ -23,6 +23,7 @@
#include <stdint.h>
#include <stdlib.h>
+#include <string.h>
#include <nsutils/time.h>
#include "netsurf/inttypes.h"
diff --git a/content/content.h b/content/content.h
index edf9ed2..1bae813 100644
--- a/content/content.h
+++ b/content/content.h
@@ -29,7 +29,6 @@
#include <libwapcaplet/libwapcaplet.h>
-#include "desktop/search.h" /* search flags enum */
#include "netsurf/content_type.h"
#include "netsurf/mouse.h" /* mouse state enums */
#include "netsurf/console.h" /* console state and flags enums */
@@ -421,24 +420,6 @@ bool content_scroll_at_point(struct hlcache_handle *h,
bool content_drop_file_at_point(struct hlcache_handle *h,
int x, int y, char *file);
-/**
- * Free text search a content
- *
- * \param[in] h Handle to content to search.
- * \param[in] context The context passed to gui table search handlers
- * \param[in] flags The flags that control the search
- * \param[in] The string being searched for.
- * \retun NSERROR_OK on success else error code on faliure
- */
-nserror content_textsearch(struct hlcache_handle *h, void *context, search_flags_t flags,
const char *string);
-
-/**
- * Clear a search
- *
- * \param[in] h Handle to content to clear search from.
- */
-nserror content_textsearch_clear(struct hlcache_handle *h);
-
/**
* Control debug con a content.
diff --git a/content/handlers/css/css.c b/content/handlers/css/css.c
index 6bdc124..be945fb 100644
--- a/content/handlers/css/css.c
+++ b/content/handlers/css/css.c
@@ -16,6 +16,7 @@
* along with this program. If not, see <
http://www.gnu.org/licenses/>.
*/
+#include <string.h>
#include <assert.h>
#include <libwapcaplet/libwapcaplet.h>
#include <dom/dom.h>
diff --git a/content/handlers/html/box_special.c b/content/handlers/html/box_special.c
index c6be9e6..f761557 100644
--- a/content/handlers/html/box_special.c
+++ b/content/handlers/html/box_special.c
@@ -26,6 +26,7 @@
* Implementation of special element handling conversion.
*/
+#include <string.h>
#include <stdbool.h>
#include <dom/dom.h>
diff --git a/content/handlers/html/box_textarea.c b/content/handlers/html/box_textarea.c
index 1038be3..b3e3c36 100644
--- a/content/handlers/html/box_textarea.c
+++ b/content/handlers/html/box_textarea.c
@@ -21,6 +21,7 @@
* Box tree treeview box replacement (implementation).
*/
+#include <string.h>
#include <dom/dom.h>
#include "utils/config.h"
diff --git a/content/handlers/html/dom_event.c b/content/handlers/html/dom_event.c
index d490cad..71ef138 100644
--- a/content/handlers/html/dom_event.c
+++ b/content/handlers/html/dom_event.c
@@ -22,6 +22,8 @@
* Implementation of HTML content DOM event handling.
*/
+#include <string.h>
+
#include "utils/config.h"
#include "utils/corestrings.h"
#include "utils/nsoption.h"
diff --git a/content/handlers/html/forms.c b/content/handlers/html/forms.c
index 08adf8d..4669154 100644
--- a/content/handlers/html/forms.c
+++ b/content/handlers/html/forms.c
@@ -21,6 +21,8 @@
* HTML form handling implementation
*/
+#include <string.h>
+
#include "utils/config.h"
#include "utils/corestrings.h"
#include "utils/log.h"
diff --git a/content/handlers/html/interaction.c b/content/handlers/html/interaction.c
index 421535c..90e7b76 100644
--- a/content/handlers/html/interaction.c
+++ b/content/handlers/html/interaction.c
@@ -26,6 +26,7 @@
#include <assert.h>
#include <stdbool.h>
+#include <string.h>
#include <dom/dom.h>
diff --git a/content/handlers/image/png.c b/content/handlers/image/png.c
index 4926d9a..06a38ca 100644
--- a/content/handlers/image/png.c
+++ b/content/handlers/image/png.c
@@ -19,6 +19,7 @@
*/
#include <stdbool.h>
+#include <string.h>
#include <stdlib.h>
#include <png.h>
diff --git a/content/handlers/text/textplain.c b/content/handlers/text/textplain.c
index b5ad0ae..21876ec 100644
--- a/content/handlers/text/textplain.c
+++ b/content/handlers/text/textplain.c
@@ -23,6 +23,7 @@
* plain text content handling implementation.
*/
+#include <string.h>
#include <parserutils/input/inputstream.h>
#include "utils/errors.h"
diff --git a/content/textsearch.c b/content/textsearch.c
index 8028320..3f97d42 100644
--- a/content/textsearch.c
+++ b/content/textsearch.c
@@ -25,9 +25,11 @@
#include <stdbool.h>
#include <stddef.h>
#include <stdlib.h>
+#include <string.h>
#include "utils/errors.h"
#include "utils/utils.h"
+#include "utils/ascii.h"
#include "netsurf/types.h"
#include "desktop/selection.h"
@@ -507,11 +509,11 @@ content_textsearch_find_pattern(const char *string,
if (ch != '#') {
/* scan forwards until we find a match for
this char */
- if (!case_sens) ch = toupper(ch);
+ if (!case_sens) ch = ascii_to_upper(ch);
while (s < es) {
if (case_sens) {
if (*s == ch) break;
- } else if (toupper(*s) == ch)
+ } else if (ascii_to_upper(*s) == ch)
break;
s++;
}
@@ -548,7 +550,7 @@ content_textsearch_find_pattern(const char *string,
if (case_sens)
matches = (*s == ch);
else
- matches = (toupper(*s) == toupper(ch));
+ matches = (ascii_to_upper(*s) == ascii_to_upper(ch));
}
if (matches && first) {
ss = s; /* remember first non-'*' char */
diff --git a/content/textsearch.h b/content/textsearch.h
index e30ebc4..c32b17c 100644
--- a/content/textsearch.h
+++ b/content/textsearch.h
@@ -28,9 +28,28 @@
struct textsearch_context;
struct content;
+struct hlcache_handle;
struct box;
/**
+ * Free text search a content
+ *
+ * \param[in] h Handle to content to search.
+ * \param[in] context The context passed to gui table search handlers
+ * \param[in] flags The flags that control the search
+ * \param[in] The string being searched for.
+ * \retun NSERROR_OK on success else error code on faliure
+ */
+nserror content_textsearch(struct hlcache_handle *h, void *context, search_flags_t flags,
const char *string);
+
+/**
+ * Clear a search
+ *
+ * \param[in] h Handle to content to clear search from.
+ */
+nserror content_textsearch_clear(struct hlcache_handle *h);
+
+/**
* Ends the search process, invalidating all state freeing the list of
* found boxes.
*/
diff --git a/desktop/browser_window.c b/desktop/browser_window.c
index 546198f..3224706 100644
--- a/desktop/browser_window.c
+++ b/desktop/browser_window.c
@@ -27,6 +27,7 @@
#include "utils/config.h"
#include <stdlib.h>
+#include <string.h>
#include <math.h>
#include <nsutils/time.h>
diff --git a/desktop/gui_factory.c b/desktop/gui_factory.c
index a4532fe..a141d7d 100644
--- a/desktop/gui_factory.c
+++ b/desktop/gui_factory.c
@@ -19,6 +19,7 @@
#include <stdlib.h>
#include <stdint.h>
#include <stdbool.h>
+#include <string.h>
#include "utils/config.h"
#include "utils/errors.h"
diff --git a/desktop/search.c b/desktop/search.c
index d4abfed..e21f520 100644
--- a/desktop/search.c
+++ b/desktop/search.c
@@ -26,7 +26,7 @@
#include <stdbool.h>
#include "utils/errors.h"
-#include "content/content.h"
+#include "content/textsearch.h"
#include "netsurf/types.h"
#include "netsurf/browser_window.h"
diff --git a/desktop/search.h b/desktop/search.h
index baf382e..c39d1d8 100644
--- a/desktop/search.h
+++ b/desktop/search.h
@@ -16,11 +16,13 @@
* along with this program. If not, see <
http://www.gnu.org/licenses/>.
*/
-#ifndef _NETSURF_DESKTOP_SEARCH_H_
-#define _NETSURF_DESKTOP_SEARCH_H_
+/**
+ * \file
+ * Browseing window text search interface
+ */
-#include <ctype.h>
-#include <string.h>
+#ifndef NETSURF_DESKTOP_SEARCH_H_
+#define NETSURF_DESKTOP_SEARCH_H_
struct browser_window;
diff --git a/desktop/searchweb.c b/desktop/searchweb.c
index 2c0873d..597b8ff 100644
--- a/desktop/searchweb.c
+++ b/desktop/searchweb.c
@@ -22,6 +22,7 @@
*/
#include <stdlib.h>
+#include <string.h>
#include "utils/utils.h"
#include "utils/log.h"
diff --git a/desktop/selection.c b/desktop/selection.c
index 417a504..332e9da 100644
--- a/desktop/selection.c
+++ b/desktop/selection.c
@@ -23,6 +23,7 @@
*/
#include <stdlib.h>
+#include <string.h>
#include "netsurf/clipboard.h"
#include "netsurf/browser_window.h"
commitdiff
http://git.netsurf-browser.org/netsurf.git/commit/?id=2352bea1534c5cfe130...
commit 2352bea1534c5cfe13018cbc04b9026f5dda60f7
Author: Vincent Sanders <vince(a)kyllikki.org>
Commit: Vincent Sanders <vince(a)kyllikki.org>
use the ascii locale safe handling instead of ctype API
diff --git a/content/handlers/html/box_construct.c
b/content/handlers/html/box_construct.c
index 5edd88e..e2eaf8c 100644
--- a/content/handlers/html/box_construct.c
+++ b/content/handlers/html/box_construct.c
@@ -25,6 +25,7 @@
* Implementation of conversion from DOM tree to box tree.
*/
+#include <string.h>
#include <dom/dom.h>
#include "utils/errors.h"
@@ -967,20 +968,20 @@ box_text_transform(char *s, unsigned int len, enum
css_text_transform_e tt)
case CSS_TEXT_TRANSFORM_UPPERCASE:
for (i = 0; i < len; ++i)
if ((unsigned char) s[i] < 0x80)
- s[i] = toupper(s[i]);
+ s[i] = ascii_to_upper(s[i]);
break;
case CSS_TEXT_TRANSFORM_LOWERCASE:
for (i = 0; i < len; ++i)
if ((unsigned char) s[i] < 0x80)
- s[i] = tolower(s[i]);
+ s[i] = ascii_to_lower(s[i]);
break;
case CSS_TEXT_TRANSFORM_CAPITALIZE:
if ((unsigned char) s[0] < 0x80)
- s[0] = toupper(s[0]);
+ s[0] = ascii_to_upper(s[0]);
for (i = 1; i < len; ++i)
if ((unsigned char) s[i] < 0x80 &&
- isspace(s[i - 1]))
- s[i] = toupper(s[i]);
+ ascii_is_space(s[i - 1]))
+ s[i] = ascii_to_upper(s[i]);
break;
default:
break;
-----------------------------------------------------------------------
Summary of changes:
content/content.c | 1 +
content/content.h | 19 -------------------
content/handlers/css/css.c | 1 +
content/handlers/html/box_construct.c | 11 ++++++-----
content/handlers/html/box_special.c | 1 +
content/handlers/html/box_textarea.c | 1 +
content/handlers/html/dom_event.c | 2 ++
content/handlers/html/forms.c | 2 ++
content/handlers/html/interaction.c | 1 +
content/handlers/image/png.c | 1 +
content/handlers/text/textplain.c | 1 +
content/textsearch.c | 8 +++++---
content/textsearch.h | 19 +++++++++++++++++++
desktop/browser_window.c | 1 +
desktop/gui_factory.c | 1 +
desktop/search.c | 2 +-
desktop/search.h | 10 ++++++----
desktop/searchweb.c | 1 +
desktop/selection.c | 1 +
19 files changed, 52 insertions(+), 32 deletions(-)
diff --git a/content/content.c b/content/content.c
index f72f3d4..ae4718f 100644
--- a/content/content.c
+++ b/content/content.c
@@ -23,6 +23,7 @@
#include <stdint.h>
#include <stdlib.h>
+#include <string.h>
#include <nsutils/time.h>
#include "netsurf/inttypes.h"
diff --git a/content/content.h b/content/content.h
index edf9ed2..1bae813 100644
--- a/content/content.h
+++ b/content/content.h
@@ -29,7 +29,6 @@
#include <libwapcaplet/libwapcaplet.h>
-#include "desktop/search.h" /* search flags enum */
#include "netsurf/content_type.h"
#include "netsurf/mouse.h" /* mouse state enums */
#include "netsurf/console.h" /* console state and flags enums */
@@ -421,24 +420,6 @@ bool content_scroll_at_point(struct hlcache_handle *h,
bool content_drop_file_at_point(struct hlcache_handle *h,
int x, int y, char *file);
-/**
- * Free text search a content
- *
- * \param[in] h Handle to content to search.
- * \param[in] context The context passed to gui table search handlers
- * \param[in] flags The flags that control the search
- * \param[in] The string being searched for.
- * \retun NSERROR_OK on success else error code on faliure
- */
-nserror content_textsearch(struct hlcache_handle *h, void *context, search_flags_t flags,
const char *string);
-
-/**
- * Clear a search
- *
- * \param[in] h Handle to content to clear search from.
- */
-nserror content_textsearch_clear(struct hlcache_handle *h);
-
/**
* Control debug con a content.
diff --git a/content/handlers/css/css.c b/content/handlers/css/css.c
index 6bdc124..be945fb 100644
--- a/content/handlers/css/css.c
+++ b/content/handlers/css/css.c
@@ -16,6 +16,7 @@
* along with this program. If not, see <
http://www.gnu.org/licenses/>.
*/
+#include <string.h>
#include <assert.h>
#include <libwapcaplet/libwapcaplet.h>
#include <dom/dom.h>
diff --git a/content/handlers/html/box_construct.c
b/content/handlers/html/box_construct.c
index 5edd88e..e2eaf8c 100644
--- a/content/handlers/html/box_construct.c
+++ b/content/handlers/html/box_construct.c
@@ -25,6 +25,7 @@
* Implementation of conversion from DOM tree to box tree.
*/
+#include <string.h>
#include <dom/dom.h>
#include "utils/errors.h"
@@ -967,20 +968,20 @@ box_text_transform(char *s, unsigned int len, enum
css_text_transform_e tt)
case CSS_TEXT_TRANSFORM_UPPERCASE:
for (i = 0; i < len; ++i)
if ((unsigned char) s[i] < 0x80)
- s[i] = toupper(s[i]);
+ s[i] = ascii_to_upper(s[i]);
break;
case CSS_TEXT_TRANSFORM_LOWERCASE:
for (i = 0; i < len; ++i)
if ((unsigned char) s[i] < 0x80)
- s[i] = tolower(s[i]);
+ s[i] = ascii_to_lower(s[i]);
break;
case CSS_TEXT_TRANSFORM_CAPITALIZE:
if ((unsigned char) s[0] < 0x80)
- s[0] = toupper(s[0]);
+ s[0] = ascii_to_upper(s[0]);
for (i = 1; i < len; ++i)
if ((unsigned char) s[i] < 0x80 &&
- isspace(s[i - 1]))
- s[i] = toupper(s[i]);
+ ascii_is_space(s[i - 1]))
+ s[i] = ascii_to_upper(s[i]);
break;
default:
break;
diff --git a/content/handlers/html/box_special.c b/content/handlers/html/box_special.c
index c6be9e6..f761557 100644
--- a/content/handlers/html/box_special.c
+++ b/content/handlers/html/box_special.c
@@ -26,6 +26,7 @@
* Implementation of special element handling conversion.
*/
+#include <string.h>
#include <stdbool.h>
#include <dom/dom.h>
diff --git a/content/handlers/html/box_textarea.c b/content/handlers/html/box_textarea.c
index 1038be3..b3e3c36 100644
--- a/content/handlers/html/box_textarea.c
+++ b/content/handlers/html/box_textarea.c
@@ -21,6 +21,7 @@
* Box tree treeview box replacement (implementation).
*/
+#include <string.h>
#include <dom/dom.h>
#include "utils/config.h"
diff --git a/content/handlers/html/dom_event.c b/content/handlers/html/dom_event.c
index d490cad..71ef138 100644
--- a/content/handlers/html/dom_event.c
+++ b/content/handlers/html/dom_event.c
@@ -22,6 +22,8 @@
* Implementation of HTML content DOM event handling.
*/
+#include <string.h>
+
#include "utils/config.h"
#include "utils/corestrings.h"
#include "utils/nsoption.h"
diff --git a/content/handlers/html/forms.c b/content/handlers/html/forms.c
index 08adf8d..4669154 100644
--- a/content/handlers/html/forms.c
+++ b/content/handlers/html/forms.c
@@ -21,6 +21,8 @@
* HTML form handling implementation
*/
+#include <string.h>
+
#include "utils/config.h"
#include "utils/corestrings.h"
#include "utils/log.h"
diff --git a/content/handlers/html/interaction.c b/content/handlers/html/interaction.c
index 421535c..90e7b76 100644
--- a/content/handlers/html/interaction.c
+++ b/content/handlers/html/interaction.c
@@ -26,6 +26,7 @@
#include <assert.h>
#include <stdbool.h>
+#include <string.h>
#include <dom/dom.h>
diff --git a/content/handlers/image/png.c b/content/handlers/image/png.c
index 4926d9a..06a38ca 100644
--- a/content/handlers/image/png.c
+++ b/content/handlers/image/png.c
@@ -19,6 +19,7 @@
*/
#include <stdbool.h>
+#include <string.h>
#include <stdlib.h>
#include <png.h>
diff --git a/content/handlers/text/textplain.c b/content/handlers/text/textplain.c
index b5ad0ae..21876ec 100644
--- a/content/handlers/text/textplain.c
+++ b/content/handlers/text/textplain.c
@@ -23,6 +23,7 @@
* plain text content handling implementation.
*/
+#include <string.h>
#include <parserutils/input/inputstream.h>
#include "utils/errors.h"
diff --git a/content/textsearch.c b/content/textsearch.c
index 8028320..3f97d42 100644
--- a/content/textsearch.c
+++ b/content/textsearch.c
@@ -25,9 +25,11 @@
#include <stdbool.h>
#include <stddef.h>
#include <stdlib.h>
+#include <string.h>
#include "utils/errors.h"
#include "utils/utils.h"
+#include "utils/ascii.h"
#include "netsurf/types.h"
#include "desktop/selection.h"
@@ -507,11 +509,11 @@ content_textsearch_find_pattern(const char *string,
if (ch != '#') {
/* scan forwards until we find a match for
this char */
- if (!case_sens) ch = toupper(ch);
+ if (!case_sens) ch = ascii_to_upper(ch);
while (s < es) {
if (case_sens) {
if (*s == ch) break;
- } else if (toupper(*s) == ch)
+ } else if (ascii_to_upper(*s) == ch)
break;
s++;
}
@@ -548,7 +550,7 @@ content_textsearch_find_pattern(const char *string,
if (case_sens)
matches = (*s == ch);
else
- matches = (toupper(*s) == toupper(ch));
+ matches = (ascii_to_upper(*s) == ascii_to_upper(ch));
}
if (matches && first) {
ss = s; /* remember first non-'*' char */
diff --git a/content/textsearch.h b/content/textsearch.h
index e30ebc4..c32b17c 100644
--- a/content/textsearch.h
+++ b/content/textsearch.h
@@ -28,9 +28,28 @@
struct textsearch_context;
struct content;
+struct hlcache_handle;
struct box;
/**
+ * Free text search a content
+ *
+ * \param[in] h Handle to content to search.
+ * \param[in] context The context passed to gui table search handlers
+ * \param[in] flags The flags that control the search
+ * \param[in] The string being searched for.
+ * \retun NSERROR_OK on success else error code on faliure
+ */
+nserror content_textsearch(struct hlcache_handle *h, void *context, search_flags_t flags,
const char *string);
+
+/**
+ * Clear a search
+ *
+ * \param[in] h Handle to content to clear search from.
+ */
+nserror content_textsearch_clear(struct hlcache_handle *h);
+
+/**
* Ends the search process, invalidating all state freeing the list of
* found boxes.
*/
diff --git a/desktop/browser_window.c b/desktop/browser_window.c
index 546198f..3224706 100644
--- a/desktop/browser_window.c
+++ b/desktop/browser_window.c
@@ -27,6 +27,7 @@
#include "utils/config.h"
#include <stdlib.h>
+#include <string.h>
#include <math.h>
#include <nsutils/time.h>
diff --git a/desktop/gui_factory.c b/desktop/gui_factory.c
index a4532fe..a141d7d 100644
--- a/desktop/gui_factory.c
+++ b/desktop/gui_factory.c
@@ -19,6 +19,7 @@
#include <stdlib.h>
#include <stdint.h>
#include <stdbool.h>
+#include <string.h>
#include "utils/config.h"
#include "utils/errors.h"
diff --git a/desktop/search.c b/desktop/search.c
index d4abfed..e21f520 100644
--- a/desktop/search.c
+++ b/desktop/search.c
@@ -26,7 +26,7 @@
#include <stdbool.h>
#include "utils/errors.h"
-#include "content/content.h"
+#include "content/textsearch.h"
#include "netsurf/types.h"
#include "netsurf/browser_window.h"
diff --git a/desktop/search.h b/desktop/search.h
index baf382e..c39d1d8 100644
--- a/desktop/search.h
+++ b/desktop/search.h
@@ -16,11 +16,13 @@
* along with this program. If not, see <
http://www.gnu.org/licenses/>.
*/
-#ifndef _NETSURF_DESKTOP_SEARCH_H_
-#define _NETSURF_DESKTOP_SEARCH_H_
+/**
+ * \file
+ * Browseing window text search interface
+ */
-#include <ctype.h>
-#include <string.h>
+#ifndef NETSURF_DESKTOP_SEARCH_H_
+#define NETSURF_DESKTOP_SEARCH_H_
struct browser_window;
diff --git a/desktop/searchweb.c b/desktop/searchweb.c
index 2c0873d..597b8ff 100644
--- a/desktop/searchweb.c
+++ b/desktop/searchweb.c
@@ -22,6 +22,7 @@
*/
#include <stdlib.h>
+#include <string.h>
#include "utils/utils.h"
#include "utils/log.h"
diff --git a/desktop/selection.c b/desktop/selection.c
index 417a504..332e9da 100644
--- a/desktop/selection.c
+++ b/desktop/selection.c
@@ -23,6 +23,7 @@
*/
#include <stdlib.h>
+#include <string.h>
#include "netsurf/clipboard.h"
#include "netsurf/browser_window.h"
--
NetSurf Browser