summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2017-03-19 14:27:05 +0000
committerVincent Sanders <vince@kyllikki.org>2017-03-19 14:27:05 +0000
commit6fb654d35634c01344fae8ace5ef6d340cdafd17 (patch)
tree3a51071a29fe7deedfed3cb1bab4ca273b961a88
parenteb5e5ff48636cd4a63f9517087490c296cde9c69 (diff)
downloadnetsurf-6fb654d35634c01344fae8ace5ef6d340cdafd17.tar.gz
rework corestring implementation
This removes special casing for some strings and importantly the multiple huge lists of variables in code.
-rw-r--r--utils/corestringlist.h354
-rw-r--r--utils/corestrings.c943
-rw-r--r--utils/corestrings.h298
3 files changed, 430 insertions, 1165 deletions
diff --git a/utils/corestringlist.h b/utils/corestringlist.h
new file mode 100644
index 000000000..def5a73bf
--- /dev/null
+++ b/utils/corestringlist.h
@@ -0,0 +1,354 @@
+/*
+ * Copyright 2012 Vincent Sanders <vince@netsurf-browser.org>
+ *
+ * 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 <http://www.gnu.org/licenses/>.
+ */
+
+/**
+ * \file
+ * Core string lists
+ *
+ * three macros must be defined to use this header
+ * CORESTRING_LWC_VALUE - wapcaplet strings with a value not derived from name
+ * CORESTRING_DOM_VALUE - dom strings with a value not derived from name
+ * CORESTRING_NSURL - nsurl from given url
+ *
+ * two helper macros are defined that allow simple mapping strings
+ * CORESTRING_LWC_STRING - libwapcaplet strings with a simple name value mapping
+ * CORESTRING_DOM_STRING - dom strings with a simple name value mapping
+ *
+ * \note This header is specificaly intented to be included multiple
+ * times with different macro definitions so there is no guard.
+ */
+
+#if !defined(CORESTRING_LWC_VALUE) | !defined(CORESTRING_DOM_VALUE) | !defined(CORESTRING_NSURL)
+#error "missing macro definition. This header must not be directly included"
+#endif
+
+#undef CORESTRING_LWC_STRING
+#define CORESTRING_LWC_STRING(NAME) CORESTRING_LWC_VALUE(NAME, #NAME)
+
+#undef CORESTRING_DOM_STRING
+#define CORESTRING_DOM_STRING(NAME) CORESTRING_DOM_VALUE(NAME, #NAME);
+
+/* lwc_string strings */
+CORESTRING_LWC_STRING(a);
+CORESTRING_LWC_STRING(about);
+CORESTRING_LWC_STRING(abscenter);
+CORESTRING_LWC_STRING(absmiddle);
+CORESTRING_LWC_STRING(align);
+CORESTRING_LWC_STRING(applet);
+CORESTRING_LWC_STRING(base);
+CORESTRING_LWC_STRING(baseline);
+CORESTRING_LWC_STRING(body);
+CORESTRING_LWC_STRING(bottom);
+CORESTRING_LWC_STRING(button);
+CORESTRING_LWC_STRING(caption);
+CORESTRING_LWC_STRING(charset);
+CORESTRING_LWC_STRING(center);
+CORESTRING_LWC_STRING(checkbox);
+CORESTRING_LWC_STRING(circle);
+CORESTRING_LWC_STRING(col);
+CORESTRING_LWC_STRING(data);
+CORESTRING_LWC_STRING(default);
+CORESTRING_LWC_STRING(div);
+CORESTRING_LWC_STRING(embed);
+CORESTRING_LWC_STRING(file);
+CORESTRING_LWC_STRING(filename);
+CORESTRING_LWC_STRING(font);
+CORESTRING_LWC_STRING(frame);
+CORESTRING_LWC_STRING(frameset);
+CORESTRING_LWC_STRING(h1);
+CORESTRING_LWC_STRING(h2);
+CORESTRING_LWC_STRING(h3);
+CORESTRING_LWC_STRING(h4);
+CORESTRING_LWC_STRING(h5);
+CORESTRING_LWC_STRING(h6);
+CORESTRING_LWC_STRING(head);
+CORESTRING_LWC_STRING(hidden);
+CORESTRING_LWC_STRING(hr);
+CORESTRING_LWC_STRING(html);
+CORESTRING_LWC_STRING(http);
+CORESTRING_LWC_STRING(https);
+CORESTRING_LWC_STRING(icon);
+CORESTRING_LWC_STRING(iframe);
+CORESTRING_LWC_STRING(image);
+CORESTRING_LWC_STRING(img);
+CORESTRING_LWC_STRING(input);
+CORESTRING_LWC_STRING(javascript);
+CORESTRING_LWC_STRING(justify);
+CORESTRING_LWC_STRING(left);
+CORESTRING_LWC_STRING(li);
+CORESTRING_LWC_STRING(link);
+CORESTRING_LWC_STRING(mailto);
+CORESTRING_LWC_STRING(meta);
+CORESTRING_LWC_STRING(middle);
+CORESTRING_LWC_STRING(no);
+CORESTRING_LWC_STRING(noscript);
+CORESTRING_LWC_STRING(object);
+CORESTRING_LWC_STRING(optgroup);
+CORESTRING_LWC_STRING(option);
+CORESTRING_LWC_STRING(p);
+CORESTRING_LWC_STRING(param);
+CORESTRING_LWC_STRING(password);
+CORESTRING_LWC_STRING(poly);
+CORESTRING_LWC_STRING(polygon);
+CORESTRING_LWC_STRING(post);
+CORESTRING_LWC_STRING(radio);
+CORESTRING_LWC_STRING(rect);
+CORESTRING_LWC_STRING(rectangle);
+CORESTRING_LWC_STRING(refresh);
+CORESTRING_LWC_STRING(reset);
+CORESTRING_LWC_STRING(resource);
+CORESTRING_LWC_STRING(right);
+CORESTRING_LWC_STRING(search);
+CORESTRING_LWC_STRING(select);
+CORESTRING_LWC_STRING(src);
+CORESTRING_LWC_STRING(style);
+CORESTRING_LWC_STRING(submit);
+CORESTRING_LWC_STRING(table);
+CORESTRING_LWC_STRING(tbody);
+CORESTRING_LWC_STRING(td);
+CORESTRING_LWC_STRING(text);
+CORESTRING_LWC_STRING(textarea);
+CORESTRING_LWC_STRING(texttop);
+CORESTRING_LWC_STRING(tfoot);
+CORESTRING_LWC_STRING(th);
+CORESTRING_LWC_STRING(thead);
+CORESTRING_LWC_STRING(title);
+CORESTRING_LWC_STRING(top);
+CORESTRING_LWC_STRING(tr);
+CORESTRING_LWC_STRING(ul);
+CORESTRING_LWC_STRING(url);
+CORESTRING_LWC_STRING(yes);
+CORESTRING_LWC_STRING(_blank);
+CORESTRING_LWC_STRING(_parent);
+CORESTRING_LWC_STRING(_self);
+CORESTRING_LWC_STRING(_top);
+
+/* unusual lwc strings */
+CORESTRING_LWC_VALUE(shortcut_icon, "shortcut icon");
+CORESTRING_LWC_VALUE(slash_, "/");
+
+/* mime types */
+CORESTRING_LWC_VALUE(multipart_form_data, "multipart/form-data");
+CORESTRING_LWC_VALUE(text_css, "text/css");
+CORESTRING_LWC_VALUE(unknown_unknown, "unknown/unknown");
+CORESTRING_LWC_VALUE(application_unknown, "application/unknown");
+CORESTRING_LWC_VALUE(any, "*/*");
+CORESTRING_LWC_VALUE(text_xml, "text/xml");
+CORESTRING_LWC_VALUE(application_xml, "application/xml");
+CORESTRING_LWC_VALUE(text_html, "text/html");
+CORESTRING_LWC_VALUE(text_plain, "text/plain");
+CORESTRING_LWC_VALUE(application_octet_stream, "application/octet-stream");
+CORESTRING_LWC_VALUE(image_gif, "image/gif");
+CORESTRING_LWC_VALUE(image_png, "image/png");
+CORESTRING_LWC_VALUE(image_jpeg, "image/jpeg");
+CORESTRING_LWC_VALUE(image_bmp, "image/bmp");
+CORESTRING_LWC_VALUE(image_vnd_microsoft_icon, "image/vnd.microsoft.icon");
+CORESTRING_LWC_VALUE(image_webp, "image/webp");
+CORESTRING_LWC_VALUE(application_rss_xml, "application/rss+xml");
+CORESTRING_LWC_VALUE(application_atom_xml, "application/atom+xml");
+CORESTRING_LWC_VALUE(audio_wave, "audio/wave");
+CORESTRING_LWC_VALUE(application_ogg, "application/ogg");
+CORESTRING_LWC_VALUE(video_webm, "video/webm");
+CORESTRING_LWC_VALUE(application_x_rar_compressed, "application/x-rar-compressed");
+CORESTRING_LWC_VALUE(application_zip, "application/zip");
+CORESTRING_LWC_VALUE(application_x_gzip, "application/x-gzip");
+CORESTRING_LWC_VALUE(application_postscript, "application/postscript");
+CORESTRING_LWC_VALUE(application_pdf, "application/pdf");
+CORESTRING_LWC_VALUE(video_mp4, "video/mp4");
+CORESTRING_LWC_VALUE(image_svg, "image/svg+xml");
+
+
+/* DOM strings */
+CORESTRING_DOM_STRING(a);
+CORESTRING_DOM_STRING(abort);
+CORESTRING_DOM_STRING(afterprint);
+CORESTRING_DOM_STRING(align);
+CORESTRING_DOM_STRING(alt);
+CORESTRING_DOM_STRING(area);
+CORESTRING_DOM_STRING(async);
+CORESTRING_DOM_STRING(background);
+CORESTRING_DOM_STRING(beforeprint);
+CORESTRING_DOM_STRING(beforeunload);
+CORESTRING_DOM_STRING(bgcolor);
+CORESTRING_DOM_STRING(blur);
+CORESTRING_DOM_STRING(border);
+CORESTRING_DOM_STRING(bordercolor);
+CORESTRING_DOM_STRING(cancel);
+CORESTRING_DOM_STRING(canplay);
+CORESTRING_DOM_STRING(canplaythrough);
+CORESTRING_DOM_STRING(cellpadding);
+CORESTRING_DOM_STRING(cellspacing);
+CORESTRING_DOM_STRING(change);
+CORESTRING_DOM_STRING(charset);
+CORESTRING_DOM_STRING(class);
+CORESTRING_DOM_STRING(classid);
+CORESTRING_DOM_STRING(click);
+CORESTRING_DOM_STRING(close);
+CORESTRING_DOM_STRING(codebase);
+CORESTRING_DOM_STRING(color);
+CORESTRING_DOM_STRING(cols);
+CORESTRING_DOM_STRING(colspan);
+CORESTRING_DOM_STRING(content);
+CORESTRING_DOM_STRING(contextmenu);
+CORESTRING_DOM_STRING(coords);
+CORESTRING_DOM_STRING(cuechange);
+CORESTRING_DOM_STRING(data);
+CORESTRING_DOM_STRING(dblclick);
+CORESTRING_DOM_STRING(defer);
+CORESTRING_DOM_STRING(DOMAttrModified);
+CORESTRING_DOM_STRING(DOMNodeInserted);
+CORESTRING_DOM_STRING(DOMNodeInsertedIntoDocument);
+CORESTRING_DOM_STRING(DOMSubtreeModified);
+CORESTRING_DOM_STRING(drag);
+CORESTRING_DOM_STRING(dragend);
+CORESTRING_DOM_STRING(dragenter);
+CORESTRING_DOM_STRING(dragleave);
+CORESTRING_DOM_STRING(dragover);
+CORESTRING_DOM_STRING(dragstart);
+CORESTRING_DOM_STRING(drop);
+CORESTRING_DOM_STRING(durationchange);
+CORESTRING_DOM_STRING(emptied);
+CORESTRING_DOM_STRING(ended);
+CORESTRING_DOM_STRING(error);
+CORESTRING_DOM_STRING(focus);
+CORESTRING_DOM_STRING(frameborder);
+CORESTRING_DOM_STRING(hashchange);
+CORESTRING_DOM_STRING(height);
+CORESTRING_DOM_STRING(href);
+CORESTRING_DOM_STRING(hreflang);
+CORESTRING_DOM_STRING(hspace);
+/* http-equiv: see below */
+CORESTRING_DOM_STRING(id);
+CORESTRING_DOM_STRING(input);
+CORESTRING_DOM_STRING(invalid);
+CORESTRING_DOM_STRING(keydown);
+CORESTRING_DOM_STRING(keypress);
+CORESTRING_DOM_STRING(keyup);
+CORESTRING_DOM_STRING(link);
+CORESTRING_DOM_STRING(load);
+CORESTRING_DOM_STRING(loadeddata);
+CORESTRING_DOM_STRING(loadedmetadata);
+CORESTRING_DOM_STRING(loadstart);
+CORESTRING_DOM_STRING(map);
+CORESTRING_DOM_STRING(marginheight);
+CORESTRING_DOM_STRING(marginwidth);
+CORESTRING_DOM_STRING(media);
+CORESTRING_DOM_STRING(message);
+CORESTRING_DOM_STRING(mousedown);
+CORESTRING_DOM_STRING(mousemove);
+CORESTRING_DOM_STRING(mouseout);
+CORESTRING_DOM_STRING(mouseover);
+CORESTRING_DOM_STRING(mouseup);
+CORESTRING_DOM_STRING(mousewheel);
+CORESTRING_DOM_STRING(name);
+CORESTRING_DOM_STRING(nohref);
+CORESTRING_DOM_STRING(noresize);
+CORESTRING_DOM_STRING(nowrap);
+CORESTRING_DOM_STRING(offline);
+CORESTRING_DOM_STRING(online);
+CORESTRING_DOM_STRING(pagehide);
+CORESTRING_DOM_STRING(pageshow);
+CORESTRING_DOM_STRING(pause);
+CORESTRING_DOM_STRING(play);
+CORESTRING_DOM_STRING(playing);
+CORESTRING_DOM_STRING(popstate);
+CORESTRING_DOM_STRING(progress);
+CORESTRING_DOM_STRING(ratechange);
+CORESTRING_DOM_STRING(readystatechange);
+CORESTRING_DOM_STRING(rect);
+CORESTRING_DOM_STRING(rel);
+CORESTRING_DOM_STRING(reset);
+CORESTRING_DOM_STRING(resize);
+CORESTRING_DOM_STRING(rows);
+CORESTRING_DOM_STRING(rowspan);
+CORESTRING_DOM_STRING(scroll);
+CORESTRING_DOM_STRING(scrolling);
+CORESTRING_DOM_STRING(seeked);
+CORESTRING_DOM_STRING(seeking);
+CORESTRING_DOM_STRING(select);
+CORESTRING_DOM_STRING(selected);
+CORESTRING_DOM_STRING(shape);
+CORESTRING_DOM_STRING(show);
+CORESTRING_DOM_STRING(size);
+CORESTRING_DOM_STRING(sizes);
+CORESTRING_DOM_STRING(src);
+CORESTRING_DOM_STRING(stalled);
+CORESTRING_DOM_STRING(storage);
+CORESTRING_DOM_STRING(style);
+CORESTRING_DOM_STRING(submit);
+CORESTRING_DOM_STRING(suspend);
+CORESTRING_DOM_STRING(target);
+CORESTRING_DOM_STRING(text);
+CORESTRING_DOM_STRING(timeupdate);
+CORESTRING_DOM_STRING(title);
+CORESTRING_DOM_STRING(type);
+CORESTRING_DOM_STRING(unload);
+CORESTRING_DOM_STRING(valign);
+CORESTRING_DOM_STRING(value);
+CORESTRING_DOM_STRING(vlink);
+CORESTRING_DOM_STRING(volumechange);
+CORESTRING_DOM_STRING(vspace);
+CORESTRING_DOM_STRING(waiting);
+CORESTRING_DOM_STRING(width);
+/* DOM node names, not really CSS */
+CORESTRING_DOM_STRING(BUTTON);
+CORESTRING_DOM_STRING(INPUT);
+CORESTRING_DOM_STRING(SELECT);
+CORESTRING_DOM_STRING(TEXTAREA);
+CORESTRING_DOM_STRING(BODY);
+CORESTRING_DOM_STRING(HEAD);
+/* DOM input types, not really CSS */
+CORESTRING_DOM_STRING(button);
+CORESTRING_DOM_STRING(image);
+CORESTRING_DOM_STRING(radio);
+CORESTRING_DOM_STRING(checkbox);
+CORESTRING_DOM_STRING(file);
+/* DOM event prefix */
+CORESTRING_DOM_STRING(on);
+/* DOM events forwarded from body to window */
+CORESTRING_DOM_STRING(onblur);
+CORESTRING_DOM_STRING(onerror);
+CORESTRING_DOM_STRING(onfocus);
+CORESTRING_DOM_STRING(onload);
+CORESTRING_DOM_STRING(onresize);
+CORESTRING_DOM_STRING(onscroll);
+/* Corestrings used by DOM event registration */
+CORESTRING_DOM_STRING(autocomplete);
+CORESTRING_DOM_STRING(autocompleteerror);
+CORESTRING_DOM_STRING(dragexit);
+CORESTRING_DOM_STRING(mouseenter);
+CORESTRING_DOM_STRING(mouseleave);
+CORESTRING_DOM_STRING(wheel);
+CORESTRING_DOM_STRING(sort);
+CORESTRING_DOM_STRING(toggle);
+/* DOM userdata keys, not really CSS */
+CORESTRING_DOM_STRING(__ns_key_box_node_data);
+CORESTRING_DOM_STRING(__ns_key_libcss_node_data);
+CORESTRING_DOM_STRING(__ns_key_file_name_node_data);
+CORESTRING_DOM_STRING(__ns_key_image_coords_node_data);
+CORESTRING_DOM_STRING(__ns_key_html_content_data);
+
+/* unusual DOM strings */
+CORESTRING_DOM_VALUE(text_javascript, "text/javascript");
+CORESTRING_DOM_VALUE(http_equiv, "http-equiv");
+CORESTRING_DOM_VALUE(html_namespace, "http://www.w3.org/1999/xhtml");
+
+CORESTRING_NSURL(about_blank, "about:blank");
+
+#undef CORESTRING_LWC_STRING
+#undef CORESTRING_DOM_STRING
diff --git a/utils/corestrings.c b/utils/corestrings.c
index 87a342313..d8934b739 100644
--- a/utils/corestrings.c
+++ b/utils/corestrings.c
@@ -16,8 +16,9 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-/** \file
- * Useful interned string pointers (implementation).
+/**
+ * \file
+ * Useful interned string tables implementation.
*/
#include <dom/dom.h>
@@ -26,280 +27,19 @@
#include "utils/nsurl.h"
#include "utils/utils.h"
-/* 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;
-lwc_string *corestring_lwc_applet;
-lwc_string *corestring_lwc_base;
-lwc_string *corestring_lwc_baseline;
-lwc_string *corestring_lwc_body;
-lwc_string *corestring_lwc_bottom;
-lwc_string *corestring_lwc_button;
-lwc_string *corestring_lwc_caption;
-lwc_string *corestring_lwc_center;
-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;
-lwc_string *corestring_lwc_file;
-lwc_string *corestring_lwc_filename;
-lwc_string *corestring_lwc_font;
-lwc_string *corestring_lwc_frame;
-lwc_string *corestring_lwc_frameset;
-lwc_string *corestring_lwc_h1;
-lwc_string *corestring_lwc_h2;
-lwc_string *corestring_lwc_h3;
-lwc_string *corestring_lwc_h4;
-lwc_string *corestring_lwc_h5;
-lwc_string *corestring_lwc_h6;
-lwc_string *corestring_lwc_head;
-lwc_string *corestring_lwc_hidden;
-lwc_string *corestring_lwc_hr;
-lwc_string *corestring_lwc_html;
-lwc_string *corestring_lwc_http;
-lwc_string *corestring_lwc_https;
-lwc_string *corestring_lwc_icon;
-lwc_string *corestring_lwc_iframe;
-lwc_string *corestring_lwc_image;
-lwc_string *corestring_lwc_img;
-lwc_string *corestring_lwc_input;
-lwc_string *corestring_lwc_javascript;
-lwc_string *corestring_lwc_justify;
-lwc_string *corestring_lwc_left;
-lwc_string *corestring_lwc_li;
-lwc_string *corestring_lwc_link;
-lwc_string *corestring_lwc_mailto;
-lwc_string *corestring_lwc_meta;
-lwc_string *corestring_lwc_middle;
-lwc_string *corestring_lwc_multipart_form_data;
-lwc_string *corestring_lwc_no;
-lwc_string *corestring_lwc_noscript;
-lwc_string *corestring_lwc_object;
-lwc_string *corestring_lwc_optgroup;
-lwc_string *corestring_lwc_option;
-lwc_string *corestring_lwc_p;
-lwc_string *corestring_lwc_param;
-lwc_string *corestring_lwc_password;
-lwc_string *corestring_lwc_poly;
-lwc_string *corestring_lwc_polygon;
-lwc_string *corestring_lwc_post;
-lwc_string *corestring_lwc_radio;
-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;
-lwc_string *corestring_lwc_shortcut_icon;
-lwc_string *corestring_lwc_src;
-lwc_string *corestring_lwc_style;
-lwc_string *corestring_lwc_submit;
-lwc_string *corestring_lwc_table;
-lwc_string *corestring_lwc_tbody;
-lwc_string *corestring_lwc_td;
-lwc_string *corestring_lwc_text;
-lwc_string *corestring_lwc_textarea;
-lwc_string *corestring_lwc_texttop;
-lwc_string *corestring_lwc_text_css;
-lwc_string *corestring_lwc_tfoot;
-lwc_string *corestring_lwc_th;
-lwc_string *corestring_lwc_thead;
-lwc_string *corestring_lwc_title;
-lwc_string *corestring_lwc_top;
-lwc_string *corestring_lwc_tr;
-lwc_string *corestring_lwc_ul;
-lwc_string *corestring_lwc_url;
-lwc_string *corestring_lwc_yes;
-lwc_string *corestring_lwc__blank;
-lwc_string *corestring_lwc__parent;
-lwc_string *corestring_lwc__self;
-lwc_string *corestring_lwc__top;
-lwc_string *corestring_lwc_slash_;
-
-/* dom_string strings */
-dom_string *corestring_dom_a;
-dom_string *corestring_dom_alt;
-dom_string *corestring_dom_abort;
-dom_string *corestring_dom_afterprint;
-dom_string *corestring_dom_align;
-dom_string *corestring_dom_area;
-dom_string *corestring_dom_async;
-dom_string *corestring_dom_background;
-dom_string *corestring_dom_beforeprint;
-dom_string *corestring_dom_beforeunload;
-dom_string *corestring_dom_bgcolor;
-dom_string *corestring_dom_blur;
-dom_string *corestring_dom_border;
-dom_string *corestring_dom_bordercolor;
-dom_string *corestring_dom_cancel;
-dom_string *corestring_dom_canplay;
-dom_string *corestring_dom_canplaythrough;
-dom_string *corestring_dom_cellpadding;
-dom_string *corestring_dom_cellspacing;
-dom_string *corestring_dom_change;
-dom_string *corestring_dom_charset;
-dom_string *corestring_dom_class;
-dom_string *corestring_dom_classid;
-dom_string *corestring_dom_click;
-dom_string *corestring_dom_close;
-dom_string *corestring_dom_codebase;
-dom_string *corestring_dom_color;
-dom_string *corestring_dom_cols;
-dom_string *corestring_dom_colspan;
-dom_string *corestring_dom_content;
-dom_string *corestring_dom_contextmenu;
-dom_string *corestring_dom_coords;
-dom_string *corestring_dom_cuechange;
-dom_string *corestring_dom_data;
-dom_string *corestring_dom_dblclick;
-dom_string *corestring_dom_defer;
-dom_string *corestring_dom_DOMAttrModified;
-dom_string *corestring_dom_DOMNodeInserted;
-dom_string *corestring_dom_DOMNodeInsertedIntoDocument;
-dom_string *corestring_dom_DOMSubtreeModified;
-dom_string *corestring_dom_drag;
-dom_string *corestring_dom_dragend;
-dom_string *corestring_dom_dragenter;
-dom_string *corestring_dom_dragleave;
-dom_string *corestring_dom_dragover;
-dom_string *corestring_dom_dragstart;
-dom_string *corestring_dom_drop;
-dom_string *corestring_dom_durationchange;
-dom_string *corestring_dom_emptied;
-dom_string *corestring_dom_ended;
-dom_string *corestring_dom_error;
-dom_string *corestring_dom_focus;
-dom_string *corestring_dom_frameborder;
-dom_string *corestring_dom_hashchange;
-dom_string *corestring_dom_height;
-dom_string *corestring_dom_href;
-dom_string *corestring_dom_hreflang;
-dom_string *corestring_dom_hspace;
-dom_string *corestring_dom_http_equiv;
-dom_string *corestring_dom_id;
-dom_string *corestring_dom_input;
-dom_string *corestring_dom_invalid;
-dom_string *corestring_dom_keydown;
-dom_string *corestring_dom_keypress;
-dom_string *corestring_dom_keyup;
-dom_string *corestring_dom_link;
-dom_string *corestring_dom_load;
-dom_string *corestring_dom_loadeddata;
-dom_string *corestring_dom_loadedmetadata;
-dom_string *corestring_dom_loadstart;
-dom_string *corestring_dom_map;
-dom_string *corestring_dom_marginheight;
-dom_string *corestring_dom_marginwidth;
-dom_string *corestring_dom_media;
-dom_string *corestring_dom_message;
-dom_string *corestring_dom_mousedown;
-dom_string *corestring_dom_mousemove;
-dom_string *corestring_dom_mouseout;
-dom_string *corestring_dom_mouseover;
-dom_string *corestring_dom_mouseup;
-dom_string *corestring_dom_mousewheel;
-dom_string *corestring_dom_name;
-dom_string *corestring_dom_nohref;
-dom_string *corestring_dom_noresize;
-dom_string *corestring_dom_nowrap;
-dom_string *corestring_dom_offline;
-dom_string *corestring_dom_online;
-dom_string *corestring_dom_pagehide;
-dom_string *corestring_dom_pageshow;
-dom_string *corestring_dom_pause;
-dom_string *corestring_dom_play;
-dom_string *corestring_dom_playing;
-dom_string *corestring_dom_popstate;
-dom_string *corestring_dom_progress;
-dom_string *corestring_dom_ratechange;
-dom_string *corestring_dom_readystatechange;
-dom_string *corestring_dom_rect;
-dom_string *corestring_dom_rel;
-dom_string *corestring_dom_reset;
-dom_string *corestring_dom_resize;
-dom_string *corestring_dom_rows;
-dom_string *corestring_dom_rowspan;
-dom_string *corestring_dom_scroll;
-dom_string *corestring_dom_scrolling;
-dom_string *corestring_dom_seeked;
-dom_string *corestring_dom_seeking;
-dom_string *corestring_dom_select;
-dom_string *corestring_dom_selected;
-dom_string *corestring_dom_shape;
-dom_string *corestring_dom_show;
-dom_string *corestring_dom_size;
-dom_string *corestring_dom_sizes;
-dom_string *corestring_dom_src;
-dom_string *corestring_dom_stalled;
-dom_string *corestring_dom_storage;
-dom_string *corestring_dom_style;
-dom_string *corestring_dom_submit;
-dom_string *corestring_dom_suspend;
-dom_string *corestring_dom_target;
-dom_string *corestring_dom_text;
-dom_string *corestring_dom_text_javascript;
-dom_string *corestring_dom_timeupdate;
-dom_string *corestring_dom_title;
-dom_string *corestring_dom_type;
-dom_string *corestring_dom_unload;
-dom_string *corestring_dom_valign;
-dom_string *corestring_dom_value;
-dom_string *corestring_dom_vlink;
-dom_string *corestring_dom_volumechange;
-dom_string *corestring_dom_vspace;
-dom_string *corestring_dom_waiting;
-dom_string *corestring_dom_width;
-dom_string *corestring_dom_BUTTON;
-dom_string *corestring_dom_INPUT;
-dom_string *corestring_dom_SELECT;
-dom_string *corestring_dom_TEXTAREA;
-dom_string *corestring_dom_BODY;
-dom_string *corestring_dom_HEAD;
-dom_string *corestring_dom_html_namespace;
-dom_string *corestring_dom_button;
-dom_string *corestring_dom_image;
-dom_string *corestring_dom_radio;
-dom_string *corestring_dom_checkbox;
-dom_string *corestring_dom_file;
-dom_string *corestring_dom_on;
-dom_string *corestring_dom_onblur;
-dom_string *corestring_dom_onerror;
-dom_string *corestring_dom_onfocus;
-dom_string *corestring_dom_onload;
-dom_string *corestring_dom_onresize;
-dom_string *corestring_dom_onscroll;
-dom_string *corestring_dom_autocomplete;
-dom_string *corestring_dom_autocompleteerror;
-dom_string *corestring_dom_dragexit;
-dom_string *corestring_dom_mouseenter;
-dom_string *corestring_dom_mouseleave;
-dom_string *corestring_dom_wheel;
-dom_string *corestring_dom_sort;
-dom_string *corestring_dom_toggle;
-dom_string *corestring_dom___ns_key_box_node_data;
-dom_string *corestring_dom___ns_key_libcss_node_data;
-dom_string *corestring_dom___ns_key_file_name_node_data;
-dom_string *corestring_dom___ns_key_image_coords_node_data;
-dom_string *corestring_dom___ns_key_html_content_data;
-
-/* nsurl URLs */
-nsurl *corestring_nsurl_about_blank;
-
-/*
- * Free the core strings
- */
-void corestrings_fini(void)
+/* define corestrings */
+#define CORESTRING_LWC_VALUE(NAME,VALUE) lwc_string *corestring_lwc_##NAME
+#define CORESTRING_DOM_VALUE(NAME,VALUE) dom_string *corestring_dom_##NAME
+#define CORESTRING_NSURL(NAME,VALUE) nsurl *corestring_nsurl_##NAME
+#include "utils/corestringlist.h"
+#undef CORESTRING_LWC_VALUE
+#undef CORESTRING_DOM_VALUE
+#undef CORESTRING_NSURL
+
+/* exported interface documented in utils/corestrings.h */
+nserror corestrings_fini(void)
{
-#define CSS_LWC_STRING_UNREF(NAME) \
+#define CORESTRING_LWC_VALUE(NAME,VALUE) \
do { \
if (corestring_lwc_##NAME != NULL) { \
lwc_string_unref(corestring_lwc_##NAME); \
@@ -307,107 +47,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);
- CSS_LWC_STRING_UNREF(applet);
- CSS_LWC_STRING_UNREF(base);
- CSS_LWC_STRING_UNREF(baseline);
- CSS_LWC_STRING_UNREF(body);
- CSS_LWC_STRING_UNREF(bottom);
- CSS_LWC_STRING_UNREF(button);
- CSS_LWC_STRING_UNREF(caption);
- CSS_LWC_STRING_UNREF(charset);
- CSS_LWC_STRING_UNREF(center);
- 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);
- CSS_LWC_STRING_UNREF(file);
- CSS_LWC_STRING_UNREF(filename);
- CSS_LWC_STRING_UNREF(font);
- CSS_LWC_STRING_UNREF(frame);
- CSS_LWC_STRING_UNREF(frameset);
- CSS_LWC_STRING_UNREF(h1);
- CSS_LWC_STRING_UNREF(h2);
- CSS_LWC_STRING_UNREF(h3);
- CSS_LWC_STRING_UNREF(h4);
- CSS_LWC_STRING_UNREF(h5);
- CSS_LWC_STRING_UNREF(h6);
- CSS_LWC_STRING_UNREF(head);
- CSS_LWC_STRING_UNREF(hidden);
- CSS_LWC_STRING_UNREF(hr);
- CSS_LWC_STRING_UNREF(html);
- CSS_LWC_STRING_UNREF(http);
- CSS_LWC_STRING_UNREF(https);
- CSS_LWC_STRING_UNREF(icon);
- CSS_LWC_STRING_UNREF(iframe);
- CSS_LWC_STRING_UNREF(image);
- CSS_LWC_STRING_UNREF(img);
- CSS_LWC_STRING_UNREF(input);
- CSS_LWC_STRING_UNREF(javascript);
- CSS_LWC_STRING_UNREF(justify);
- CSS_LWC_STRING_UNREF(left);
- CSS_LWC_STRING_UNREF(li);
- CSS_LWC_STRING_UNREF(link);
- CSS_LWC_STRING_UNREF(mailto);
- CSS_LWC_STRING_UNREF(meta);
- CSS_LWC_STRING_UNREF(middle);
- CSS_LWC_STRING_UNREF(multipart_form_data);
- CSS_LWC_STRING_UNREF(no);
- CSS_LWC_STRING_UNREF(noscript);
- CSS_LWC_STRING_UNREF(object);
- CSS_LWC_STRING_UNREF(optgroup);
- CSS_LWC_STRING_UNREF(option);
- CSS_LWC_STRING_UNREF(p);
- CSS_LWC_STRING_UNREF(param);
- CSS_LWC_STRING_UNREF(password);
- CSS_LWC_STRING_UNREF(poly);
- CSS_LWC_STRING_UNREF(polygon);
- CSS_LWC_STRING_UNREF(post);
- CSS_LWC_STRING_UNREF(radio);
- CSS_LWC_STRING_UNREF(rect);
- 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);
- CSS_LWC_STRING_UNREF(shortcut_icon);
- CSS_LWC_STRING_UNREF(src);
- CSS_LWC_STRING_UNREF(style);
- CSS_LWC_STRING_UNREF(submit);
- CSS_LWC_STRING_UNREF(table);
- CSS_LWC_STRING_UNREF(tbody);
- CSS_LWC_STRING_UNREF(td);
- CSS_LWC_STRING_UNREF(text);
- CSS_LWC_STRING_UNREF(textarea);
- CSS_LWC_STRING_UNREF(texttop);
- CSS_LWC_STRING_UNREF(text_css);
- CSS_LWC_STRING_UNREF(tfoot);
- CSS_LWC_STRING_UNREF(th);
- CSS_LWC_STRING_UNREF(thead);
- CSS_LWC_STRING_UNREF(title);
- CSS_LWC_STRING_UNREF(top);
- CSS_LWC_STRING_UNREF(tr);
- CSS_LWC_STRING_UNREF(ul);
- CSS_LWC_STRING_UNREF(url);
- CSS_LWC_STRING_UNREF(yes);
- CSS_LWC_STRING_UNREF(_blank);
- CSS_LWC_STRING_UNREF(_parent);
- CSS_LWC_STRING_UNREF(_self);
- CSS_LWC_STRING_UNREF(_top);
- CSS_LWC_STRING_UNREF(slash_);
-
-#undef CSS_LWC_STRING_UNREF
-
-#define CSS_DOM_STRING_UNREF(NAME) \
+#define CORESTRING_DOM_VALUE(NAME,VALUE) \
do { \
if (corestring_dom_##NAME != NULL) { \
dom_string_unref(corestring_dom_##NAME); \
@@ -415,547 +55,72 @@ void corestrings_fini(void)
} \
} while (0)
- CSS_DOM_STRING_UNREF(a);
- CSS_DOM_STRING_UNREF(abort);
- CSS_DOM_STRING_UNREF(afterprint);
- CSS_DOM_STRING_UNREF(align);
- CSS_DOM_STRING_UNREF(alt);
- CSS_DOM_STRING_UNREF(area);
- CSS_DOM_STRING_UNREF(async);
- CSS_DOM_STRING_UNREF(background);
- CSS_DOM_STRING_UNREF(beforeprint);
- CSS_DOM_STRING_UNREF(beforeunload);
- CSS_DOM_STRING_UNREF(bgcolor);
- CSS_DOM_STRING_UNREF(blur);
- CSS_DOM_STRING_UNREF(border);
- CSS_DOM_STRING_UNREF(bordercolor);
- CSS_DOM_STRING_UNREF(cancel);
- CSS_DOM_STRING_UNREF(canplay);
- CSS_DOM_STRING_UNREF(canplaythrough);
- CSS_DOM_STRING_UNREF(cellpadding);
- CSS_DOM_STRING_UNREF(cellspacing);
- CSS_DOM_STRING_UNREF(change);
- CSS_DOM_STRING_UNREF(charset);
- CSS_DOM_STRING_UNREF(class);
- CSS_DOM_STRING_UNREF(classid);
- CSS_DOM_STRING_UNREF(click);
- CSS_DOM_STRING_UNREF(close);
- CSS_DOM_STRING_UNREF(codebase);
- CSS_DOM_STRING_UNREF(color);
- CSS_DOM_STRING_UNREF(cols);
- CSS_DOM_STRING_UNREF(colspan);
- CSS_DOM_STRING_UNREF(content);
- CSS_DOM_STRING_UNREF(contextmenu);
- CSS_DOM_STRING_UNREF(coords);
- CSS_DOM_STRING_UNREF(cuechange);
- CSS_DOM_STRING_UNREF(data);
- CSS_DOM_STRING_UNREF(dblclick);
- CSS_DOM_STRING_UNREF(defer);
- CSS_DOM_STRING_UNREF(DOMAttrModified);
- CSS_DOM_STRING_UNREF(DOMNodeInserted);
- CSS_DOM_STRING_UNREF(DOMNodeInsertedIntoDocument);
- CSS_DOM_STRING_UNREF(DOMSubtreeModified);
- CSS_DOM_STRING_UNREF(drag);
- CSS_DOM_STRING_UNREF(dragend);
- CSS_DOM_STRING_UNREF(dragenter);
- CSS_DOM_STRING_UNREF(dragleave);
- CSS_DOM_STRING_UNREF(dragover);
- CSS_DOM_STRING_UNREF(dragstart);
- CSS_DOM_STRING_UNREF(drop);
- CSS_DOM_STRING_UNREF(durationchange);
- CSS_DOM_STRING_UNREF(emptied);
- CSS_DOM_STRING_UNREF(ended);
- CSS_DOM_STRING_UNREF(error);
- CSS_DOM_STRING_UNREF(focus);
- CSS_DOM_STRING_UNREF(frameborder);
- CSS_DOM_STRING_UNREF(hashchange);
- CSS_DOM_STRING_UNREF(height);
- CSS_DOM_STRING_UNREF(href);
- CSS_DOM_STRING_UNREF(hreflang);
- CSS_DOM_STRING_UNREF(hspace);
- CSS_DOM_STRING_UNREF(http_equiv);
- CSS_DOM_STRING_UNREF(id);
- CSS_DOM_STRING_UNREF(input);
- CSS_DOM_STRING_UNREF(invalid);
- CSS_DOM_STRING_UNREF(keydown);
- CSS_DOM_STRING_UNREF(keypress);
- CSS_DOM_STRING_UNREF(keyup);
- CSS_DOM_STRING_UNREF(link);
- CSS_DOM_STRING_UNREF(load);
- CSS_DOM_STRING_UNREF(loadeddata);
- CSS_DOM_STRING_UNREF(loadedmetadata);
- CSS_DOM_STRING_UNREF(loadstart);
- CSS_DOM_STRING_UNREF(map);
- CSS_DOM_STRING_UNREF(marginheight);
- CSS_DOM_STRING_UNREF(marginwidth);
- CSS_DOM_STRING_UNREF(media);
- CSS_DOM_STRING_UNREF(message);
- CSS_DOM_STRING_UNREF(mousedown);
- CSS_DOM_STRING_UNREF(mousemove);
- CSS_DOM_STRING_UNREF(mouseout);
- CSS_DOM_STRING_UNREF(mouseover);
- CSS_DOM_STRING_UNREF(mouseup);
- CSS_DOM_STRING_UNREF(mousewheel);
- CSS_DOM_STRING_UNREF(name);
- CSS_DOM_STRING_UNREF(nohref);
- CSS_DOM_STRING_UNREF(noresize);
- CSS_DOM_STRING_UNREF(nowrap);
- CSS_DOM_STRING_UNREF(offline);
- CSS_DOM_STRING_UNREF(online);
- CSS_DOM_STRING_UNREF(pagehide);
- CSS_DOM_STRING_UNREF(pageshow);
- CSS_DOM_STRING_UNREF(pause);
- CSS_DOM_STRING_UNREF(play);
- CSS_DOM_STRING_UNREF(playing);
- CSS_DOM_STRING_UNREF(popstate);
- CSS_DOM_STRING_UNREF(progress);
- CSS_DOM_STRING_UNREF(ratechange);
- CSS_DOM_STRING_UNREF(readystatechange);
- CSS_DOM_STRING_UNREF(rect);
- CSS_DOM_STRING_UNREF(rel);
- CSS_DOM_STRING_UNREF(reset);
- CSS_DOM_STRING_UNREF(resize);
- CSS_DOM_STRING_UNREF(rows);
- CSS_DOM_STRING_UNREF(rowspan);
- CSS_DOM_STRING_UNREF(scroll);
- CSS_DOM_STRING_UNREF(scrolling);
- CSS_DOM_STRING_UNREF(seeked);
- CSS_DOM_STRING_UNREF(seeking);
- CSS_DOM_STRING_UNREF(select);
- CSS_DOM_STRING_UNREF(selected);
- CSS_DOM_STRING_UNREF(shape);
- CSS_DOM_STRING_UNREF(show);
- CSS_DOM_STRING_UNREF(size);
- CSS_DOM_STRING_UNREF(sizes);
- CSS_DOM_STRING_UNREF(src);
- CSS_DOM_STRING_UNREF(stalled);
- CSS_DOM_STRING_UNREF(storage);
- CSS_DOM_STRING_UNREF(style);
- CSS_DOM_STRING_UNREF(submit);
- CSS_DOM_STRING_UNREF(suspend);
- CSS_DOM_STRING_UNREF(target);
- CSS_DOM_STRING_UNREF(text);
- CSS_DOM_STRING_UNREF(text_javascript);
- CSS_DOM_STRING_UNREF(timeupdate);
- CSS_DOM_STRING_UNREF(title);
- CSS_DOM_STRING_UNREF(type);
- CSS_DOM_STRING_UNREF(unload);
- CSS_DOM_STRING_UNREF(valign);
- CSS_DOM_STRING_UNREF(value);
- CSS_DOM_STRING_UNREF(vlink);
- CSS_DOM_STRING_UNREF(volumechange);
- CSS_DOM_STRING_UNREF(vspace);
- CSS_DOM_STRING_UNREF(waiting);
- CSS_DOM_STRING_UNREF(width);
- /* DOM node names, not really CSS */
- CSS_DOM_STRING_UNREF(BUTTON);
- CSS_DOM_STRING_UNREF(INPUT);
- CSS_DOM_STRING_UNREF(SELECT);
- CSS_DOM_STRING_UNREF(TEXTAREA);
- CSS_DOM_STRING_UNREF(BODY);
- CSS_DOM_STRING_UNREF(HEAD);
- /* DOM namespaces, not really CSS */
- CSS_DOM_STRING_UNREF(html_namespace);
- /* DOM input types, not really CSS */
- CSS_DOM_STRING_UNREF(button);
- CSS_DOM_STRING_UNREF(image);
- CSS_DOM_STRING_UNREF(radio);
- CSS_DOM_STRING_UNREF(checkbox);
- CSS_DOM_STRING_UNREF(file);
- /* DOM event prefix */
- CSS_DOM_STRING_UNREF(on);
- /* DOM events forwarded from body to window */
- CSS_DOM_STRING_UNREF(onblur);
- CSS_DOM_STRING_UNREF(onerror);
- CSS_DOM_STRING_UNREF(onfocus);
- CSS_DOM_STRING_UNREF(onload);
- CSS_DOM_STRING_UNREF(onresize);
- CSS_DOM_STRING_UNREF(onscroll);
- /* Corestrings used by DOM event registration */
- CSS_DOM_STRING_UNREF(autocomplete);
- CSS_DOM_STRING_UNREF(autocompleteerror);
- CSS_DOM_STRING_UNREF(dragexit);
- CSS_DOM_STRING_UNREF(mouseenter);
- CSS_DOM_STRING_UNREF(mouseleave);
- CSS_DOM_STRING_UNREF(wheel);
- CSS_DOM_STRING_UNREF(sort);
- CSS_DOM_STRING_UNREF(toggle);
- /* DOM userdata keys, not really CSS */
- CSS_DOM_STRING_UNREF(__ns_key_box_node_data);
- CSS_DOM_STRING_UNREF(__ns_key_libcss_node_data);
- CSS_DOM_STRING_UNREF(__ns_key_file_name_node_data);
- CSS_DOM_STRING_UNREF(__ns_key_image_coords_node_data);
- CSS_DOM_STRING_UNREF(__ns_key_html_content_data);
-#undef CSS_DOM_STRING_UNREF
+#define CORESTRING_NSURL(NAME,VALUE) \
+ do { \
+ if (corestring_nsurl_##NAME != NULL) { \
+ nsurl_unref(corestring_nsurl_##NAME); \
+ corestring_nsurl_##NAME = NULL; \
+ } \
+ } while (0)
+
+
+#include "utils/corestringlist.h"
- /* nsurl URLs */
- if (corestring_nsurl_about_blank != NULL) {
- nsurl_unref(corestring_nsurl_about_blank);
- corestring_nsurl_about_blank = NULL;
- }
+#undef CORESTRING_LWC_VALUE
+#undef CORESTRING_DOM_VALUE
+#undef CORESTRING_NSURL
+
+ return NSERROR_OK;
}
-/*
- * Create the core strings
- */
+/* exported interface documented in utils/corestrings.h */
nserror corestrings_init(void)
{
lwc_error lerror;
nserror error;
dom_exception exc;
-#define CSS_LWC_STRING_INTERN(NAME) \
+#define CORESTRING_LWC_VALUE(NAME,VALUE) \
do { \
lerror = lwc_intern_string( \
- (const char *)#NAME, \
- sizeof(#NAME) - 1, \
- &corestring_lwc_##NAME ); \
- if ((lerror != lwc_error_ok) || \
- (corestring_lwc_##NAME == NULL)) { \
+ (const char *)VALUE, \
+ sizeof(VALUE) - 1, \
+ &corestring_lwc_##NAME ); \
+ if ((lerror != lwc_error_ok) || \
+ (corestring_lwc_##NAME == NULL)) { \
error = NSERROR_NOMEM; \
goto error; \
} \
} 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);
- CSS_LWC_STRING_INTERN(applet);
- CSS_LWC_STRING_INTERN(base);
- CSS_LWC_STRING_INTERN(baseline);
- CSS_LWC_STRING_INTERN(body);
- CSS_LWC_STRING_INTERN(bottom);
- CSS_LWC_STRING_INTERN(button);
- CSS_LWC_STRING_INTERN(caption);
- CSS_LWC_STRING_INTERN(charset);
- CSS_LWC_STRING_INTERN(center);
- 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);
- CSS_LWC_STRING_INTERN(file);
- CSS_LWC_STRING_INTERN(filename);
- CSS_LWC_STRING_INTERN(font);
- CSS_LWC_STRING_INTERN(frame);
- CSS_LWC_STRING_INTERN(frameset);
- CSS_LWC_STRING_INTERN(h1);
- CSS_LWC_STRING_INTERN(h2);
- CSS_LWC_STRING_INTERN(h3);
- CSS_LWC_STRING_INTERN(h4);
- CSS_LWC_STRING_INTERN(h5);
- CSS_LWC_STRING_INTERN(h6);
- CSS_LWC_STRING_INTERN(head);
- CSS_LWC_STRING_INTERN(hidden);
- CSS_LWC_STRING_INTERN(hr);
- CSS_LWC_STRING_INTERN(html);
- CSS_LWC_STRING_INTERN(http);
- CSS_LWC_STRING_INTERN(https);
- CSS_LWC_STRING_INTERN(icon);
- CSS_LWC_STRING_INTERN(iframe);
- CSS_LWC_STRING_INTERN(image);
- CSS_LWC_STRING_INTERN(img);
- CSS_LWC_STRING_INTERN(input);
- CSS_LWC_STRING_INTERN(javascript);
- CSS_LWC_STRING_INTERN(justify);
- CSS_LWC_STRING_INTERN(left);
- CSS_LWC_STRING_INTERN(li);
- CSS_LWC_STRING_INTERN(link);
- CSS_LWC_STRING_INTERN(mailto);
- CSS_LWC_STRING_INTERN(meta);
- CSS_LWC_STRING_INTERN(middle);
- CSS_LWC_STRING_INTERN(no);
- CSS_LWC_STRING_INTERN(noscript);
- CSS_LWC_STRING_INTERN(object);
- CSS_LWC_STRING_INTERN(optgroup);
- CSS_LWC_STRING_INTERN(option);
- CSS_LWC_STRING_INTERN(p);
- CSS_LWC_STRING_INTERN(param);
- CSS_LWC_STRING_INTERN(password);
- CSS_LWC_STRING_INTERN(poly);
- CSS_LWC_STRING_INTERN(polygon);
- CSS_LWC_STRING_INTERN(post);
- CSS_LWC_STRING_INTERN(radio);
- CSS_LWC_STRING_INTERN(rect);
- 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);
- CSS_LWC_STRING_INTERN(src);
- CSS_LWC_STRING_INTERN(style);
- CSS_LWC_STRING_INTERN(submit);
- CSS_LWC_STRING_INTERN(table);
- CSS_LWC_STRING_INTERN(tbody);
- CSS_LWC_STRING_INTERN(td);
- CSS_LWC_STRING_INTERN(text);
- CSS_LWC_STRING_INTERN(textarea);
- CSS_LWC_STRING_INTERN(texttop);
- CSS_LWC_STRING_INTERN(tfoot);
- CSS_LWC_STRING_INTERN(th);
- CSS_LWC_STRING_INTERN(thead);
- CSS_LWC_STRING_INTERN(title);
- CSS_LWC_STRING_INTERN(top);
- CSS_LWC_STRING_INTERN(tr);
- CSS_LWC_STRING_INTERN(ul);
- CSS_LWC_STRING_INTERN(url);
- CSS_LWC_STRING_INTERN(yes);
- CSS_LWC_STRING_INTERN(_blank);
- CSS_LWC_STRING_INTERN(_parent);
- CSS_LWC_STRING_INTERN(_self);
- CSS_LWC_STRING_INTERN(_top);
-#undef CSS_LWC_STRING_INTERN
-
-
- lerror = lwc_intern_string("multipart/form-data",
- SLEN("multipart/form-data"),
- &corestring_lwc_multipart_form_data);
- if ((lerror != lwc_error_ok) ||
- (corestring_lwc_multipart_form_data == NULL)) {
- error = NSERROR_NOMEM;
- goto error;
- }
-
- lerror = lwc_intern_string("shortcut icon", SLEN("shortcut icon"),
- &corestring_lwc_shortcut_icon);
- if ((lerror != lwc_error_ok) || (corestring_lwc_shortcut_icon == NULL)) {
- error = NSERROR_NOMEM;
- goto error;
- }
-
- lerror = lwc_intern_string("text/css", SLEN("text/css"),
- &corestring_lwc_text_css);
- if ((lerror != lwc_error_ok) || (corestring_lwc_text_css == NULL)) {
- error = NSERROR_NOMEM;
- goto error;
- }
-
- lerror = lwc_intern_string("/", SLEN("/"),
- &corestring_lwc_slash_);
- if ((lerror != lwc_error_ok) || (corestring_lwc_slash_ == NULL)) {
- error = NSERROR_NOMEM;
- goto error;
- }
-
-
-#define CSS_DOM_STRING_INTERN(NAME) \
+#define CORESTRING_DOM_VALUE(NAME,VALUE) \
do { \
exc = dom_string_create_interned( \
- (const uint8_t *)#NAME, \
- sizeof(#NAME) - 1, \
+ (const uint8_t *)VALUE, \
+ sizeof(VALUE) - 1, \
&corestring_dom_##NAME ); \
- if ((exc != DOM_NO_ERR) || \
+ if ((exc != DOM_NO_ERR) || \
(corestring_dom_##NAME == NULL)) { \
error = NSERROR_NOMEM; \
goto error; \
} \
} while(0)
- CSS_DOM_STRING_INTERN(a);
- CSS_DOM_STRING_INTERN(abort);
- CSS_DOM_STRING_INTERN(afterprint);
- CSS_DOM_STRING_INTERN(align);
- CSS_DOM_STRING_INTERN(alt);
- CSS_DOM_STRING_INTERN(area);
- CSS_DOM_STRING_INTERN(async);
- CSS_DOM_STRING_INTERN(background);
- CSS_DOM_STRING_INTERN(beforeprint);
- CSS_DOM_STRING_INTERN(beforeunload);
- CSS_DOM_STRING_INTERN(bgcolor);
- CSS_DOM_STRING_INTERN(blur);
- CSS_DOM_STRING_INTERN(border);
- CSS_DOM_STRING_INTERN(bordercolor);
- CSS_DOM_STRING_INTERN(cancel);
- CSS_DOM_STRING_INTERN(canplay);
- CSS_DOM_STRING_INTERN(canplaythrough);
- CSS_DOM_STRING_INTERN(cellpadding);
- CSS_DOM_STRING_INTERN(cellspacing);
- CSS_DOM_STRING_INTERN(change);
- CSS_DOM_STRING_INTERN(charset);
- CSS_DOM_STRING_INTERN(class);
- CSS_DOM_STRING_INTERN(classid);
- CSS_DOM_STRING_INTERN(click);
- CSS_DOM_STRING_INTERN(close);
- CSS_DOM_STRING_INTERN(codebase);
- CSS_DOM_STRING_INTERN(color);
- CSS_DOM_STRING_INTERN(cols);
- CSS_DOM_STRING_INTERN(colspan);
- CSS_DOM_STRING_INTERN(content);
- CSS_DOM_STRING_INTERN(contextmenu);
- CSS_DOM_STRING_INTERN(coords);
- CSS_DOM_STRING_INTERN(cuechange);
- CSS_DOM_STRING_INTERN(data);
- CSS_DOM_STRING_INTERN(dblclick);
- CSS_DOM_STRING_INTERN(defer);
- CSS_DOM_STRING_INTERN(DOMAttrModified);
- CSS_DOM_STRING_INTERN(DOMNodeInserted);
- CSS_DOM_STRING_INTERN(DOMNodeInsertedIntoDocument);
- CSS_DOM_STRING_INTERN(DOMSubtreeModified);
- CSS_DOM_STRING_INTERN(drag);
- CSS_DOM_STRING_INTERN(dragend);
- CSS_DOM_STRING_INTERN(dragenter);
- CSS_DOM_STRING_INTERN(dragleave);
- CSS_DOM_STRING_INTERN(dragover);
- CSS_DOM_STRING_INTERN(dragstart);
- CSS_DOM_STRING_INTERN(drop);
- CSS_DOM_STRING_INTERN(durationchange);
- CSS_DOM_STRING_INTERN(emptied);
- CSS_DOM_STRING_INTERN(ended);
- CSS_DOM_STRING_INTERN(error);
- CSS_DOM_STRING_INTERN(focus);
- CSS_DOM_STRING_INTERN(frameborder);
- CSS_DOM_STRING_INTERN(hashchange);
- CSS_DOM_STRING_INTERN(height);
- CSS_DOM_STRING_INTERN(href);
- CSS_DOM_STRING_INTERN(hreflang);
- CSS_DOM_STRING_INTERN(hspace);
- /* http-equiv: see below */
- CSS_DOM_STRING_INTERN(id);
- CSS_DOM_STRING_INTERN(input);
- CSS_DOM_STRING_INTERN(invalid);
- CSS_DOM_STRING_INTERN(keydown);
- CSS_DOM_STRING_INTERN(keypress);
- CSS_DOM_STRING_INTERN(keyup);
- CSS_DOM_STRING_INTERN(link);
- CSS_DOM_STRING_INTERN(load);
- CSS_DOM_STRING_INTERN(loadeddata);
- CSS_DOM_STRING_INTERN(loadedmetadata);
- CSS_DOM_STRING_INTERN(loadstart);
- CSS_DOM_STRING_INTERN(map);
- CSS_DOM_STRING_INTERN(marginheight);
- CSS_DOM_STRING_INTERN(marginwidth);
- CSS_DOM_STRING_INTERN(media);
- CSS_DOM_STRING_INTERN(message);
- CSS_DOM_STRING_INTERN(mousedown);
- CSS_DOM_STRING_INTERN(mousemove);
- CSS_DOM_STRING_INTERN(mouseout);
- CSS_DOM_STRING_INTERN(mouseover);
- CSS_DOM_STRING_INTERN(mouseup);
- CSS_DOM_STRING_INTERN(mousewheel);
- CSS_DOM_STRING_INTERN(name);
- CSS_DOM_STRING_INTERN(nohref);
- CSS_DOM_STRING_INTERN(noresize);
- CSS_DOM_STRING_INTERN(nowrap);
- CSS_DOM_STRING_INTERN(offline);
- CSS_DOM_STRING_INTERN(online);
- CSS_DOM_STRING_INTERN(pagehide);
- CSS_DOM_STRING_INTERN(pageshow);
- CSS_DOM_STRING_INTERN(pause);
- CSS_DOM_STRING_INTERN(play);
- CSS_DOM_STRING_INTERN(playing);
- CSS_DOM_STRING_INTERN(popstate);
- CSS_DOM_STRING_INTERN(progress);
- CSS_DOM_STRING_INTERN(ratechange);
- CSS_DOM_STRING_INTERN(readystatechange);
- CSS_DOM_STRING_INTERN(rect);
- CSS_DOM_STRING_INTERN(rel);
- CSS_DOM_STRING_INTERN(reset);
- CSS_DOM_STRING_INTERN(resize);
- CSS_DOM_STRING_INTERN(rows);
- CSS_DOM_STRING_INTERN(rowspan);
- CSS_DOM_STRING_INTERN(scroll);
- CSS_DOM_STRING_INTERN(scrolling);
- CSS_DOM_STRING_INTERN(seeked);
- CSS_DOM_STRING_INTERN(seeking);
- CSS_DOM_STRING_INTERN(select);
- CSS_DOM_STRING_INTERN(selected);
- CSS_DOM_STRING_INTERN(shape);
- CSS_DOM_STRING_INTERN(show);
- CSS_DOM_STRING_INTERN(size);
- CSS_DOM_STRING_INTERN(sizes);
- CSS_DOM_STRING_INTERN(src);
- CSS_DOM_STRING_INTERN(stalled);
- CSS_DOM_STRING_INTERN(storage);
- CSS_DOM_STRING_INTERN(style);
- CSS_DOM_STRING_INTERN(submit);
- CSS_DOM_STRING_INTERN(suspend);
- CSS_DOM_STRING_INTERN(target);
- CSS_DOM_STRING_INTERN(text);
- CSS_DOM_STRING_INTERN(timeupdate);
- CSS_DOM_STRING_INTERN(title);
- CSS_DOM_STRING_INTERN(type);
- CSS_DOM_STRING_INTERN(unload);
- CSS_DOM_STRING_INTERN(valign);
- CSS_DOM_STRING_INTERN(value);
- CSS_DOM_STRING_INTERN(vlink);
- CSS_DOM_STRING_INTERN(volumechange);
- CSS_DOM_STRING_INTERN(vspace);
- CSS_DOM_STRING_INTERN(waiting);
- CSS_DOM_STRING_INTERN(width);
- /* DOM node names, not really CSS */
- CSS_DOM_STRING_INTERN(BUTTON);
- CSS_DOM_STRING_INTERN(INPUT);
- CSS_DOM_STRING_INTERN(SELECT);
- CSS_DOM_STRING_INTERN(TEXTAREA);
- CSS_DOM_STRING_INTERN(BODY);
- CSS_DOM_STRING_INTERN(HEAD);
- /* DOM input types, not really CSS */
- CSS_DOM_STRING_INTERN(button);
- CSS_DOM_STRING_INTERN(image);
- CSS_DOM_STRING_INTERN(radio);
- CSS_DOM_STRING_INTERN(checkbox);
- CSS_DOM_STRING_INTERN(file);
- /* DOM event prefix */
- CSS_DOM_STRING_INTERN(on);
- /* DOM events forwarded from body to window */
- CSS_DOM_STRING_INTERN(onblur);
- CSS_DOM_STRING_INTERN(onerror);
- CSS_DOM_STRING_INTERN(onfocus);
- CSS_DOM_STRING_INTERN(onload);
- CSS_DOM_STRING_INTERN(onresize);
- CSS_DOM_STRING_INTERN(onscroll);
- /* Corestrings used by DOM event registration */
- CSS_DOM_STRING_INTERN(autocomplete);
- CSS_DOM_STRING_INTERN(autocompleteerror);
- CSS_DOM_STRING_INTERN(dragexit);
- CSS_DOM_STRING_INTERN(mouseenter);
- CSS_DOM_STRING_INTERN(mouseleave);
- CSS_DOM_STRING_INTERN(wheel);
- CSS_DOM_STRING_INTERN(sort);
- CSS_DOM_STRING_INTERN(toggle);
- /* DOM userdata keys, not really CSS */
- CSS_DOM_STRING_INTERN(__ns_key_box_node_data);
- CSS_DOM_STRING_INTERN(__ns_key_libcss_node_data);
- CSS_DOM_STRING_INTERN(__ns_key_file_name_node_data);
- CSS_DOM_STRING_INTERN(__ns_key_image_coords_node_data);
- CSS_DOM_STRING_INTERN(__ns_key_html_content_data);
-#undef CSS_DOM_STRING_INTERN
-
- exc = dom_string_create_interned((const uint8_t *) "text/javascript",
- SLEN("text/javascript"),
- &corestring_dom_text_javascript);
- if ((exc != DOM_NO_ERR) || (corestring_dom_text_javascript == NULL)) {
- error = NSERROR_NOMEM;
- goto error;
- }
-
- exc = dom_string_create_interned((const uint8_t *) "http-equiv",
- SLEN("http-equiv"),
- &corestring_dom_http_equiv);
- if ((exc != DOM_NO_ERR) || (corestring_dom_http_equiv == NULL)) {
- error = NSERROR_NOMEM;
- goto error;
- }
+#define CORESTRING_NSURL(NAME,VALUE) \
+ do { \
+ error = nsurl_create(VALUE, \
+ &corestring_nsurl_##NAME); \
+ if (error != NSERROR_OK) { \
+ goto error; \
+ } \
+ } while(0)
- exc = dom_string_create_interned((const uint8_t *) "http://www.w3.org/1999/xhtml",
- SLEN("http://www.w3.org/1999/xhtml"),
- &corestring_dom_html_namespace);
- if ((exc != DOM_NO_ERR) || (corestring_dom_html_namespace == NULL)) {
- error = NSERROR_NOMEM;
- goto error;
- }
+#include "utils/corestringlist.h"
- error = nsurl_create("about:blank", &corestring_nsurl_about_blank);
- if (error != NSERROR_OK) {
- goto error;
- }
+#undef CORESTRING_LWC_VALUE
+#undef CORESTRING_DOM_VALUE
+#undef CORESTRING_NSURL
return NSERROR_OK;
diff --git a/utils/corestrings.h b/utils/corestrings.h
index 88dc2ce3d..e4bf91e58 100644
--- a/utils/corestrings.h
+++ b/utils/corestrings.h
@@ -32,286 +32,32 @@
/** File url prefix length. */
#define FILE_SCHEME_PREFIX_LEN 8
+/**
+ * Initialise the core string tables
+ *
+ * \return NSERROR_OK on success else appropriate error code
+ */
nserror corestrings_init(void);
-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;
-extern lwc_string *corestring_lwc_applet;
-extern lwc_string *corestring_lwc_base;
-extern lwc_string *corestring_lwc_baseline;
-extern lwc_string *corestring_lwc_body;
-extern lwc_string *corestring_lwc_bottom;
-extern lwc_string *corestring_lwc_button;
-extern lwc_string *corestring_lwc_caption;
-extern lwc_string *corestring_lwc_center;
-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;
-extern lwc_string *corestring_lwc_file;
-extern lwc_string *corestring_lwc_filename;
-extern lwc_string *corestring_lwc_font;
-extern lwc_string *corestring_lwc_frame;
-extern lwc_string *corestring_lwc_frameset;
-extern lwc_string *corestring_lwc_h1;
-extern lwc_string *corestring_lwc_h2;
-extern lwc_string *corestring_lwc_h3;
-extern lwc_string *corestring_lwc_h4;
-extern lwc_string *corestring_lwc_h5;
-extern lwc_string *corestring_lwc_h6;
-extern lwc_string *corestring_lwc_head;
-extern lwc_string *corestring_lwc_hidden;
-extern lwc_string *corestring_lwc_hr;
-extern lwc_string *corestring_lwc_html;
-extern lwc_string *corestring_lwc_http;
-extern lwc_string *corestring_lwc_https;
-extern lwc_string *corestring_lwc_icon;
-extern lwc_string *corestring_lwc_iframe;
-extern lwc_string *corestring_lwc_image;
-extern lwc_string *corestring_lwc_img;
-extern lwc_string *corestring_lwc_input;
-extern lwc_string *corestring_lwc_javascript;
-extern lwc_string *corestring_lwc_justify;
-extern lwc_string *corestring_lwc_left;
-extern lwc_string *corestring_lwc_li;
-extern lwc_string *corestring_lwc_link;
-extern lwc_string *corestring_lwc_mailto;
-extern lwc_string *corestring_lwc_meta;
-extern lwc_string *corestring_lwc_middle;
-extern lwc_string *corestring_lwc_multipart_form_data; /* multipart/form-data */
-extern lwc_string *corestring_lwc_no;
-extern lwc_string *corestring_lwc_noscript;
-extern lwc_string *corestring_lwc_object;
-extern lwc_string *corestring_lwc_optgroup;
-extern lwc_string *corestring_lwc_option;
-extern lwc_string *corestring_lwc_p;
-extern lwc_string *corestring_lwc_param;
-extern lwc_string *corestring_lwc_password;
-extern lwc_string *corestring_lwc_poly;
-extern lwc_string *corestring_lwc_polygon;
-extern lwc_string *corestring_lwc_post;
-extern lwc_string *corestring_lwc_radio;
-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;
-extern lwc_string *corestring_lwc_shortcut_icon; /* shortcut icon */
-extern lwc_string *corestring_lwc_src;
-extern lwc_string *corestring_lwc_style;
-extern lwc_string *corestring_lwc_submit;
-extern lwc_string *corestring_lwc_table;
-extern lwc_string *corestring_lwc_tbody;
-extern lwc_string *corestring_lwc_td;
-extern lwc_string *corestring_lwc_text;
-extern lwc_string *corestring_lwc_textarea;
-extern lwc_string *corestring_lwc_texttop;
-extern lwc_string *corestring_lwc_text_css; /* text/css */
-extern lwc_string *corestring_lwc_tfoot;
-extern lwc_string *corestring_lwc_th;
-extern lwc_string *corestring_lwc_thead;
-extern lwc_string *corestring_lwc_title;
-extern lwc_string *corestring_lwc_top;
-extern lwc_string *corestring_lwc_tr;
-extern lwc_string *corestring_lwc_ul;
-extern lwc_string *corestring_lwc_url;
-extern lwc_string *corestring_lwc_yes;
-extern lwc_string *corestring_lwc__blank;
-extern lwc_string *corestring_lwc__parent;
-extern lwc_string *corestring_lwc__self;
-extern lwc_string *corestring_lwc__top;
-extern lwc_string *corestring_lwc_slash_; /* / */
+/**
+ * free resources of core string tables.
+ *
+ * \return NSERROR_OK on success else appropriate error code
+ */
+nserror corestrings_fini(void);
struct dom_string;
-/* dom_string strings */
-extern struct dom_string *corestring_dom_a;
-extern struct dom_string *corestring_dom_alt;
-extern struct dom_string *corestring_dom_abort;
-extern struct dom_string *corestring_dom_afterprint;
-extern struct dom_string *corestring_dom_align;
-extern struct dom_string *corestring_dom_area;
-extern struct dom_string *corestring_dom_async;
-extern struct dom_string *corestring_dom_background;
-extern struct dom_string *corestring_dom_beforeprint;
-extern struct dom_string *corestring_dom_beforeunload;
-extern struct dom_string *corestring_dom_bgcolor;
-extern struct dom_string *corestring_dom_blur;
-extern struct dom_string *corestring_dom_border;
-extern struct dom_string *corestring_dom_bordercolor;
-extern struct dom_string *corestring_dom_cancel;
-extern struct dom_string *corestring_dom_canplay;
-extern struct dom_string *corestring_dom_canplaythrough;
-extern struct dom_string *corestring_dom_cellpadding;
-extern struct dom_string *corestring_dom_cellspacing;
-extern struct dom_string *corestring_dom_change;
-extern struct dom_string *corestring_dom_charset;
-extern struct dom_string *corestring_dom_class;
-extern struct dom_string *corestring_dom_classid;
-extern struct dom_string *corestring_dom_click;
-extern struct dom_string *corestring_dom_close;
-extern struct dom_string *corestring_dom_codebase;
-extern struct dom_string *corestring_dom_color;
-extern struct dom_string *corestring_dom_cols;
-extern struct dom_string *corestring_dom_colspan;
-extern struct dom_string *corestring_dom_content;
-extern struct dom_string *corestring_dom_contextmenu;
-extern struct dom_string *corestring_dom_coords;
-extern struct dom_string *corestring_dom_cuechange;
-extern struct dom_string *corestring_dom_data;
-extern struct dom_string *corestring_dom_dblclick;
-extern struct dom_string *corestring_dom_defer;
-extern struct dom_string *corestring_dom_DOMAttrModified;
-extern struct dom_string *corestring_dom_DOMNodeInserted;
-extern struct dom_string *corestring_dom_DOMNodeInsertedIntoDocument;
-extern struct dom_string *corestring_dom_DOMSubtreeModified;
-extern struct dom_string *corestring_dom_drag;
-extern struct dom_string *corestring_dom_dragend;
-extern struct dom_string *corestring_dom_dragenter;
-extern struct dom_string *corestring_dom_dragleave;
-extern struct dom_string *corestring_dom_dragover;
-extern struct dom_string *corestring_dom_dragstart;
-extern struct dom_string *corestring_dom_drop;
-extern struct dom_string *corestring_dom_durationchange;
-extern struct dom_string *corestring_dom_emptied;
-extern struct dom_string *corestring_dom_ended;
-extern struct dom_string *corestring_dom_error;
-extern struct dom_string *corestring_dom_focus;
-extern struct dom_string *corestring_dom_frameborder;
-extern struct dom_string *corestring_dom_hashchange;
-extern struct dom_string *corestring_dom_height;
-extern struct dom_string *corestring_dom_href;
-extern struct dom_string *corestring_dom_hreflang;
-extern struct dom_string *corestring_dom_hspace;
-extern struct dom_string *corestring_dom_http_equiv; /* http-equiv */
-extern struct dom_string *corestring_dom_id;
-extern struct dom_string *corestring_dom_input;
-extern struct dom_string *corestring_dom_invalid;
-extern struct dom_string *corestring_dom_keydown;
-extern struct dom_string *corestring_dom_keypress;
-extern struct dom_string *corestring_dom_keyup;
-extern struct dom_string *corestring_dom_link;
-extern struct dom_string *corestring_dom_load;
-extern struct dom_string *corestring_dom_loadeddata;
-extern struct dom_string *corestring_dom_loadedmetadata;
-extern struct dom_string *corestring_dom_loadstart;
-extern struct dom_string *corestring_dom_map;
-extern struct dom_string *corestring_dom_marginheight;
-extern struct dom_string *corestring_dom_marginwidth;
-extern struct dom_string *corestring_dom_media;
-extern struct dom_string *corestring_dom_message;
-extern struct dom_string *corestring_dom_mousedown;
-extern struct dom_string *corestring_dom_mousemove;
-extern struct dom_string *corestring_dom_mouseout;
-extern struct dom_string *corestring_dom_mouseover;
-extern struct dom_string *corestring_dom_mouseup;
-extern struct dom_string *corestring_dom_mousewheel;
-extern struct dom_string *corestring_dom_name;
-extern struct dom_string *corestring_dom_nohref;
-extern struct dom_string *corestring_dom_noresize;
-extern struct dom_string *corestring_dom_nowrap;
-extern struct dom_string *corestring_dom_offline;
-extern struct dom_string *corestring_dom_online;
-extern struct dom_string *corestring_dom_pagehide;
-extern struct dom_string *corestring_dom_pageshow;
-extern struct dom_string *corestring_dom_pause;
-extern struct dom_string *corestring_dom_play;
-extern struct dom_string *corestring_dom_playing;
-extern struct dom_string *corestring_dom_popstate;
-extern struct dom_string *corestring_dom_progress;
-extern struct dom_string *corestring_dom_ratechange;
-extern struct dom_string *corestring_dom_readystatechange;
-extern struct dom_string *corestring_dom_rect;
-extern struct dom_string *corestring_dom_rel;
-extern struct dom_string *corestring_dom_reset;
-extern struct dom_string *corestring_dom_resize;
-extern struct dom_string *corestring_dom_rows;
-extern struct dom_string *corestring_dom_rowspan;
-extern struct dom_string *corestring_dom_scroll;
-extern struct dom_string *corestring_dom_scrolling;
-extern struct dom_string *corestring_dom_seeked;
-extern struct dom_string *corestring_dom_seeking;
-extern struct dom_string *corestring_dom_select;
-extern struct dom_string *corestring_dom_selected;
-extern struct dom_string *corestring_dom_shape;
-extern struct dom_string *corestring_dom_show;
-extern struct dom_string *corestring_dom_size;
-extern struct dom_string *corestring_dom_sizes;
-extern struct dom_string *corestring_dom_src;
-extern struct dom_string *corestring_dom_stalled;
-extern struct dom_string *corestring_dom_storage;
-extern struct dom_string *corestring_dom_style;
-extern struct dom_string *corestring_dom_submit;
-extern struct dom_string *corestring_dom_suspend;
-extern struct dom_string *corestring_dom_target;
-extern struct dom_string *corestring_dom_text;
-extern struct dom_string *corestring_dom_text_javascript; /* text/javascript */
-extern struct dom_string *corestring_dom_timeupdate;
-extern struct dom_string *corestring_dom_title;
-extern struct dom_string *corestring_dom_type;
-extern struct dom_string *corestring_dom_unload;
-extern struct dom_string *corestring_dom_valign;
-extern struct dom_string *corestring_dom_value;
-extern struct dom_string *corestring_dom_vlink;
-extern struct dom_string *corestring_dom_volumechange;
-extern struct dom_string *corestring_dom_vspace;
-extern struct dom_string *corestring_dom_waiting;
-extern struct dom_string *corestring_dom_width;
-/* DOM node types */
-extern struct dom_string *corestring_dom_BUTTON;
-extern struct dom_string *corestring_dom_INPUT;
-extern struct dom_string *corestring_dom_SELECT;
-extern struct dom_string *corestring_dom_TEXTAREA;
-extern struct dom_string *corestring_dom_BODY;
-extern struct dom_string *corestring_dom_HEAD;
-/* DOM namespaces */
-extern struct dom_string *corestring_dom_html_namespace;
-/* DOM input node types */
-extern struct dom_string *corestring_dom_button;
-/* extern struct dom_string *corestring_dom_submit; */
-/* extern struct dom_string *corestring_dom_reset; */
-extern struct dom_string *corestring_dom_image;
-extern struct dom_string *corestring_dom_radio;
-extern struct dom_string *corestring_dom_checkbox;
-extern struct dom_string *corestring_dom_file;
-/* Event prefix */
-extern struct dom_string *corestring_dom_on;
-/* These are the event attributes which forward from body to window */
-extern struct dom_string *corestring_dom_onblur;
-extern struct dom_string *corestring_dom_onerror;
-extern struct dom_string *corestring_dom_onfocus;
-extern struct dom_string *corestring_dom_onload;
-extern struct dom_string *corestring_dom_onresize;
-extern struct dom_string *corestring_dom_onscroll;
-/* Corestrings used by DOM event registration */
-extern struct dom_string *corestring_dom_autocomplete;
-extern struct dom_string *corestring_dom_autocompleteerror;
-extern struct dom_string *corestring_dom_dragexit;
-extern struct dom_string *corestring_dom_mouseenter;
-extern struct dom_string *corestring_dom_mouseleave;
-extern struct dom_string *corestring_dom_wheel;
-extern struct dom_string *corestring_dom_sort;
-extern struct dom_string *corestring_dom_toggle;
-/* DOM userdata keys */
-extern struct dom_string *corestring_dom___ns_key_box_node_data;
-extern struct dom_string *corestring_dom___ns_key_libcss_node_data;
-extern struct dom_string *corestring_dom___ns_key_file_name_node_data;
-extern struct dom_string *corestring_dom___ns_key_image_coords_node_data;
-extern struct dom_string *corestring_dom___ns_key_html_content_data;
-
-/* URLs */
-extern struct nsurl *corestring_nsurl_about_blank;
+/* declare corestrings */
+#define CORESTRING_LWC_VALUE(NAME,VALUE) \
+ extern lwc_string *corestring_lwc_##NAME
+#define CORESTRING_DOM_VALUE(NAME,VALUE) \
+ extern struct dom_string *corestring_dom_##NAME
+#define CORESTRING_NSURL(NAME,VALUE) \
+ extern struct nsurl *corestring_nsurl_##NAME
+#include "utils/corestringlist.h"
+#undef CORESTRING_LWC_VALUE
+#undef CORESTRING_DOM_VALUE
+#undef CORESTRING_NSURL
#endif