[lasem] dom: move entity declaration from mathml to dom.
- From: Emmanuel Pacaud <emmanuel src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [lasem] dom: move entity declaration from mathml to dom.
- Date: Tue, 12 Jun 2012 11:33:13 +0000 (UTC)
commit 8f23ca445a46226000086cb4638c280e533346b7
Author: Emmanuel Pacaud <emmanuel gnome org>
Date: Tue Jun 12 13:32:46 2012 +0200
dom: move entity declaration from mathml to dom.
docs/reference/lasem/Makefile.am | 1 -
docs/reference/lasem/lasem-sections.txt | 1 +
src/Makefile.am | 4 ++--
src/lsmdom.h | 1 +
...smmathmlentitydictionary.c => lsmdomentities.c} | 18 +++++++++---------
...smmathmlentitydictionary.h => lsmdomentities.h} | 6 +++---
src/lsmdomparser.c | 4 ++--
src/lsmmathml.h | 1 -
src/lsmmathmloperatordictionary.c | 4 ++--
9 files changed, 20 insertions(+), 20 deletions(-)
---
diff --git a/docs/reference/lasem/Makefile.am b/docs/reference/lasem/Makefile.am
index 8dacf0e..3a1ba30 100644
--- a/docs/reference/lasem/Makefile.am
+++ b/docs/reference/lasem/Makefile.am
@@ -77,7 +77,6 @@ IGNORE_HFILES=\
lsmmathmlenums.h \
lsmmathmltraits.h \
lsmmathmlattributes.h \
- lsmmathmlentitydictionary.h \
lsmmathmloperatordictionary.h \
lsmmathmldocument.h \
lsmmathmlelement.h \
diff --git a/docs/reference/lasem/lasem-sections.txt b/docs/reference/lasem/lasem-sections.txt
index 2ec4d7d..9479ae4 100644
--- a/docs/reference/lasem/lasem-sections.txt
+++ b/docs/reference/lasem/lasem-sections.txt
@@ -113,6 +113,7 @@ lsm_dom_document_get_url
lsm_dom_document_set_url
lsm_dom_document_set_path
lsm_dom_document_get_href_data
+lsm_dom_get_entity
<SUBSECTION Standard>
LsmDomDocumentClass
LSM_DOM_DOCUMENT
diff --git a/src/Makefile.am b/src/Makefile.am
index bcce241..de94a8d 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -37,6 +37,7 @@ LASEM_DOM_SRCS = \
lsmattributes.c \
lsmcairo.c \
lsmdomenumtypes.c \
+ lsmdomentities.c \
lsmdomnode.c \
lsmdomnodelist.c \
lsmdomnamednodemap.c \
@@ -54,7 +55,6 @@ LASEM_MATHML_SRCS = \
lsmmathmlenums.c \
lsmmathmltraits.c \
lsmmathmlattributes.c \
- lsmmathmlentitydictionary.c \
lsmmathmloperatordictionary.c \
lsmmathmldocument.c \
lsmmathmlelement.c \
@@ -135,6 +135,7 @@ LASEM_DOM_HDRS = \
lsmtraits.h \
lsmproperties.h \
lsmattributes.h \
+ lsmdomentities.h \
lsmdom.h \
lsmdomtypes.h \
lsmdomnode.h \
@@ -155,7 +156,6 @@ LASEM_MATHML_HDRS = \
lsmmathmlenums.h \
lsmmathmltraits.h \
lsmmathmlattributes.h \
- lsmmathmlentitydictionary.h \
lsmmathmloperatordictionary.h \
lsmmathmldocument.h \
lsmmathmlelement.h \
diff --git a/src/lsmdom.h b/src/lsmdom.h
index 71c7515..382cce2 100644
--- a/src/lsmdom.h
+++ b/src/lsmdom.h
@@ -28,6 +28,7 @@
#include <lsmdomtypes.h>
+#include <lsmdomentities.h>
#include <lsmdomnode.h>
#include <lsmdomnodelist.h>
#include <lsmdomdocument.h>
diff --git a/src/lsmmathmlentitydictionary.c b/src/lsmdomentities.c
similarity index 99%
rename from src/lsmmathmlentitydictionary.c
rename to src/lsmdomentities.c
index af94295..1c05a87 100644
--- a/src/lsmmathmlentitydictionary.c
+++ b/src/lsmdomentities.c
@@ -1,6 +1,6 @@
/* Lasem
*
- * Copyright  2007-2008 Emmanuel Pacaud
+ * Copyright  2007-2012 Emmanuel Pacaud
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -21,14 +21,14 @@
* Emmanuel Pacaud <emmanuel gnome org>
*/
-#include <lsmmathmlentitydictionary.h>
+#include <lsmdomentities.h>
#include <glib.h>
#include <stdio.h>
static const struct {
const char *name;
const char *utf8;
-} lsm_mathml_entities[] = {
+} lsm_dom_entities[] = {
{"AElig", "\xc3\x86" }, /* Ã [LATIN CAPITAL LETTER AE]*/
{"Aacute", "\xc3\x81" }, /* Ã [LATIN CAPITAL LETTER A WITH ACUTE]*/
{"Abreve", "\xc4\x82" }, /* Ä [LATIN CAPITAL LETTER A WITH BREVE]*/
@@ -2123,7 +2123,7 @@ static const struct {
};
static GHashTable *
-lsm_mathml_get_entity_dictionary (void)
+lsm_dom_get_entities (void)
{
static GHashTable *entity_hash = NULL;
int i;
@@ -2133,20 +2133,20 @@ lsm_mathml_get_entity_dictionary (void)
entity_hash = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, NULL);
- for (i = 0; i < G_N_ELEMENTS (lsm_mathml_entities); i++)
+ for (i = 0; i < G_N_ELEMENTS (lsm_dom_entities); i++)
g_hash_table_insert (entity_hash,
- (char *) lsm_mathml_entities[i].name,
- (char *) lsm_mathml_entities[i].utf8);
+ (char *) lsm_dom_entities[i].name,
+ (char *) lsm_dom_entities[i].utf8);
return entity_hash;
}
const char *
-lsm_mathml_entity_get_utf8 (const char *name)
+lsm_dom_get_entity (const char *name)
{
const char *utf8;
- utf8 = g_hash_table_lookup (lsm_mathml_get_entity_dictionary (), name);
+ utf8 = g_hash_table_lookup (lsm_dom_get_entities (), name);
if (utf8 == NULL)
return name;
diff --git a/src/lsmmathmlentitydictionary.h b/src/lsmdomentities.h
similarity index 87%
rename from src/lsmmathmlentitydictionary.h
rename to src/lsmdomentities.h
index 04b0e6b..f5a73a5 100644
--- a/src/lsmmathmlentitydictionary.h
+++ b/src/lsmdomentities.h
@@ -1,6 +1,6 @@
/* Lasem
*
- * Copyright  2007-2008 Emmanuel Pacaud
+ * Copyright  2007-2012 Emmanuel Pacaud
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -24,11 +24,11 @@
#ifndef LSM_MATHML_ENTITY_DICTIONARY_H
#define LSM_MATHML_ENTITY_DICTIONARY_H
-#include <lsmmathmltypes.h>
+#include <lsmdomtypes.h>
G_BEGIN_DECLS
-const char *lsm_mathml_entity_get_utf8 (const char *name);
+const char *lsm_dom_get_entity (const char *name);
G_END_DECLS
diff --git a/src/lsmdomparser.c b/src/lsmdomparser.c
index e35a849..d8a8f35 100644
--- a/src/lsmdomparser.c
+++ b/src/lsmdomparser.c
@@ -24,7 +24,7 @@
#include <lsmdebug.h>
#include <lsmdomimplementation.h>
#include <lsmdomnode.h>
-#include <lsmmathmlentitydictionary.h>
+#include <lsmdomentities.h>
#include <lsmsvgtextelement.h>
#include <lsmstr.h>
#include <libxml/parser.h>
@@ -168,7 +168,7 @@ lsm_dom_parser_get_entity (void *user_data, const xmlChar *name)
if (entity != NULL)
return entity;
- utf8 = lsm_mathml_entity_get_utf8 ((char *) name);
+ utf8 = lsm_dom_get_entity ((char *) name);
if (utf8 != NULL) {
entity = xmlNewEntity (NULL, name, XML_INTERNAL_GENERAL_ENTITY, NULL, NULL, (xmlChar *) utf8);
diff --git a/src/lsmmathml.h b/src/lsmmathml.h
index 5a3cd82..1a8ff92 100644
--- a/src/lsmmathml.h
+++ b/src/lsmmathml.h
@@ -31,7 +31,6 @@
#include <lsmmathmlenums.h>
#include <lsmmathmltraits.h>
#include <lsmmathmlattributes.h>
-#include <lsmmathmlentitydictionary.h>
#include <lsmmathmloperatordictionary.h>
#include <lsmmathmldocument.h>
#include <lsmmathmlelement.h>
diff --git a/src/lsmmathmloperatordictionary.c b/src/lsmmathmloperatordictionary.c
index f053886..bdbd9a6 100644
--- a/src/lsmmathmloperatordictionary.c
+++ b/src/lsmmathmloperatordictionary.c
@@ -22,7 +22,7 @@
*/
#include <lsmmathmloperatordictionary.h>
-#include <lsmmathmlentitydictionary.h>
+#include <lsmdomentities.h>
#include <stdio.h>
/* Automatically generated using a slightly modified version of gnumerator parser */
@@ -3227,7 +3227,7 @@ _get_operator_dictionary (void)
operator_hash = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
for (i = 0; i < G_N_ELEMENTS (lsm_mathml_operator_entries); i++) {
- utf8 = lsm_mathml_entity_get_utf8 (lsm_mathml_operator_entries[i].name);
+ utf8 = lsm_dom_get_entity (lsm_mathml_operator_entries[i].name);
switch (lsm_mathml_operator_entries[i].form) {
case LSM_MATHML_FORM_PREFIX:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]