]> 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, 20 Nov 2023 16:42:26 +0000 (11:42 -0500)
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 0a69edd2172f413bb3bd3a546fc711e70683384d..502d02c881ab26cd2d5e0e2f9e03a603bd46fc87 100644 (file)
@@ -56,5 +56,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