path: root/include
diff options
authorJohn Mark Bell <>2008-11-27 12:14:07 +0000
committerJohn Mark Bell <>2008-11-27 12:14:07 +0000
commit7adaf92154adc7f3455769ca197f906e3d4cddaa (patch)
treeae172720c8e44a35b87b5506602768db19ec538f /include
parent79c0f3bc5c1581a6f2f6568a50e3b4f64b452541 (diff)
css_string is now the same as a parserutils_dict_entry. This allows us to use dict entries directly as strings.
iChange the way in which selectors are represented. This significantly reduces memory requirements -- reducing the approximate usage count (excludes the string dictionary, which is about 360k) of allzengarden.css from 4,535,400 bytes to 2,414,312 bytes on a 64bit platform. The string dictionary is now created and owned by the stylesheet object. The parser is just given access to this so that it can store strings in it. svn path=/trunk/libcss/; revision=5809
Diffstat (limited to 'include')
1 files changed, 6 insertions, 4 deletions
diff --git a/include/libcss/types.h b/include/libcss/types.h
index 4cb8fbc..7bce679 100644
--- a/include/libcss/types.h
+++ b/include/libcss/types.h
@@ -12,6 +12,8 @@
#include <stdint.h>
#include <stdlib.h>
+#include <parserutils/utils/dict.h>
/** Source of charset information, in order of importance
* A client-dictated charset will override all others.
* A document-specified charset will override autodetection or the default */
@@ -53,11 +55,11 @@ typedef enum css_origin {
* String type
+ *
+ * \todo It might be better to define parserutils_string, and use that.
+ * (where parserutils_string is identical to parserutils_dict_entry)
-typedef struct css_string {
- uint8_t *ptr; /**< Pointer to data */
- size_t len; /**< Byte length of string */
-} css_string;
+typedef parserutils_dict_entry css_string;
typedef struct css_stylesheet css_stylesheet;