summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2014-01-24 20:08:41 +0000
committerMichael Drake <tlsa@netsurf-browser.org>2014-01-24 20:08:41 +0000
commit14238615a43f3c0f57790ab4b54fd44204695179 (patch)
treee07ea5f844f9aaea5a69d63c9e3a03a1c9f5462d
parente32dc31b04b8db0c27ef666e85a0cd058302fb15 (diff)
downloadnetsurf-14238615a43f3c0f57790ab4b54fd44204695179.tar.gz
netsurf-14238615a43f3c0f57790ab4b54fd44204695179.tar.bz2
Use corestrings for "about", "data", and "resource".
-rw-r--r--content/fetchers/about.c9
-rw-r--r--content/fetchers/data.c8
-rw-r--r--content/fetchers/resource.c9
-rw-r--r--utils/corestrings.c9
-rw-r--r--utils/corestrings.h3
5 files changed, 18 insertions, 20 deletions
diff --git a/content/fetchers/about.c b/content/fetchers/about.c
index cac8b2b01..8e973a9cc 100644
--- a/content/fetchers/about.c
+++ b/content/fetchers/about.c
@@ -48,6 +48,7 @@
#include "content/urldb.h"
#include "desktop/netsurf.h"
#include "utils/nsoption.h"
+#include "utils/corestrings.h"
#include "utils/log.h"
#include "utils/messages.h"
#include "utils/url.h"
@@ -839,13 +840,7 @@ static void fetch_about_poll(lwc_string *scheme)
void fetch_about_register(void)
{
- lwc_string *scheme;
-
- if (lwc_intern_string("about", SLEN("about"),
- &scheme) != lwc_error_ok) {
- die("Failed to initialise the fetch module "
- "(couldn't intern \"about\").");
- }
+ lwc_string *scheme = lwc_string_ref(corestring_lwc_about);
fetch_add_fetcher(scheme,
fetch_about_initialise,
diff --git a/content/fetchers/data.c b/content/fetchers/data.c
index fbaa24780..e192812a7 100644
--- a/content/fetchers/data.c
+++ b/content/fetchers/data.c
@@ -34,6 +34,7 @@
#include "content/fetchers/data.h"
#include "content/urldb.h"
#include "desktop/netsurf.h"
+#include "utils/corestrings.h"
#include "utils/nsoption.h"
#include "utils/log.h"
#include "utils/messages.h"
@@ -326,12 +327,7 @@ static void fetch_data_poll(lwc_string *scheme)
void fetch_data_register(void)
{
- lwc_string *scheme;
-
- if (lwc_intern_string("data", SLEN("data"), &scheme) != lwc_error_ok) {
- die("Failed to initialise the fetch module "
- "(couldn't intern \"data\").");
- }
+ lwc_string *scheme = lwc_string_ref(corestring_lwc_data);
fetch_add_fetcher(scheme,
fetch_data_initialise,
diff --git a/content/fetchers/resource.c b/content/fetchers/resource.c
index cce816aa5..b2791b432 100644
--- a/content/fetchers/resource.c
+++ b/content/fetchers/resource.c
@@ -43,6 +43,7 @@
#include "content/urldb.h"
#include "desktop/gui.h"
#include "desktop/gui_factory.h"
+#include "utils/corestrings.h"
#include "utils/nsoption.h"
#include "utils/log.h"
#include "utils/messages.h"
@@ -356,13 +357,7 @@ static void fetch_resource_poll(lwc_string *scheme)
void fetch_resource_register(void)
{
- lwc_string *scheme;
-
- if (lwc_intern_string("resource", SLEN("resource"),
- &scheme) != lwc_error_ok) {
- die("Failed to initialise the fetch module "
- "(couldn't intern \"resource\").");
- }
+ lwc_string *scheme = lwc_string_ref(corestring_lwc_resource);
fetch_add_fetcher(scheme,
fetch_resource_initialise,
diff --git a/utils/corestrings.c b/utils/corestrings.c
index ebe7c9932..1a0c962da 100644
--- a/utils/corestrings.c
+++ b/utils/corestrings.c
@@ -27,6 +27,7 @@
/* lwc_string strings */
lwc_string *corestring_lwc_a;
+lwc_string *corestring_lwc_about;
lwc_string *corestring_lwc_abscenter;
lwc_string *corestring_lwc_absmiddle;
lwc_string *corestring_lwc_align;
@@ -42,6 +43,7 @@ lwc_string *corestring_lwc_charset;
lwc_string *corestring_lwc_checkbox;
lwc_string *corestring_lwc_circle;
lwc_string *corestring_lwc_col;
+lwc_string *corestring_lwc_data;
lwc_string *corestring_lwc_default;
lwc_string *corestring_lwc_div;
lwc_string *corestring_lwc_embed;
@@ -88,6 +90,7 @@ lwc_string *corestring_lwc_rect;
lwc_string *corestring_lwc_rectangle;
lwc_string *corestring_lwc_refresh;
lwc_string *corestring_lwc_reset;
+lwc_string *corestring_lwc_resource;
lwc_string *corestring_lwc_right;
lwc_string *corestring_lwc_search;
lwc_string *corestring_lwc_select;
@@ -276,6 +279,7 @@ void corestrings_fini(void)
} while (0)
CSS_LWC_STRING_UNREF(a);
+ CSS_LWC_STRING_UNREF(about);
CSS_LWC_STRING_UNREF(abscenter);
CSS_LWC_STRING_UNREF(absmiddle);
CSS_LWC_STRING_UNREF(align);
@@ -291,6 +295,7 @@ void corestrings_fini(void)
CSS_LWC_STRING_UNREF(checkbox);
CSS_LWC_STRING_UNREF(circle);
CSS_LWC_STRING_UNREF(col);
+ CSS_LWC_STRING_UNREF(data);
CSS_LWC_STRING_UNREF(default);
CSS_LWC_STRING_UNREF(div);
CSS_LWC_STRING_UNREF(embed);
@@ -337,6 +342,7 @@ void corestrings_fini(void)
CSS_LWC_STRING_UNREF(rectangle);
CSS_LWC_STRING_UNREF(refresh);
CSS_LWC_STRING_UNREF(reset);
+ CSS_LWC_STRING_UNREF(resource);
CSS_LWC_STRING_UNREF(right);
CSS_LWC_STRING_UNREF(search);
CSS_LWC_STRING_UNREF(select);
@@ -549,6 +555,7 @@ nserror corestrings_init(void)
} while(0)
CSS_LWC_STRING_INTERN(a);
+ CSS_LWC_STRING_INTERN(about);
CSS_LWC_STRING_INTERN(abscenter);
CSS_LWC_STRING_INTERN(absmiddle);
CSS_LWC_STRING_INTERN(align);
@@ -564,6 +571,7 @@ nserror corestrings_init(void)
CSS_LWC_STRING_INTERN(checkbox);
CSS_LWC_STRING_INTERN(circle);
CSS_LWC_STRING_INTERN(col);
+ CSS_LWC_STRING_INTERN(data);
CSS_LWC_STRING_INTERN(default);
CSS_LWC_STRING_INTERN(div);
CSS_LWC_STRING_INTERN(embed);
@@ -609,6 +617,7 @@ nserror corestrings_init(void)
CSS_LWC_STRING_INTERN(rectangle);
CSS_LWC_STRING_INTERN(refresh);
CSS_LWC_STRING_INTERN(reset);
+ CSS_LWC_STRING_INTERN(resource);
CSS_LWC_STRING_INTERN(right);
CSS_LWC_STRING_INTERN(search);
CSS_LWC_STRING_INTERN(select);
diff --git a/utils/corestrings.h b/utils/corestrings.h
index 5c3349f04..555b916b5 100644
--- a/utils/corestrings.h
+++ b/utils/corestrings.h
@@ -31,6 +31,7 @@ void corestrings_fini(void);
/* lwc_string strings */
extern lwc_string *corestring_lwc_a;
+extern lwc_string *corestring_lwc_about;
extern lwc_string *corestring_lwc_abscenter;
extern lwc_string *corestring_lwc_absmiddle;
extern lwc_string *corestring_lwc_align;
@@ -46,6 +47,7 @@ extern lwc_string *corestring_lwc_charset;
extern lwc_string *corestring_lwc_checkbox;
extern lwc_string *corestring_lwc_circle;
extern lwc_string *corestring_lwc_col;
+extern lwc_string *corestring_lwc_data;
extern lwc_string *corestring_lwc_default;
extern lwc_string *corestring_lwc_div;
extern lwc_string *corestring_lwc_embed;
@@ -92,6 +94,7 @@ extern lwc_string *corestring_lwc_rect;
extern lwc_string *corestring_lwc_rectangle;
extern lwc_string *corestring_lwc_refresh;
extern lwc_string *corestring_lwc_reset;
+extern lwc_string *corestring_lwc_resource;
extern lwc_string *corestring_lwc_right;
extern lwc_string *corestring_lwc_search;
extern lwc_string *corestring_lwc_select;