]> gitweb.michael.orlitzky.com - libsvgtiny.git/commitdiff
src/svgtiny_strings.h: intern a "userdata" key string
authorMichael Orlitzky <michael@orlitzky.com>
Tue, 17 Oct 2023 14:22:35 +0000 (10:22 -0400)
committerMichael Orlitzky <michael@orlitzky.com>
Mon, 9 Jun 2025 01:13:06 +0000 (21:13 -0400)
To implement libcss's select handler API, we need to implement two
functions that get/set "userdata" on a node. The corresponding libdom
API allows you to set arbitrary data in the form of key->value pairs;
so to identify THIS particular data, we need to use the same string
each time. For that reason we intern "_libcss_user_data" and call it
the "userdata_key".

src/svgtiny_strings.h

index 1dc3bcad0786d169c0863e40a6631f99cf86a7db..c77dc59481f158fb9061bb3c551808b270457e4d 100644 (file)
@@ -57,5 +57,6 @@ SVGTINY_STRING_ACTION2(stop_color,stop-color)
 SVGTINY_STRING_ACTION2(zero_percent,0%)
 SVGTINY_STRING_ACTION2(hundred_percent,100%)
 SVGTINY_STRING_ACTION2(universal,*)
+SVGTINY_STRING_ACTION2(userdata_key,_libcss_user_data)
 
 #undef SVGTINY_STRING_ACTION