summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile4
-rw-r--r--src/CMakeLists.txt1
-rw-r--r--src/entities.inc (renamed from src/entities.h)15
-rw-r--r--src/houdini_html_u.c2
-rw-r--r--tools/make_entities_inc.py (renamed from tools/make_entities_h.py)19
5 files changed, 7 insertions, 34 deletions
diff --git a/Makefile b/Makefile
index 10d4e98..d1dc9ae 100644
--- a/Makefile
+++ b/Makefile
@@ -111,9 +111,9 @@ $(SRCDIR)/scanners.c: $(SRCDIR)/scanners.re
esac
re2c --case-insensitive -b -i --no-generation-date -o $@ $<
-# We include entities.h in the repository, so normally this
+# We include entities.inc in the repository, so normally this
# doesn't need to be regenerated:
-$(SRCDIR)/entities.h: tools/make_entities_h.py
+$(SRCDIR)/entities.inc: tools/make_entities_inc.py
python3 $< > $@
update-spec:
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 06de9ef..37a46d3 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -16,7 +16,6 @@ set(HEADERS
inlines.h
houdini.h
cmark_ctype.h
- entities.h
)
set(LIBRARY_SOURCES
cmark.c
diff --git a/src/entities.h b/src/entities.inc
index 765f1b8..ec3d2a9 100644
--- a/src/entities.h
+++ b/src/entities.inc
@@ -1,9 +1,4 @@
-#ifndef CMARK_ENTITIES_H
-#define CMARK_ENTITIES_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
+/* Autogenerated by tools/make_headers_inc.py */
struct cmark_entity_node {
unsigned char *entity;
@@ -2141,11 +2136,3 @@ static const struct cmark_entity_node cmark_entities[] = {
{(unsigned char*)"zwj", {226, 128, 141, 0}},
{(unsigned char*)"zwnj", {226, 128, 140, 0}},
};
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-
diff --git a/src/houdini_html_u.c b/src/houdini_html_u.c
index e4cf8fe..002357d 100644
--- a/src/houdini_html_u.c
+++ b/src/houdini_html_u.c
@@ -5,7 +5,7 @@
#include "buffer.h"
#include "houdini.h"
#include "utf8.h"
-#include "entities.h"
+#include "entities.inc"
/* Binary tree lookup code for entities added by JGM */
diff --git a/tools/make_entities_h.py b/tools/make_entities_inc.py
index 48492c7..7ed307b 100644
--- a/tools/make_entities_h.py
+++ b/tools/make_entities_inc.py
@@ -1,6 +1,6 @@
# Creates C data structures for binary lookup table of entities,
# using python's html5 entity data.
-# Usage: python3 tools/make_entities_h.py > src/entities.h
+# Usage: python3 tools/make_entities_inc.py > src/entities.inc
import html
@@ -12,12 +12,7 @@ entities5 = html.entities.html5
entities = sorted([(k[:-1], entities5[k].encode('utf-8')) for k in entities5.keys() if k[-1] == ';'])
# Print out the header:
-print("""#ifndef CMARK_ENTITIES_H
-#define CMARK_ENTITIES_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
+print("""/* Autogenerated by tools/make_headers_inc.py */
struct cmark_entity_node {
unsigned char *entity;
@@ -34,12 +29,4 @@ print("\nstatic const struct cmark_entity_node cmark_entities[] = {");
for (ent, bs) in entities:
print('{(unsigned char*)"' + ent + '", {' + ', '.join(map(str, bs)) + ', 0}},')
-print("};\n");
-
-print("""
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-""")
+print("};")