From 4742f2cef1d4a253d2d21ccb70c5799ee6a4c992 Mon Sep 17 00:00:00 2001 From: Sven Neumann Date: Sat, 22 Nov 2008 12:37:57 +0000 Subject: [PATCH] removed obsolete section about gserialize. 2008-11-22 Sven Neumann * parasites.txt: removed obsolete section about gserialize. svn path=/trunk/; revision=27708 --- devel-docs/ChangeLog | 4 ++++ devel-docs/parasites.txt | 39 --------------------------------------- 2 files changed, 4 insertions(+), 39 deletions(-) diff --git a/devel-docs/ChangeLog b/devel-docs/ChangeLog index 3a98bc1e0f..fe73088510 100644 --- a/devel-docs/ChangeLog +++ b/devel-docs/ChangeLog @@ -1,3 +1,7 @@ +2008-11-22 Sven Neumann + + * parasites.txt: removed obsolete section about gserialize. + 2008-09-29 Sven Neumann * release-howto.txt: there's no need to fiddle with diff --git a/devel-docs/parasites.txt b/devel-docs/parasites.txt index b6237edbae..93e2eb5f51 100644 --- a/devel-docs/parasites.txt +++ b/devel-docs/parasites.txt @@ -272,42 +272,3 @@ non-persistant data might be fine as well): the size of the string representation of your data, you can use gimp_config_serialize_to_string() and other functions to easily convert your data to/from a character string. - -- Obsolete: Use the libgimp serialize functions - - NOTE: libgimp/gserialize.[ch] has been excluded from the build since - gimp-1.2. This decision was made since noone seemed to use it so - far. The files can still be pulled out of SVN, so if you decide - to use them, you will have to include a copy into your plugin - source or resurrect the functionality in libgimp. - - Look at the stuff in libgimp/gserialize.h. These functions allow for - relatively easy serializing/deserializing of structs. The advantages - are that the gimp-developers have already taken care of endian-ness - issues and other hazzles. The drawback is that you might encounter - problems when you want to extend your structures later, as you have to - be prepared for images saved with parasites form a very old version of - your plug-in, and the gserialize functions do not handle different data - formats nicely itself. - - One way out around this is to prefix your data with a version identifier - (remember to use a guchar, i.e. something without endian-ness problems). - Remember to skip it before deserializing. - - Another very easy way is to add a version tag to your parasite name, - i.e. "foo-bar-v1", "foo-bar-v2". Your plug-in could then check for older - versions and act accordingly and/or attach the new parasite or both the - new and the old version of your data. - - The gserialize stuff also makes it possible to just append more fields - (i.e. more gserialized structs) to your data. You could check the length - of the parasite data ("anything left?") to decide wether to decode more - fields. Here's some example: - - data = parasite_data(p); - size = parasite_data_size(p); - length = gdeserialize(...); - tlength += length; - data += length; - if (tlength != size) - gdeserialize the next one, etc.