diff options
author | Dan Winship <danw@src.gnome.org> | 2008-01-15 17:40:47 +0000 |
---|---|---|
committer | Dan Winship <danw@src.gnome.org> | 2008-01-15 17:40:47 +0000 |
commit | 96d28e7f42ead1ddde6bccca9fba6831710a531f (patch) | |
tree | 8b3fd4ae679d19656aef6264cfcf260e515a8eec /libsoup/soup-value-utils.h | |
parent | 3f957a48574e9ac8eba06cf91fb2f101ffcf982d (diff) | |
download | libsoup-96d28e7f42ead1ddde6bccca9fba6831710a531f.tar.gz |
Merge libsoup-2.4 branch to trunk
* Merge libsoup-2.4 branch to trunk
svn path=/trunk/; revision=1041
Diffstat (limited to 'libsoup/soup-value-utils.h')
-rw-r--r-- | libsoup/soup-value-utils.h | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/libsoup/soup-value-utils.h b/libsoup/soup-value-utils.h new file mode 100644 index 00000000..19f7ccec --- /dev/null +++ b/libsoup/soup-value-utils.h @@ -0,0 +1,69 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ +/* + * Copyright (C) 2007 Red Hat, Inc. + */ + +#ifndef SOUP_VALUE_UTILS_H +#define SOUP_VALUE_UTILS_H 1 + +#include <libsoup/soup-types.h> +#include <gobject/gvaluecollector.h> + +G_BEGIN_DECLS + +#define SOUP_VALUE_SETV(val, type, args) \ +G_STMT_START { \ + char *error = NULL; \ + \ + memset (val, 0, sizeof (GValue)); \ + g_value_init (val, type); \ + G_VALUE_COLLECT (val, args, G_VALUE_NOCOPY_CONTENTS, &error); \ + if (error) \ + g_free (error); \ +} G_STMT_END + +#define SOUP_VALUE_GETV(val, type, args) \ +G_STMT_START { \ + char *error = NULL; \ + \ + G_VALUE_LCOPY (val, args, G_VALUE_NOCOPY_CONTENTS, &error); \ + if (error) \ + g_free (error); \ +} G_STMT_END + +GHashTable *soup_value_hash_new (void); +void soup_value_hash_insert_value (GHashTable *hash, + const char *key, + GValue *value); +void soup_value_hash_insert (GHashTable *hash, + const char *key, + GType type, + ...); +gboolean soup_value_hash_lookup (GHashTable *hash, + const char *key, + GType type, + ...); + +GValueArray *soup_value_array_from_args (va_list args); +gboolean soup_value_array_to_args (GValueArray *array, + va_list args); + +void soup_value_array_insert (GValueArray *array, + guint index_, + GType type, + ...); +void soup_value_array_append (GValueArray *array, + GType type, + ...); +gboolean soup_value_array_get_nth (GValueArray *array, + guint index_, + GType type, + ...); + + +GType soup_byte_array_get_type (void); +#define SOUP_TYPE_BYTE_ARRAY (soup_byte_array_get_type ()) + +G_END_DECLS + +#endif /* SOUP_VALUE_UTILS_H */ |