hook gvariant vectors up to kdbus
[platform/upstream/glib.git] / gobject / gboxed.c
index b5c6029..ab41951 100644 (file)
@@ -12,9 +12,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General
- * Public License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
- * Boston, MA 02111-1307, USA.
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
  */
 
 #include "config.h"
@@ -77,6 +75,15 @@ value_free (GValue *value)
   g_free (value);
 }
 
+static GPollFD *
+pollfd_copy (GPollFD *src)
+{
+  GPollFD *dest = g_new0 (GPollFD, 1);
+  /* just a couple of integers */
+  memcpy (dest, src, sizeof (GPollFD));
+  return dest;
+}
+
 void
 _g_boxed_type_init (void)
 {
@@ -140,16 +147,23 @@ G_DEFINE_BOXED_TYPE (GVariantType, g_variant_type, g_variant_type_copy, g_varian
 #undef g_variant_type_get_type
 
 G_DEFINE_BOXED_TYPE (GVariantBuilder, g_variant_builder, g_variant_builder_ref, g_variant_builder_unref)
+G_DEFINE_BOXED_TYPE (GVariantDict, g_variant_dict, g_variant_dict_ref, g_variant_dict_unref)
 
 G_DEFINE_BOXED_TYPE (GError, g_error, g_error_copy, g_error_free)
 
 G_DEFINE_BOXED_TYPE (GDateTime, g_date_time, g_date_time_ref, g_date_time_unref);
 G_DEFINE_BOXED_TYPE (GTimeZone, g_time_zone, g_time_zone_ref, g_time_zone_unref);
 G_DEFINE_BOXED_TYPE (GKeyFile, g_key_file, g_key_file_ref, g_key_file_unref)
+G_DEFINE_BOXED_TYPE (GMappedFile, g_mapped_file, g_mapped_file_ref, g_mapped_file_unref)
 
 G_DEFINE_BOXED_TYPE (GMainLoop, g_main_loop, g_main_loop_ref, g_main_loop_unref)
 G_DEFINE_BOXED_TYPE (GMainContext, g_main_context, g_main_context_ref, g_main_context_unref)
 G_DEFINE_BOXED_TYPE (GSource, g_source, g_source_ref, g_source_unref)
+G_DEFINE_BOXED_TYPE (GPollFD, g_pollfd, pollfd_copy, g_free)
+G_DEFINE_BOXED_TYPE (GMarkupParseContext, g_markup_parse_context, g_markup_parse_context_ref, g_markup_parse_context_unref)
+
+G_DEFINE_BOXED_TYPE (GThread, g_thread, g_thread_ref, g_thread_unref)
+G_DEFINE_BOXED_TYPE (GChecksum, g_checksum, g_checksum_copy, g_checksum_free)
 
 /* This one can't use G_DEFINE_BOXED_TYPE (GStrv, g_strv, g_strdupv, g_strfreev) */
 GType
@@ -242,7 +256,7 @@ boxed_proxy_lcopy_value (const GValue *value,
   gpointer *boxed_p = collect_values[0].v_pointer;
 
   if (!boxed_p)
-    return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
+    return g_strdup_printf ("value location for '%s' passed as NULL", G_VALUE_TYPE_NAME (value));
 
   if (!value->data[0].v_pointer)
     *boxed_p = NULL;
@@ -316,7 +330,7 @@ g_boxed_type_register_static (const gchar   *name,
  * 
  * Provide a copy of a boxed structure @src_boxed which is of type @boxed_type.
  * 
- * Returns: The newly created copy of the boxed structure.
+ * Returns: (transfer full): The newly created copy of the boxed structure.
  */
 gpointer
 g_boxed_copy (GType         boxed_type,
@@ -361,7 +375,7 @@ g_boxed_copy (GType         boxed_type,
 
       /* double check and grouse if things went wrong */
       if (dest_value.data[1].v_ulong)
-       g_warning ("the copy_value() implementation of type `%s' seems to make use of reserved GValue fields",
+       g_warning ("the copy_value() implementation of type '%s' seems to make use of reserved GValue fields",
                   g_type_name (boxed_type));
 
       dest_boxed = dest_value.data[0].v_pointer;