GNOME Bugzilla – Bug 301171
Adding Glib::KeyFile
Last modified: 2005-04-26 23:01:56 UTC
Perl bindings for the GKeyFile object
Created attachment 45435 [details] [review] Glib::KeyFile glue code The glue code for Glib::KeyFile, with the remarks from Torsten fro conditional compilation.
Created attachment 45436 [details] Glib::KeyFile XS code Glib::KeyFile XS, with *_list variants implemented, and muppet's remarks on string freeing
Created attachment 45437 [details] Glib::KeyFile test suite Glib::KeyFile test suite for use with make test
In get_keys() and get_groups(), you return a list of strings, or undef if the C function returns no strings. in perl that means that whether the function returned anything or not, @return > 0. to check if there are keys, i have to explicitly check defined($ret[0]). it would be easier to use (and code) if it returned an empty list instead of undef. in the set_boolean case of set_boolean, you want SvTRUE rather than SvIV -- this will allow you to handle undef without warnings at runtime. similarly, get_boolean should use boolSV for the new boolean output value instead of newSViv. (yeah, 0 is false, but that's not perl's boolean false -- that's ''.) the same goes for the [sg]et_boolean_list ones.
Created attachment 45491 [details] Glib::KeyFile XS code New XS file, implementing muppet's remarks
Created attachment 45492 [details] Glib::KeyFile test suite New test suite, with a check for initial group state.
I'm happy with the xs file now, but the test file looks a bit lean for as many functions as the xs file creates. ;-)
Created attachment 45515 [details] Glib::KeyFile test suite Here's the latest test suite. It will skip the tests if we are not using a Glib >= 2.6.0.
If it's okay, I could commit it by tomorrow, in order to be included in the next release of the 1.09x series.
Everything looks fine to me. Just a minor nag: the copyright disclaimer in the XS file says 2003-2005.
Committed the latest patch