2012-07-22 18:48:55 +04:00
|
|
|
/*
|
|
|
|
* Copyright 2012 Michael Drake <tlsa@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
|
|
|
|
* Useful interned string pointers (implementation).
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <dom/dom.h>
|
|
|
|
|
|
|
|
#include "utils/corestrings.h"
|
2012-07-22 23:52:34 +04:00
|
|
|
#include "utils/utils.h"
|
2012-07-22 18:48:55 +04:00
|
|
|
|
|
|
|
/* lwc_string strings */
|
|
|
|
lwc_string *corestring_lwc_a;
|
|
|
|
lwc_string *corestring_lwc_abscenter;
|
|
|
|
lwc_string *corestring_lwc_absmiddle;
|
|
|
|
lwc_string *corestring_lwc_align;
|
|
|
|
lwc_string *corestring_lwc_applet;
|
2012-07-23 02:28:45 +04:00
|
|
|
lwc_string *corestring_lwc_base;
|
2012-07-22 18:48:55 +04:00
|
|
|
lwc_string *corestring_lwc_baseline;
|
|
|
|
lwc_string *corestring_lwc_body;
|
|
|
|
lwc_string *corestring_lwc_bottom;
|
2012-07-22 21:01:10 +04:00
|
|
|
lwc_string *corestring_lwc_button;
|
2012-07-22 18:48:55 +04:00
|
|
|
lwc_string *corestring_lwc_caption;
|
|
|
|
lwc_string *corestring_lwc_center;
|
2012-07-23 15:06:43 +04:00
|
|
|
lwc_string *corestring_lwc_checkbox;
|
2012-07-22 23:52:34 +04:00
|
|
|
lwc_string *corestring_lwc_circle;
|
2012-07-22 18:48:55 +04:00
|
|
|
lwc_string *corestring_lwc_col;
|
2012-07-22 23:52:34 +04:00
|
|
|
lwc_string *corestring_lwc_default;
|
2012-07-22 18:48:55 +04:00
|
|
|
lwc_string *corestring_lwc_div;
|
|
|
|
lwc_string *corestring_lwc_embed;
|
2012-07-23 15:06:43 +04:00
|
|
|
lwc_string *corestring_lwc_file;
|
2012-07-22 18:48:55 +04:00
|
|
|
lwc_string *corestring_lwc_font;
|
2012-07-26 18:57:33 +04:00
|
|
|
lwc_string *corestring_lwc_frame;
|
|
|
|
lwc_string *corestring_lwc_frameset;
|
2012-07-22 18:48:55 +04:00
|
|
|
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;
|
2012-07-23 02:28:45 +04:00
|
|
|
lwc_string *corestring_lwc_head;
|
2012-07-23 15:06:43 +04:00
|
|
|
lwc_string *corestring_lwc_hidden;
|
2012-07-22 18:48:55 +04:00
|
|
|
lwc_string *corestring_lwc_hr;
|
2012-07-23 02:28:45 +04:00
|
|
|
lwc_string *corestring_lwc_html;
|
2012-07-22 18:48:55 +04:00
|
|
|
lwc_string *corestring_lwc_iframe;
|
2012-07-23 15:06:43 +04:00
|
|
|
lwc_string *corestring_lwc_image;
|
2012-07-22 18:48:55 +04:00
|
|
|
lwc_string *corestring_lwc_img;
|
|
|
|
lwc_string *corestring_lwc_input;
|
|
|
|
lwc_string *corestring_lwc_justify;
|
|
|
|
lwc_string *corestring_lwc_left;
|
2012-07-23 02:28:45 +04:00
|
|
|
lwc_string *corestring_lwc_link;
|
2012-07-26 17:49:27 +04:00
|
|
|
lwc_string *corestring_lwc_meta;
|
2012-07-22 18:48:55 +04:00
|
|
|
lwc_string *corestring_lwc_middle;
|
2012-07-23 15:06:43 +04:00
|
|
|
lwc_string *corestring_lwc_multipart_form_data;
|
2012-07-26 18:57:33 +04:00
|
|
|
lwc_string *corestring_lwc_no;
|
2012-07-26 17:49:27 +04:00
|
|
|
lwc_string *corestring_lwc_noscript;
|
2012-07-22 18:48:55 +04:00
|
|
|
lwc_string *corestring_lwc_object;
|
2012-07-26 18:57:33 +04:00
|
|
|
lwc_string *corestring_lwc_optgroup;
|
|
|
|
lwc_string *corestring_lwc_option;
|
2012-07-22 18:48:55 +04:00
|
|
|
lwc_string *corestring_lwc_p;
|
2012-07-26 18:57:33 +04:00
|
|
|
lwc_string *corestring_lwc_param;
|
2012-07-22 18:48:55 +04:00
|
|
|
lwc_string *corestring_lwc_password;
|
2012-07-22 23:52:34 +04:00
|
|
|
lwc_string *corestring_lwc_poly;
|
|
|
|
lwc_string *corestring_lwc_polygon;
|
2012-07-23 15:06:43 +04:00
|
|
|
lwc_string *corestring_lwc_post;
|
|
|
|
lwc_string *corestring_lwc_radio;
|
2012-07-22 23:52:34 +04:00
|
|
|
lwc_string *corestring_lwc_rect;
|
|
|
|
lwc_string *corestring_lwc_rectangle;
|
2012-07-26 17:49:27 +04:00
|
|
|
lwc_string *corestring_lwc_refresh;
|
2012-07-23 15:06:43 +04:00
|
|
|
lwc_string *corestring_lwc_reset;
|
2012-07-22 18:48:55 +04:00
|
|
|
lwc_string *corestring_lwc_right;
|
2012-07-26 18:57:33 +04:00
|
|
|
lwc_string *corestring_lwc_src;
|
2012-07-26 17:49:27 +04:00
|
|
|
lwc_string *corestring_lwc_style;
|
2012-07-23 15:06:43 +04:00
|
|
|
lwc_string *corestring_lwc_submit;
|
2012-07-22 18:48:55 +04:00
|
|
|
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;
|
2012-07-26 17:49:27 +04:00
|
|
|
lwc_string *corestring_lwc_text_css;
|
2012-07-22 18:48:55 +04:00
|
|
|
lwc_string *corestring_lwc_tfoot;
|
|
|
|
lwc_string *corestring_lwc_th;
|
|
|
|
lwc_string *corestring_lwc_thead;
|
2012-07-23 15:06:43 +04:00
|
|
|
lwc_string *corestring_lwc_title;
|
2012-07-22 18:48:55 +04:00
|
|
|
lwc_string *corestring_lwc_top;
|
|
|
|
lwc_string *corestring_lwc_tr;
|
2012-07-26 17:49:27 +04:00
|
|
|
lwc_string *corestring_lwc_url;
|
2012-07-26 18:57:33 +04:00
|
|
|
lwc_string *corestring_lwc_yes;
|
2012-07-23 02:28:45 +04:00
|
|
|
lwc_string *corestring_lwc__blank;
|
|
|
|
lwc_string *corestring_lwc__parent;
|
|
|
|
lwc_string *corestring_lwc__self;
|
|
|
|
lwc_string *corestring_lwc__top;
|
2012-07-22 18:48:55 +04:00
|
|
|
|
|
|
|
/* dom_string strings */
|
2012-07-22 23:52:34 +04:00
|
|
|
dom_string *corestring_dom_a;
|
2012-07-22 18:48:55 +04:00
|
|
|
dom_string *corestring_dom_align;
|
2012-07-22 23:52:34 +04:00
|
|
|
dom_string *corestring_dom_area;
|
2012-07-27 19:59:49 +04:00
|
|
|
dom_string *corestring_dom_async;
|
2012-07-22 18:48:55 +04:00
|
|
|
dom_string *corestring_dom_background;
|
|
|
|
dom_string *corestring_dom_bgcolor;
|
|
|
|
dom_string *corestring_dom_border;
|
|
|
|
dom_string *corestring_dom_bordercolor;
|
|
|
|
dom_string *corestring_dom_cellpadding;
|
|
|
|
dom_string *corestring_dom_cellspacing;
|
|
|
|
dom_string *corestring_dom_color;
|
|
|
|
dom_string *corestring_dom_cols;
|
2012-07-23 02:28:45 +04:00
|
|
|
dom_string *corestring_dom_content;
|
2012-07-22 23:52:34 +04:00
|
|
|
dom_string *corestring_dom_coords;
|
2012-07-27 19:59:49 +04:00
|
|
|
dom_string *corestring_dom_defer;
|
2012-07-22 18:48:55 +04:00
|
|
|
dom_string *corestring_dom_height;
|
|
|
|
dom_string *corestring_dom_href;
|
2012-07-23 02:28:45 +04:00
|
|
|
dom_string *corestring_dom_hreflang;
|
2012-07-22 18:48:55 +04:00
|
|
|
dom_string *corestring_dom_hspace;
|
2012-07-23 02:28:45 +04:00
|
|
|
dom_string *corestring_dom_http_equiv;
|
2012-07-22 23:52:34 +04:00
|
|
|
dom_string *corestring_dom_id;
|
2012-07-22 18:48:55 +04:00
|
|
|
dom_string *corestring_dom_link;
|
2012-07-22 23:52:34 +04:00
|
|
|
dom_string *corestring_dom_map;
|
2012-07-23 02:28:45 +04:00
|
|
|
dom_string *corestring_dom_media;
|
2012-07-22 23:52:34 +04:00
|
|
|
dom_string *corestring_dom_name;
|
|
|
|
dom_string *corestring_dom_nohref;
|
|
|
|
dom_string *corestring_dom_rect;
|
2012-07-23 02:28:45 +04:00
|
|
|
dom_string *corestring_dom_rel;
|
2012-07-22 18:48:55 +04:00
|
|
|
dom_string *corestring_dom_rows;
|
|
|
|
dom_string *corestring_dom_size;
|
2012-07-23 02:28:45 +04:00
|
|
|
dom_string *corestring_dom_sizes;
|
2012-07-22 23:52:34 +04:00
|
|
|
dom_string *corestring_dom_shape;
|
2012-07-22 21:58:22 +04:00
|
|
|
dom_string *corestring_dom_src;
|
2012-07-22 23:52:34 +04:00
|
|
|
dom_string *corestring_dom_target;
|
2012-07-22 18:48:55 +04:00
|
|
|
dom_string *corestring_dom_text;
|
2012-07-22 21:58:22 +04:00
|
|
|
dom_string *corestring_dom_text_javascript;
|
2012-07-22 18:48:55 +04:00
|
|
|
dom_string *corestring_dom_type;
|
|
|
|
dom_string *corestring_dom_valign;
|
|
|
|
dom_string *corestring_dom_vlink;
|
|
|
|
dom_string *corestring_dom_vspace;
|
|
|
|
dom_string *corestring_dom_width;
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Free the core strings
|
|
|
|
*/
|
|
|
|
void corestrings_fini(void)
|
|
|
|
{
|
|
|
|
#define CSS_LWC_STRING_UNREF(NAME) \
|
|
|
|
do { \
|
|
|
|
if (corestring_lwc_##NAME != NULL) { \
|
|
|
|
lwc_string_unref(corestring_lwc_##NAME); \
|
|
|
|
corestring_lwc_##NAME = NULL; \
|
|
|
|
} \
|
|
|
|
} while (0)
|
|
|
|
|
|
|
|
CSS_LWC_STRING_UNREF(a);
|
|
|
|
CSS_LWC_STRING_UNREF(abscenter);
|
|
|
|
CSS_LWC_STRING_UNREF(absmiddle);
|
|
|
|
CSS_LWC_STRING_UNREF(align);
|
|
|
|
CSS_LWC_STRING_UNREF(applet);
|
2012-07-23 02:28:45 +04:00
|
|
|
CSS_LWC_STRING_UNREF(base);
|
2012-07-22 18:48:55 +04:00
|
|
|
CSS_LWC_STRING_UNREF(baseline);
|
|
|
|
CSS_LWC_STRING_UNREF(body);
|
|
|
|
CSS_LWC_STRING_UNREF(bottom);
|
2012-07-22 21:01:10 +04:00
|
|
|
CSS_LWC_STRING_UNREF(button);
|
2012-07-22 18:48:55 +04:00
|
|
|
CSS_LWC_STRING_UNREF(caption);
|
|
|
|
CSS_LWC_STRING_UNREF(center);
|
2012-07-23 15:06:43 +04:00
|
|
|
CSS_LWC_STRING_UNREF(checkbox);
|
2012-07-22 23:52:34 +04:00
|
|
|
CSS_LWC_STRING_UNREF(circle);
|
2012-07-22 18:48:55 +04:00
|
|
|
CSS_LWC_STRING_UNREF(col);
|
2012-07-22 23:52:34 +04:00
|
|
|
CSS_LWC_STRING_UNREF(default);
|
2012-07-22 18:48:55 +04:00
|
|
|
CSS_LWC_STRING_UNREF(div);
|
|
|
|
CSS_LWC_STRING_UNREF(embed);
|
2012-07-23 15:06:43 +04:00
|
|
|
CSS_LWC_STRING_UNREF(file);
|
2012-07-22 18:48:55 +04:00
|
|
|
CSS_LWC_STRING_UNREF(font);
|
2012-07-26 18:57:33 +04:00
|
|
|
CSS_LWC_STRING_UNREF(frame);
|
|
|
|
CSS_LWC_STRING_UNREF(frameset);
|
2012-07-22 18:48:55 +04:00
|
|
|
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);
|
2012-07-23 02:28:45 +04:00
|
|
|
CSS_LWC_STRING_UNREF(head);
|
2012-07-23 15:06:43 +04:00
|
|
|
CSS_LWC_STRING_UNREF(hidden);
|
2012-07-22 18:48:55 +04:00
|
|
|
CSS_LWC_STRING_UNREF(hr);
|
2012-07-23 02:28:45 +04:00
|
|
|
CSS_LWC_STRING_UNREF(html);
|
2012-07-22 18:48:55 +04:00
|
|
|
CSS_LWC_STRING_UNREF(iframe);
|
2012-07-23 15:06:43 +04:00
|
|
|
CSS_LWC_STRING_UNREF(image);
|
2012-07-22 18:48:55 +04:00
|
|
|
CSS_LWC_STRING_UNREF(img);
|
|
|
|
CSS_LWC_STRING_UNREF(input);
|
|
|
|
CSS_LWC_STRING_UNREF(justify);
|
|
|
|
CSS_LWC_STRING_UNREF(left);
|
2012-07-23 02:28:45 +04:00
|
|
|
CSS_LWC_STRING_UNREF(link);
|
2012-07-26 17:49:27 +04:00
|
|
|
CSS_LWC_STRING_UNREF(meta);
|
2012-07-22 18:48:55 +04:00
|
|
|
CSS_LWC_STRING_UNREF(middle);
|
2012-07-23 15:06:43 +04:00
|
|
|
CSS_LWC_STRING_UNREF(multipart_form_data);
|
2012-07-26 18:57:33 +04:00
|
|
|
CSS_LWC_STRING_UNREF(no);
|
2012-07-26 17:49:27 +04:00
|
|
|
CSS_LWC_STRING_UNREF(noscript);
|
2012-07-22 18:48:55 +04:00
|
|
|
CSS_LWC_STRING_UNREF(object);
|
2012-07-26 18:57:33 +04:00
|
|
|
CSS_LWC_STRING_UNREF(optgroup);
|
|
|
|
CSS_LWC_STRING_UNREF(option);
|
2012-07-22 18:48:55 +04:00
|
|
|
CSS_LWC_STRING_UNREF(p);
|
2012-07-26 18:57:33 +04:00
|
|
|
CSS_LWC_STRING_UNREF(param);
|
2012-07-22 18:48:55 +04:00
|
|
|
CSS_LWC_STRING_UNREF(password);
|
2012-07-22 23:52:34 +04:00
|
|
|
CSS_LWC_STRING_UNREF(poly);
|
|
|
|
CSS_LWC_STRING_UNREF(polygon);
|
2012-07-23 15:06:43 +04:00
|
|
|
CSS_LWC_STRING_UNREF(post);
|
|
|
|
CSS_LWC_STRING_UNREF(radio);
|
2012-07-22 23:52:34 +04:00
|
|
|
CSS_LWC_STRING_UNREF(rect);
|
|
|
|
CSS_LWC_STRING_UNREF(rectangle);
|
2012-07-26 17:49:27 +04:00
|
|
|
CSS_LWC_STRING_UNREF(refresh);
|
2012-07-23 15:06:43 +04:00
|
|
|
CSS_LWC_STRING_UNREF(reset);
|
2012-07-22 18:48:55 +04:00
|
|
|
CSS_LWC_STRING_UNREF(right);
|
2012-07-26 18:57:33 +04:00
|
|
|
CSS_LWC_STRING_UNREF(src);
|
2012-07-26 17:49:27 +04:00
|
|
|
CSS_LWC_STRING_UNREF(style);
|
2012-07-23 15:06:43 +04:00
|
|
|
CSS_LWC_STRING_UNREF(submit);
|
2012-07-22 18:48:55 +04:00
|
|
|
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);
|
2012-07-26 17:49:27 +04:00
|
|
|
CSS_LWC_STRING_UNREF(text_css);
|
2012-07-22 18:48:55 +04:00
|
|
|
CSS_LWC_STRING_UNREF(tfoot);
|
|
|
|
CSS_LWC_STRING_UNREF(th);
|
|
|
|
CSS_LWC_STRING_UNREF(thead);
|
2012-07-23 15:06:43 +04:00
|
|
|
CSS_LWC_STRING_UNREF(title);
|
2012-07-22 18:48:55 +04:00
|
|
|
CSS_LWC_STRING_UNREF(top);
|
|
|
|
CSS_LWC_STRING_UNREF(tr);
|
2012-07-26 17:49:27 +04:00
|
|
|
CSS_LWC_STRING_UNREF(url);
|
2012-07-26 18:57:33 +04:00
|
|
|
CSS_LWC_STRING_UNREF(yes);
|
2012-07-23 02:28:45 +04:00
|
|
|
CSS_LWC_STRING_UNREF(_blank);
|
|
|
|
CSS_LWC_STRING_UNREF(_parent);
|
|
|
|
CSS_LWC_STRING_UNREF(_self);
|
|
|
|
CSS_LWC_STRING_UNREF(_top);
|
2012-07-23 15:06:43 +04:00
|
|
|
|
2012-07-22 18:48:55 +04:00
|
|
|
#undef CSS_LWC_STRING_UNREF
|
|
|
|
|
|
|
|
#define CSS_DOM_STRING_UNREF(NAME) \
|
|
|
|
do { \
|
|
|
|
if (corestring_dom_##NAME != NULL) { \
|
|
|
|
dom_string_unref(corestring_dom_##NAME); \
|
|
|
|
corestring_dom_##NAME = NULL; \
|
|
|
|
} \
|
|
|
|
} while (0)
|
|
|
|
|
2012-07-22 23:52:34 +04:00
|
|
|
CSS_DOM_STRING_UNREF(a);
|
2012-07-22 18:48:55 +04:00
|
|
|
CSS_DOM_STRING_UNREF(align);
|
2012-07-22 23:52:34 +04:00
|
|
|
CSS_DOM_STRING_UNREF(area);
|
2012-07-27 19:59:49 +04:00
|
|
|
CSS_DOM_STRING_UNREF(async);
|
2012-07-22 18:48:55 +04:00
|
|
|
CSS_DOM_STRING_UNREF(background);
|
|
|
|
CSS_DOM_STRING_UNREF(bgcolor);
|
|
|
|
CSS_DOM_STRING_UNREF(border);
|
|
|
|
CSS_DOM_STRING_UNREF(bordercolor);
|
|
|
|
CSS_DOM_STRING_UNREF(cellpadding);
|
|
|
|
CSS_DOM_STRING_UNREF(cellspacing);
|
|
|
|
CSS_DOM_STRING_UNREF(color);
|
|
|
|
CSS_DOM_STRING_UNREF(cols);
|
2012-07-23 02:28:45 +04:00
|
|
|
CSS_DOM_STRING_UNREF(content);
|
2012-07-22 23:52:34 +04:00
|
|
|
CSS_DOM_STRING_UNREF(coords);
|
2012-07-27 19:59:49 +04:00
|
|
|
CSS_DOM_STRING_UNREF(defer);
|
2012-07-22 18:48:55 +04:00
|
|
|
CSS_DOM_STRING_UNREF(height);
|
|
|
|
CSS_DOM_STRING_UNREF(href);
|
2012-07-23 02:28:45 +04:00
|
|
|
CSS_DOM_STRING_UNREF(hreflang);
|
2012-07-22 18:48:55 +04:00
|
|
|
CSS_DOM_STRING_UNREF(hspace);
|
2012-07-23 02:28:45 +04:00
|
|
|
CSS_DOM_STRING_UNREF(http_equiv);
|
2012-07-22 23:52:34 +04:00
|
|
|
CSS_DOM_STRING_UNREF(id);
|
2012-07-22 18:48:55 +04:00
|
|
|
CSS_DOM_STRING_UNREF(link);
|
2012-07-22 23:52:34 +04:00
|
|
|
CSS_DOM_STRING_UNREF(map);
|
2012-07-23 02:28:45 +04:00
|
|
|
CSS_DOM_STRING_UNREF(media);
|
2012-07-22 23:52:34 +04:00
|
|
|
CSS_DOM_STRING_UNREF(name);
|
|
|
|
CSS_DOM_STRING_UNREF(nohref);
|
|
|
|
CSS_DOM_STRING_UNREF(rect);
|
2012-07-23 02:28:45 +04:00
|
|
|
CSS_DOM_STRING_UNREF(rel);
|
2012-07-22 18:48:55 +04:00
|
|
|
CSS_DOM_STRING_UNREF(rows);
|
|
|
|
CSS_DOM_STRING_UNREF(size);
|
2012-07-23 02:28:45 +04:00
|
|
|
CSS_DOM_STRING_UNREF(sizes);
|
2012-07-22 23:52:34 +04:00
|
|
|
CSS_DOM_STRING_UNREF(shape);
|
2012-07-22 21:58:22 +04:00
|
|
|
CSS_DOM_STRING_UNREF(src);
|
2012-07-22 23:52:34 +04:00
|
|
|
CSS_DOM_STRING_UNREF(target);
|
2012-07-22 18:48:55 +04:00
|
|
|
CSS_DOM_STRING_UNREF(text);
|
2012-07-22 21:58:22 +04:00
|
|
|
CSS_DOM_STRING_UNREF(text_javascript);
|
2012-07-22 18:48:55 +04:00
|
|
|
CSS_DOM_STRING_UNREF(type);
|
|
|
|
CSS_DOM_STRING_UNREF(valign);
|
|
|
|
CSS_DOM_STRING_UNREF(vlink);
|
|
|
|
CSS_DOM_STRING_UNREF(vspace);
|
|
|
|
CSS_DOM_STRING_UNREF(width);
|
|
|
|
#undef CSS_DOM_STRING_UNREF
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Create the core strings
|
|
|
|
*/
|
|
|
|
nserror corestrings_init(void)
|
|
|
|
{
|
|
|
|
lwc_error lerror;
|
|
|
|
nserror error;
|
|
|
|
dom_exception exc;
|
|
|
|
|
|
|
|
#define CSS_LWC_STRING_INTERN(NAME) \
|
|
|
|
do { \
|
|
|
|
lerror = lwc_intern_string( \
|
|
|
|
(const char *)#NAME, \
|
|
|
|
sizeof(#NAME) - 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(abscenter);
|
|
|
|
CSS_LWC_STRING_INTERN(absmiddle);
|
|
|
|
CSS_LWC_STRING_INTERN(align);
|
|
|
|
CSS_LWC_STRING_INTERN(applet);
|
2012-07-23 02:28:45 +04:00
|
|
|
CSS_LWC_STRING_INTERN(base);
|
2012-07-22 18:48:55 +04:00
|
|
|
CSS_LWC_STRING_INTERN(baseline);
|
|
|
|
CSS_LWC_STRING_INTERN(body);
|
|
|
|
CSS_LWC_STRING_INTERN(bottom);
|
2012-07-22 21:01:10 +04:00
|
|
|
CSS_LWC_STRING_INTERN(button);
|
2012-07-22 18:48:55 +04:00
|
|
|
CSS_LWC_STRING_INTERN(caption);
|
|
|
|
CSS_LWC_STRING_INTERN(center);
|
2012-07-23 15:06:43 +04:00
|
|
|
CSS_LWC_STRING_INTERN(checkbox);
|
2012-07-22 23:52:34 +04:00
|
|
|
CSS_LWC_STRING_INTERN(circle);
|
2012-07-22 18:48:55 +04:00
|
|
|
CSS_LWC_STRING_INTERN(col);
|
2012-07-22 23:52:34 +04:00
|
|
|
CSS_LWC_STRING_INTERN(default);
|
2012-07-22 18:48:55 +04:00
|
|
|
CSS_LWC_STRING_INTERN(div);
|
|
|
|
CSS_LWC_STRING_INTERN(embed);
|
2012-07-23 15:06:43 +04:00
|
|
|
CSS_LWC_STRING_INTERN(file);
|
2012-07-22 18:48:55 +04:00
|
|
|
CSS_LWC_STRING_INTERN(font);
|
2012-07-26 18:57:33 +04:00
|
|
|
CSS_LWC_STRING_INTERN(frame);
|
|
|
|
CSS_LWC_STRING_INTERN(frameset);
|
2012-07-22 18:48:55 +04:00
|
|
|
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);
|
2012-07-23 02:28:45 +04:00
|
|
|
CSS_LWC_STRING_INTERN(head);
|
2012-07-23 15:06:43 +04:00
|
|
|
CSS_LWC_STRING_INTERN(hidden);
|
2012-07-22 18:48:55 +04:00
|
|
|
CSS_LWC_STRING_INTERN(hr);
|
2012-07-23 02:28:45 +04:00
|
|
|
CSS_LWC_STRING_INTERN(html);
|
2012-07-22 18:48:55 +04:00
|
|
|
CSS_LWC_STRING_INTERN(iframe);
|
2012-07-23 15:06:43 +04:00
|
|
|
CSS_LWC_STRING_INTERN(image);
|
2012-07-22 18:48:55 +04:00
|
|
|
CSS_LWC_STRING_INTERN(img);
|
|
|
|
CSS_LWC_STRING_INTERN(input);
|
|
|
|
CSS_LWC_STRING_INTERN(justify);
|
|
|
|
CSS_LWC_STRING_INTERN(left);
|
2012-07-23 02:28:45 +04:00
|
|
|
CSS_LWC_STRING_INTERN(link);
|
2012-07-26 17:49:27 +04:00
|
|
|
CSS_LWC_STRING_INTERN(meta);
|
2012-07-22 18:48:55 +04:00
|
|
|
CSS_LWC_STRING_INTERN(middle);
|
2012-07-26 18:57:33 +04:00
|
|
|
CSS_LWC_STRING_INTERN(no);
|
2012-07-26 17:49:27 +04:00
|
|
|
CSS_LWC_STRING_INTERN(noscript);
|
2012-07-22 18:48:55 +04:00
|
|
|
CSS_LWC_STRING_INTERN(object);
|
2012-07-26 18:57:33 +04:00
|
|
|
CSS_LWC_STRING_INTERN(optgroup);
|
2012-07-26 21:27:15 +04:00
|
|
|
CSS_LWC_STRING_INTERN(option);
|
2012-07-22 18:48:55 +04:00
|
|
|
CSS_LWC_STRING_INTERN(p);
|
2012-07-26 18:57:33 +04:00
|
|
|
CSS_LWC_STRING_INTERN(param);
|
2012-07-22 18:48:55 +04:00
|
|
|
CSS_LWC_STRING_INTERN(password);
|
2012-07-22 23:52:34 +04:00
|
|
|
CSS_LWC_STRING_INTERN(poly);
|
|
|
|
CSS_LWC_STRING_INTERN(polygon);
|
2012-07-23 15:06:43 +04:00
|
|
|
CSS_LWC_STRING_INTERN(post);
|
|
|
|
CSS_LWC_STRING_INTERN(radio);
|
2012-07-22 23:52:34 +04:00
|
|
|
CSS_LWC_STRING_INTERN(rect);
|
|
|
|
CSS_LWC_STRING_INTERN(rectangle);
|
2012-07-26 17:49:27 +04:00
|
|
|
CSS_LWC_STRING_INTERN(refresh);
|
2012-07-23 15:06:43 +04:00
|
|
|
CSS_LWC_STRING_INTERN(reset);
|
2012-07-22 18:48:55 +04:00
|
|
|
CSS_LWC_STRING_INTERN(right);
|
2012-07-26 18:57:33 +04:00
|
|
|
CSS_LWC_STRING_INTERN(src);
|
2012-07-26 17:49:27 +04:00
|
|
|
CSS_LWC_STRING_INTERN(style);
|
2012-07-23 15:06:43 +04:00
|
|
|
CSS_LWC_STRING_INTERN(submit);
|
2012-07-22 18:48:55 +04:00
|
|
|
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);
|
2012-07-23 15:06:43 +04:00
|
|
|
CSS_LWC_STRING_INTERN(title);
|
2012-07-22 18:48:55 +04:00
|
|
|
CSS_LWC_STRING_INTERN(top);
|
|
|
|
CSS_LWC_STRING_INTERN(tr);
|
2012-07-26 17:49:27 +04:00
|
|
|
CSS_LWC_STRING_INTERN(url);
|
2012-07-26 18:57:33 +04:00
|
|
|
CSS_LWC_STRING_INTERN(yes);
|
2012-07-23 02:28:45 +04:00
|
|
|
CSS_LWC_STRING_INTERN(_blank);
|
|
|
|
CSS_LWC_STRING_INTERN(_parent);
|
|
|
|
CSS_LWC_STRING_INTERN(_self);
|
|
|
|
CSS_LWC_STRING_INTERN(_top);
|
2012-07-22 18:48:55 +04:00
|
|
|
#undef CSS_LWC_STRING_INTERN
|
|
|
|
|
2012-07-26 18:57:33 +04:00
|
|
|
|
2012-07-23 15:06:43 +04:00
|
|
|
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))
|
2012-07-26 17:49:27 +04:00
|
|
|
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))
|
2012-07-23 15:06:43 +04:00
|
|
|
goto error;
|
|
|
|
|
|
|
|
|
2012-07-22 18:48:55 +04:00
|
|
|
#define CSS_DOM_STRING_INTERN(NAME) \
|
|
|
|
do { \
|
|
|
|
exc = dom_string_create_interned( \
|
|
|
|
(const uint8_t *)#NAME, \
|
|
|
|
sizeof(#NAME) - 1, \
|
|
|
|
&corestring_dom_##NAME ); \
|
|
|
|
if ((exc != DOM_NO_ERR) || \
|
|
|
|
(corestring_dom_##NAME == NULL)) { \
|
|
|
|
error = NSERROR_NOMEM; \
|
|
|
|
goto error; \
|
|
|
|
} \
|
|
|
|
} while(0)
|
|
|
|
|
2012-07-22 23:52:34 +04:00
|
|
|
CSS_DOM_STRING_INTERN(a);
|
2012-07-22 18:48:55 +04:00
|
|
|
CSS_DOM_STRING_INTERN(align);
|
2012-07-22 23:52:34 +04:00
|
|
|
CSS_DOM_STRING_INTERN(area);
|
2012-07-27 19:59:49 +04:00
|
|
|
CSS_DOM_STRING_INTERN(async);
|
2012-07-22 18:48:55 +04:00
|
|
|
CSS_DOM_STRING_INTERN(background);
|
|
|
|
CSS_DOM_STRING_INTERN(bgcolor);
|
|
|
|
CSS_DOM_STRING_INTERN(border);
|
|
|
|
CSS_DOM_STRING_INTERN(bordercolor);
|
|
|
|
CSS_DOM_STRING_INTERN(cellpadding);
|
|
|
|
CSS_DOM_STRING_INTERN(cellspacing);
|
|
|
|
CSS_DOM_STRING_INTERN(color);
|
|
|
|
CSS_DOM_STRING_INTERN(cols);
|
2012-07-23 02:28:45 +04:00
|
|
|
CSS_DOM_STRING_INTERN(content);
|
2012-07-22 23:52:34 +04:00
|
|
|
CSS_DOM_STRING_INTERN(coords);
|
2012-07-27 19:59:49 +04:00
|
|
|
CSS_DOM_STRING_INTERN(defer);
|
2012-07-22 18:48:55 +04:00
|
|
|
CSS_DOM_STRING_INTERN(height);
|
|
|
|
CSS_DOM_STRING_INTERN(href);
|
2012-07-23 02:28:45 +04:00
|
|
|
CSS_DOM_STRING_INTERN(hreflang);
|
2012-07-22 18:48:55 +04:00
|
|
|
CSS_DOM_STRING_INTERN(hspace);
|
2012-07-22 23:52:34 +04:00
|
|
|
CSS_DOM_STRING_INTERN(id);
|
2012-07-22 18:48:55 +04:00
|
|
|
CSS_DOM_STRING_INTERN(link);
|
2012-07-22 23:52:34 +04:00
|
|
|
CSS_DOM_STRING_INTERN(map);
|
2012-07-23 02:28:45 +04:00
|
|
|
CSS_DOM_STRING_INTERN(media);
|
2012-07-22 23:52:34 +04:00
|
|
|
CSS_DOM_STRING_INTERN(name);
|
|
|
|
CSS_DOM_STRING_INTERN(nohref);
|
|
|
|
CSS_DOM_STRING_INTERN(rect);
|
2012-07-23 02:28:45 +04:00
|
|
|
CSS_DOM_STRING_INTERN(rel);
|
2012-07-22 18:48:55 +04:00
|
|
|
CSS_DOM_STRING_INTERN(rows);
|
|
|
|
CSS_DOM_STRING_INTERN(size);
|
2012-07-23 02:28:45 +04:00
|
|
|
CSS_DOM_STRING_INTERN(sizes);
|
2012-07-22 23:52:34 +04:00
|
|
|
CSS_DOM_STRING_INTERN(shape);
|
2012-07-22 21:58:22 +04:00
|
|
|
CSS_DOM_STRING_INTERN(src);
|
2012-07-22 23:52:34 +04:00
|
|
|
CSS_DOM_STRING_INTERN(target);
|
2012-07-22 18:48:55 +04:00
|
|
|
CSS_DOM_STRING_INTERN(text);
|
|
|
|
CSS_DOM_STRING_INTERN(type);
|
|
|
|
CSS_DOM_STRING_INTERN(valign);
|
|
|
|
CSS_DOM_STRING_INTERN(vlink);
|
|
|
|
CSS_DOM_STRING_INTERN(vspace);
|
|
|
|
CSS_DOM_STRING_INTERN(width);
|
|
|
|
#undef CSS_DOM_STRING_INTERN
|
|
|
|
|
2012-07-22 23:52:34 +04:00
|
|
|
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))
|
|
|
|
goto error;
|
|
|
|
|
2012-07-23 02:28:45 +04:00
|
|
|
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))
|
|
|
|
goto error;
|
|
|
|
|
2012-07-22 18:48:55 +04:00
|
|
|
return NSERROR_OK;
|
|
|
|
|
|
|
|
error:
|
|
|
|
corestrings_fini();
|
|
|
|
|
|
|
|
return error;
|
|
|
|
}
|