Yep - see other similar code in GLib or GTK+.