<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [
<!ENTITY version SYSTEM "version.xml">
]>
<refentry id="cutter-Convenience-test-data-API">
<refmeta>
<refentrytitle role="top_of_page" id="cutter-Convenience-test-data-API.top_of_page">Convenience test data API</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>
  CUTTER Library
</refmiscinfo>
</refmeta>
<refnamediv>
<refname>Convenience test data API</refname>
<refpurpose>API to create test data without
structure definition.</refpurpose>
</refnamediv>

<refsynopsisdiv id="cutter-Convenience-test-data-API.synopsis" role="synopsis">
<title role="synopsis.title">Synopsis</title>

<synopsis><link linkend="void"><returnvalue>void</returnvalue></link>                <link linkend="gcut-add-datum">gcut_add_datum</link>                      (<parameter>const <link linkend="gchar"><type>gchar</type></link> *name</parameter>,
                                                         <parameter>const <link linkend="gchar"><type>gchar</type></link> *first_field_name</parameter>,
                                                         <parameter>...</parameter>);
<link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>            <link linkend="gcut-data-get-boolean">gcut_data_get_boolean</link>               (<parameter><link linkend="gconstpointer"><type>gconstpointer</type></link> data</parameter>,
                                                         <parameter>const <link linkend="gchar"><type>gchar</type></link> *field_name</parameter>);
<link linkend="gconstpointer"><returnvalue>gconstpointer</returnvalue></link>       <link linkend="gcut-data-get-boxed">gcut_data_get_boxed</link>                 (<parameter><link linkend="gconstpointer"><type>gconstpointer</type></link> data</parameter>,
                                                         <parameter>const <link linkend="gchar"><type>gchar</type></link> *field_name</parameter>);
#define             <link linkend="gcut-data-get-char">gcut_data_get_char</link>                  (data,
                                                         field_name)
<link linkend="gdouble"><returnvalue>gdouble</returnvalue></link>             <link linkend="gcut-data-get-double">gcut_data_get_double</link>                (<parameter><link linkend="gconstpointer"><type>gconstpointer</type></link> data</parameter>,
                                                         <parameter>const <link linkend="gchar"><type>gchar</type></link> *field_name</parameter>);
<link linkend="gint"><returnvalue>gint</returnvalue></link>                <link linkend="gcut-data-get-enum">gcut_data_get_enum</link>                  (<parameter><link linkend="gconstpointer"><type>gconstpointer</type></link> data</parameter>,
                                                         <parameter>const <link linkend="gchar"><type>gchar</type></link> *field_name</parameter>);
<link linkend="guint"><returnvalue>guint</returnvalue></link>               <link linkend="gcut-data-get-flags">gcut_data_get_flags</link>                 (<parameter><link linkend="gconstpointer"><type>gconstpointer</type></link> data</parameter>,
                                                         <parameter>const <link linkend="gchar"><type>gchar</type></link> *field_name</parameter>);
<link linkend="gint"><returnvalue>gint</returnvalue></link>                <link linkend="gcut-data-get-int">gcut_data_get_int</link>                   (<parameter><link linkend="gconstpointer"><type>gconstpointer</type></link> data</parameter>,
                                                         <parameter>const <link linkend="gchar"><type>gchar</type></link> *field_name</parameter>);
#define             <link linkend="gcut-data-get-int64">gcut_data_get_int64</link>                 (data,
                                                         field_name)
<link linkend="GObject"><returnvalue>GObject</returnvalue></link> *           <link linkend="gcut-data-get-object">gcut_data_get_object</link>                (<parameter><link linkend="gconstpointer"><type>gconstpointer</type></link> data</parameter>,
                                                         <parameter>const <link linkend="gchar"><type>gchar</type></link> *field_name</parameter>);
<link linkend="gconstpointer"><returnvalue>gconstpointer</returnvalue></link>       <link linkend="gcut-data-get-pointer">gcut_data_get_pointer</link>               (<parameter><link linkend="gconstpointer"><type>gconstpointer</type></link> data</parameter>,
                                                         <parameter>const <link linkend="gchar"><type>gchar</type></link> *field_name</parameter>);
#define             <link linkend="gcut-data-get-size">gcut_data_get_size</link>                  (data,
                                                         field_name)
const <link linkend="gchar"><returnvalue>gchar</returnvalue></link> *       <link linkend="gcut-data-get-string">gcut_data_get_string</link>                (<parameter><link linkend="gconstpointer"><type>gconstpointer</type></link> data</parameter>,
                                                         <parameter>const <link linkend="gchar"><type>gchar</type></link> *field_name</parameter>);
<link linkend="guint"><returnvalue>guint</returnvalue></link>               <link linkend="gcut-data-get-uint">gcut_data_get_uint</link>                  (<parameter><link linkend="gconstpointer"><type>gconstpointer</type></link> data</parameter>,
                                                         <parameter>const <link linkend="gchar"><type>gchar</type></link> *field_name</parameter>);
#define             <link linkend="gcut-data-get-uint64">gcut_data_get_uint64</link>                (data,
                                                         field_name)
<link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>            <link linkend="gcut-data-has-field">gcut_data_has_field</link>                 (<parameter><link linkend="gconstpointer"><type>gconstpointer</type></link> data</parameter>,
                                                         <parameter>const <link linkend="gchar"><type>gchar</type></link> *field_name</parameter>);
</synopsis>
</refsynopsisdiv>

<refsect1 id="cutter-Convenience-test-data-API.description" role="desc">
<title role="desc.title">Description</title>
<para>
<link linkend="cut-add-data"><function>cut_add_data()</function></link> requires custom data type for complex test
data. But it's not easy to write. <link linkend="gcut-add-datum"><function>gcut_add_datum()</function></link>
provides API to use complex test data without custom data
type. It uses <link linkend="GType"><type>GType</type></link> for providing complex data.
</para>
</refsect1>
<refsect1 id="cutter-Convenience-test-data-API.details" role="details">
<title role="details.title">Details</title>
<refsect2 id="gcut-add-datum" role="function" condition="since:1.0.6">
<title>gcut_add_datum ()</title>
<indexterm zone="gcut-add-datum" role="1.0.6"><primary>gcut_add_datum</primary></indexterm>
<programlisting><link linkend="void"><returnvalue>void</returnvalue></link>                gcut_add_datum                      (<parameter>const <link linkend="gchar"><type>gchar</type></link> *name</parameter>,
                                                         <parameter>const <link linkend="gchar"><type>gchar</type></link> *first_field_name</parameter>,
                                                         <parameter>...</parameter>);</programlisting>
<para>
Adds a datum to be used in data driven test. It's
convenient rather than <link linkend="cut-add-data"><function>cut_add_data()</function></link> because you doesn't
need to define a new structure for a complex test data.
</para>
<para>
e.g.:
<informalexample><programlisting>
#include &lt;gcutter.h&gt;

void data_translate (void);
void test_translate (gconstpointer data);

static const gchar*
translate (gint input)
{
   switch(input) {
   case 1:
       return "first";
   case 111:
       return "a hundred eleven";
   default:
       return "unsupported";
   }
}

void
data_translate(void)
{
    gcut_add_datum("simple data",
                   "translated", G_TYPE_STRING, "first",
                   "input", G_TYPE_INT, 1,
                   NULL);
    gcut_add_datum("complex data",
                   "translated", G_TYPE_STRING, "a hundred eleven",
                   "input", G_TYPE_INT, 111,
                   NULL);
}

void
test_translate(gconstpointer data)
{
    cut_assert_equal_string(gcut_data_get_string(data, "translated"),
                            translate(gcut_data_get_int(data, "input")));
}
</programlisting></informalexample>
</para>
<para>
Available types and their values are the followings:
</para>
<para>
<variablelist>
  <varlistentry>
    <term><link linkend="G-TYPE-CHAR:CAPS"><type>G_TYPE_CHAR</type></link></term>
    <listitem>
      <para><link linkend="gchar"><type>gchar</type></link> value</para>
      <para>e.g.:
<informalexample><programlisting>
gcut_add_datum("data name",
               "field-name", G_TYPE_CHAR, 'X',
               NULL);
</programlisting></informalexample>
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term><link linkend="G-TYPE-STRING:CAPS"><type>G_TYPE_STRING</type></link></term>
    <listitem>
      <para>const <link linkend="gchar"><type>gchar</type></link> *value</para>
      <para>e.g.:
<informalexample><programlisting>
gcut_add_datum("data name",
               "field-name", G_TYPE_STRING, "string value",
               NULL);
</programlisting></informalexample>
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term><link linkend="G-TYPE-INT:CAPS"><type>G_TYPE_INT</type></link></term>
    <listitem>
      <para><link linkend="gint"><type>gint</type></link> value</para>
      <para>e.g.:
<informalexample><programlisting>
gcut_add_datum("data name",
               "field-name", G_TYPE_INT, 100,
               NULL);
</programlisting></informalexample>
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term><link linkend="G-TYPE-UINT:CAPS"><type>G_TYPE_UINT</type></link></term>
    <listitem>
      <para><link linkend="guint"><type>guint</type></link> value</para>
      <para>e.g.:
<informalexample><programlisting>
gcut_add_datum("data name",
               "field-name", G_TYPE_UINT, 100,
               NULL);
</programlisting></informalexample>
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term><link linkend="G-TYPE-INT64:CAPS"><type>G_TYPE_INT64</type></link></term>
    <listitem>
      <para><link linkend="gint64"><type>gint64</type></link> value</para>
      <para>e.g.:
<informalexample><programlisting>
gcut_add_datum("data name",
               "field-name", G_TYPE_INT64, G_GINT64_CONSTANT(100),
               NULL);
</programlisting></informalexample>
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term><link linkend="G-TYPE-UINT64:CAPS"><type>G_TYPE_UINT64</type></link></term>
    <listitem>
      <para><link linkend="guint64"><type>guint64</type></link> value</para>
      <para>e.g.:
<informalexample><programlisting>
gcut_add_datum("data name",
               "field-name", G_TYPE_UINT64, G_GUINT64_CONSTANT(100),
               NULL);
</programlisting></informalexample>
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term><link linkend="G-TYPE-GTYPE:CAPS"><type>G_TYPE_GTYPE</type></link></term>
    <listitem>
      <para><link linkend="GType"><type>GType</type></link> value</para>
      <para>e.g.:
<informalexample><programlisting>
gcut_add_datum("data name",
               "field-name", G_TYPE_GTYPE, G_TYPE_OBJECT,
               NULL);
</programlisting></informalexample>
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>GFlags types</term>
    <listitem>
      <para>its type value.</para>
      <para>e.g.:
<informalexample><programlisting>
gcut_add_datum("data name",
               "field-name", GTK_TYPE_WIDGET_FLAGS, GTK_TOPLEVEL | GTK_MAPPED,
               NULL);
</programlisting></informalexample>
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>GEnum types</term>
    <listitem>
      <para>its type value.</para>
      <para>e.g.:
<informalexample><programlisting>
gcut_add_datum("data name",
               "field-name", GTK_TYPE_WRAP_MODE, GTK_WRAP_NONE,
               NULL);
</programlisting></informalexample>
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term><link linkend="G-TYPE-POINTER:CAPS"><type>G_TYPE_POINTER</type></link></term>
    <listitem>
      <para><link linkend="gconstpointer"><type>gconstpointer</type></link> value, <link linkend="GDestroyNotify"><type>GDestroyNotify</type></link> notify</para>
      <para>notify is called when value is destroyed.</para>
      <para>e.g.:
<informalexample><programlisting>
gcut_add_datum("data name",
               "field-name", G_TYPE_POINTER, my_structure_new(...), my_structure_free,
               NULL);
</programlisting></informalexample>
      </para>
      <para>NOTE: value's ownership is passed to Cutter. Don't free it.</para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>GBoxed types</term>
    <listitem>
      <para>its type value.</para>
      <para>e.g.:
<informalexample><programlisting>
gcut_add_datum("data name",
               "field-name", G_TYPE_HASH_TABLE,
               gcut_hash_table_string_string_new("name1", "value1",
                                                 "name2", "value2",
                                                 NULL),
               NULL);
</programlisting></informalexample>
      </para>
      <para>NOTE: value's ownership is passed to Cutter. Don't free it.</para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term><link linkend="G-TYPE-BOOLEAN:CAPS"><type>G_TYPE_BOOLEAN</type></link></term>
    <listitem>
      <para><link linkend="gboolean"><type>gboolean</type></link> value</para>
      <para>e.g.:
<informalexample><programlisting>
gcut_add_datum("data name",
               "field-name", G_TYPE_BOOLEAN, TRUE,
               NULL);
</programlisting></informalexample>
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term><link linkend="G-TYPE-DOUBLE:CAPS"><type>G_TYPE_DOUBLE</type></link></term>
    <listitem>
      <para><link linkend="gdouble"><type>gdouble</type></link> value</para>
      <para>e.g.:
<informalexample><programlisting>
gcut_add_datum("data name",
               "field-name", G_TYPE_DOUBLE, 2.9,
               NULL);
</programlisting></informalexample>
      </para>
    </listitem>
  </varlistentry>
</variablelist>
</para><variablelist role="params">
<varlistentry><term><parameter>name</parameter>&#160;:</term>
<listitem><simpara>the name of the data.</simpara></listitem></varlistentry>
<varlistentry><term><parameter>first_field_name</parameter>&#160;:</term>
<listitem><simpara>the first field name.</simpara></listitem></varlistentry>
<varlistentry><term><parameter>...</parameter>&#160;:</term>
<listitem><simpara>the type and value pair of the first field,
followed optionally by the next field name, type
and value triples. <link linkend="NULL:CAPS"><literal>NULL</literal></link>-terminated. See
description for more details.</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 1.0.6</para></refsect2>
<refsect2 id="gcut-data-get-boolean" role="function" condition="since:1.1.3">
<title>gcut_data_get_boolean ()</title>
<indexterm zone="gcut-data-get-boolean" role="1.1.3"><primary>gcut_data_get_boolean</primary></indexterm>
<programlisting><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>            gcut_data_get_boolean               (<parameter><link linkend="gconstpointer"><type>gconstpointer</type></link> data</parameter>,
                                                         <parameter>const <link linkend="gchar"><type>gchar</type></link> *field_name</parameter>);</programlisting>
<para>
Gets a field value identified by <parameter>field_name</parameter> as boolean.
</para><variablelist role="params">
<varlistentry><term><parameter>data</parameter>&#160;:</term>
<listitem><simpara>the data added by <link linkend="gcut-add-datum"><function>gcut_add_datum()</function></link>.</simpara></listitem></varlistentry>
<varlistentry><term><parameter>field_name</parameter>&#160;:</term>
<listitem><simpara>the field name.</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>a field value corresponded to <parameter>field_name</parameter>.</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 1.1.3</para></refsect2>
<refsect2 id="gcut-data-get-boxed" role="function" condition="since:1.0.7">
<title>gcut_data_get_boxed ()</title>
<indexterm zone="gcut-data-get-boxed" role="1.0.7"><primary>gcut_data_get_boxed</primary></indexterm>
<programlisting><link linkend="gconstpointer"><returnvalue>gconstpointer</returnvalue></link>       gcut_data_get_boxed                 (<parameter><link linkend="gconstpointer"><type>gconstpointer</type></link> data</parameter>,
                                                         <parameter>const <link linkend="gchar"><type>gchar</type></link> *field_name</parameter>);</programlisting>
<para>
Gets a field value identified by <parameter>field_name</parameter> as
GBoxed type value.
</para><variablelist role="params">
<varlistentry><term><parameter>data</parameter>&#160;:</term>
<listitem><simpara>the data added by <link linkend="gcut-add-datum"><function>gcut_add_datum()</function></link>.</simpara></listitem></varlistentry>
<varlistentry><term><parameter>field_name</parameter>&#160;:</term>
<listitem><simpara>the field name.</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>a field value corresponded to <parameter>field_name</parameter>.</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 1.0.7</para></refsect2>
<refsect2 id="gcut-data-get-char" role="macro" condition="since:1.1.3">
<title>gcut_data_get_char()</title>
<indexterm zone="gcut-data-get-char" role="1.1.3"><primary>gcut_data_get_char</primary></indexterm>
<programlisting>#define             gcut_data_get_char(data, field_name)</programlisting>
<para>
Gets a field value identified by <parameter>field_name</parameter> as char.
</para><variablelist role="params">
<varlistentry><term><parameter>data</parameter>&#160;:</term>
<listitem><simpara>the data added by <link linkend="gcut-add-datum"><function>gcut_add_datum()</function></link>.</simpara></listitem></varlistentry>
<varlistentry><term><parameter>field_name</parameter>&#160;:</term>
<listitem><simpara>the field name.</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>a field value corresponded to <parameter>field_name</parameter>.</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 1.1.3</para></refsect2>
<refsect2 id="gcut-data-get-double" role="function" condition="since:1.1.3">
<title>gcut_data_get_double ()</title>
<indexterm zone="gcut-data-get-double" role="1.1.3"><primary>gcut_data_get_double</primary></indexterm>
<programlisting><link linkend="gdouble"><returnvalue>gdouble</returnvalue></link>             gcut_data_get_double                (<parameter><link linkend="gconstpointer"><type>gconstpointer</type></link> data</parameter>,
                                                         <parameter>const <link linkend="gchar"><type>gchar</type></link> *field_name</parameter>);</programlisting>
<para>
Gets a field value identified by <parameter>field_name</parameter> as double
floating point number.
</para><variablelist role="params">
<varlistentry><term><parameter>data</parameter>&#160;:</term>
<listitem><simpara>the data added by <link linkend="gcut-add-datum"><function>gcut_add_datum()</function></link>.</simpara></listitem></varlistentry>
<varlistentry><term><parameter>field_name</parameter>&#160;:</term>
<listitem><simpara>the field name.</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>a field value corresponded to <parameter>field_name</parameter>.</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 1.1.3</para></refsect2>
<refsect2 id="gcut-data-get-enum" role="function" condition="since:1.0.6">
<title>gcut_data_get_enum ()</title>
<indexterm zone="gcut-data-get-enum" role="1.0.6"><primary>gcut_data_get_enum</primary></indexterm>
<programlisting><link linkend="gint"><returnvalue>gint</returnvalue></link>                gcut_data_get_enum                  (<parameter><link linkend="gconstpointer"><type>gconstpointer</type></link> data</parameter>,
                                                         <parameter>const <link linkend="gchar"><type>gchar</type></link> *field_name</parameter>);</programlisting>
<para>
Gets a field value identified by <parameter>field_name</parameter> as
integer of GEnum type.
</para><variablelist role="params">
<varlistentry><term><parameter>data</parameter>&#160;:</term>
<listitem><simpara>the data added by <link linkend="gcut-add-datum"><function>gcut_add_datum()</function></link>.</simpara></listitem></varlistentry>
<varlistentry><term><parameter>field_name</parameter>&#160;:</term>
<listitem><simpara>the field name.</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>a field value corresponded to <parameter>field_name</parameter>.</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 1.0.6</para></refsect2>
<refsect2 id="gcut-data-get-flags" role="function" condition="since:1.0.6">
<title>gcut_data_get_flags ()</title>
<indexterm zone="gcut-data-get-flags" role="1.0.6"><primary>gcut_data_get_flags</primary></indexterm>
<programlisting><link linkend="guint"><returnvalue>guint</returnvalue></link>               gcut_data_get_flags                 (<parameter><link linkend="gconstpointer"><type>gconstpointer</type></link> data</parameter>,
                                                         <parameter>const <link linkend="gchar"><type>gchar</type></link> *field_name</parameter>);</programlisting>
<para>
Gets a field value identified by <parameter>field_name</parameter> as
unsigned integer of GFlags.
</para><variablelist role="params">
<varlistentry><term><parameter>data</parameter>&#160;:</term>
<listitem><simpara>the data added by <link linkend="gcut-add-datum"><function>gcut_add_datum()</function></link>.</simpara></listitem></varlistentry>
<varlistentry><term><parameter>field_name</parameter>&#160;:</term>
<listitem><simpara>the field name.</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>a field value corresponded to <parameter>field_name</parameter>.</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 1.0.6</para></refsect2>
<refsect2 id="gcut-data-get-int" role="function" condition="since:1.0.6">
<title>gcut_data_get_int ()</title>
<indexterm zone="gcut-data-get-int" role="1.0.6"><primary>gcut_data_get_int</primary></indexterm>
<programlisting><link linkend="gint"><returnvalue>gint</returnvalue></link>                gcut_data_get_int                   (<parameter><link linkend="gconstpointer"><type>gconstpointer</type></link> data</parameter>,
                                                         <parameter>const <link linkend="gchar"><type>gchar</type></link> *field_name</parameter>);</programlisting>
<para>
Gets a field value identified by <parameter>field_name</parameter> as integer.
</para><variablelist role="params">
<varlistentry><term><parameter>data</parameter>&#160;:</term>
<listitem><simpara>the data added by <link linkend="gcut-add-datum"><function>gcut_add_datum()</function></link>.</simpara></listitem></varlistentry>
<varlistentry><term><parameter>field_name</parameter>&#160;:</term>
<listitem><simpara>the field name.</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>a field value corresponded to <parameter>field_name</parameter>.</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 1.0.6</para></refsect2>
<refsect2 id="gcut-data-get-int64" role="macro" condition="since:1.1.3">
<title>gcut_data_get_int64()</title>
<indexterm zone="gcut-data-get-int64" role="1.1.3"><primary>gcut_data_get_int64</primary></indexterm>
<programlisting>#define             gcut_data_get_int64(data, field_name)</programlisting>
<para>
Gets a field value identified by <parameter>field_name</parameter> as 64-bit
integer.
</para><variablelist role="params">
<varlistentry><term><parameter>data</parameter>&#160;:</term>
<listitem><simpara>the data added by <link linkend="gcut-add-datum"><function>gcut_add_datum()</function></link>.</simpara></listitem></varlistentry>
<varlistentry><term><parameter>field_name</parameter>&#160;:</term>
<listitem><simpara>the field name.</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>a field value corresponded to <parameter>field_name</parameter>.</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 1.1.3</para></refsect2>
<refsect2 id="gcut-data-get-object" role="function" condition="since:1.1.1">
<title>gcut_data_get_object ()</title>
<indexterm zone="gcut-data-get-object" role="1.1.1"><primary>gcut_data_get_object</primary></indexterm>
<programlisting><link linkend="GObject"><returnvalue>GObject</returnvalue></link> *           gcut_data_get_object                (<parameter><link linkend="gconstpointer"><type>gconstpointer</type></link> data</parameter>,
                                                         <parameter>const <link linkend="gchar"><type>gchar</type></link> *field_name</parameter>);</programlisting>
<para>
Gets a field value identified by <parameter>field_name</parameter> as
<link linkend="GObject"><type>GObject</type></link> type value.
</para><variablelist role="params">
<varlistentry><term><parameter>data</parameter>&#160;:</term>
<listitem><simpara>the data added by <link linkend="gcut-add-datum"><function>gcut_add_datum()</function></link>.</simpara></listitem></varlistentry>
<varlistentry><term><parameter>field_name</parameter>&#160;:</term>
<listitem><simpara>the field name.</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>a field value corresponded to <parameter>field_name</parameter>.</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 1.1.1</para></refsect2>
<refsect2 id="gcut-data-get-pointer" role="function" condition="since:1.0.6">
<title>gcut_data_get_pointer ()</title>
<indexterm zone="gcut-data-get-pointer" role="1.0.6"><primary>gcut_data_get_pointer</primary></indexterm>
<programlisting><link linkend="gconstpointer"><returnvalue>gconstpointer</returnvalue></link>       gcut_data_get_pointer               (<parameter><link linkend="gconstpointer"><type>gconstpointer</type></link> data</parameter>,
                                                         <parameter>const <link linkend="gchar"><type>gchar</type></link> *field_name</parameter>);</programlisting>
<para>
Gets a field value identified by <parameter>field_name</parameter> as
pointer.
</para><variablelist role="params">
<varlistentry><term><parameter>data</parameter>&#160;:</term>
<listitem><simpara>the data added by <link linkend="gcut-add-datum"><function>gcut_add_datum()</function></link>.</simpara></listitem></varlistentry>
<varlistentry><term><parameter>field_name</parameter>&#160;:</term>
<listitem><simpara>the field name.</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>a field value corresponded to <parameter>field_name</parameter>.</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 1.0.6</para></refsect2>
<refsect2 id="gcut-data-get-size" role="macro" condition="since:1.1.3">
<title>gcut_data_get_size()</title>
<indexterm zone="gcut-data-get-size" role="1.1.3"><primary>gcut_data_get_size</primary></indexterm>
<programlisting>#define             gcut_data_get_size(data, field_name)</programlisting>
<para>
Gets a field value identified by <parameter>field_name</parameter> as size_t.
</para><variablelist role="params">
<varlistentry><term><parameter>data</parameter>&#160;:</term>
<listitem><simpara>the data added by <link linkend="gcut-add-datum"><function>gcut_add_datum()</function></link>.</simpara></listitem></varlistentry>
<varlistentry><term><parameter>field_name</parameter>&#160;:</term>
<listitem><simpara>the field name.</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>a field value corresponded to <parameter>field_name</parameter>.</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 1.1.3</para></refsect2>
<refsect2 id="gcut-data-get-string" role="function" condition="since:1.0.6">
<title>gcut_data_get_string ()</title>
<indexterm zone="gcut-data-get-string" role="1.0.6"><primary>gcut_data_get_string</primary></indexterm>
<programlisting>const <link linkend="gchar"><returnvalue>gchar</returnvalue></link> *       gcut_data_get_string                (<parameter><link linkend="gconstpointer"><type>gconstpointer</type></link> data</parameter>,
                                                         <parameter>const <link linkend="gchar"><type>gchar</type></link> *field_name</parameter>);</programlisting>
<para>
Gets a field value identified by <parameter>field_name</parameter> as string.
</para><variablelist role="params">
<varlistentry><term><parameter>data</parameter>&#160;:</term>
<listitem><simpara>the data added by <link linkend="gcut-add-datum"><function>gcut_add_datum()</function></link>.</simpara></listitem></varlistentry>
<varlistentry><term><parameter>field_name</parameter>&#160;:</term>
<listitem><simpara>the field name.</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>a field value corresponded to <parameter>field_name</parameter>.</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 1.0.6</para></refsect2>
<refsect2 id="gcut-data-get-uint" role="function" condition="since:1.0.6">
<title>gcut_data_get_uint ()</title>
<indexterm zone="gcut-data-get-uint" role="1.0.6"><primary>gcut_data_get_uint</primary></indexterm>
<programlisting><link linkend="guint"><returnvalue>guint</returnvalue></link>               gcut_data_get_uint                  (<parameter><link linkend="gconstpointer"><type>gconstpointer</type></link> data</parameter>,
                                                         <parameter>const <link linkend="gchar"><type>gchar</type></link> *field_name</parameter>);</programlisting>
<para>
Gets a field value identified by <parameter>field_name</parameter> as
unsigned integer.
</para><variablelist role="params">
<varlistentry><term><parameter>data</parameter>&#160;:</term>
<listitem><simpara>the data added by <link linkend="gcut-add-datum"><function>gcut_add_datum()</function></link>.</simpara></listitem></varlistentry>
<varlistentry><term><parameter>field_name</parameter>&#160;:</term>
<listitem><simpara>the field name.</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>a field value corresponded to <parameter>field_name</parameter>.</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 1.0.6</para></refsect2>
<refsect2 id="gcut-data-get-uint64" role="macro" condition="since:1.1.3">
<title>gcut_data_get_uint64()</title>
<indexterm zone="gcut-data-get-uint64" role="1.1.3"><primary>gcut_data_get_uint64</primary></indexterm>
<programlisting>#define             gcut_data_get_uint64(data, field_name)</programlisting>
<para>
Gets a field value identified by <parameter>field_name</parameter> as
64-bit unsigned integer.
</para><variablelist role="params">
<varlistentry><term><parameter>data</parameter>&#160;:</term>
<listitem><simpara>the data added by <link linkend="gcut-add-datum"><function>gcut_add_datum()</function></link>.</simpara></listitem></varlistentry>
<varlistentry><term><parameter>field_name</parameter>&#160;:</term>
<listitem><simpara>the field name.</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>a field value corresponded to <parameter>field_name</parameter>.</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 1.1.3</para></refsect2>
<refsect2 id="gcut-data-has-field" role="function" condition="since:1.1.5">
<title>gcut_data_has_field ()</title>
<indexterm zone="gcut-data-has-field" role="1.1.5"><primary>gcut_data_has_field</primary></indexterm>
<programlisting><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>            gcut_data_has_field                 (<parameter><link linkend="gconstpointer"><type>gconstpointer</type></link> data</parameter>,
                                                         <parameter>const <link linkend="gchar"><type>gchar</type></link> *field_name</parameter>);</programlisting>
<variablelist role="params">
<varlistentry><term><parameter>data</parameter>&#160;:</term>
<listitem><simpara>the data added by <link linkend="gcut-add-datum"><function>gcut_add_datum()</function></link>.</simpara></listitem></varlistentry>
<varlistentry><term><parameter>field_name</parameter>&#160;:</term>
<listitem><simpara>the field name.</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara><link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if <parameter>data</parameter> has a <parameter>field_name</parameter> field is
available, <link linkend="FALSE:CAPS"><literal>FALSE</literal></link> otherwise.</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 1.1.5</para></refsect2>

</refsect1>

</refentry>
