aboutsummaryrefslogtreecommitdiff
path: root/src/html.hh
diff options
context:
space:
mode:
authorRodrigo Arias Mallo <rodarima@gmail.com>2024-06-07 22:44:49 +0200
committerRodrigo Arias Mallo <rodarima@gmail.com>2024-06-07 22:44:49 +0200
commit586e6deefd4c8bcf7f904246a68063c1199865a1 (patch)
tree3daa9f8479a052211f4cba17d28182a7e648c385 /src/html.hh
parent09b83d718a1edaa10d6947dcba5e4093637a88b8 (diff)
Ensure the same number of tags for CSS and HTML
The Tags array can be modified without changing the "ntags" number in the CSS side. To prevent errors, an static assert ensures the same number is used in both sides, which is known at compilation time. Fixes: https://github.com/dillo-browser/dillo/issues/184
Diffstat (limited to 'src/html.hh')
-rw-r--r--src/html.hh16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/html.hh b/src/html.hh
index 5b18c1a8..ef1187ff 100644
--- a/src/html.hh
+++ b/src/html.hh
@@ -1,3 +1,15 @@
+/*
+ * File: html.hh
+ *
+ * Copyright (C) 2005-2009 Jorge Arellano Cid <jcid@dillo.org>
+ * Copyright (C) 2024 Rodrigo Arias Mallo <rodarima@gmail.com>
+ *
+ * This program 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; either version 3 of the License, or
+ * (at your option) any later version.
+ */
+
#ifndef __HTML_HH__
#define __HTML_HH__
@@ -7,6 +19,10 @@
extern "C" {
#endif /* __cplusplus */
+/* Keep in sync with the length of the Tags array. It is protected by an
+ * static assert in html.cc to prevent errors) */
+#define HTML_NTAGS 93
+
/*
* Exported functions
*/