[glib/gvarianttype] Move some documentation to header file

Also, change G_VARIANT_TYPE(str) for G_VARIANT_TYPE(type_string)
so It's correctly documented now.
This commit is contained in:
Javier Jardón 2010-01-26 19:15:48 +01:00
parent 3c66490503
commit b0d2f344a6
2 changed files with 26 additions and 27 deletions

View File

@ -479,29 +479,6 @@
* </refsect2>
*/
/**
* GVariantType:
*
* A type in the GVariant type system.
*
* Two types may not be compared by value; use g_variant_type_equal() or
* g_variant_type_is_subtype(). May be copied using
* g_variant_type_copy() and freed using g_variant_type_free().
**/
/**
* G_VARIANT_TYPE:
* @type_string: a well-formed #GVariantType type string
*
* Converts a string to a const #GVariantType. Depending on the
* current debugging level, this function may perform a runtime check
* to ensure that @string is a valid GVariant type string.
*
* It is always a programmer error to use this macro with an invalid
* type string.
*
* Since 2.24
**/
static gboolean
g_variant_type_check (const GVariantType *type)

View File

@ -26,6 +26,17 @@
#include <glib/gmessages.h>
#include <glib/gtypes.h>
G_BEGIN_DECLS
/**
* GVariantType:
*
* A type in the GVariant type system.
*
* Two types may not be compared by value; use g_variant_type_equal() or
* g_variant_type_is_subtype(). May be copied using
* g_variant_type_copy() and freed using g_variant_type_free().
**/
typedef struct _GVariantType GVariantType;
/**
@ -216,14 +227,25 @@ typedef struct _GVariantType GVariantType;
**/
#define G_VARIANT_TYPE_DICTIONARY ((const GVariantType *) "a{?*}")
/**
* G_VARIANT_TYPE:
* @type_string: a well-formed #GVariantType type string
*
* Converts a string to a const #GVariantType. Depending on the
* current debugging level, this function may perform a runtime check
* to ensure that @string is a valid GVariant type string.
*
* It is always a programmer error to use this macro with an invalid
* type string.
*
* Since 2.24
**/
#ifndef G_DISABLE_CHECKS
# define G_VARIANT_TYPE(str) (g_variant_type_checked_ ((str)))
# define G_VARIANT_TYPE(type_string) (g_variant_type_checked_ ((type_string)))
#else
# define G_VARIANT_TYPE(str) ((const GVariantType *) (str))
# define G_VARIANT_TYPE(type_string) ((const GVariantType *) (type_string))
#endif
G_BEGIN_DECLS
/* type string checking */
gboolean g_variant_type_string_is_valid (const gchar *type_string);
gboolean g_variant_type_string_scan (const gchar *string,