-/* Stylespecs are of the from attr1-attr2-etc. We require that each attr in
- * 'spec' matches the one at same index in 'attrib' when '*' matches anything.
- * The score increment for exact match is 2*3^index and 1*3^index for '*'
- * match. If all elements of 'spec' match those of 'attrib' exactly, the
- * accumulated score is returned. Otherwise the matching fails and zero is
- * returned. For example:
- *
- * spec attrib score
- * foo-*-baz foo-bar-baz 2+1*3+2*3^2 = 23
- * foo-bar foo-bar-baz 2+2*3 = 8
- * foo-baz foo-bar-baz 0
- *
- * gr_stylespec_score2 continues matching from attrib_p2 (if not NULL) when
- * it has reached end of attrib.
- */
-extern uint gr_stylespec_score(const char *spec, const char *attrib);
-extern uint gr_stylespec_score2(const char *spec, const char *attrib,
- const char *attrib_p2);
+ /* Every star ('*') element of 'spec' increases score by one.
+ * Every other element of 'spec' found in 'attr' increases the score by the
+ * number set in attr times two. Any element of 'spec' (other than star),
+ * not found in 'attr', forces score to zero.
+ */
+extern uint gr_stylespec_score(const GrStyleSpec *spec, const GrStyleSpec *attr);
+extern uint gr_stylespec_score2(const GrStyleSpec *spec, const GrStyleSpec *attr,
+ const GrStyleSpec *attr2);
+
+extern void gr_stylespec_init(GrStyleSpec *spec);
+extern bool gr_stylespec_set(GrStyleSpec *spec, GrAttr a);
+extern bool gr_stylespec_isset(const GrStyleSpec *spec, GrAttr a);
+extern void gr_stylespec_unset(GrStyleSpec *spec, GrAttr a);
+extern bool gr_stylespec_add(GrStyleSpec *spec, GrAttr a, uint score);
+extern bool gr_stylespec_append(GrStyleSpec *dst, const GrStyleSpec *src);
+extern void gr_stylespec_unalloc(GrStyleSpec *spec);
+extern bool gr_stylespec_equals(const GrStyleSpec *s1, const GrStyleSpec *s2);
+extern bool gr_stylespec_load(GrStyleSpec *spec, const char *str);
+extern bool gr_stylespec_load_(GrStyleSpec *spec, const char *str,
+ bool no_order_score);