Add a boxed type for nul-terminated string arrays. (#110528)

Fri Jan  9 23:41:00 2004  Matthias Clasen  <maclas@gmx.de>

	* gboxed.h:
	* gboxed.c (g_strv_get_type): Add a boxed type for nul-terminated
	string arrays.  (#110528)
This commit is contained in:
Matthias Clasen
2004-01-09 22:39:55 +00:00
committed by Matthias Clasen
parent ba482c66c3
commit b4f769efaf
6 changed files with 67 additions and 1 deletions

View File

@@ -1,3 +1,8 @@
Fri Jan 9 23:40:23 2004 Matthias Clasen <maclas@gmx.de>
* gobject/tmpl/gboxed.sgml:
* gobject/gobject-sections.txt: Add G_TYPE_STRV and GStrv.
Fri Dec 26 02:04:49 2003 Matthias Clasen <maclas@gmx.de>
* glib/glib-sections.txt: Add g_ptr_array_foreach().

View File

@@ -291,12 +291,15 @@ g_pointer_type_register_static
<SUBSECTION>
G_TYPE_GSTRING
G_TYPE_STRV
GStrv
<SUBSECTION Standard>
G_TYPE_IS_BOXED
<SUBSECTION Private>
g_gstring_get_type
g_strv_get_type
</SECTION>
<SECTION>

View File

@@ -82,3 +82,39 @@ The #GType for #GString.
<!-- ##### MACRO G_TYPE_STRV ##### -->
<para>
The #GType for a boxed type holding a %NULL-terminated array of strings.
</para>
<para>
The code fragments in the following example show the use of a property of
type #G_TYPE_STRV with g_object_class_install_property(), g_object_set()
and g_object_get().
</para>
<informalexample><programlisting>
g_object_class_install_property (object_class,
PROP_AUTHORS,
g_param_spec_boxed ("authors",
_("Authors"),
_("List of authors"),
G_TYPE_STRV,
G_PARAM_READWRITE));
gchar *authors[] = { "Owen", "Tim", NULL };
g_object_set (obj, "authors", authors, NULL);
gchar *writers[];
g_object_get (obj, "authors", &amp;writers, NULL);
/* do something with writers */
g_strfreev (writers);
</programlisting></informalexample>
@Since: 2.4
<!-- ##### TYPEDEF GStrv ##### -->
<para>
A C representable type name for #G_TYPE_STRV.
</para>