[glib/gsettings] relicense code, strictly follow glib header style
- From: Ryan Lortie <ryanl src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [glib/gsettings] relicense code, strictly follow glib header style
- Date: Wed, 9 Sep 2009 21:25:38 +0000 (UTC)
commit c24345eeee144b2fc31069f43b819e071108a788
Author: Ryan Lortie <desrt desrt ca>
Date: Wed Sep 9 17:23:05 2009 -0400
relicense code, strictly follow glib header style
also, merge gvariant-loadstore.h into gvariant.h
no functional changes here
glib/Makefile.am | 1 -
glib/glib.h | 1 -
glib/glib.symbols | 53 +++++++---------
glib/gvariant-core.c | 19 ++++--
glib/gvariant-loadstore.h | 50 ---------------
glib/gvariant-markup.c | 21 +++++--
glib/gvariant-parser.c | 19 ++++--
glib/gvariant-printer.c | 20 ++++--
glib/gvariant-private.h | 31 ++++++---
glib/gvariant-serialiser.c | 19 ++++--
glib/gvariant-serialiser.h | 23 +++++--
glib/gvariant-util.c | 21 +++++--
glib/gvariant-valist.c | 21 +++++--
glib/gvariant.h | 151 ++++++++++++++++++++++++++++----------------
glib/gvarianttype.c | 21 +++++--
glib/gvarianttype.h | 52 +++++++++------
glib/gvarianttypeinfo.c | 19 ++++--
glib/gvarianttypeinfo.h | 35 +++++++----
18 files changed, 337 insertions(+), 240 deletions(-)
---
diff --git a/glib/Makefile.am b/glib/Makefile.am
index 52be679..af18b0d 100644
--- a/glib/Makefile.am
+++ b/glib/Makefile.am
@@ -254,7 +254,6 @@ glibsubinclude_HEADERS = \
gurifuncs.h \
gutils.h \
gvarianttype.h \
- gvariant-loadstore.h \
gvariant.h \
gwin32.h \
gprintf.h
diff --git a/glib/glib.h b/glib/glib.h
index f7f9a9d..dd0784d 100644
--- a/glib/glib.h
+++ b/glib/glib.h
@@ -86,7 +86,6 @@
#include <glib/gurifuncs.h>
#include <glib/gutils.h>
#include <glib/gvarianttype.h>
-#include <glib/gvariant-loadstore.h>
#include <glib/gvariant.h>
#ifdef G_PLATFORM_WIN32
#include <glib/gwin32.h>
diff --git a/glib/glib.symbols b/glib/glib.symbols
index 5ce3b40..a565b4c 100644
--- a/glib/glib.symbols
+++ b/glib/glib.symbols
@@ -1643,8 +1643,14 @@ g_match_info_fetch_all
#endif
#endif
-#if IN_HEADER(_gvariant_h_)
-#if IN_FILE(_gvariant_core_c_)
+#if IN_HEADER(__G_VARIANT_H__)
+#if IN_FILE(__G_VARIANT_CORE_C__)
+g_variant_load
+g_variant_from_slice
+g_variant_from_data
+g_variant_store
+g_variant_get_data
+g_variant_get_size
g_variant_ref
g_variant_ref_sink
g_variant_unref
@@ -1655,7 +1661,8 @@ g_variant_n_children
g_variant_get_type
#endif
-#if IN_FILE(_gvariant_util_c_)
+#if IN_FILE(__G_VARIANT_UTIL_C__)
+g_variant_from_file
g_variant_flatten
g_variant_get_type_class
g_variant_get_type_string
@@ -1707,18 +1714,18 @@ g_variant_builder_cancel
g_variant_lookup_value
#endif
-#if IN_FILE(_gvariant_parser_c_)
+#if IN_FILE(__G_VARIANT_PARSER_C__)
g_variant_parse
g_variant_parsef
g_variant_parsef_va
#endif
-#if IN_FILE(_gvariant_printer_c_)
+#if IN_FILE(__G_VARIANT_PRINTER_C__)
g_variant_print
g_variant_print_string
#endif
-#if IN_FILE(_gvariant_markup_c_)
+#if IN_FILE(__G_VARIANT_MARKUP_C__)
g_variant_markup_print
g_variant_markup_print_string
g_variant_markup_subparser_start
@@ -1728,7 +1735,7 @@ g_variant_markup_parse_context_end
g_variant_markup_parse
#endif
-#if IN_FILE(_gvariant_valist_c_)
+#if IN_FILE(__G_VARIANT_VALIST_C__)
g_variant_iter_next
g_variant_builder_add
g_variant_new
@@ -1741,8 +1748,8 @@ g_variant_lookup
#endif
#endif
-#if IN_HEADER(_gvarianttype_h_)
-#if IN_FILE(_gvarianttype_c_)
+#if IN_HEADER(__G_VARIANT_TYPE_H__)
+#if IN_FILE(__G_VARIANT_TYPE_C__)
g_variant_type_string_is_valid
g_variant_type_string_scan
g_variant_type_free
@@ -1775,8 +1782,8 @@ g_variant_type_check_string_
#endif
#endif
-#if IN_HEADER(_gvarianttypeinfo_h_)
-#if IN_FILE(_gvarianttypeinfo_c_)
+#if IN_HEADER(__G_VARIANT_TYPE_INFO_H__)
+#if IN_FILE(__G_VARIANT_TYPE_INFO_C__)
g_variant_type_info_get_type
g_variant_type_info_get_type_class
g_variant_type_info_get_string
@@ -1791,8 +1798,8 @@ g_variant_type_info_unref
#endif
#endif
-#if IN_HEADER(_gvariant_serialiser_h_)
-#if IN_FILE(_gvariant_serialiser_c_)
+#if IN_HEADER(__G_VARIANT_SERIALISER_H__)
+#if IN_FILE(__G_VARIANT_SERIALISER_C__)
g_variant_serialised_n_children
g_variant_serialised_get_child
g_variant_serialiser_needed_size
@@ -1803,22 +1810,8 @@ g_variant_serialised_byteswap
#endif
#endif
-#if IN_HEADER(_gvariant_loadstore_h_)
-#if IN_FILE(_gvariant_core_c_)
-g_variant_load
-g_variant_from_slice
-g_variant_from_data
-g_variant_store
-g_variant_get_data
-g_variant_get_size
-#endif
-#if IN_FILE(_gvariant_util_c_)
-g_variant_from_file
-#endif
-#endif
-
-#if IN_HEADER(_gvariant_private_h_)
-#if IN_FILE(_gvariant_core_c_)
+#if IN_HEADER(__G_VARIANT_PRIVATE_H__)
+#if IN_FILE(__G_VARIANT_CORE_C__)
g_variant_new_tree
g_variant_assert_invariant
g_variant_is_trusted
@@ -1826,7 +1819,7 @@ g_variant_load_fixed
g_variant_is_normal_
#endif
-#if IN_FILE(_gvariant_util_c_)
+#if IN_FILE(__G_VARIANT_UTIL_C__)
g_variant_dump_data
g_variant_iter_should_free
g_variant_deep_copy
diff --git a/glib/gvariant-core.c b/glib/gvariant-core.c
index 641dd18..7b8d4a7 100644
--- a/glib/gvariant-core.c
+++ b/glib/gvariant-core.c
@@ -1,11 +1,20 @@
/*
* Copyright © 2007, 2008 Ryan Lortie
*
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of version 3 of the GNU General Public License as
- * published by the Free Software Foundation.
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
*
- * See the included COPYING file for more information.
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * 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.
*/
/**
@@ -1460,5 +1469,5 @@ g_variant_load (const GVariantType *type,
}
}
-#define _gvariant_core_c_
+#define __G_VARIANT_CORE_C__
#include "galiasdef.c"
diff --git a/glib/gvariant-markup.c b/glib/gvariant-markup.c
index 476ef58..a1f7aa0 100644
--- a/glib/gvariant-markup.c
+++ b/glib/gvariant-markup.c
@@ -1,11 +1,20 @@
/*
* Copyright © 2008 Ryan Lortie
*
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of version 3 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * See the included COPYING file for more information.
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * 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.
*/
#include <glib/gtestutils.h>
@@ -1004,5 +1013,5 @@ g_variant_markup_parse_context_end (GMarkupParseContext *context,
return value;
}
-#define _gvariant_markup_c_
+#define __G_VARIANT_MARKUP_C__
#include "galiasdef.c"
diff --git a/glib/gvariant-parser.c b/glib/gvariant-parser.c
index 063d264..fb14e37 100644
--- a/glib/gvariant-parser.c
+++ b/glib/gvariant-parser.c
@@ -1,13 +1,20 @@
/*
* Copyright © 2009, Codethink Limited
*
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of version 3 of the GNU General Public License as
- * published by the Free Software Foundation.
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
*
- * See the included COPYING file for more information.
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
*
- * Authors: Ryan Lortie <desrt desrt ca>
+ * 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.
*/
#include <stdlib.h>
@@ -2189,5 +2196,5 @@ g_variant_parse (const gchar *text,
return result;
}
-#define _gvariant_parser_c_
+#define __G_VARIANT_PARSER_C__
#include "galiasdef.c"
diff --git a/glib/gvariant-printer.c b/glib/gvariant-printer.c
index 97c4266..63d6967 100644
--- a/glib/gvariant-printer.c
+++ b/glib/gvariant-printer.c
@@ -1,13 +1,21 @@
/*
* Copyright © 2009, Sam Thursfield
*
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of version 3 of the GNU General Public License as
- * published by the Free Software Foundation.
*
- * See the included COPYING file for more information.
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
*
- * Authors: Sam Thursfield <ssssam gmail com>
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * 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.
*/
#include <math.h>
@@ -300,5 +308,5 @@ g_variant_print_string (GVariant *value,
return string;
};
-#define _gvariant_printer_c_
+#define __G_VARIANT_PRINTER_C__
#include "galiasdef.c"
diff --git a/glib/gvariant-private.h b/glib/gvariant-private.h
index 14e717a..dd38c6d 100644
--- a/glib/gvariant-private.h
+++ b/glib/gvariant-private.h
@@ -1,34 +1,43 @@
/*
* Copyright © 2007, 2008 Ryan Lortie
*
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of version 3 of the GNU General Public License as
- * published by the Free Software Foundation.
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
*
- * See the included COPYING file for more information.
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * 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.
*/
-#ifndef _gvariant_private_h_
-#define _gvariant_private_h_
+#ifndef __G_VARIANT_PRIVATE_H__
+#define __G_VARIANT_PRIVATE_H__
-#include "gvariant-loadstore.h"
#include "gvarianttypeinfo.h"
+#include "gvariant.h"
/* gvariant-core.c */
-GVariant *g_variant_new_tree (const GVariantType *type,
+GVariant * g_variant_new_tree (const GVariantType *type,
GVariant **children,
gsize n_children,
gboolean trusted);
void g_variant_assert_invariant (GVariant *value);
gboolean g_variant_is_trusted (GVariant *value);
void g_variant_dump_data (GVariant *value);
-GVariant *g_variant_load_fixed (const GVariantType *type,
+GVariant * g_variant_load_fixed (const GVariantType *type,
gconstpointer data,
gsize n_items);
gboolean g_variant_iter_should_free (GVariantIter *iter);
-GVariant *g_variant_deep_copy (GVariant *value);
+GVariant * g_variant_deep_copy (GVariant *value);
/* do not use -- only for test cases */
gboolean g_variant_is_normal_ (GVariant *value);
-#endif /* _gvariant_private_h_ */
+#endif /* __G_VARIANT_PRIVATE_H__ */
diff --git a/glib/gvariant-serialiser.c b/glib/gvariant-serialiser.c
index 6b27a55..82f394b 100644
--- a/glib/gvariant-serialiser.c
+++ b/glib/gvariant-serialiser.c
@@ -1,11 +1,20 @@
/*
* Copyright © 2007, 2008 Ryan Lortie
*
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of version 3 of the GNU General Public License as
- * published by the Free Software Foundation.
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
*
- * See the included COPYING file for more information.
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * 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.
*/
#include "gvariant-serialiser.h"
@@ -1249,5 +1258,5 @@ g_variant_serialised_is_normal (GVariantSerialised value)
}
}
-#define _gvariant_serialiser_c_
+#define __G_VARIANT_SERIALISER_C__
#include "galiasdef.c"
diff --git a/glib/gvariant-serialiser.h b/glib/gvariant-serialiser.h
index 643269a..3201da1 100644
--- a/glib/gvariant-serialiser.h
+++ b/glib/gvariant-serialiser.h
@@ -1,15 +1,24 @@
/*
* Copyright © 2007, 2008 Ryan Lortie
*
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of version 3 of the GNU General Public License as
- * published by the Free Software Foundation.
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
*
- * See the included COPYING file for more information.
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * 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.
*/
-#ifndef _gvariant_serialiser_h_
-#define _gvariant_serialiser_h_
+#ifndef __G_VARIANT_SERIALISER_H__
+#define __G_VARIANT_SERIALISER_H__
#include "gvarianttypeinfo.h"
@@ -44,4 +53,4 @@ void g_variant_serialised_assert_invariant (GVarian
gboolean g_variant_serialised_is_normal (GVariantSerialised value);
void g_variant_serialised_byteswap (GVariantSerialised value);
-#endif /* _gvariant_serialiser_h_ */
+#endif /* __G_VARIANT_SERIALISER_H__ */
diff --git a/glib/gvariant-util.c b/glib/gvariant-util.c
index 79fdbc4..aa0ea34 100644
--- a/glib/gvariant-util.c
+++ b/glib/gvariant-util.c
@@ -1,11 +1,20 @@
/*
* Copyright © 2007, 2008 Ryan Lortie
*
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of version 3 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * See the included COPYING file for more information.
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * 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.
*/
#include <string.h>
@@ -2010,5 +2019,5 @@ g_variant_from_file (const GVariantType *type,
mapped);
}
-#define _gvariant_util_c_
+#define __G_VARIANT_UTIL_C__
#include "galiasdef.c"
diff --git a/glib/gvariant-valist.c b/glib/gvariant-valist.c
index ab36713..0e302ab 100644
--- a/glib/gvariant-valist.c
+++ b/glib/gvariant-valist.c
@@ -1,11 +1,20 @@
/*
* Copyright © 2007, 2008 Ryan Lortie
*
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of version 3 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * See the included COPYING file for more information.
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * 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.
*/
#include "gvariant-private.h"
@@ -1550,5 +1559,5 @@ g_variant_lookup (GVariant *dictionary,
return TRUE;
}
-#define _gvariant_valist_c_
+#define __G_VARIANT_VALIST_C__
#include "galiasdef.c"
diff --git a/glib/gvariant.h b/glib/gvariant.h
index c5e7121..8574b56 100644
--- a/glib/gvariant.h
+++ b/glib/gvariant.h
@@ -1,15 +1,25 @@
/*
* Copyright © 2007, 2008 Ryan Lortie
+ * Copyright © 2009 Codethink Limited
*
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of version 3 of the GNU General Public License as
- * published by the Free Software Foundation.
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
*
- * See the included COPYING file for more information.
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * 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.
*/
-#ifndef _gvariant_h_
-#define _gvariant_h_
+#ifndef __G_VARIANT_H__
+#define __G_VARIANT_H__
#include <glib/gvarianttype.h>
#include <glib/gstring.h>
@@ -28,21 +38,21 @@ struct OPAQUE_TYPE__GVariantIter
G_BEGIN_DECLS
-GVariant *g_variant_ref (GVariant *value);
-GVariant *g_variant_ref_sink (GVariant *value);
+GVariant * g_variant_ref (GVariant *value);
+GVariant * g_variant_ref_sink (GVariant *value);
void g_variant_unref (GVariant *value);
void g_variant_flatten (GVariant *value);
GVariantTypeClass g_variant_get_type_class (GVariant *value);
-const GVariantType *g_variant_get_type (GVariant *value);
-const gchar *g_variant_get_type_string (GVariant *value);
+const GVariantType * g_variant_get_type (GVariant *value);
+const gchar * g_variant_get_type_string (GVariant *value);
gboolean g_variant_is_basic (GVariant *value);
gboolean g_variant_is_container (GVariant *value);
gboolean g_variant_matches (GVariant *value,
const GVariantType *pattern);
/* varargs construct/deconstruct */
-GVariant *g_variant_new (const gchar *format_string,
+GVariant * g_variant_new (const gchar *format_string,
...);
void g_variant_get (GVariant *value,
const gchar *format_string,
@@ -54,7 +64,7 @@ gboolean g_variant_format_string_scan (const g
GVariantType * g_variant_format_string_scan_type (const gchar *string,
const gchar *limit,
const gchar **endptr);
-GVariant *g_variant_new_va (gpointer must_be_null,
+GVariant * g_variant_new_va (gpointer must_be_null,
const gchar *format_string,
const gchar **endptr,
va_list *app);
@@ -65,22 +75,22 @@ void g_variant_get_va (GVarian
va_list *app);
/* constructors */
-GVariant *g_variant_new_boolean (gboolean boolean);
-GVariant *g_variant_new_byte (guint8 byte);
-GVariant *g_variant_new_uint16 (guint16 uint16);
-GVariant *g_variant_new_int16 (gint16 int16);
-GVariant *g_variant_new_uint32 (guint32 uint32);
-GVariant *g_variant_new_int32 (gint32 int32);
-GVariant *g_variant_new_uint64 (guint64 uint64);
-GVariant *g_variant_new_int64 (gint64 int64);
-GVariant *g_variant_new_double (gdouble floating);
-GVariant *g_variant_new_string (const gchar *string);
-GVariant *g_variant_new_object_path (const gchar *string);
+GVariant * g_variant_new_boolean (gboolean boolean);
+GVariant * g_variant_new_byte (guint8 byte);
+GVariant * g_variant_new_uint16 (guint16 uint16);
+GVariant * g_variant_new_int16 (gint16 int16);
+GVariant * g_variant_new_uint32 (guint32 uint32);
+GVariant * g_variant_new_int32 (gint32 int32);
+GVariant * g_variant_new_uint64 (guint64 uint64);
+GVariant * g_variant_new_int64 (gint64 int64);
+GVariant * g_variant_new_double (gdouble floating);
+GVariant * g_variant_new_string (const gchar *string);
+GVariant * g_variant_new_object_path (const gchar *string);
gboolean g_variant_is_object_path (const gchar *string);
-GVariant *g_variant_new_signature (const gchar *string);
+GVariant * g_variant_new_signature (const gchar *string);
gboolean g_variant_is_signature (const gchar *string);
-GVariant *g_variant_new_variant (GVariant *value);
-GVariant *g_variant_new_strv (const gchar * const *strv,
+GVariant * g_variant_new_variant (GVariant *value);
+GVariant * g_variant_new_strv (const gchar * const *strv,
gint length);
/* deconstructors */
@@ -93,28 +103,28 @@ gint32 g_variant_get_int32 (GVarian
guint64 g_variant_get_uint64 (GVariant *value);
gint64 g_variant_get_int64 (GVariant *value);
gdouble g_variant_get_double (GVariant *value);
-const gchar *g_variant_get_string (GVariant *value,
+const gchar * g_variant_get_string (GVariant *value,
gsize *length);
-gchar *g_variant_dup_string (GVariant *value,
+gchar * g_variant_dup_string (GVariant *value,
gsize *length);
const gchar ** g_variant_get_strv (GVariant *value,
gint *length);
gchar ** g_variant_dup_strv (GVariant *value,
gint *length);
-GVariant *g_variant_get_variant (GVariant *value);
+GVariant * g_variant_get_variant (GVariant *value);
gconstpointer g_variant_get_fixed (GVariant *value,
gsize size);
gconstpointer g_variant_get_fixed_array (GVariant *value,
gsize elem_size,
gsize *length);
gsize g_variant_n_children (GVariant *value);
-GVariant *g_variant_get_child_value (GVariant *value,
+GVariant * g_variant_get_child_value (GVariant *value,
gsize index);
void g_variant_get_child (GVariant *value,
gint index,
const gchar *format_string,
...);
-GVariant *g_variant_lookup_value (GVariant *dictionary,
+GVariant * g_variant_lookup_value (GVariant *dictionary,
const gchar *key);
gboolean g_variant_lookup (GVariant *dictionary,
const gchar *key,
@@ -124,7 +134,7 @@ gboolean g_variant_lookup (GVarian
/* GVariantIter */
gsize g_variant_iter_init (GVariantIter *iter,
GVariant *value);
-GVariant *g_variant_iter_next_value (GVariantIter *iter);
+GVariant * g_variant_iter_next_value (GVariantIter *iter);
void g_variant_iter_cancel (GVariantIter *iter);
gboolean g_variant_iter_was_cancelled (GVariantIter *iter);
gboolean g_variant_iter_next (GVariantIter *iter,
@@ -137,21 +147,32 @@ void g_variant_builder_add_value (GVarian
void g_variant_builder_add (GVariantBuilder *builder,
const gchar *format_string,
...);
-GVariantBuilder *g_variant_builder_open (GVariantBuilder *parent,
+GVariantBuilder * g_variant_builder_open (GVariantBuilder *parent,
GVariantTypeClass tclass,
const GVariantType *type);
-GVariantBuilder *g_variant_builder_close (GVariantBuilder *child);
+GVariantBuilder * g_variant_builder_close (GVariantBuilder *child);
gboolean g_variant_builder_check_add (GVariantBuilder *builder,
GVariantTypeClass tclass,
const GVariantType *type,
GError **error);
gboolean g_variant_builder_check_end (GVariantBuilder *builder,
GError **error);
-GVariantBuilder *g_variant_builder_new (GVariantTypeClass tclass,
+GVariantBuilder * g_variant_builder_new (GVariantTypeClass tclass,
const GVariantType *type);
-GVariant *g_variant_builder_end (GVariantBuilder *builder);
+GVariant * g_variant_builder_end (GVariantBuilder *builder);
void g_variant_builder_cancel (GVariantBuilder *builder);
+#define G_VARIANT_BUILDER_ERROR \
+ (g_quark_from_static_string ("g-variant-builder-error-quark"))
+
+typedef enum
+{
+ G_VARIANT_BUILDER_ERROR_TOO_MANY,
+ G_VARIANT_BUILDER_ERROR_TOO_FEW,
+ G_VARIANT_BUILDER_ERROR_INFER,
+ G_VARIANT_BUILDER_ERROR_TYPE
+} GVariantBuilderError;
+
/* text printing/parsing */
typedef struct
{
@@ -160,9 +181,9 @@ typedef struct
gchar *error;
} GVariantParseError;
-gchar *g_variant_print (GVariant *value,
+gchar * g_variant_print (GVariant *value,
gboolean type_annotate);
-GString *g_variant_print_string (GVariant *value,
+GString * g_variant_print_string (GVariant *value,
GString *string,
gboolean type_annotate);
GVariant * g_variant_parse (const gchar *text,
@@ -180,39 +201,59 @@ GVariant * g_variant_parse_full (const g
GVariantParseError *error);
/* markup printing/parsing */
-gchar *g_variant_markup_print (GVariant *value,
+gchar * g_variant_markup_print (GVariant *value,
gboolean newlines,
gint indentation,
gint tabstop);
-GString *g_variant_markup_print_string (GVariant *value,
+GString * g_variant_markup_print_string (GVariant *value,
GString *string,
gboolean newlines,
gint indentation,
gint tabstop);
void g_variant_markup_subparser_start (GMarkupParseContext *context,
const GVariantType *type);
-GVariant *g_variant_markup_subparser_end (GMarkupParseContext *context,
+GVariant * g_variant_markup_subparser_end (GMarkupParseContext *context,
GError **error);
-GMarkupParseContext *g_variant_markup_parse_context_new (GMarkupParseFlags flags,
+GMarkupParseContext * g_variant_markup_parse_context_new (GMarkupParseFlags flags,
const GVariantType *type);
-GVariant *g_variant_markup_parse_context_end (GMarkupParseContext *context,
+GVariant * g_variant_markup_parse_context_end (GMarkupParseContext *context,
GError **error);
-GVariant *g_variant_markup_parse (const gchar *text,
+GVariant * g_variant_markup_parse (const gchar *text,
gssize text_len,
const GVariantType *type,
GError **error);
-G_END_DECLS
-
-#define G_VARIANT_BUILDER_ERROR \
- (g_quark_from_static_string ("g-variant-builder-error-quark"))
-
+/* load/store serialised format */
typedef enum
{
- G_VARIANT_BUILDER_ERROR_TOO_MANY,
- G_VARIANT_BUILDER_ERROR_TOO_FEW,
- G_VARIANT_BUILDER_ERROR_INFER,
- G_VARIANT_BUILDER_ERROR_TYPE
-} GVariantBuilderError;
+ G_VARIANT_TRUSTED = 0x00010000,
+ G_VARIANT_LAZY_BYTESWAP = 0x00020000,
+} GVariantFlags;
+
+GVariant * g_variant_load (const GVariantType *type,
+ gconstpointer data,
+ gsize size,
+ GVariantFlags flags);
+GVariant * g_variant_from_slice (const GVariantType *type,
+ gpointer slice,
+ gsize size,
+ GVariantFlags flags);
+GVariant * g_variant_from_data (const GVariantType *type,
+ gconstpointer data,
+ gsize size,
+ GVariantFlags flags,
+ GDestroyNotify notify,
+ gpointer user_data);
+GVariant * g_variant_from_file (const GVariantType *type,
+ const gchar *filename,
+ GVariantFlags flags,
+ GError **error);
+
+void g_variant_store (GVariant *value,
+ gpointer data);
+gconstpointer g_variant_get_data (GVariant *value);
+gsize g_variant_get_size (GVariant *value);
+
+G_END_DECLS
-#endif /* _gvariant_h_ */
+#endif /* __G_VARIANT_H__ */
diff --git a/glib/gvarianttype.c b/glib/gvarianttype.c
index 5e6b489..4651647 100644
--- a/glib/gvarianttype.c
+++ b/glib/gvarianttype.c
@@ -1,11 +1,20 @@
/*
* Copyright © 2007, 2008 Ryan Lortie
*
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of version 3 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * See the included COPYING file for more information.
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * 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.
*/
#include "gvarianttype.h"
@@ -1032,5 +1041,5 @@ g_variant_type_new_dict_entry (const GVariantType *key,
return (GVariantType *) new;
}
-#define _gvarianttype_c_
+#define __G_VARIANT_TYPE_C__
#include "galiasdef.c"
diff --git a/glib/gvarianttype.h b/glib/gvarianttype.h
index a9d168c..dcb0f49 100644
--- a/glib/gvarianttype.h
+++ b/glib/gvarianttype.h
@@ -1,15 +1,25 @@
/*
* Copyright © 2007, 2008 Ryan Lortie
+ * Copyright © 2009 Codethink Limited
*
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of version 3 of the GNU General Public License as
- * published by the Free Software Foundation.
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
*
- * See the included COPYING file for more information.
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * 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.
*/
-#ifndef _gvarianttype_h_
-#define _gvarianttype_h_
+#ifndef __G_VARIANT_TYPE_H__
+#define __G_VARIANT_TYPE_H__
#include <glib/gtypes.h>
@@ -259,13 +269,13 @@ gboolean g_variant_type_string_scan (const g
/* create/destroy */
void g_variant_type_free (GVariantType *type);
-GVariantType *g_variant_type_copy (const GVariantType *type);
-GVariantType *g_variant_type_new (const gchar *type_string);
+GVariantType * g_variant_type_copy (const GVariantType *type);
+GVariantType * g_variant_type_new (const gchar *type_string);
/* getters */
gsize g_variant_type_get_string_length (const GVariantType *type);
-const gchar *g_variant_type_peek_string (const GVariantType *type);
-gchar *g_variant_type_dup_string (const GVariantType *type);
+const gchar * g_variant_type_peek_string (const GVariantType *type);
+gchar * g_variant_type_dup_string (const GVariantType *type);
/* classification */
gboolean g_variant_type_is_concrete (const GVariantType *type);
@@ -289,25 +299,25 @@ gboolean g_variant_type_class_is_container (GVarian
gboolean g_variant_type_class_is_basic (GVariantTypeClass tclass);
/* type iterator interface */
-const GVariantType *g_variant_type_element (const GVariantType *type);
-const GVariantType *g_variant_type_first (const GVariantType *type);
-const GVariantType *g_variant_type_next (const GVariantType *type);
+const GVariantType * g_variant_type_element (const GVariantType *type);
+const GVariantType * g_variant_type_first (const GVariantType *type);
+const GVariantType * g_variant_type_next (const GVariantType *type);
gsize g_variant_type_n_items (const GVariantType *type);
-const GVariantType *g_variant_type_key (const GVariantType *type);
-const GVariantType *g_variant_type_value (const GVariantType *type);
+const GVariantType * g_variant_type_key (const GVariantType *type);
+const GVariantType * g_variant_type_value (const GVariantType *type);
/* constructors */
-GVariantType *g_variant_type_new_array (const GVariantType *element);
-GVariantType *g_variant_type_new_maybe (const GVariantType *element);
+GVariantType * g_variant_type_new_array (const GVariantType *element);
+GVariantType * g_variant_type_new_maybe (const GVariantType *element);
typedef const GVariantType *(*GVariantTypeGetter) (gpointer data);
-GVariantType *g_variant_type_new_tuple_ (const gpointer *items,
+GVariantType * g_variant_type_new_tuple_ (const gpointer *items,
GVariantTypeGetter func,
gsize length);
-GVariantType *g_variant_type_new_dict_entry (const GVariantType *key,
+GVariantType * g_variant_type_new_dict_entry (const GVariantType *key,
const GVariantType *value);
/*< private >*/
-const GVariantType *g_variant_type_check_string_ (const gchar *type_string);
+const GVariantType * g_variant_type_check_string_ (const gchar *type_string);
G_END_DECLS
@@ -318,4 +328,4 @@ G_END_DECLS
(g_variant_type_new_tuple_ ((const gpointer *) items, (GVariantTypeGetter) (1 ? func : \
(const GVariantType *(*)(typeof (items[0]))) NULL), length))
-#endif /* _gvarianttype_h_ */
+#endif /* __G_VARIANT_TYPE_H__ */
diff --git a/glib/gvarianttypeinfo.c b/glib/gvarianttypeinfo.c
index a383ecc..344f3d0 100644
--- a/glib/gvarianttypeinfo.c
+++ b/glib/gvarianttypeinfo.c
@@ -1,11 +1,20 @@
/*
* Copyright © 2008 Ryan Lortie
*
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of version 3 of the GNU General Public License as
- * published by the Free Software Foundation.
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
*
- * See the included COPYING file for more information.
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * 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.
*/
#include "gvarianttypeinfo.h"
@@ -456,5 +465,5 @@ g_variant_type_info_unref (GVariantTypeInfo *info)
}
}
-#define _gvarianttypeinfo_c_
+#define __G_VARIANT_TYPE_INFO_C__
#include "galiasdef.c"
diff --git a/glib/gvarianttypeinfo.h b/glib/gvarianttypeinfo.h
index a34695c..643b178 100644
--- a/glib/gvarianttypeinfo.h
+++ b/glib/gvarianttypeinfo.h
@@ -1,15 +1,24 @@
/*
* Copyright © 2008 Ryan Lortie
*
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of version 3 of the GNU General Public License as
- * published by the Free Software Foundation.
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
*
- * See the included COPYING file for more information.
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * 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.
*/
-#ifndef _gvarianttypeinfo_h_
-#define _gvarianttypeinfo_h_
+#ifndef __G_VARIANT_TYPE_INFO_H__
+#define __G_VARIANT_TYPE_INFO_H__
#include "gvarianttype.h"
@@ -27,28 +36,28 @@ typedef struct
#define STRUCT_MEMBER_VARIABLE (-2)
/* query */
-const GVariantType *g_variant_type_info_get_type (GVariantTypeInfo *typeinfo);
+const GVariantType * g_variant_type_info_get_type (GVariantTypeInfo *typeinfo);
GVariantTypeClass g_variant_type_info_get_type_class (GVariantTypeInfo *typeinfo);
-const gchar *g_variant_type_info_get_string (GVariantTypeInfo *typeinfo);
+const gchar * g_variant_type_info_get_string (GVariantTypeInfo *typeinfo);
void g_variant_type_info_query (GVariantTypeInfo *typeinfo,
guint *alignment,
gsize *size);
/* array */
-GVariantTypeInfo *g_variant_type_info_element (GVariantTypeInfo *typeinfo);
+GVariantTypeInfo * g_variant_type_info_element (GVariantTypeInfo *typeinfo);
void g_variant_type_info_query_element (GVariantTypeInfo *typeinfo,
guint *alignment,
gsize *size);
/* structure */
gsize g_variant_type_info_n_members (GVariantTypeInfo *typeinfo);
-const GVariantMemberInfo *g_variant_type_info_member_info (GVariantTypeInfo *typeinfo,
+const GVariantMemberInfo * g_variant_type_info_member_info (GVariantTypeInfo *typeinfo,
gsize index);
/* new/ref/unref */
-GVariantTypeInfo *g_variant_type_info_get (const GVariantType *type);
-GVariantTypeInfo *g_variant_type_info_ref (GVariantTypeInfo *typeinfo);
+GVariantTypeInfo * g_variant_type_info_get (const GVariantType *type);
+GVariantTypeInfo * g_variant_type_info_ref (GVariantTypeInfo *typeinfo);
void g_variant_type_info_unref (GVariantTypeInfo *typeinfo);
-#endif /* _gvarianttypeinfo_h_ */
+#endif /* __G_VARIANT_TYPE_INFO_H__ */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]