<?xml version="1.0"?>
<!DOCTYPE refentry PUBLIC '-//OASIS//DTD DocBook XML V4.5//EN'
                      'http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd' [
<!ENTITY % local.common.attrib "xmlns:xi  CDATA  #FIXED 'http://www.w3.org/2003/XInclude'">
<!ENTITY version SYSTEM "version.xml">
]>
<refentry id="glib-Key-value-file-parser">
<refmeta>
<refentrytitle role="top_of_page" id="glib-Key-value-file-parser.top_of_page">Key-value file parser</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GLIB Library</refmiscinfo>
</refmeta>
<refnamediv>
<refname>Key-value file parser</refname>
<refpurpose>parses .ini-like config files</refpurpose>
</refnamediv>

<refsect1 id="glib-Key-value-file-parser.functions" role="functions_proto">
<title role="functions_proto.title">Functions</title>
<informaltable pgwide="1" frame="none">
<tgroup cols="2">
<colspec colname="functions_proto_type" colwidth="150px"/>
<colspec colname="functions_proto_name"/>
<tbody>
<row><entry role="function_type"><link linkend="GKeyFile"><returnvalue>GKeyFile</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="g-key-file-new">g_key_file_new</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="g-key-file-free">g_key_file_free</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="GKeyFile"><returnvalue>GKeyFile</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="g-key-file-ref">g_key_file_ref</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="g-key-file-unref">g_key_file_unref</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="g-key-file-set-list-separator">g_key_file_set_list_separator</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
</entry><entry role="function_name"><link linkend="g-key-file-load-from-file">g_key_file_load_from_file</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
</entry><entry role="function_name"><link linkend="g-key-file-load-from-data">g_key_file_load_from_data</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
</entry><entry role="function_name"><link linkend="g-key-file-load-from-bytes">g_key_file_load_from_bytes</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
</entry><entry role="function_name"><link linkend="g-key-file-load-from-data-dirs">g_key_file_load_from_data_dirs</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
</entry><entry role="function_name"><link linkend="g-key-file-load-from-dirs">g_key_file_load_from_dirs</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="gchar"><returnvalue>gchar</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="g-key-file-to-data">g_key_file_to_data</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
</entry><entry role="function_name"><link linkend="g-key-file-save-to-file">g_key_file_save_to_file</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="gchar"><returnvalue>gchar</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="g-key-file-get-start-group">g_key_file_get_start_group</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="gchar"><returnvalue>gchar</returnvalue></link>&#160;**
</entry><entry role="function_name"><link linkend="g-key-file-get-groups">g_key_file_get_groups</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="gchar"><returnvalue>gchar</returnvalue></link>&#160;**
</entry><entry role="function_name"><link linkend="g-key-file-get-keys">g_key_file_get_keys</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
</entry><entry role="function_name"><link linkend="g-key-file-has-group">g_key_file_has_group</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
</entry><entry role="function_name"><link linkend="g-key-file-has-key">g_key_file_has_key</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>

<row><entry role="function_type"><link linkend="gchar"><returnvalue>gchar</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="g-key-file-get-value">g_key_file_get_value</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="gchar"><returnvalue>gchar</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="g-key-file-get-string">g_key_file_get_string</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="gchar"><returnvalue>gchar</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="g-key-file-get-locale-string">g_key_file_get_locale_string</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="gchar"><returnvalue>gchar</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="g-key-file-get-locale-for-key">g_key_file_get_locale_for_key</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
</entry><entry role="function_name"><link linkend="g-key-file-get-boolean">g_key_file_get_boolean</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="gint"><returnvalue>gint</returnvalue></link>
</entry><entry role="function_name"><link linkend="g-key-file-get-integer">g_key_file_get_integer</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="gint64"><returnvalue>gint64</returnvalue></link>
</entry><entry role="function_name"><link linkend="g-key-file-get-int64">g_key_file_get_int64</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="guint64"><returnvalue>guint64</returnvalue></link>
</entry><entry role="function_name"><link linkend="g-key-file-get-uint64">g_key_file_get_uint64</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="gdouble"><returnvalue>gdouble</returnvalue></link>
</entry><entry role="function_name"><link linkend="g-key-file-get-double">g_key_file_get_double</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="gchar"><returnvalue>gchar</returnvalue></link>&#160;**
</entry><entry role="function_name"><link linkend="g-key-file-get-string-list">g_key_file_get_string_list</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="gchar"><returnvalue>gchar</returnvalue></link>&#160;**
</entry><entry role="function_name"><link linkend="g-key-file-get-locale-string-list">g_key_file_get_locale_string_list</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="g-key-file-get-boolean-list">g_key_file_get_boolean_list</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="gint"><returnvalue>gint</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="g-key-file-get-integer-list">g_key_file_get_integer_list</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="gdouble"><returnvalue>gdouble</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="g-key-file-get-double-list">g_key_file_get_double_list</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="gchar"><returnvalue>gchar</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="g-key-file-get-comment">g_key_file_get_comment</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>

<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="g-key-file-set-value">g_key_file_set_value</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="g-key-file-set-string">g_key_file_set_string</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="g-key-file-set-locale-string">g_key_file_set_locale_string</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="g-key-file-set-boolean">g_key_file_set_boolean</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="g-key-file-set-integer">g_key_file_set_integer</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="g-key-file-set-int64">g_key_file_set_int64</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="g-key-file-set-uint64">g_key_file_set_uint64</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="g-key-file-set-double">g_key_file_set_double</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="g-key-file-set-string-list">g_key_file_set_string_list</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="g-key-file-set-locale-string-list">g_key_file_set_locale_string_list</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="g-key-file-set-boolean-list">g_key_file_set_boolean_list</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="g-key-file-set-integer-list">g_key_file_set_integer_list</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="g-key-file-set-double-list">g_key_file_set_double_list</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
</entry><entry role="function_name"><link linkend="g-key-file-set-comment">g_key_file_set_comment</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
</entry><entry role="function_name"><link linkend="g-key-file-remove-group">g_key_file_remove_group</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
</entry><entry role="function_name"><link linkend="g-key-file-remove-key">g_key_file_remove_key</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
</entry><entry role="function_name"><link linkend="g-key-file-remove-comment">g_key_file_remove_comment</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="glib-Key-value-file-parser.other" role="other_proto">
<title role="other_proto.title">Types and Values</title>
<informaltable pgwide="1" frame="none">
<tgroup cols="2">
<colspec colname="other_proto_type" colwidth="150px"/>
<colspec colname="other_proto_name"/>
<tbody>
<row><entry role="datatype_keyword"></entry><entry role="function_name"><link linkend="GKeyFile">GKeyFile</link></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="G-KEY-FILE-ERROR:CAPS">G_KEY_FILE_ERROR</link></entry></row>
<row><entry role="datatype_keyword">enum</entry><entry role="function_name"><link linkend="GKeyFileError">GKeyFileError</link></entry></row>
<row><entry role="datatype_keyword">enum</entry><entry role="function_name"><link linkend="GKeyFileFlags">GKeyFileFlags</link></entry></row>




<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="G-KEY-FILE-DESKTOP-GROUP:CAPS">G_KEY_FILE_DESKTOP_GROUP</link></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="G-KEY-FILE-DESKTOP-KEY-TYPE:CAPS">G_KEY_FILE_DESKTOP_KEY_TYPE</link></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="G-KEY-FILE-DESKTOP-KEY-VERSION:CAPS">G_KEY_FILE_DESKTOP_KEY_VERSION</link></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="G-KEY-FILE-DESKTOP-KEY-NAME:CAPS">G_KEY_FILE_DESKTOP_KEY_NAME</link></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="G-KEY-FILE-DESKTOP-KEY-GENERIC-NAME:CAPS">G_KEY_FILE_DESKTOP_KEY_GENERIC_NAME</link></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="G-KEY-FILE-DESKTOP-KEY-NO-DISPLAY:CAPS">G_KEY_FILE_DESKTOP_KEY_NO_DISPLAY</link></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="G-KEY-FILE-DESKTOP-KEY-COMMENT:CAPS">G_KEY_FILE_DESKTOP_KEY_COMMENT</link></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="G-KEY-FILE-DESKTOP-KEY-ICON:CAPS">G_KEY_FILE_DESKTOP_KEY_ICON</link></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="G-KEY-FILE-DESKTOP-KEY-HIDDEN:CAPS">G_KEY_FILE_DESKTOP_KEY_HIDDEN</link></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="G-KEY-FILE-DESKTOP-KEY-ONLY-SHOW-IN:CAPS">G_KEY_FILE_DESKTOP_KEY_ONLY_SHOW_IN</link></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="G-KEY-FILE-DESKTOP-KEY-NOT-SHOW-IN:CAPS">G_KEY_FILE_DESKTOP_KEY_NOT_SHOW_IN</link></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="G-KEY-FILE-DESKTOP-KEY-TRY-EXEC:CAPS">G_KEY_FILE_DESKTOP_KEY_TRY_EXEC</link></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="G-KEY-FILE-DESKTOP-KEY-EXEC:CAPS">G_KEY_FILE_DESKTOP_KEY_EXEC</link></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="G-KEY-FILE-DESKTOP-KEY-PATH:CAPS">G_KEY_FILE_DESKTOP_KEY_PATH</link></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="G-KEY-FILE-DESKTOP-KEY-TERMINAL:CAPS">G_KEY_FILE_DESKTOP_KEY_TERMINAL</link></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="G-KEY-FILE-DESKTOP-KEY-MIME-TYPE:CAPS">G_KEY_FILE_DESKTOP_KEY_MIME_TYPE</link></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="G-KEY-FILE-DESKTOP-KEY-CATEGORIES:CAPS">G_KEY_FILE_DESKTOP_KEY_CATEGORIES</link></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="G-KEY-FILE-DESKTOP-KEY-STARTUP-NOTIFY:CAPS">G_KEY_FILE_DESKTOP_KEY_STARTUP_NOTIFY</link></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="G-KEY-FILE-DESKTOP-KEY-STARTUP-WM-CLASS:CAPS">G_KEY_FILE_DESKTOP_KEY_STARTUP_WM_CLASS</link></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="G-KEY-FILE-DESKTOP-KEY-URL:CAPS">G_KEY_FILE_DESKTOP_KEY_URL</link></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="G-KEY-FILE-DESKTOP-KEY-ACTIONS:CAPS">G_KEY_FILE_DESKTOP_KEY_ACTIONS</link></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="G-KEY-FILE-DESKTOP-KEY-DBUS-ACTIVATABLE:CAPS">G_KEY_FILE_DESKTOP_KEY_DBUS_ACTIVATABLE</link></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="G-KEY-FILE-DESKTOP-TYPE-APPLICATION:CAPS">G_KEY_FILE_DESKTOP_TYPE_APPLICATION</link></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="G-KEY-FILE-DESKTOP-TYPE-LINK:CAPS">G_KEY_FILE_DESKTOP_TYPE_LINK</link></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="G-KEY-FILE-DESKTOP-TYPE-DIRECTORY:CAPS">G_KEY_FILE_DESKTOP_TYPE_DIRECTORY</link></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>

<refsect1 id="glib-Key-value-file-parser.includes"><title>Includes</title><synopsis>#include &lt;glib.h&gt;
#include &lt;glib/gprintf.h&gt;
</synopsis></refsect1>

<refsect1 id="glib-Key-value-file-parser.description" role="desc">
<title role="desc.title">Description</title>
<para><link linkend="GKeyFile"><type>GKeyFile</type></link> lets you parse, edit or create files containing groups of
key-value pairs, which we call "key files" for lack of a better name.
Several freedesktop.org specifications use key files now, e.g the
<ulink url="http://freedesktop.org/Standards/desktop-entry-spec">Desktop Entry Specification</ulink>
and the
<ulink url="http://freedesktop.org/Standards/icon-theme-spec">Icon Theme Specification</ulink>.</para>
<para>The syntax of key files is described in detail in the
<ulink url="http://freedesktop.org/Standards/desktop-entry-spec">Desktop Entry Specification</ulink>,
here is a quick summary: Key files
consists of groups of key-value pairs, interspersed with comments.</para>
<informalexample><programlisting role="example"><![CDATA[
# this is just an example
# there can be comments before the first group

[First Group]

Name=Key File Example\tthis value shows\nescaping

# localized strings are stored in multiple key-value pairs
Welcome=Hello
Welcome[de]=Hallo
Welcome[fr_FR]=Bonjour
Welcome[it]=Ciao
Welcome[be@latin]=Hello

[Another Group]

Numbers=2;20;-200;0

Booleans=true;false;true;true
]]></programlisting></informalexample>
<para></para>
<para>Lines beginning with a '#' and blank lines are considered comments.</para>
<para>Groups are started by a header line containing the group name enclosed
in '[' and ']', and ended implicitly by the start of the next group or
the end of the file. Each key-value pair must be contained in a group.</para>
<para>Key-value pairs generally have the form <literal>key=value</literal>, with the
exception of localized strings, which have the form
<literal>key[locale]=value</literal>, with a locale identifier of the
form <literal>lang_COUNTRY@MODIFIER</literal> where <literal>COUNTRY</literal> and <literal>MODIFIER</literal>
are optional.
Space before and after the '=' character are ignored. Newline, tab,
carriage return and backslash characters in value are escaped as \n,
\t, \r, and \\, respectively. To preserve leading spaces in values,
these can also be escaped as \s.</para>
<para>Key files can store strings (possibly with localized variants), integers,
booleans and lists of these. Lists are separated by a separator character,
typically ';' or ','. To use the list separator character in a value in
a list, it has to be escaped by prefixing it with a backslash.</para>
<para>This syntax is obviously inspired by the .ini files commonly met
on Windows, but there are some important differences:</para>
<itemizedlist>
<listitem>
<para>.ini files use the ';' character to begin comments,
key files use the '#' character.</para>
</listitem>
<listitem>
<para>Key files do not allow for ungrouped keys meaning only
comments can precede the first group.</para>
</listitem>
<listitem>
<para>Key files are always encoded in UTF-8.</para>
</listitem>
<listitem>
<para>Key and Group names are case-sensitive. For example, a group called
[GROUP] is a different from [group].</para>
</listitem>
<listitem>
<para>.ini files don't have a strongly typed boolean entry type,
they only have <link linkend="GetProfileInt"><function>GetProfileInt()</function></link>. In key files, only
true and false (in lower case) are allowed.</para>
</listitem>
</itemizedlist>
<para>Note that in contrast to the
<ulink url="http://freedesktop.org/Standards/desktop-entry-spec">Desktop Entry Specification</ulink>,
groups in key files may contain the same
key multiple times; the last entry wins. Key files may also contain
multiple groups with the same name; they are merged together.
Another difference is that keys and group names in key files are not
restricted to ASCII characters.</para>
<para>Here is an example of loading a key file and reading a value:</para>
<informalexample><programlisting role="example"><![CDATA[
g_autoptr(GError) error = NULL;
g_autoptr(GKeyFile) key_file = g_key_file_new ();

if (!g_key_file_load_from_file (key_file, "key-file.ini", flags, &error))
  {
    if (!g_error_matches (error, G_FILE_ERROR, G_FILE_ERROR_NOENT))
      g_warning ("Error loading key file: %s", error->message);
    return;
  }

g_autofree gchar *val = g_key_file_get_string (key_file, "Group Name", "SomeKey", &error);
if (val == NULL &&
    !g_error_matches (error, G_KEY_FILE_ERROR, G_KEY_FILE_ERROR_KEY_NOT_FOUND))
  {
    g_warning ("Error finding key in key file: %s", error->message);
    return;
  }
else if (val == NULL)
  {
    // Fall back to a default value.
    val = g_strdup ("default-value");
  }
]]></programlisting></informalexample>
<para></para>
<para>Here is an example of creating and saving a key file:</para>
<informalexample><programlisting role="example"><![CDATA[
g_autoptr(GKeyFile) key_file = g_key_file_new ();
const gchar *val = …;
g_autoptr(GError) error = NULL;

g_key_file_set_string (key_file, "Group Name", "SomeKey", val);

// Save as a file.
if (!g_key_file_save_to_file (key_file, "key-file.ini", &error))
  {
    g_warning ("Error saving key file: %s", error->message);
    return;
  }

// Or store to a GBytes for use elsewhere.
gsize data_len;
g_autofree guint8 *data = (guint8 *) g_key_file_to_data (key_file, &data_len, &error);
if (data == NULL)
  {
    g_warning ("Error saving key file: %s", error->message);
    return;
  }
g_autoptr(GBytes) bytes = g_bytes_new_take (g_steal_pointer (&data), data_len);
]]></programlisting></informalexample>
<para></para>

</refsect1>
<refsect1 id="glib-Key-value-file-parser.functions_details" role="details">
<title role="details.title">Functions</title>
<refsect2 id="g-key-file-new" role="function" condition="since:2.6">
<title>g_key_file_new&#160;()</title>
<indexterm zone="g-key-file-new" role="2.6"><primary sortas="key_file_new">g_key_file_new</primary></indexterm>
<programlisting language="C"><link linkend="GKeyFile"><returnvalue>GKeyFile</returnvalue></link>&#160;*
g_key_file_new (<parameter><type>void</type></parameter>);</programlisting>
<para>Creates a new empty <link linkend="GKeyFile"><type>GKeyFile</type></link> object. Use
<link linkend="g-key-file-load-from-file"><function>g_key_file_load_from_file()</function></link>, <link linkend="g-key-file-load-from-data"><function>g_key_file_load_from_data()</function></link>,
<link linkend="g-key-file-load-from-dirs"><function>g_key_file_load_from_dirs()</function></link> or <link linkend="g-key-file-load-from-data-dirs"><function>g_key_file_load_from_data_dirs()</function></link> to
read an existing key file.</para>
<refsect3 id="g-key-file-new.returns" role="returns">
<title>Returns</title>
<para>an empty <link linkend="GKeyFile"><type>GKeyFile</type></link>. </para>
<para><emphasis role="annotation">[<acronym>transfer full</acronym>]</emphasis></para>
</refsect3><para role="since">Since: <link linkend="api-index-2.6">2.6</link></para></refsect2>
<refsect2 id="g-key-file-free" role="function" condition="since:2.6">
<title>g_key_file_free&#160;()</title>
<indexterm zone="g-key-file-free" role="2.6"><primary sortas="key_file_free">g_key_file_free</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
g_key_file_free (<parameter><link linkend="GKeyFile"><type>GKeyFile</type></link> *key_file</parameter>);</programlisting>
<para>Clears all keys and groups from <parameter>key_file</parameter>
, and decreases the
reference count by 1. If the reference count reaches zero,
frees the key file and all its allocated memory.</para>

<para><emphasis role="annotation">[<acronym>skip</acronym>]</emphasis></para><refsect3 id="g-key-file-free.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>key_file</para></entry>
<entry role="parameter_description"><para>a <link linkend="GKeyFile"><type>GKeyFile</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><para role="since">Since: <link linkend="api-index-2.6">2.6</link></para></refsect2>
<refsect2 id="g-key-file-ref" role="function" condition="since:2.32">
<title>g_key_file_ref&#160;()</title>
<indexterm zone="g-key-file-ref" role="2.32"><primary sortas="key_file_ref">g_key_file_ref</primary></indexterm>
<programlisting language="C"><link linkend="GKeyFile"><returnvalue>GKeyFile</returnvalue></link>&#160;*
g_key_file_ref (<parameter><link linkend="GKeyFile"><type>GKeyFile</type></link> *key_file</parameter>);</programlisting>
<para>Increases the reference count of <parameter>key_file</parameter>
.</para>

<para><emphasis role="annotation">[<acronym>skip</acronym>]</emphasis></para><refsect3 id="g-key-file-ref.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>key_file</para></entry>
<entry role="parameter_description"><para>a <link linkend="GKeyFile"><type>GKeyFile</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="g-key-file-ref.returns" role="returns">
<title>Returns</title>
<para> the same <parameter>key_file</parameter>
.</para>
</refsect3><para role="since">Since: <link linkend="api-index-2.32">2.32</link></para></refsect2>
<refsect2 id="g-key-file-unref" role="function" condition="since:2.32">
<title>g_key_file_unref&#160;()</title>
<indexterm zone="g-key-file-unref" role="2.32"><primary sortas="key_file_unref">g_key_file_unref</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
g_key_file_unref (<parameter><link linkend="GKeyFile"><type>GKeyFile</type></link> *key_file</parameter>);</programlisting>
<para>Decreases the reference count of <parameter>key_file</parameter>
 by 1. If the reference count
reaches zero, frees the key file and all its allocated memory.</para>
<refsect3 id="g-key-file-unref.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>key_file</para></entry>
<entry role="parameter_description"><para>a <link linkend="GKeyFile"><type>GKeyFile</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><para role="since">Since: <link linkend="api-index-2.32">2.32</link></para></refsect2>
<refsect2 id="g-key-file-set-list-separator" role="function" condition="since:2.6">
<title>g_key_file_set_list_separator&#160;()</title>
<indexterm zone="g-key-file-set-list-separator" role="2.6"><primary sortas="key_file_set_list_separator">g_key_file_set_list_separator</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
g_key_file_set_list_separator (<parameter><link linkend="GKeyFile"><type>GKeyFile</type></link> *key_file</parameter>,
                               <parameter><link linkend="gchar"><type>gchar</type></link> separator</parameter>);</programlisting>
<para>Sets the character which is used to separate
values in lists. Typically ';' or ',' are used
as separators. The default list separator is ';'.</para>
<refsect3 id="g-key-file-set-list-separator.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>key_file</para></entry>
<entry role="parameter_description"><para>a <link linkend="GKeyFile"><type>GKeyFile</type></link> </para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>separator</para></entry>
<entry role="parameter_description"><para>the separator</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><para role="since">Since: <link linkend="api-index-2.6">2.6</link></para></refsect2>
<refsect2 id="g-key-file-load-from-file" role="function" condition="since:2.6">
<title>g_key_file_load_from_file&#160;()</title>
<indexterm zone="g-key-file-load-from-file" role="2.6"><primary sortas="key_file_load_from_file">g_key_file_load_from_file</primary></indexterm>
<programlisting language="C"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
g_key_file_load_from_file (<parameter><link linkend="GKeyFile"><type>GKeyFile</type></link> *key_file</parameter>,
                           <parameter>const <link linkend="gchar"><type>gchar</type></link> *file</parameter>,
                           <parameter><link linkend="GKeyFileFlags"><type>GKeyFileFlags</type></link> flags</parameter>,
                           <parameter><link linkend="GError"><type>GError</type></link> **error</parameter>);</programlisting>
<para>Loads a key file into an empty <link linkend="GKeyFile"><type>GKeyFile</type></link> structure.</para>
<para>If the OS returns an error when opening or reading the file, a
<link linkend="G-FILE-ERROR:CAPS"><literal>G_FILE_ERROR</literal></link> is returned. If there is a problem parsing the file, a
<link linkend="G-KEY-FILE-ERROR:CAPS"><literal>G_KEY_FILE_ERROR</literal></link> is returned.</para>
<para>This function will never return a <link linkend="G-KEY-FILE-ERROR-NOT-FOUND:CAPS"><literal>G_KEY_FILE_ERROR_NOT_FOUND</literal></link> error. If the
<parameter>file</parameter>
 is not found, <link linkend="G-FILE-ERROR-NOENT:CAPS"><literal>G_FILE_ERROR_NOENT</literal></link> is returned.</para>
<refsect3 id="g-key-file-load-from-file.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>key_file</para></entry>
<entry role="parameter_description"><para>an empty <link linkend="GKeyFile"><type>GKeyFile</type></link> struct</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>file</para></entry>
<entry role="parameter_description"><para>the path of a filename to load, in the GLib filename encoding. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>type</acronym> filename]</emphasis></entry></row>
<row><entry role="parameter_name"><para>flags</para></entry>
<entry role="parameter_description"><para>flags from <link linkend="GKeyFileFlags"><type>GKeyFileFlags</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>error</para></entry>
<entry role="parameter_description"><para>return location for a <link linkend="GError"><type>GError</type></link>, or <link linkend="NULL:CAPS"><literal>NULL</literal></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="g-key-file-load-from-file.returns" role="returns">
<title>Returns</title>
<para> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if a key file could be loaded, <link linkend="FALSE:CAPS"><literal>FALSE</literal></link> otherwise</para>
</refsect3><para role="since">Since: <link linkend="api-index-2.6">2.6</link></para></refsect2>
<refsect2 id="g-key-file-load-from-data" role="function" condition="since:2.6">
<title>g_key_file_load_from_data&#160;()</title>
<indexterm zone="g-key-file-load-from-data" role="2.6"><primary sortas="key_file_load_from_data">g_key_file_load_from_data</primary></indexterm>
<programlisting language="C"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
g_key_file_load_from_data (<parameter><link linkend="GKeyFile"><type>GKeyFile</type></link> *key_file</parameter>,
                           <parameter>const <link linkend="gchar"><type>gchar</type></link> *data</parameter>,
                           <parameter><link linkend="gsize"><type>gsize</type></link> length</parameter>,
                           <parameter><link linkend="GKeyFileFlags"><type>GKeyFileFlags</type></link> flags</parameter>,
                           <parameter><link linkend="GError"><type>GError</type></link> **error</parameter>);</programlisting>
<para>Loads a key file from memory into an empty <link linkend="GKeyFile"><type>GKeyFile</type></link> structure.  
If the object cannot be created then <link linkend="error"><literal>error</literal></link> is set to a <link linkend="GKeyFileError"><type>GKeyFileError</type></link>.</para>
<refsect3 id="g-key-file-load-from-data.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>key_file</para></entry>
<entry role="parameter_description"><para>an empty <link linkend="GKeyFile"><type>GKeyFile</type></link> struct</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>data</para></entry>
<entry role="parameter_description"><para>key file loaded in memory</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>length</para></entry>
<entry role="parameter_description"><para>the length of <parameter>data</parameter>
in bytes (or (gsize)-1 if data is nul-terminated)</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>flags</para></entry>
<entry role="parameter_description"><para>flags from <link linkend="GKeyFileFlags"><type>GKeyFileFlags</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>error</para></entry>
<entry role="parameter_description"><para>return location for a <link linkend="GError"><type>GError</type></link>, or <link linkend="NULL:CAPS"><literal>NULL</literal></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="g-key-file-load-from-data.returns" role="returns">
<title>Returns</title>
<para> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if a key file could be loaded, <link linkend="FALSE:CAPS"><literal>FALSE</literal></link> otherwise</para>
</refsect3><para role="since">Since: <link linkend="api-index-2.6">2.6</link></para></refsect2>
<refsect2 id="g-key-file-load-from-bytes" role="function" condition="since:2.50">
<title>g_key_file_load_from_bytes&#160;()</title>
<indexterm zone="g-key-file-load-from-bytes" role="2.50"><primary sortas="key_file_load_from_bytes">g_key_file_load_from_bytes</primary></indexterm>
<programlisting language="C"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
g_key_file_load_from_bytes (<parameter><link linkend="GKeyFile"><type>GKeyFile</type></link> *key_file</parameter>,
                            <parameter><link linkend="GBytes"><type>GBytes</type></link> *bytes</parameter>,
                            <parameter><link linkend="GKeyFileFlags"><type>GKeyFileFlags</type></link> flags</parameter>,
                            <parameter><link linkend="GError"><type>GError</type></link> **error</parameter>);</programlisting>
<para>Loads a key file from the data in <parameter>bytes</parameter>
 into an empty <link linkend="GKeyFile"><type>GKeyFile</type></link> structure.
If the object cannot be created then <link linkend="error"><literal>error</literal></link> is set to a <link linkend="GKeyFileError"><type>GKeyFileError</type></link>.</para>
<refsect3 id="g-key-file-load-from-bytes.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>key_file</para></entry>
<entry role="parameter_description"><para>an empty <link linkend="GKeyFile"><type>GKeyFile</type></link> struct</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>bytes</para></entry>
<entry role="parameter_description"><para>a <link linkend="GBytes"><type>GBytes</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>flags</para></entry>
<entry role="parameter_description"><para>flags from <link linkend="GKeyFileFlags"><type>GKeyFileFlags</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>error</para></entry>
<entry role="parameter_description"><para>return location for a <link linkend="GError"><type>GError</type></link>, or <link linkend="NULL:CAPS"><literal>NULL</literal></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="g-key-file-load-from-bytes.returns" role="returns">
<title>Returns</title>
<para> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if a key file could be loaded, <link linkend="FALSE:CAPS"><literal>FALSE</literal></link> otherwise</para>
</refsect3><para role="since">Since: <link linkend="api-index-2.50">2.50</link></para></refsect2>
<refsect2 id="g-key-file-load-from-data-dirs" role="function" condition="since:2.6">
<title>g_key_file_load_from_data_dirs&#160;()</title>
<indexterm zone="g-key-file-load-from-data-dirs" role="2.6"><primary sortas="key_file_load_from_data_dirs">g_key_file_load_from_data_dirs</primary></indexterm>
<programlisting language="C"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
g_key_file_load_from_data_dirs (<parameter><link linkend="GKeyFile"><type>GKeyFile</type></link> *key_file</parameter>,
                                <parameter>const <link linkend="gchar"><type>gchar</type></link> *file</parameter>,
                                <parameter><link linkend="gchar"><type>gchar</type></link> **full_path</parameter>,
                                <parameter><link linkend="GKeyFileFlags"><type>GKeyFileFlags</type></link> flags</parameter>,
                                <parameter><link linkend="GError"><type>GError</type></link> **error</parameter>);</programlisting>
<para>This function looks for a key file named <parameter>file</parameter>
 in the paths 
returned from <link linkend="g-get-user-data-dir"><function>g_get_user_data_dir()</function></link> and <link linkend="g-get-system-data-dirs"><function>g_get_system_data_dirs()</function></link>, 
loads the file into <parameter>key_file</parameter>
 and returns the file's full path in 
<parameter>full_path</parameter>
.  If the file could not be loaded then an <link linkend="error"><literal>error</literal></link> is
set to either a <link linkend="GFileError"><type>GFileError</type></link> or <link linkend="GKeyFileError"><type>GKeyFileError</type></link>.</para>
<refsect3 id="g-key-file-load-from-data-dirs.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>key_file</para></entry>
<entry role="parameter_description"><para>an empty <link linkend="GKeyFile"><type>GKeyFile</type></link> struct</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>file</para></entry>
<entry role="parameter_description"><para>a relative path to a filename to open and parse. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>type</acronym> filename]</emphasis></entry></row>
<row><entry role="parameter_name"><para>full_path</para></entry>
<entry role="parameter_description"><para>return location for a string containing the full path
of the file, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>out</acronym>][<acronym>type</acronym> filename][<acronym>optional</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>flags</para></entry>
<entry role="parameter_description"><para>flags from <link linkend="GKeyFileFlags"><type>GKeyFileFlags</type></link> </para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>error</para></entry>
<entry role="parameter_description"><para>return location for a <link linkend="GError"><type>GError</type></link>, or <link linkend="NULL:CAPS"><literal>NULL</literal></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="g-key-file-load-from-data-dirs.returns" role="returns">
<title>Returns</title>
<para> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if a key file could be loaded, <link linkend="FALSE:CAPS"><literal>FALSE</literal></link> othewise</para>
</refsect3><para role="since">Since: <link linkend="api-index-2.6">2.6</link></para></refsect2>
<refsect2 id="g-key-file-load-from-dirs" role="function" condition="since:2.14">
<title>g_key_file_load_from_dirs&#160;()</title>
<indexterm zone="g-key-file-load-from-dirs" role="2.14"><primary sortas="key_file_load_from_dirs">g_key_file_load_from_dirs</primary></indexterm>
<programlisting language="C"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
g_key_file_load_from_dirs (<parameter><link linkend="GKeyFile"><type>GKeyFile</type></link> *key_file</parameter>,
                           <parameter>const <link linkend="gchar"><type>gchar</type></link> *file</parameter>,
                           <parameter>const <link linkend="gchar"><type>gchar</type></link> **search_dirs</parameter>,
                           <parameter><link linkend="gchar"><type>gchar</type></link> **full_path</parameter>,
                           <parameter><link linkend="GKeyFileFlags"><type>GKeyFileFlags</type></link> flags</parameter>,
                           <parameter><link linkend="GError"><type>GError</type></link> **error</parameter>);</programlisting>
<para>This function looks for a key file named <parameter>file</parameter>
 in the paths
specified in <parameter>search_dirs</parameter>
, loads the file into <parameter>key_file</parameter>
 and
returns the file's full path in <parameter>full_path</parameter>
.</para>
<para>If the file could not be found in any of the <parameter>search_dirs</parameter>
,
<link linkend="G-KEY-FILE-ERROR-NOT-FOUND:CAPS"><literal>G_KEY_FILE_ERROR_NOT_FOUND</literal></link> is returned. If
the file is found but the OS returns an error when opening or reading the
file, a <link linkend="G-FILE-ERROR:CAPS"><literal>G_FILE_ERROR</literal></link> is returned. If there is a problem parsing the file, a
<link linkend="G-KEY-FILE-ERROR:CAPS"><literal>G_KEY_FILE_ERROR</literal></link> is returned.</para>
<refsect3 id="g-key-file-load-from-dirs.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>key_file</para></entry>
<entry role="parameter_description"><para>an empty <link linkend="GKeyFile"><type>GKeyFile</type></link> struct</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>file</para></entry>
<entry role="parameter_description"><para>a relative path to a filename to open and parse. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>type</acronym> filename]</emphasis></entry></row>
<row><entry role="parameter_name"><para>search_dirs</para></entry>
<entry role="parameter_description"><para><link linkend="NULL:CAPS"><literal>NULL</literal></link>-terminated array of directories to search. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>array</acronym> zero-terminated=1][<acronym>element-type</acronym> filename]</emphasis></entry></row>
<row><entry role="parameter_name"><para>full_path</para></entry>
<entry role="parameter_description"><para>return location for a string containing the full path
of the file, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>out</acronym>][<acronym>type</acronym> filename][<acronym>optional</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>flags</para></entry>
<entry role="parameter_description"><para>flags from <link linkend="GKeyFileFlags"><type>GKeyFileFlags</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>error</para></entry>
<entry role="parameter_description"><para>return location for a <link linkend="GError"><type>GError</type></link>, or <link linkend="NULL:CAPS"><literal>NULL</literal></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="g-key-file-load-from-dirs.returns" role="returns">
<title>Returns</title>
<para> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if a key file could be loaded, <link linkend="FALSE:CAPS"><literal>FALSE</literal></link> otherwise</para>
</refsect3><para role="since">Since: <link linkend="api-index-2.14">2.14</link></para></refsect2>
<refsect2 id="g-key-file-to-data" role="function" condition="since:2.6">
<title>g_key_file_to_data&#160;()</title>
<indexterm zone="g-key-file-to-data" role="2.6"><primary sortas="key_file_to_data">g_key_file_to_data</primary></indexterm>
<programlisting language="C"><link linkend="gchar"><returnvalue>gchar</returnvalue></link>&#160;*
g_key_file_to_data (<parameter><link linkend="GKeyFile"><type>GKeyFile</type></link> *key_file</parameter>,
                    <parameter><link linkend="gsize"><type>gsize</type></link> *length</parameter>,
                    <parameter><link linkend="GError"><type>GError</type></link> **error</parameter>);</programlisting>
<para>This function outputs <parameter>key_file</parameter>
 as a string.  </para>
<para>Note that this function never reports an error,
so it is safe to pass <link linkend="NULL:CAPS"><literal>NULL</literal></link> as <parameter>error</parameter>
.</para>
<refsect3 id="g-key-file-to-data.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>key_file</para></entry>
<entry role="parameter_description"><para>a <link linkend="GKeyFile"><type>GKeyFile</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>length</para></entry>
<entry role="parameter_description"><para>return location for the length of the
returned string, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>out</acronym>][<acronym>optional</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>error</para></entry>
<entry role="parameter_description"><para>return location for a <link linkend="GError"><type>GError</type></link>, or <link linkend="NULL:CAPS"><literal>NULL</literal></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="g-key-file-to-data.returns" role="returns">
<title>Returns</title>
<para> a newly allocated string holding
the contents of the <link linkend="GKeyFile"><type>GKeyFile</type></link> </para>
</refsect3><para role="since">Since: <link linkend="api-index-2.6">2.6</link></para></refsect2>
<refsect2 id="g-key-file-save-to-file" role="function" condition="since:2.40">
<title>g_key_file_save_to_file&#160;()</title>
<indexterm zone="g-key-file-save-to-file" role="2.40"><primary sortas="key_file_save_to_file">g_key_file_save_to_file</primary></indexterm>
<programlisting language="C"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
g_key_file_save_to_file (<parameter><link linkend="GKeyFile"><type>GKeyFile</type></link> *key_file</parameter>,
                         <parameter>const <link linkend="gchar"><type>gchar</type></link> *filename</parameter>,
                         <parameter><link linkend="GError"><type>GError</type></link> **error</parameter>);</programlisting>
<para>Writes the contents of <parameter>key_file</parameter>
 to <parameter>filename</parameter>
 using
<link linkend="g-file-set-contents"><function>g_file_set_contents()</function></link>.</para>
<para>This function can fail for any of the reasons that
<link linkend="g-file-set-contents"><function>g_file_set_contents()</function></link> may fail.</para>
<refsect3 id="g-key-file-save-to-file.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>key_file</para></entry>
<entry role="parameter_description"><para>a <link linkend="GKeyFile"><type>GKeyFile</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>filename</para></entry>
<entry role="parameter_description"><para>the name of the file to write to</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>error</para></entry>
<entry role="parameter_description"><para>a pointer to a <link linkend="NULL:CAPS"><literal>NULL</literal></link> <link linkend="GError"><type>GError</type></link>, or <link linkend="NULL:CAPS"><literal>NULL</literal></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="g-key-file-save-to-file.returns" role="returns">
<title>Returns</title>
<para> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if successful, else <link linkend="FALSE:CAPS"><literal>FALSE</literal></link> with <parameter>error</parameter>
set</para>
</refsect3><para role="since">Since: <link linkend="api-index-2.40">2.40</link></para></refsect2>
<refsect2 id="g-key-file-get-start-group" role="function" condition="since:2.6">
<title>g_key_file_get_start_group&#160;()</title>
<indexterm zone="g-key-file-get-start-group" role="2.6"><primary sortas="key_file_get_start_group">g_key_file_get_start_group</primary></indexterm>
<programlisting language="C"><link linkend="gchar"><returnvalue>gchar</returnvalue></link>&#160;*
g_key_file_get_start_group (<parameter><link linkend="GKeyFile"><type>GKeyFile</type></link> *key_file</parameter>);</programlisting>
<para>Returns the name of the start group of the file.</para>
<refsect3 id="g-key-file-get-start-group.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>key_file</para></entry>
<entry role="parameter_description"><para>a <link linkend="GKeyFile"><type>GKeyFile</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="g-key-file-get-start-group.returns" role="returns">
<title>Returns</title>
<para> The start group of the key file.</para>
</refsect3><para role="since">Since: <link linkend="api-index-2.6">2.6</link></para></refsect2>
<refsect2 id="g-key-file-get-groups" role="function" condition="since:2.6">
<title>g_key_file_get_groups&#160;()</title>
<indexterm zone="g-key-file-get-groups" role="2.6"><primary sortas="key_file_get_groups">g_key_file_get_groups</primary></indexterm>
<programlisting language="C"><link linkend="gchar"><returnvalue>gchar</returnvalue></link>&#160;**
g_key_file_get_groups (<parameter><link linkend="GKeyFile"><type>GKeyFile</type></link> *key_file</parameter>,
                       <parameter><link linkend="gsize"><type>gsize</type></link> *length</parameter>);</programlisting>
<para>Returns all groups in the key file loaded with <parameter>key_file</parameter>
.  
The array of returned groups will be <link linkend="NULL:CAPS"><literal>NULL</literal></link>-terminated, so 
<parameter>length</parameter>
 may optionally be <link linkend="NULL:CAPS"><literal>NULL</literal></link>.</para>
<refsect3 id="g-key-file-get-groups.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>key_file</para></entry>
<entry role="parameter_description"><para>a <link linkend="GKeyFile"><type>GKeyFile</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>length</para></entry>
<entry role="parameter_description"><para>return location for the number of returned groups, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>out</acronym>][<acronym>optional</acronym>]</emphasis></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="g-key-file-get-groups.returns" role="returns">
<title>Returns</title>
<para>a newly-allocated <link linkend="NULL:CAPS"><literal>NULL</literal></link>-terminated array of strings.
Use <link linkend="g-strfreev"><function>g_strfreev()</function></link> to free it. </para>
<para><emphasis role="annotation">[<acronym>array</acronym> zero-terminated=1][<acronym>transfer full</acronym>]</emphasis></para>
</refsect3><para role="since">Since: <link linkend="api-index-2.6">2.6</link></para></refsect2>
<refsect2 id="g-key-file-get-keys" role="function" condition="since:2.6">
<title>g_key_file_get_keys&#160;()</title>
<indexterm zone="g-key-file-get-keys" role="2.6"><primary sortas="key_file_get_keys">g_key_file_get_keys</primary></indexterm>
<programlisting language="C"><link linkend="gchar"><returnvalue>gchar</returnvalue></link>&#160;**
g_key_file_get_keys (<parameter><link linkend="GKeyFile"><type>GKeyFile</type></link> *key_file</parameter>,
                     <parameter>const <link linkend="gchar"><type>gchar</type></link> *group_name</parameter>,
                     <parameter><link linkend="gsize"><type>gsize</type></link> *length</parameter>,
                     <parameter><link linkend="GError"><type>GError</type></link> **error</parameter>);</programlisting>
<para>Returns all keys for the group name <parameter>group_name</parameter>
.  The array of
returned keys will be <link linkend="NULL:CAPS"><literal>NULL</literal></link>-terminated, so <parameter>length</parameter>
 may
optionally be <link linkend="NULL:CAPS"><literal>NULL</literal></link>. In the event that the <parameter>group_name</parameter>
 cannot
be found, <link linkend="NULL:CAPS"><literal>NULL</literal></link> is returned and <parameter>error</parameter>
 is set to
<link linkend="G-KEY-FILE-ERROR-GROUP-NOT-FOUND:CAPS"><type>G_KEY_FILE_ERROR_GROUP_NOT_FOUND</type></link>.</para>
<refsect3 id="g-key-file-get-keys.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>key_file</para></entry>
<entry role="parameter_description"><para>a <link linkend="GKeyFile"><type>GKeyFile</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>group_name</para></entry>
<entry role="parameter_description"><para>a group name</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>length</para></entry>
<entry role="parameter_description"><para>return location for the number of keys returned, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>out</acronym>][<acronym>optional</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>error</para></entry>
<entry role="parameter_description"><para>return location for a <link linkend="GError"><type>GError</type></link>, or <link linkend="NULL:CAPS"><literal>NULL</literal></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="g-key-file-get-keys.returns" role="returns">
<title>Returns</title>
<para>a newly-allocated <link linkend="NULL:CAPS"><literal>NULL</literal></link>-terminated array of strings.
Use <link linkend="g-strfreev"><function>g_strfreev()</function></link> to free it. </para>
<para><emphasis role="annotation">[<acronym>array</acronym> zero-terminated=1][<acronym>transfer full</acronym>]</emphasis></para>
</refsect3><para role="since">Since: <link linkend="api-index-2.6">2.6</link></para></refsect2>
<refsect2 id="g-key-file-has-group" role="function" condition="since:2.6">
<title>g_key_file_has_group&#160;()</title>
<indexterm zone="g-key-file-has-group" role="2.6"><primary sortas="key_file_has_group">g_key_file_has_group</primary></indexterm>
<programlisting language="C"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
g_key_file_has_group (<parameter><link linkend="GKeyFile"><type>GKeyFile</type></link> *key_file</parameter>,
                      <parameter>const <link linkend="gchar"><type>gchar</type></link> *group_name</parameter>);</programlisting>
<para>Looks whether the key file has the group <parameter>group_name</parameter>
.</para>
<refsect3 id="g-key-file-has-group.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>key_file</para></entry>
<entry role="parameter_description"><para>a <link linkend="GKeyFile"><type>GKeyFile</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>group_name</para></entry>
<entry role="parameter_description"><para>a group name</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="g-key-file-has-group.returns" role="returns">
<title>Returns</title>
<para> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if <parameter>group_name</parameter>
is a part of <parameter>key_file</parameter>
, <link linkend="FALSE:CAPS"><literal>FALSE</literal></link>
otherwise.</para>
</refsect3><para role="since">Since: <link linkend="api-index-2.6">2.6</link></para></refsect2>
<refsect2 id="g-key-file-has-key" role="function" condition="since:2.6">
<title>g_key_file_has_key&#160;()</title>
<indexterm zone="g-key-file-has-key" role="2.6"><primary sortas="key_file_has_key">g_key_file_has_key</primary></indexterm>
<programlisting language="C"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
g_key_file_has_key (<parameter><link linkend="GKeyFile"><type>GKeyFile</type></link> *key_file</parameter>,
                    <parameter>const <link linkend="gchar"><type>gchar</type></link> *group_name</parameter>,
                    <parameter>const <link linkend="gchar"><type>gchar</type></link> *key</parameter>,
                    <parameter><link linkend="GError"><type>GError</type></link> **error</parameter>);</programlisting>
<para>Looks whether the key file has the key <parameter>key</parameter>
 in the group
<parameter>group_name</parameter>
.</para>
<para>Note that this function does not follow the rules for <link linkend="GError"><type>GError</type></link> strictly;
the return value both carries meaning and signals an error.  To use
this function, you must pass a <link linkend="GError"><type>GError</type></link> pointer in <parameter>error</parameter>
, and check
whether it is not <link linkend="NULL:CAPS"><literal>NULL</literal></link> to see if an error occurred.</para>
<para>Language bindings should use <link linkend="g-key-file-get-value"><function>g_key_file_get_value()</function></link> to test whether
or not a key exists.</para>

<para><emphasis role="annotation">[<acronym>skip</acronym>]</emphasis></para><refsect3 id="g-key-file-has-key.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>key_file</para></entry>
<entry role="parameter_description"><para>a <link linkend="GKeyFile"><type>GKeyFile</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>group_name</para></entry>
<entry role="parameter_description"><para>a group name</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>key</para></entry>
<entry role="parameter_description"><para>a key name</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>error</para></entry>
<entry role="parameter_description"><para>return location for a <link linkend="GError"><type>GError</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="g-key-file-has-key.returns" role="returns">
<title>Returns</title>
<para> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if <parameter>key</parameter>
is a part of <parameter>group_name</parameter>
, <link linkend="FALSE:CAPS"><literal>FALSE</literal></link> otherwise</para>
</refsect3><para role="since">Since: <link linkend="api-index-2.6">2.6</link></para></refsect2>
<refsect2 id="g-key-file-get-value" role="function" condition="since:2.6">
<title>g_key_file_get_value&#160;()</title>
<indexterm zone="g-key-file-get-value" role="2.6"><primary sortas="key_file_get_value">g_key_file_get_value</primary></indexterm>
<programlisting language="C"><link linkend="gchar"><returnvalue>gchar</returnvalue></link>&#160;*
g_key_file_get_value (<parameter><link linkend="GKeyFile"><type>GKeyFile</type></link> *key_file</parameter>,
                      <parameter>const <link linkend="gchar"><type>gchar</type></link> *group_name</parameter>,
                      <parameter>const <link linkend="gchar"><type>gchar</type></link> *key</parameter>,
                      <parameter><link linkend="GError"><type>GError</type></link> **error</parameter>);</programlisting>
<para>Returns the raw value associated with <parameter>key</parameter>
 under <parameter>group_name</parameter>
. 
Use <link linkend="g-key-file-get-string"><function>g_key_file_get_string()</function></link> to retrieve an unescaped UTF-8 string. </para>
<para>In the event the key cannot be found, <link linkend="NULL:CAPS"><literal>NULL</literal></link> is returned and 
<parameter>error</parameter>
 is set to <link linkend="G-KEY-FILE-ERROR-KEY-NOT-FOUND:CAPS"><type>G_KEY_FILE_ERROR_KEY_NOT_FOUND</type></link>.  In the 
event that the <parameter>group_name</parameter>
 cannot be found, <link linkend="NULL:CAPS"><literal>NULL</literal></link> is returned 
and <parameter>error</parameter>
 is set to <link linkend="G-KEY-FILE-ERROR-GROUP-NOT-FOUND:CAPS"><type>G_KEY_FILE_ERROR_GROUP_NOT_FOUND</type></link>.</para>
<refsect3 id="g-key-file-get-value.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>key_file</para></entry>
<entry role="parameter_description"><para>a <link linkend="GKeyFile"><type>GKeyFile</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>group_name</para></entry>
<entry role="parameter_description"><para>a group name</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>key</para></entry>
<entry role="parameter_description"><para>a key</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>error</para></entry>
<entry role="parameter_description"><para>return location for a <link linkend="GError"><type>GError</type></link>, or <link linkend="NULL:CAPS"><literal>NULL</literal></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="g-key-file-get-value.returns" role="returns">
<title>Returns</title>
<para> a newly allocated string or <link linkend="NULL:CAPS"><literal>NULL</literal></link> if the specified
key cannot be found.</para>
</refsect3><para role="since">Since: <link linkend="api-index-2.6">2.6</link></para></refsect2>
<refsect2 id="g-key-file-get-string" role="function" condition="since:2.6">
<title>g_key_file_get_string&#160;()</title>
<indexterm zone="g-key-file-get-string" role="2.6"><primary sortas="key_file_get_string">g_key_file_get_string</primary></indexterm>
<programlisting language="C"><link linkend="gchar"><returnvalue>gchar</returnvalue></link>&#160;*
g_key_file_get_string (<parameter><link linkend="GKeyFile"><type>GKeyFile</type></link> *key_file</parameter>,
                       <parameter>const <link linkend="gchar"><type>gchar</type></link> *group_name</parameter>,
                       <parameter>const <link linkend="gchar"><type>gchar</type></link> *key</parameter>,
                       <parameter><link linkend="GError"><type>GError</type></link> **error</parameter>);</programlisting>
<para>Returns the string value associated with <parameter>key</parameter>
 under <parameter>group_name</parameter>
.
Unlike <link linkend="g-key-file-get-value"><function>g_key_file_get_value()</function></link>, this function handles escape sequences
like \s.</para>
<para>In the event the key cannot be found, <link linkend="NULL:CAPS"><literal>NULL</literal></link> is returned and 
<parameter>error</parameter>
 is set to <link linkend="G-KEY-FILE-ERROR-KEY-NOT-FOUND:CAPS"><type>G_KEY_FILE_ERROR_KEY_NOT_FOUND</type></link>.  In the 
event that the <parameter>group_name</parameter>
 cannot be found, <link linkend="NULL:CAPS"><literal>NULL</literal></link> is returned 
and <parameter>error</parameter>
 is set to <link linkend="G-KEY-FILE-ERROR-GROUP-NOT-FOUND:CAPS"><type>G_KEY_FILE_ERROR_GROUP_NOT_FOUND</type></link>.</para>
<refsect3 id="g-key-file-get-string.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>key_file</para></entry>
<entry role="parameter_description"><para>a <link linkend="GKeyFile"><type>GKeyFile</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>group_name</para></entry>
<entry role="parameter_description"><para>a group name</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>key</para></entry>
<entry role="parameter_description"><para>a key</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>error</para></entry>
<entry role="parameter_description"><para>return location for a <link linkend="GError"><type>GError</type></link>, or <link linkend="NULL:CAPS"><literal>NULL</literal></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="g-key-file-get-string.returns" role="returns">
<title>Returns</title>
<para> a newly allocated string or <link linkend="NULL:CAPS"><literal>NULL</literal></link> if the specified
key cannot be found.</para>
</refsect3><para role="since">Since: <link linkend="api-index-2.6">2.6</link></para></refsect2>
<refsect2 id="g-key-file-get-locale-string" role="function" condition="since:2.6">
<title>g_key_file_get_locale_string&#160;()</title>
<indexterm zone="g-key-file-get-locale-string" role="2.6"><primary sortas="key_file_get_locale_string">g_key_file_get_locale_string</primary></indexterm>
<programlisting language="C"><link linkend="gchar"><returnvalue>gchar</returnvalue></link>&#160;*
g_key_file_get_locale_string (<parameter><link linkend="GKeyFile"><type>GKeyFile</type></link> *key_file</parameter>,
                              <parameter>const <link linkend="gchar"><type>gchar</type></link> *group_name</parameter>,
                              <parameter>const <link linkend="gchar"><type>gchar</type></link> *key</parameter>,
                              <parameter>const <link linkend="gchar"><type>gchar</type></link> *locale</parameter>,
                              <parameter><link linkend="GError"><type>GError</type></link> **error</parameter>);</programlisting>
<para>Returns the value associated with <parameter>key</parameter>
 under <parameter>group_name</parameter>

translated in the given <parameter>locale</parameter>
 if available.  If <parameter>locale</parameter>
 is
<link linkend="NULL:CAPS"><literal>NULL</literal></link> then the current locale is assumed. </para>
<para>If <parameter>locale</parameter>
 is to be non-<link linkend="NULL:CAPS"><literal>NULL</literal></link>, or if the current locale will change over
the lifetime of the <link linkend="GKeyFile"><type>GKeyFile</type></link>, it must be loaded with
<link linkend="G-KEY-FILE-KEEP-TRANSLATIONS:CAPS"><literal>G_KEY_FILE_KEEP_TRANSLATIONS</literal></link> in order to load strings for all locales.</para>
<para>If <parameter>key</parameter>
 cannot be found then <link linkend="NULL:CAPS"><literal>NULL</literal></link> is returned and <parameter>error</parameter>
 is set 
to <link linkend="G-KEY-FILE-ERROR-KEY-NOT-FOUND:CAPS"><type>G_KEY_FILE_ERROR_KEY_NOT_FOUND</type></link>. If the value associated
with <parameter>key</parameter>
 cannot be interpreted or no suitable translation can
be found then the untranslated value is returned.</para>
<refsect3 id="g-key-file-get-locale-string.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>key_file</para></entry>
<entry role="parameter_description"><para>a <link linkend="GKeyFile"><type>GKeyFile</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>group_name</para></entry>
<entry role="parameter_description"><para>a group name</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>key</para></entry>
<entry role="parameter_description"><para>a key</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>locale</para></entry>
<entry role="parameter_description"><para>a locale identifier or <link linkend="NULL:CAPS"><literal>NULL</literal></link>. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>nullable</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>error</para></entry>
<entry role="parameter_description"><para>return location for a <link linkend="GError"><type>GError</type></link>, or <link linkend="NULL:CAPS"><literal>NULL</literal></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="g-key-file-get-locale-string.returns" role="returns">
<title>Returns</title>
<para> a newly allocated string or <link linkend="NULL:CAPS"><literal>NULL</literal></link> if the specified
key cannot be found.</para>
</refsect3><para role="since">Since: <link linkend="api-index-2.6">2.6</link></para></refsect2>
<refsect2 id="g-key-file-get-locale-for-key" role="function" condition="since:2.56">
<title>g_key_file_get_locale_for_key&#160;()</title>
<indexterm zone="g-key-file-get-locale-for-key" role="2.56"><primary sortas="key_file_get_locale_for_key">g_key_file_get_locale_for_key</primary></indexterm>
<programlisting language="C"><link linkend="gchar"><returnvalue>gchar</returnvalue></link>&#160;*
g_key_file_get_locale_for_key (<parameter><link linkend="GKeyFile"><type>GKeyFile</type></link> *key_file</parameter>,
                               <parameter>const <link linkend="gchar"><type>gchar</type></link> *group_name</parameter>,
                               <parameter>const <link linkend="gchar"><type>gchar</type></link> *key</parameter>,
                               <parameter>const <link linkend="gchar"><type>gchar</type></link> *locale</parameter>);</programlisting>
<para>Returns the actual locale which the result of
<link linkend="g-key-file-get-locale-string"><function>g_key_file_get_locale_string()</function></link> or <link linkend="g-key-file-get-locale-string-list"><function>g_key_file_get_locale_string_list()</function></link>
came from.</para>
<para>If calling <link linkend="g-key-file-get-locale-string"><function>g_key_file_get_locale_string()</function></link> or
<link linkend="g-key-file-get-locale-string-list"><function>g_key_file_get_locale_string_list()</function></link> with exactly the same <parameter>key_file</parameter>
,
<parameter>group_name</parameter>
, <parameter>key</parameter>
 and <parameter>locale</parameter>
, the result of those functions will
have originally been tagged with the locale that is the result of
this function.</para>
<refsect3 id="g-key-file-get-locale-for-key.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>key_file</para></entry>
<entry role="parameter_description"><para>a <link linkend="GKeyFile"><type>GKeyFile</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>group_name</para></entry>
<entry role="parameter_description"><para>a group name</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>key</para></entry>
<entry role="parameter_description"><para>a key</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>locale</para></entry>
<entry role="parameter_description"><para>a locale identifier or <link linkend="NULL:CAPS"><literal>NULL</literal></link>. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>nullable</acronym>]</emphasis></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="g-key-file-get-locale-for-key.returns" role="returns">
<title>Returns</title>
<para>the locale from the file, or <link linkend="NULL:CAPS"><literal>NULL</literal></link> if the key was not
found or the entry in the file was was untranslated. </para>
<para><emphasis role="annotation">[<acronym>nullable</acronym>]</emphasis></para>
</refsect3><para role="since">Since: <link linkend="api-index-2.56">2.56</link></para></refsect2>
<refsect2 id="g-key-file-get-boolean" role="function" condition="since:2.6">
<title>g_key_file_get_boolean&#160;()</title>
<indexterm zone="g-key-file-get-boolean" role="2.6"><primary sortas="key_file_get_boolean">g_key_file_get_boolean</primary></indexterm>
<programlisting language="C"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
g_key_file_get_boolean (<parameter><link linkend="GKeyFile"><type>GKeyFile</type></link> *key_file</parameter>,
                        <parameter>const <link linkend="gchar"><type>gchar</type></link> *group_name</parameter>,
                        <parameter>const <link linkend="gchar"><type>gchar</type></link> *key</parameter>,
                        <parameter><link linkend="GError"><type>GError</type></link> **error</parameter>);</programlisting>
<para>Returns the value associated with <parameter>key</parameter>
 under <parameter>group_name</parameter>
 as a
boolean. </para>
<para>If <parameter>key</parameter>
 cannot be found then <link linkend="FALSE:CAPS"><literal>FALSE</literal></link> is returned and <parameter>error</parameter>
 is set
to <link linkend="G-KEY-FILE-ERROR-KEY-NOT-FOUND:CAPS"><type>G_KEY_FILE_ERROR_KEY_NOT_FOUND</type></link>. Likewise, if the value
associated with <parameter>key</parameter>
 cannot be interpreted as a boolean then <link linkend="FALSE:CAPS"><literal>FALSE</literal></link>
is returned and <parameter>error</parameter>
 is set to <link linkend="G-KEY-FILE-ERROR-INVALID-VALUE:CAPS"><type>G_KEY_FILE_ERROR_INVALID_VALUE</type></link>.</para>
<refsect3 id="g-key-file-get-boolean.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>key_file</para></entry>
<entry role="parameter_description"><para>a <link linkend="GKeyFile"><type>GKeyFile</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>group_name</para></entry>
<entry role="parameter_description"><para>a group name</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>key</para></entry>
<entry role="parameter_description"><para>a key</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>error</para></entry>
<entry role="parameter_description"><para>return location for a <link linkend="GError"><type>GError</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="g-key-file-get-boolean.returns" role="returns">
<title>Returns</title>
<para> the value associated with the key as a boolean,
or <link linkend="FALSE:CAPS"><literal>FALSE</literal></link> if the key was not found or could not be parsed.</para>
</refsect3><para role="since">Since: <link linkend="api-index-2.6">2.6</link></para></refsect2>
<refsect2 id="g-key-file-get-integer" role="function" condition="since:2.6">
<title>g_key_file_get_integer&#160;()</title>
<indexterm zone="g-key-file-get-integer" role="2.6"><primary sortas="key_file_get_integer">g_key_file_get_integer</primary></indexterm>
<programlisting language="C"><link linkend="gint"><returnvalue>gint</returnvalue></link>
g_key_file_get_integer (<parameter><link linkend="GKeyFile"><type>GKeyFile</type></link> *key_file</parameter>,
                        <parameter>const <link linkend="gchar"><type>gchar</type></link> *group_name</parameter>,
                        <parameter>const <link linkend="gchar"><type>gchar</type></link> *key</parameter>,
                        <parameter><link linkend="GError"><type>GError</type></link> **error</parameter>);</programlisting>
<para>Returns the value associated with <parameter>key</parameter>
 under <parameter>group_name</parameter>
 as an
integer. </para>
<para>If <parameter>key</parameter>
 cannot be found then 0 is returned and <parameter>error</parameter>
 is set to
<link linkend="G-KEY-FILE-ERROR-KEY-NOT-FOUND:CAPS"><type>G_KEY_FILE_ERROR_KEY_NOT_FOUND</type></link>. Likewise, if the value associated
with <parameter>key</parameter>
 cannot be interpreted as an integer, or is out of range
for a <link linkend="gint"><type>gint</type></link>, then 0 is returned
and <parameter>error</parameter>
 is set to <link linkend="G-KEY-FILE-ERROR-INVALID-VALUE:CAPS"><type>G_KEY_FILE_ERROR_INVALID_VALUE</type></link>.</para>
<refsect3 id="g-key-file-get-integer.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>key_file</para></entry>
<entry role="parameter_description"><para>a <link linkend="GKeyFile"><type>GKeyFile</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>group_name</para></entry>
<entry role="parameter_description"><para>a group name</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>key</para></entry>
<entry role="parameter_description"><para>a key</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>error</para></entry>
<entry role="parameter_description"><para>return location for a <link linkend="GError"><type>GError</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="g-key-file-get-integer.returns" role="returns">
<title>Returns</title>
<para> the value associated with the key as an integer, or
0 if the key was not found or could not be parsed.</para>
</refsect3><para role="since">Since: <link linkend="api-index-2.6">2.6</link></para></refsect2>
<refsect2 id="g-key-file-get-int64" role="function" condition="since:2.26">
<title>g_key_file_get_int64&#160;()</title>
<indexterm zone="g-key-file-get-int64" role="2.26"><primary sortas="key_file_get_int64">g_key_file_get_int64</primary></indexterm>
<programlisting language="C"><link linkend="gint64"><returnvalue>gint64</returnvalue></link>
g_key_file_get_int64 (<parameter><link linkend="GKeyFile"><type>GKeyFile</type></link> *key_file</parameter>,
                      <parameter>const <link linkend="gchar"><type>gchar</type></link> *group_name</parameter>,
                      <parameter>const <link linkend="gchar"><type>gchar</type></link> *key</parameter>,
                      <parameter><link linkend="GError"><type>GError</type></link> **error</parameter>);</programlisting>
<para>Returns the value associated with <parameter>key</parameter>
 under <parameter>group_name</parameter>
 as a signed
64-bit integer. This is similar to <link linkend="g-key-file-get-integer"><function>g_key_file_get_integer()</function></link> but can return
64-bit results without truncation.</para>
<refsect3 id="g-key-file-get-int64.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>key_file</para></entry>
<entry role="parameter_description"><para>a non-<link linkend="NULL:CAPS"><literal>NULL</literal></link> <link linkend="GKeyFile"><type>GKeyFile</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>group_name</para></entry>
<entry role="parameter_description"><para>a non-<link linkend="NULL:CAPS"><literal>NULL</literal></link> group name</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>key</para></entry>
<entry role="parameter_description"><para>a non-<link linkend="NULL:CAPS"><literal>NULL</literal></link> key</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>error</para></entry>
<entry role="parameter_description"><para>return location for a <link linkend="GError"><type>GError</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="g-key-file-get-int64.returns" role="returns">
<title>Returns</title>
<para> the value associated with the key as a signed 64-bit integer, or
0 if the key was not found or could not be parsed.</para>
</refsect3><para role="since">Since: <link linkend="api-index-2.26">2.26</link></para></refsect2>
<refsect2 id="g-key-file-get-uint64" role="function" condition="since:2.26">
<title>g_key_file_get_uint64&#160;()</title>
<indexterm zone="g-key-file-get-uint64" role="2.26"><primary sortas="key_file_get_uint64">g_key_file_get_uint64</primary></indexterm>
<programlisting language="C"><link linkend="guint64"><returnvalue>guint64</returnvalue></link>
g_key_file_get_uint64 (<parameter><link linkend="GKeyFile"><type>GKeyFile</type></link> *key_file</parameter>,
                       <parameter>const <link linkend="gchar"><type>gchar</type></link> *group_name</parameter>,
                       <parameter>const <link linkend="gchar"><type>gchar</type></link> *key</parameter>,
                       <parameter><link linkend="GError"><type>GError</type></link> **error</parameter>);</programlisting>
<para>Returns the value associated with <parameter>key</parameter>
 under <parameter>group_name</parameter>
 as an unsigned
64-bit integer. This is similar to <link linkend="g-key-file-get-integer"><function>g_key_file_get_integer()</function></link> but can return
large positive results without truncation.</para>
<refsect3 id="g-key-file-get-uint64.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>key_file</para></entry>
<entry role="parameter_description"><para>a non-<link linkend="NULL:CAPS"><literal>NULL</literal></link> <link linkend="GKeyFile"><type>GKeyFile</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>group_name</para></entry>
<entry role="parameter_description"><para>a non-<link linkend="NULL:CAPS"><literal>NULL</literal></link> group name</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>key</para></entry>
<entry role="parameter_description"><para>a non-<link linkend="NULL:CAPS"><literal>NULL</literal></link> key</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>error</para></entry>
<entry role="parameter_description"><para>return location for a <link linkend="GError"><type>GError</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="g-key-file-get-uint64.returns" role="returns">
<title>Returns</title>
<para> the value associated with the key as an unsigned 64-bit integer,
or 0 if the key was not found or could not be parsed.</para>
</refsect3><para role="since">Since: <link linkend="api-index-2.26">2.26</link></para></refsect2>
<refsect2 id="g-key-file-get-double" role="function" condition="since:2.12">
<title>g_key_file_get_double&#160;()</title>
<indexterm zone="g-key-file-get-double" role="2.12"><primary sortas="key_file_get_double">g_key_file_get_double</primary></indexterm>
<programlisting language="C"><link linkend="gdouble"><returnvalue>gdouble</returnvalue></link>
g_key_file_get_double (<parameter><link linkend="GKeyFile"><type>GKeyFile</type></link> *key_file</parameter>,
                       <parameter>const <link linkend="gchar"><type>gchar</type></link> *group_name</parameter>,
                       <parameter>const <link linkend="gchar"><type>gchar</type></link> *key</parameter>,
                       <parameter><link linkend="GError"><type>GError</type></link> **error</parameter>);</programlisting>
<para>Returns the value associated with <parameter>key</parameter>
 under <parameter>group_name</parameter>
 as a
double. If <parameter>group_name</parameter>
 is <link linkend="NULL:CAPS"><literal>NULL</literal></link>, the start_group is used.</para>
<para>If <parameter>key</parameter>
 cannot be found then 0.0 is returned and <parameter>error</parameter>
 is set to
<link linkend="G-KEY-FILE-ERROR-KEY-NOT-FOUND:CAPS"><type>G_KEY_FILE_ERROR_KEY_NOT_FOUND</type></link>. Likewise, if the value associated
with <parameter>key</parameter>
 cannot be interpreted as a double then 0.0 is returned
and <parameter>error</parameter>
 is set to <link linkend="G-KEY-FILE-ERROR-INVALID-VALUE:CAPS"><type>G_KEY_FILE_ERROR_INVALID_VALUE</type></link>.</para>
<refsect3 id="g-key-file-get-double.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>key_file</para></entry>
<entry role="parameter_description"><para>a <link linkend="GKeyFile"><type>GKeyFile</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>group_name</para></entry>
<entry role="parameter_description"><para>a group name</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>key</para></entry>
<entry role="parameter_description"><para>a key</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>error</para></entry>
<entry role="parameter_description"><para>return location for a <link linkend="GError"><type>GError</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="g-key-file-get-double.returns" role="returns">
<title>Returns</title>
<para> the value associated with the key as a double, or
0.0 if the key was not found or could not be parsed.</para>
</refsect3><para role="since">Since: <link linkend="api-index-2.12">2.12</link></para></refsect2>
<refsect2 id="g-key-file-get-string-list" role="function" condition="since:2.6">
<title>g_key_file_get_string_list&#160;()</title>
<indexterm zone="g-key-file-get-string-list" role="2.6"><primary sortas="key_file_get_string_list">g_key_file_get_string_list</primary></indexterm>
<programlisting language="C"><link linkend="gchar"><returnvalue>gchar</returnvalue></link>&#160;**
g_key_file_get_string_list (<parameter><link linkend="GKeyFile"><type>GKeyFile</type></link> *key_file</parameter>,
                            <parameter>const <link linkend="gchar"><type>gchar</type></link> *group_name</parameter>,
                            <parameter>const <link linkend="gchar"><type>gchar</type></link> *key</parameter>,
                            <parameter><link linkend="gsize"><type>gsize</type></link> *length</parameter>,
                            <parameter><link linkend="GError"><type>GError</type></link> **error</parameter>);</programlisting>
<para>Returns the values associated with <parameter>key</parameter>
 under <parameter>group_name</parameter>
.</para>
<para>In the event the key cannot be found, <link linkend="NULL:CAPS"><literal>NULL</literal></link> is returned and
<parameter>error</parameter>
 is set to <link linkend="G-KEY-FILE-ERROR-KEY-NOT-FOUND:CAPS"><type>G_KEY_FILE_ERROR_KEY_NOT_FOUND</type></link>.  In the
event that the <parameter>group_name</parameter>
 cannot be found, <link linkend="NULL:CAPS"><literal>NULL</literal></link> is returned
and <parameter>error</parameter>
 is set to <link linkend="G-KEY-FILE-ERROR-GROUP-NOT-FOUND:CAPS"><type>G_KEY_FILE_ERROR_GROUP_NOT_FOUND</type></link>.</para>
<refsect3 id="g-key-file-get-string-list.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>key_file</para></entry>
<entry role="parameter_description"><para>a <link linkend="GKeyFile"><type>GKeyFile</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>group_name</para></entry>
<entry role="parameter_description"><para>a group name</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>key</para></entry>
<entry role="parameter_description"><para>a key</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>length</para></entry>
<entry role="parameter_description"><para>return location for the number of returned strings, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>out</acronym>][<acronym>optional</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>error</para></entry>
<entry role="parameter_description"><para>return location for a <link linkend="GError"><type>GError</type></link>, or <link linkend="NULL:CAPS"><literal>NULL</literal></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="g-key-file-get-string-list.returns" role="returns">
<title>Returns</title>
<para>a <link linkend="NULL:CAPS"><literal>NULL</literal></link>-terminated string array or <link linkend="NULL:CAPS"><literal>NULL</literal></link> if the specified
key cannot be found. The array should be freed with <link linkend="g-strfreev"><function>g_strfreev()</function></link>. </para>
<para><emphasis role="annotation">[<acronym>array</acronym> zero-terminated=1 length=length][<acronym>element-type</acronym> utf8][<acronym>transfer full</acronym>]</emphasis></para>
</refsect3><para role="since">Since: <link linkend="api-index-2.6">2.6</link></para></refsect2>
<refsect2 id="g-key-file-get-locale-string-list" role="function" condition="since:2.6">
<title>g_key_file_get_locale_string_list&#160;()</title>
<indexterm zone="g-key-file-get-locale-string-list" role="2.6"><primary sortas="key_file_get_locale_string_list">g_key_file_get_locale_string_list</primary></indexterm>
<programlisting language="C"><link linkend="gchar"><returnvalue>gchar</returnvalue></link>&#160;**
g_key_file_get_locale_string_list (<parameter><link linkend="GKeyFile"><type>GKeyFile</type></link> *key_file</parameter>,
                                   <parameter>const <link linkend="gchar"><type>gchar</type></link> *group_name</parameter>,
                                   <parameter>const <link linkend="gchar"><type>gchar</type></link> *key</parameter>,
                                   <parameter>const <link linkend="gchar"><type>gchar</type></link> *locale</parameter>,
                                   <parameter><link linkend="gsize"><type>gsize</type></link> *length</parameter>,
                                   <parameter><link linkend="GError"><type>GError</type></link> **error</parameter>);</programlisting>
<para>Returns the values associated with <parameter>key</parameter>
 under <parameter>group_name</parameter>

translated in the given <parameter>locale</parameter>
 if available.  If <parameter>locale</parameter>
 is
<link linkend="NULL:CAPS"><literal>NULL</literal></link> then the current locale is assumed.</para>
<para>If <parameter>locale</parameter>
 is to be non-<link linkend="NULL:CAPS"><literal>NULL</literal></link>, or if the current locale will change over
the lifetime of the <link linkend="GKeyFile"><type>GKeyFile</type></link>, it must be loaded with
<link linkend="G-KEY-FILE-KEEP-TRANSLATIONS:CAPS"><literal>G_KEY_FILE_KEEP_TRANSLATIONS</literal></link> in order to load strings for all locales.</para>
<para>If <parameter>key</parameter>
 cannot be found then <link linkend="NULL:CAPS"><literal>NULL</literal></link> is returned and <parameter>error</parameter>
 is set 
to <link linkend="G-KEY-FILE-ERROR-KEY-NOT-FOUND:CAPS"><type>G_KEY_FILE_ERROR_KEY_NOT_FOUND</type></link>. If the values associated
with <parameter>key</parameter>
 cannot be interpreted or no suitable translations
can be found then the untranslated values are returned. The 
returned array is <link linkend="NULL:CAPS"><literal>NULL</literal></link>-terminated, so <parameter>length</parameter>
 may optionally 
be <link linkend="NULL:CAPS"><literal>NULL</literal></link>.</para>
<refsect3 id="g-key-file-get-locale-string-list.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>key_file</para></entry>
<entry role="parameter_description"><para>a <link linkend="GKeyFile"><type>GKeyFile</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>group_name</para></entry>
<entry role="parameter_description"><para>a group name</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>key</para></entry>
<entry role="parameter_description"><para>a key</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>locale</para></entry>
<entry role="parameter_description"><para>a locale identifier or <link linkend="NULL:CAPS"><literal>NULL</literal></link>. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>nullable</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>length</para></entry>
<entry role="parameter_description"><para>return location for the number of returned strings or <link linkend="NULL:CAPS"><literal>NULL</literal></link>. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>out</acronym>][<acronym>optional</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>error</para></entry>
<entry role="parameter_description"><para>return location for a <link linkend="GError"><type>GError</type></link> or <link linkend="NULL:CAPS"><literal>NULL</literal></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="g-key-file-get-locale-string-list.returns" role="returns">
<title>Returns</title>
<para>a newly allocated <link linkend="NULL:CAPS"><literal>NULL</literal></link>-terminated string array
or <link linkend="NULL:CAPS"><literal>NULL</literal></link> if the key isn't found. The string array should be freed
with <link linkend="g-strfreev"><function>g_strfreev()</function></link>. </para>
<para><emphasis role="annotation">[<acronym>array</acronym> zero-terminated=1 length=length][<acronym>element-type</acronym> utf8][<acronym>transfer full</acronym>]</emphasis></para>
</refsect3><para role="since">Since: <link linkend="api-index-2.6">2.6</link></para></refsect2>
<refsect2 id="g-key-file-get-boolean-list" role="function" condition="since:2.6">
<title>g_key_file_get_boolean_list&#160;()</title>
<indexterm zone="g-key-file-get-boolean-list" role="2.6"><primary sortas="key_file_get_boolean_list">g_key_file_get_boolean_list</primary></indexterm>
<programlisting language="C"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>&#160;*
g_key_file_get_boolean_list (<parameter><link linkend="GKeyFile"><type>GKeyFile</type></link> *key_file</parameter>,
                             <parameter>const <link linkend="gchar"><type>gchar</type></link> *group_name</parameter>,
                             <parameter>const <link linkend="gchar"><type>gchar</type></link> *key</parameter>,
                             <parameter><link linkend="gsize"><type>gsize</type></link> *length</parameter>,
                             <parameter><link linkend="GError"><type>GError</type></link> **error</parameter>);</programlisting>
<para>Returns the values associated with <parameter>key</parameter>
 under <parameter>group_name</parameter>
 as
booleans. </para>
<para>If <parameter>key</parameter>
 cannot be found then <link linkend="NULL:CAPS"><literal>NULL</literal></link> is returned and <parameter>error</parameter>
 is set to
<link linkend="G-KEY-FILE-ERROR-KEY-NOT-FOUND:CAPS"><type>G_KEY_FILE_ERROR_KEY_NOT_FOUND</type></link>. Likewise, if the values associated
with <parameter>key</parameter>
 cannot be interpreted as booleans then <link linkend="NULL:CAPS"><literal>NULL</literal></link> is returned
and <parameter>error</parameter>
 is set to <link linkend="G-KEY-FILE-ERROR-INVALID-VALUE:CAPS"><type>G_KEY_FILE_ERROR_INVALID_VALUE</type></link>.</para>
<refsect3 id="g-key-file-get-boolean-list.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>key_file</para></entry>
<entry role="parameter_description"><para>a <link linkend="GKeyFile"><type>GKeyFile</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>group_name</para></entry>
<entry role="parameter_description"><para>a group name</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>key</para></entry>
<entry role="parameter_description"><para>a key</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>length</para></entry>
<entry role="parameter_description"><para>the number of booleans returned. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>out</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>error</para></entry>
<entry role="parameter_description"><para>return location for a <link linkend="GError"><type>GError</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="g-key-file-get-boolean-list.returns" role="returns">
<title>Returns</title>
<para>the values associated with the key as a list of booleans, or <link linkend="NULL:CAPS"><literal>NULL</literal></link> if the
key was not found or could not be parsed. The returned list of booleans
should be freed with <link linkend="g-free"><function>g_free()</function></link> when no longer needed. </para>
<para><emphasis role="annotation">[<acronym>array</acronym> length=length][<acronym>element-type</acronym> gboolean][<acronym>transfer container</acronym>]</emphasis></para>
</refsect3><para role="since">Since: <link linkend="api-index-2.6">2.6</link></para></refsect2>
<refsect2 id="g-key-file-get-integer-list" role="function" condition="since:2.6">
<title>g_key_file_get_integer_list&#160;()</title>
<indexterm zone="g-key-file-get-integer-list" role="2.6"><primary sortas="key_file_get_integer_list">g_key_file_get_integer_list</primary></indexterm>
<programlisting language="C"><link linkend="gint"><returnvalue>gint</returnvalue></link>&#160;*
g_key_file_get_integer_list (<parameter><link linkend="GKeyFile"><type>GKeyFile</type></link> *key_file</parameter>,
                             <parameter>const <link linkend="gchar"><type>gchar</type></link> *group_name</parameter>,
                             <parameter>const <link linkend="gchar"><type>gchar</type></link> *key</parameter>,
                             <parameter><link linkend="gsize"><type>gsize</type></link> *length</parameter>,
                             <parameter><link linkend="GError"><type>GError</type></link> **error</parameter>);</programlisting>
<para>Returns the values associated with <parameter>key</parameter>
 under <parameter>group_name</parameter>
 as
integers. </para>
<para>If <parameter>key</parameter>
 cannot be found then <link linkend="NULL:CAPS"><literal>NULL</literal></link> is returned and <parameter>error</parameter>
 is set to
<link linkend="G-KEY-FILE-ERROR-KEY-NOT-FOUND:CAPS"><type>G_KEY_FILE_ERROR_KEY_NOT_FOUND</type></link>. Likewise, if the values associated
with <parameter>key</parameter>
 cannot be interpreted as integers, or are out of range for
<link linkend="gint"><type>gint</type></link>, then <link linkend="NULL:CAPS"><literal>NULL</literal></link> is returned
and <parameter>error</parameter>
 is set to <link linkend="G-KEY-FILE-ERROR-INVALID-VALUE:CAPS"><type>G_KEY_FILE_ERROR_INVALID_VALUE</type></link>.</para>
<refsect3 id="g-key-file-get-integer-list.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>key_file</para></entry>
<entry role="parameter_description"><para>a <link linkend="GKeyFile"><type>GKeyFile</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>group_name</para></entry>
<entry role="parameter_description"><para>a group name</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>key</para></entry>
<entry role="parameter_description"><para>a key</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>length</para></entry>
<entry role="parameter_description"><para>the number of integers returned. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>out</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>error</para></entry>
<entry role="parameter_description"><para>return location for a <link linkend="GError"><type>GError</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="g-key-file-get-integer-list.returns" role="returns">
<title>Returns</title>
<para>the values associated with the key as a list of integers, or <link linkend="NULL:CAPS"><literal>NULL</literal></link> if
the key was not found or could not be parsed. The returned list of
integers should be freed with <link linkend="g-free"><function>g_free()</function></link> when no longer needed. </para>
<para><emphasis role="annotation">[<acronym>array</acronym> length=length][<acronym>element-type</acronym> gint][<acronym>transfer container</acronym>]</emphasis></para>
</refsect3><para role="since">Since: <link linkend="api-index-2.6">2.6</link></para></refsect2>
<refsect2 id="g-key-file-get-double-list" role="function" condition="since:2.12">
<title>g_key_file_get_double_list&#160;()</title>
<indexterm zone="g-key-file-get-double-list" role="2.12"><primary sortas="key_file_get_double_list">g_key_file_get_double_list</primary></indexterm>
<programlisting language="C"><link linkend="gdouble"><returnvalue>gdouble</returnvalue></link>&#160;*
g_key_file_get_double_list (<parameter><link linkend="GKeyFile"><type>GKeyFile</type></link> *key_file</parameter>,
                            <parameter>const <link linkend="gchar"><type>gchar</type></link> *group_name</parameter>,
                            <parameter>const <link linkend="gchar"><type>gchar</type></link> *key</parameter>,
                            <parameter><link linkend="gsize"><type>gsize</type></link> *length</parameter>,
                            <parameter><link linkend="GError"><type>GError</type></link> **error</parameter>);</programlisting>
<para>Returns the values associated with <parameter>key</parameter>
 under <parameter>group_name</parameter>
 as
doubles. </para>
<para>If <parameter>key</parameter>
 cannot be found then <link linkend="NULL:CAPS"><literal>NULL</literal></link> is returned and <parameter>error</parameter>
 is set to
<link linkend="G-KEY-FILE-ERROR-KEY-NOT-FOUND:CAPS"><type>G_KEY_FILE_ERROR_KEY_NOT_FOUND</type></link>. Likewise, if the values associated
with <parameter>key</parameter>
 cannot be interpreted as doubles then <link linkend="NULL:CAPS"><literal>NULL</literal></link> is returned
and <parameter>error</parameter>
 is set to <link linkend="G-KEY-FILE-ERROR-INVALID-VALUE:CAPS"><type>G_KEY_FILE_ERROR_INVALID_VALUE</type></link>.</para>
<refsect3 id="g-key-file-get-double-list.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>key_file</para></entry>
<entry role="parameter_description"><para>a <link linkend="GKeyFile"><type>GKeyFile</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>group_name</para></entry>
<entry role="parameter_description"><para>a group name</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>key</para></entry>
<entry role="parameter_description"><para>a key</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>length</para></entry>
<entry role="parameter_description"><para>the number of doubles returned. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>out</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>error</para></entry>
<entry role="parameter_description"><para>return location for a <link linkend="GError"><type>GError</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="g-key-file-get-double-list.returns" role="returns">
<title>Returns</title>
<para>the values associated with the key as a list of doubles, or <link linkend="NULL:CAPS"><literal>NULL</literal></link> if the
key was not found or could not be parsed. The returned list of doubles
should be freed with <link linkend="g-free"><function>g_free()</function></link> when no longer needed. </para>
<para><emphasis role="annotation">[<acronym>array</acronym> length=length][<acronym>element-type</acronym> gdouble][<acronym>transfer container</acronym>]</emphasis></para>
</refsect3><para role="since">Since: <link linkend="api-index-2.12">2.12</link></para></refsect2>
<refsect2 id="g-key-file-get-comment" role="function" condition="since:2.6">
<title>g_key_file_get_comment&#160;()</title>
<indexterm zone="g-key-file-get-comment" role="2.6"><primary sortas="key_file_get_comment">g_key_file_get_comment</primary></indexterm>
<programlisting language="C"><link linkend="gchar"><returnvalue>gchar</returnvalue></link>&#160;*
g_key_file_get_comment (<parameter><link linkend="GKeyFile"><type>GKeyFile</type></link> *key_file</parameter>,
                        <parameter>const <link linkend="gchar"><type>gchar</type></link> *group_name</parameter>,
                        <parameter>const <link linkend="gchar"><type>gchar</type></link> *key</parameter>,
                        <parameter><link linkend="GError"><type>GError</type></link> **error</parameter>);</programlisting>
<para>Retrieves a comment above <parameter>key</parameter>
 from <parameter>group_name</parameter>
.
If <parameter>key</parameter>
 is <link linkend="NULL:CAPS"><literal>NULL</literal></link> then <parameter>comment</parameter>
 will be read from above
<parameter>group_name</parameter>
. If both <parameter>key</parameter>
 and <parameter>group_name</parameter>
 are <link linkend="NULL:CAPS"><literal>NULL</literal></link>, then
<parameter>comment</parameter>
 will be read from above the first group in the file.</para>
<para>Note that the returned string does not include the '#' comment markers,
but does include any whitespace after them (on each line). It includes
the line breaks between lines, but does not include the final line break.</para>
<refsect3 id="g-key-file-get-comment.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>key_file</para></entry>
<entry role="parameter_description"><para>a <link linkend="GKeyFile"><type>GKeyFile</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>group_name</para></entry>
<entry role="parameter_description"><para>a group name, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>nullable</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>key</para></entry>
<entry role="parameter_description"><para>a key</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>error</para></entry>
<entry role="parameter_description"><para>return location for a <link linkend="GError"><type>GError</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="g-key-file-get-comment.returns" role="returns">
<title>Returns</title>
<para> a comment that should be freed with <link linkend="g-free"><function>g_free()</function></link></para>
</refsect3><para role="since">Since: <link linkend="api-index-2.6">2.6</link></para></refsect2>
<refsect2 id="g-key-file-set-value" role="function" condition="since:2.6">
<title>g_key_file_set_value&#160;()</title>
<indexterm zone="g-key-file-set-value" role="2.6"><primary sortas="key_file_set_value">g_key_file_set_value</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
g_key_file_set_value (<parameter><link linkend="GKeyFile"><type>GKeyFile</type></link> *key_file</parameter>,
                      <parameter>const <link linkend="gchar"><type>gchar</type></link> *group_name</parameter>,
                      <parameter>const <link linkend="gchar"><type>gchar</type></link> *key</parameter>,
                      <parameter>const <link linkend="gchar"><type>gchar</type></link> *value</parameter>);</programlisting>
<para>Associates a new value with <parameter>key</parameter>
 under <parameter>group_name</parameter>
.  </para>
<para>If <parameter>key</parameter>
 cannot be found then it is created. If <parameter>group_name</parameter>
 cannot 
be found then it is created. To set an UTF-8 string which may contain 
characters that need escaping (such as newlines or spaces), use 
<link linkend="g-key-file-set-string"><function>g_key_file_set_string()</function></link>.</para>
<refsect3 id="g-key-file-set-value.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>key_file</para></entry>
<entry role="parameter_description"><para>a <link linkend="GKeyFile"><type>GKeyFile</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>group_name</para></entry>
<entry role="parameter_description"><para>a group name</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>key</para></entry>
<entry role="parameter_description"><para>a key</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>value</para></entry>
<entry role="parameter_description"><para>a string</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><para role="since">Since: <link linkend="api-index-2.6">2.6</link></para></refsect2>
<refsect2 id="g-key-file-set-string" role="function" condition="since:2.6">
<title>g_key_file_set_string&#160;()</title>
<indexterm zone="g-key-file-set-string" role="2.6"><primary sortas="key_file_set_string">g_key_file_set_string</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
g_key_file_set_string (<parameter><link linkend="GKeyFile"><type>GKeyFile</type></link> *key_file</parameter>,
                       <parameter>const <link linkend="gchar"><type>gchar</type></link> *group_name</parameter>,
                       <parameter>const <link linkend="gchar"><type>gchar</type></link> *key</parameter>,
                       <parameter>const <link linkend="gchar"><type>gchar</type></link> *string</parameter>);</programlisting>
<para>Associates a new string value with <parameter>key</parameter>
 under <parameter>group_name</parameter>
.  
If <parameter>key</parameter>
 cannot be found then it is created.  
If <parameter>group_name</parameter>
 cannot be found then it is created.
Unlike <link linkend="g-key-file-set-value"><function>g_key_file_set_value()</function></link>, this function handles characters
that need escaping, such as newlines.</para>
<refsect3 id="g-key-file-set-string.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>key_file</para></entry>
<entry role="parameter_description"><para>a <link linkend="GKeyFile"><type>GKeyFile</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>group_name</para></entry>
<entry role="parameter_description"><para>a group name</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>key</para></entry>
<entry role="parameter_description"><para>a key</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>string</para></entry>
<entry role="parameter_description"><para>a string</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><para role="since">Since: <link linkend="api-index-2.6">2.6</link></para></refsect2>
<refsect2 id="g-key-file-set-locale-string" role="function" condition="since:2.6">
<title>g_key_file_set_locale_string&#160;()</title>
<indexterm zone="g-key-file-set-locale-string" role="2.6"><primary sortas="key_file_set_locale_string">g_key_file_set_locale_string</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
g_key_file_set_locale_string (<parameter><link linkend="GKeyFile"><type>GKeyFile</type></link> *key_file</parameter>,
                              <parameter>const <link linkend="gchar"><type>gchar</type></link> *group_name</parameter>,
                              <parameter>const <link linkend="gchar"><type>gchar</type></link> *key</parameter>,
                              <parameter>const <link linkend="gchar"><type>gchar</type></link> *locale</parameter>,
                              <parameter>const <link linkend="gchar"><type>gchar</type></link> *string</parameter>);</programlisting>
<para>Associates a string value for <parameter>key</parameter>
 and <parameter>locale</parameter>
 under <parameter>group_name</parameter>
.
If the translation for <parameter>key</parameter>
 cannot be found then it is created.</para>
<refsect3 id="g-key-file-set-locale-string.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>key_file</para></entry>
<entry role="parameter_description"><para>a <link linkend="GKeyFile"><type>GKeyFile</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>group_name</para></entry>
<entry role="parameter_description"><para>a group name</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>key</para></entry>
<entry role="parameter_description"><para>a key</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>locale</para></entry>
<entry role="parameter_description"><para>a locale identifier</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>string</para></entry>
<entry role="parameter_description"><para>a string</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><para role="since">Since: <link linkend="api-index-2.6">2.6</link></para></refsect2>
<refsect2 id="g-key-file-set-boolean" role="function" condition="since:2.6">
<title>g_key_file_set_boolean&#160;()</title>
<indexterm zone="g-key-file-set-boolean" role="2.6"><primary sortas="key_file_set_boolean">g_key_file_set_boolean</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
g_key_file_set_boolean (<parameter><link linkend="GKeyFile"><type>GKeyFile</type></link> *key_file</parameter>,
                        <parameter>const <link linkend="gchar"><type>gchar</type></link> *group_name</parameter>,
                        <parameter>const <link linkend="gchar"><type>gchar</type></link> *key</parameter>,
                        <parameter><link linkend="gboolean"><type>gboolean</type></link> value</parameter>);</programlisting>
<para>Associates a new boolean value with <parameter>key</parameter>
 under <parameter>group_name</parameter>
.
If <parameter>key</parameter>
 cannot be found then it is created.</para>
<refsect3 id="g-key-file-set-boolean.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>key_file</para></entry>
<entry role="parameter_description"><para>a <link linkend="GKeyFile"><type>GKeyFile</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>group_name</para></entry>
<entry role="parameter_description"><para>a group name</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>key</para></entry>
<entry role="parameter_description"><para>a key</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>value</para></entry>
<entry role="parameter_description"><para><link linkend="TRUE:CAPS"><literal>TRUE</literal></link> or <link linkend="FALSE:CAPS"><literal>FALSE</literal></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><para role="since">Since: <link linkend="api-index-2.6">2.6</link></para></refsect2>
<refsect2 id="g-key-file-set-integer" role="function" condition="since:2.6">
<title>g_key_file_set_integer&#160;()</title>
<indexterm zone="g-key-file-set-integer" role="2.6"><primary sortas="key_file_set_integer">g_key_file_set_integer</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
g_key_file_set_integer (<parameter><link linkend="GKeyFile"><type>GKeyFile</type></link> *key_file</parameter>,
                        <parameter>const <link linkend="gchar"><type>gchar</type></link> *group_name</parameter>,
                        <parameter>const <link linkend="gchar"><type>gchar</type></link> *key</parameter>,
                        <parameter><link linkend="gint"><type>gint</type></link> value</parameter>);</programlisting>
<para>Associates a new integer value with <parameter>key</parameter>
 under <parameter>group_name</parameter>
.
If <parameter>key</parameter>
 cannot be found then it is created.</para>
<refsect3 id="g-key-file-set-integer.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>key_file</para></entry>
<entry role="parameter_description"><para>a <link linkend="GKeyFile"><type>GKeyFile</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>group_name</para></entry>
<entry role="parameter_description"><para>a group name</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>key</para></entry>
<entry role="parameter_description"><para>a key</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>value</para></entry>
<entry role="parameter_description"><para>an integer value</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><para role="since">Since: <link linkend="api-index-2.6">2.6</link></para></refsect2>
<refsect2 id="g-key-file-set-int64" role="function" condition="since:2.26">
<title>g_key_file_set_int64&#160;()</title>
<indexterm zone="g-key-file-set-int64" role="2.26"><primary sortas="key_file_set_int64">g_key_file_set_int64</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
g_key_file_set_int64 (<parameter><link linkend="GKeyFile"><type>GKeyFile</type></link> *key_file</parameter>,
                      <parameter>const <link linkend="gchar"><type>gchar</type></link> *group_name</parameter>,
                      <parameter>const <link linkend="gchar"><type>gchar</type></link> *key</parameter>,
                      <parameter><link linkend="gint64"><type>gint64</type></link> value</parameter>);</programlisting>
<para>Associates a new integer value with <parameter>key</parameter>
 under <parameter>group_name</parameter>
.
If <parameter>key</parameter>
 cannot be found then it is created.</para>
<refsect3 id="g-key-file-set-int64.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>key_file</para></entry>
<entry role="parameter_description"><para>a <link linkend="GKeyFile"><type>GKeyFile</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>group_name</para></entry>
<entry role="parameter_description"><para>a group name</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>key</para></entry>
<entry role="parameter_description"><para>a key</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>value</para></entry>
<entry role="parameter_description"><para>an integer value</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><para role="since">Since: <link linkend="api-index-2.26">2.26</link></para></refsect2>
<refsect2 id="g-key-file-set-uint64" role="function" condition="since:2.26">
<title>g_key_file_set_uint64&#160;()</title>
<indexterm zone="g-key-file-set-uint64" role="2.26"><primary sortas="key_file_set_uint64">g_key_file_set_uint64</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
g_key_file_set_uint64 (<parameter><link linkend="GKeyFile"><type>GKeyFile</type></link> *key_file</parameter>,
                       <parameter>const <link linkend="gchar"><type>gchar</type></link> *group_name</parameter>,
                       <parameter>const <link linkend="gchar"><type>gchar</type></link> *key</parameter>,
                       <parameter><link linkend="guint64"><type>guint64</type></link> value</parameter>);</programlisting>
<para>Associates a new integer value with <parameter>key</parameter>
 under <parameter>group_name</parameter>
.
If <parameter>key</parameter>
 cannot be found then it is created.</para>
<refsect3 id="g-key-file-set-uint64.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>key_file</para></entry>
<entry role="parameter_description"><para>a <link linkend="GKeyFile"><type>GKeyFile</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>group_name</para></entry>
<entry role="parameter_description"><para>a group name</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>key</para></entry>
<entry role="parameter_description"><para>a key</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>value</para></entry>
<entry role="parameter_description"><para>an integer value</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><para role="since">Since: <link linkend="api-index-2.26">2.26</link></para></refsect2>
<refsect2 id="g-key-file-set-double" role="function" condition="since:2.12">
<title>g_key_file_set_double&#160;()</title>
<indexterm zone="g-key-file-set-double" role="2.12"><primary sortas="key_file_set_double">g_key_file_set_double</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
g_key_file_set_double (<parameter><link linkend="GKeyFile"><type>GKeyFile</type></link> *key_file</parameter>,
                       <parameter>const <link linkend="gchar"><type>gchar</type></link> *group_name</parameter>,
                       <parameter>const <link linkend="gchar"><type>gchar</type></link> *key</parameter>,
                       <parameter><link linkend="gdouble"><type>gdouble</type></link> value</parameter>);</programlisting>
<para>Associates a new double value with <parameter>key</parameter>
 under <parameter>group_name</parameter>
.
If <parameter>key</parameter>
 cannot be found then it is created.</para>
<refsect3 id="g-key-file-set-double.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>key_file</para></entry>
<entry role="parameter_description"><para>a <link linkend="GKeyFile"><type>GKeyFile</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>group_name</para></entry>
<entry role="parameter_description"><para>a group name</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>key</para></entry>
<entry role="parameter_description"><para>a key</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>value</para></entry>
<entry role="parameter_description"><para>a double value</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><para role="since">Since: <link linkend="api-index-2.12">2.12</link></para></refsect2>
<refsect2 id="g-key-file-set-string-list" role="function" condition="since:2.6">
<title>g_key_file_set_string_list&#160;()</title>
<indexterm zone="g-key-file-set-string-list" role="2.6"><primary sortas="key_file_set_string_list">g_key_file_set_string_list</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
g_key_file_set_string_list (<parameter><link linkend="GKeyFile"><type>GKeyFile</type></link> *key_file</parameter>,
                            <parameter>const <link linkend="gchar"><type>gchar</type></link> *group_name</parameter>,
                            <parameter>const <link linkend="gchar"><type>gchar</type></link> *key</parameter>,
                            <parameter>const <link linkend="gchar"><type>gchar</type></link> * const list[]</parameter>,
                            <parameter><link linkend="gsize"><type>gsize</type></link> length</parameter>);</programlisting>
<para>Associates a list of string values for <parameter>key</parameter>
 under <parameter>group_name</parameter>
.
If <parameter>key</parameter>
 cannot be found then it is created.
If <parameter>group_name</parameter>
 cannot be found then it is created.</para>
<refsect3 id="g-key-file-set-string-list.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>key_file</para></entry>
<entry role="parameter_description"><para>a <link linkend="GKeyFile"><type>GKeyFile</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>group_name</para></entry>
<entry role="parameter_description"><para>a group name</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>key</para></entry>
<entry role="parameter_description"><para>a key</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>list</para></entry>
<entry role="parameter_description"><para>an array of string values. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>array</acronym> zero-terminated=1 length=length][<acronym>element-type</acronym> utf8]</emphasis></entry></row>
<row><entry role="parameter_name"><para>length</para></entry>
<entry role="parameter_description"><para>number of string values in <parameter>list</parameter>
</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><para role="since">Since: <link linkend="api-index-2.6">2.6</link></para></refsect2>
<refsect2 id="g-key-file-set-locale-string-list" role="function" condition="since:2.6">
<title>g_key_file_set_locale_string_list&#160;()</title>
<indexterm zone="g-key-file-set-locale-string-list" role="2.6"><primary sortas="key_file_set_locale_string_list">g_key_file_set_locale_string_list</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
g_key_file_set_locale_string_list (<parameter><link linkend="GKeyFile"><type>GKeyFile</type></link> *key_file</parameter>,
                                   <parameter>const <link linkend="gchar"><type>gchar</type></link> *group_name</parameter>,
                                   <parameter>const <link linkend="gchar"><type>gchar</type></link> *key</parameter>,
                                   <parameter>const <link linkend="gchar"><type>gchar</type></link> *locale</parameter>,
                                   <parameter>const <link linkend="gchar"><type>gchar</type></link> * const list[]</parameter>,
                                   <parameter><link linkend="gsize"><type>gsize</type></link> length</parameter>);</programlisting>
<para>Associates a list of string values for <parameter>key</parameter>
 and <parameter>locale</parameter>
 under
<parameter>group_name</parameter>
.  If the translation for <parameter>key</parameter>
 cannot be found then
it is created.</para>
<refsect3 id="g-key-file-set-locale-string-list.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>key_file</para></entry>
<entry role="parameter_description"><para>a <link linkend="GKeyFile"><type>GKeyFile</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>group_name</para></entry>
<entry role="parameter_description"><para>a group name</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>key</para></entry>
<entry role="parameter_description"><para>a key</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>locale</para></entry>
<entry role="parameter_description"><para>a locale identifier</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>list</para></entry>
<entry role="parameter_description"><para>a <link linkend="NULL:CAPS"><literal>NULL</literal></link>-terminated array of locale string values. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>array</acronym> zero-terminated=1 length=length]</emphasis></entry></row>
<row><entry role="parameter_name"><para>length</para></entry>
<entry role="parameter_description"><para>the length of <parameter>list</parameter>
</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><para role="since">Since: <link linkend="api-index-2.6">2.6</link></para></refsect2>
<refsect2 id="g-key-file-set-boolean-list" role="function" condition="since:2.6">
<title>g_key_file_set_boolean_list&#160;()</title>
<indexterm zone="g-key-file-set-boolean-list" role="2.6"><primary sortas="key_file_set_boolean_list">g_key_file_set_boolean_list</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
g_key_file_set_boolean_list (<parameter><link linkend="GKeyFile"><type>GKeyFile</type></link> *key_file</parameter>,
                             <parameter>const <link linkend="gchar"><type>gchar</type></link> *group_name</parameter>,
                             <parameter>const <link linkend="gchar"><type>gchar</type></link> *key</parameter>,
                             <parameter><link linkend="gboolean"><type>gboolean</type></link> list[]</parameter>,
                             <parameter><link linkend="gsize"><type>gsize</type></link> length</parameter>);</programlisting>
<para>Associates a list of boolean values with <parameter>key</parameter>
 under <parameter>group_name</parameter>
.  
If <parameter>key</parameter>
 cannot be found then it is created.
If <parameter>group_name</parameter>
 is <link linkend="NULL:CAPS"><literal>NULL</literal></link>, the start_group is used.</para>
<refsect3 id="g-key-file-set-boolean-list.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>key_file</para></entry>
<entry role="parameter_description"><para>a <link linkend="GKeyFile"><type>GKeyFile</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>group_name</para></entry>
<entry role="parameter_description"><para>a group name</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>key</para></entry>
<entry role="parameter_description"><para>a key</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>list</para></entry>
<entry role="parameter_description"><para>an array of boolean values. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>array</acronym> length=length]</emphasis></entry></row>
<row><entry role="parameter_name"><para>length</para></entry>
<entry role="parameter_description"><para>length of <parameter>list</parameter>
</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><para role="since">Since: <link linkend="api-index-2.6">2.6</link></para></refsect2>
<refsect2 id="g-key-file-set-integer-list" role="function" condition="since:2.6">
<title>g_key_file_set_integer_list&#160;()</title>
<indexterm zone="g-key-file-set-integer-list" role="2.6"><primary sortas="key_file_set_integer_list">g_key_file_set_integer_list</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
g_key_file_set_integer_list (<parameter><link linkend="GKeyFile"><type>GKeyFile</type></link> *key_file</parameter>,
                             <parameter>const <link linkend="gchar"><type>gchar</type></link> *group_name</parameter>,
                             <parameter>const <link linkend="gchar"><type>gchar</type></link> *key</parameter>,
                             <parameter><link linkend="gint"><type>gint</type></link> list[]</parameter>,
                             <parameter><link linkend="gsize"><type>gsize</type></link> length</parameter>);</programlisting>
<para>Associates a list of integer values with <parameter>key</parameter>
 under <parameter>group_name</parameter>
.  
If <parameter>key</parameter>
 cannot be found then it is created.</para>
<refsect3 id="g-key-file-set-integer-list.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>key_file</para></entry>
<entry role="parameter_description"><para>a <link linkend="GKeyFile"><type>GKeyFile</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>group_name</para></entry>
<entry role="parameter_description"><para>a group name</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>key</para></entry>
<entry role="parameter_description"><para>a key</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>list</para></entry>
<entry role="parameter_description"><para>an array of integer values. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>array</acronym> length=length]</emphasis></entry></row>
<row><entry role="parameter_name"><para>length</para></entry>
<entry role="parameter_description"><para>number of integer values in <parameter>list</parameter>
</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><para role="since">Since: <link linkend="api-index-2.6">2.6</link></para></refsect2>
<refsect2 id="g-key-file-set-double-list" role="function" condition="since:2.12">
<title>g_key_file_set_double_list&#160;()</title>
<indexterm zone="g-key-file-set-double-list" role="2.12"><primary sortas="key_file_set_double_list">g_key_file_set_double_list</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
g_key_file_set_double_list (<parameter><link linkend="GKeyFile"><type>GKeyFile</type></link> *key_file</parameter>,
                            <parameter>const <link linkend="gchar"><type>gchar</type></link> *group_name</parameter>,
                            <parameter>const <link linkend="gchar"><type>gchar</type></link> *key</parameter>,
                            <parameter><link linkend="gdouble"><type>gdouble</type></link> list[]</parameter>,
                            <parameter><link linkend="gsize"><type>gsize</type></link> length</parameter>);</programlisting>
<para>Associates a list of double values with <parameter>key</parameter>
 under
<parameter>group_name</parameter>
.  If <parameter>key</parameter>
 cannot be found then it is created.</para>
<refsect3 id="g-key-file-set-double-list.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>key_file</para></entry>
<entry role="parameter_description"><para>a <link linkend="GKeyFile"><type>GKeyFile</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>group_name</para></entry>
<entry role="parameter_description"><para>a group name</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>key</para></entry>
<entry role="parameter_description"><para>a key</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>list</para></entry>
<entry role="parameter_description"><para>an array of double values. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>array</acronym> length=length]</emphasis></entry></row>
<row><entry role="parameter_name"><para>length</para></entry>
<entry role="parameter_description"><para>number of double values in <parameter>list</parameter>
</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><para role="since">Since: <link linkend="api-index-2.12">2.12</link></para></refsect2>
<refsect2 id="g-key-file-set-comment" role="function" condition="since:2.6">
<title>g_key_file_set_comment&#160;()</title>
<indexterm zone="g-key-file-set-comment" role="2.6"><primary sortas="key_file_set_comment">g_key_file_set_comment</primary></indexterm>
<programlisting language="C"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
g_key_file_set_comment (<parameter><link linkend="GKeyFile"><type>GKeyFile</type></link> *key_file</parameter>,
                        <parameter>const <link linkend="gchar"><type>gchar</type></link> *group_name</parameter>,
                        <parameter>const <link linkend="gchar"><type>gchar</type></link> *key</parameter>,
                        <parameter>const <link linkend="gchar"><type>gchar</type></link> *comment</parameter>,
                        <parameter><link linkend="GError"><type>GError</type></link> **error</parameter>);</programlisting>
<para>Places a comment above <parameter>key</parameter>
 from <parameter>group_name</parameter>
.</para>
<para>If <parameter>key</parameter>
 is <link linkend="NULL:CAPS"><literal>NULL</literal></link> then <parameter>comment</parameter>
 will be written above <parameter>group_name</parameter>
.
If both <parameter>key</parameter>
 and <parameter>group_name</parameter>
  are <link linkend="NULL:CAPS"><literal>NULL</literal></link>, then <parameter>comment</parameter>
 will be
written above the first group in the file.</para>
<para>Note that this function prepends a '#' comment marker to
each line of <parameter>comment</parameter>
.</para>
<refsect3 id="g-key-file-set-comment.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>key_file</para></entry>
<entry role="parameter_description"><para>a <link linkend="GKeyFile"><type>GKeyFile</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>group_name</para></entry>
<entry role="parameter_description"><para>a group name, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>nullable</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>key</para></entry>
<entry role="parameter_description"><para>a key. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>nullable</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>comment</para></entry>
<entry role="parameter_description"><para>a comment</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>error</para></entry>
<entry role="parameter_description"><para>return location for a <link linkend="GError"><type>GError</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="g-key-file-set-comment.returns" role="returns">
<title>Returns</title>
<para> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if the comment was written, <link linkend="FALSE:CAPS"><literal>FALSE</literal></link> otherwise</para>
</refsect3><para role="since">Since: <link linkend="api-index-2.6">2.6</link></para></refsect2>
<refsect2 id="g-key-file-remove-group" role="function" condition="since:2.6">
<title>g_key_file_remove_group&#160;()</title>
<indexterm zone="g-key-file-remove-group" role="2.6"><primary sortas="key_file_remove_group">g_key_file_remove_group</primary></indexterm>
<programlisting language="C"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
g_key_file_remove_group (<parameter><link linkend="GKeyFile"><type>GKeyFile</type></link> *key_file</parameter>,
                         <parameter>const <link linkend="gchar"><type>gchar</type></link> *group_name</parameter>,
                         <parameter><link linkend="GError"><type>GError</type></link> **error</parameter>);</programlisting>
<para>Removes the specified group, <parameter>group_name</parameter>
, 
from the key file.</para>
<refsect3 id="g-key-file-remove-group.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>key_file</para></entry>
<entry role="parameter_description"><para>a <link linkend="GKeyFile"><type>GKeyFile</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>group_name</para></entry>
<entry role="parameter_description"><para>a group name</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>error</para></entry>
<entry role="parameter_description"><para>return location for a <link linkend="GError"><type>GError</type></link> or <link linkend="NULL:CAPS"><literal>NULL</literal></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="g-key-file-remove-group.returns" role="returns">
<title>Returns</title>
<para> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if the group was removed, <link linkend="FALSE:CAPS"><literal>FALSE</literal></link> otherwise</para>
</refsect3><para role="since">Since: <link linkend="api-index-2.6">2.6</link></para></refsect2>
<refsect2 id="g-key-file-remove-key" role="function" condition="since:2.6">
<title>g_key_file_remove_key&#160;()</title>
<indexterm zone="g-key-file-remove-key" role="2.6"><primary sortas="key_file_remove_key">g_key_file_remove_key</primary></indexterm>
<programlisting language="C"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
g_key_file_remove_key (<parameter><link linkend="GKeyFile"><type>GKeyFile</type></link> *key_file</parameter>,
                       <parameter>const <link linkend="gchar"><type>gchar</type></link> *group_name</parameter>,
                       <parameter>const <link linkend="gchar"><type>gchar</type></link> *key</parameter>,
                       <parameter><link linkend="GError"><type>GError</type></link> **error</parameter>);</programlisting>
<para>Removes <parameter>key</parameter>
 in <parameter>group_name</parameter>
 from the key file.</para>
<refsect3 id="g-key-file-remove-key.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>key_file</para></entry>
<entry role="parameter_description"><para>a <link linkend="GKeyFile"><type>GKeyFile</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>group_name</para></entry>
<entry role="parameter_description"><para>a group name</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>key</para></entry>
<entry role="parameter_description"><para>a key name to remove</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>error</para></entry>
<entry role="parameter_description"><para>return location for a <link linkend="GError"><type>GError</type></link> or <link linkend="NULL:CAPS"><literal>NULL</literal></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="g-key-file-remove-key.returns" role="returns">
<title>Returns</title>
<para> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if the key was removed, <link linkend="FALSE:CAPS"><literal>FALSE</literal></link> otherwise</para>
</refsect3><para role="since">Since: <link linkend="api-index-2.6">2.6</link></para></refsect2>
<refsect2 id="g-key-file-remove-comment" role="function" condition="since:2.6">
<title>g_key_file_remove_comment&#160;()</title>
<indexterm zone="g-key-file-remove-comment" role="2.6"><primary sortas="key_file_remove_comment">g_key_file_remove_comment</primary></indexterm>
<programlisting language="C"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
g_key_file_remove_comment (<parameter><link linkend="GKeyFile"><type>GKeyFile</type></link> *key_file</parameter>,
                           <parameter>const <link linkend="gchar"><type>gchar</type></link> *group_name</parameter>,
                           <parameter>const <link linkend="gchar"><type>gchar</type></link> *key</parameter>,
                           <parameter><link linkend="GError"><type>GError</type></link> **error</parameter>);</programlisting>
<para>Removes a comment above <parameter>key</parameter>
 from <parameter>group_name</parameter>
.
If <parameter>key</parameter>
 is <link linkend="NULL:CAPS"><literal>NULL</literal></link> then <parameter>comment</parameter>
 will be removed above <parameter>group_name</parameter>
. 
If both <parameter>key</parameter>
 and <parameter>group_name</parameter>
 are <link linkend="NULL:CAPS"><literal>NULL</literal></link>, then <parameter>comment</parameter>
 will
be removed above the first group in the file.</para>
<refsect3 id="g-key-file-remove-comment.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>key_file</para></entry>
<entry role="parameter_description"><para>a <link linkend="GKeyFile"><type>GKeyFile</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>group_name</para></entry>
<entry role="parameter_description"><para>a group name, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>nullable</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>key</para></entry>
<entry role="parameter_description"><para>a key. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>nullable</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>error</para></entry>
<entry role="parameter_description"><para>return location for a <link linkend="GError"><type>GError</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="g-key-file-remove-comment.returns" role="returns">
<title>Returns</title>
<para> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if the comment was removed, <link linkend="FALSE:CAPS"><literal>FALSE</literal></link> otherwise</para>
</refsect3><para role="since">Since: <link linkend="api-index-2.6">2.6</link></para></refsect2>

</refsect1>
<refsect1 id="glib-Key-value-file-parser.other_details" role="details">
<title role="details.title">Types and Values</title>
<refsect2 id="GKeyFile" role="struct">
<title>GKeyFile</title>
<indexterm zone="GKeyFile"><primary sortas="KeyFile">GKeyFile</primary></indexterm>
<programlisting language="C">typedef struct _GKeyFile GKeyFile;</programlisting>
<para>The GKeyFile struct contains only private data
and should not be accessed directly.</para>
</refsect2>
<refsect2 id="G-KEY-FILE-ERROR:CAPS" role="macro">
<title>G_KEY_FILE_ERROR</title>
<indexterm zone="G-KEY-FILE-ERROR:CAPS"><primary sortas="KEY_FILE_ERROR">G_KEY_FILE_ERROR</primary></indexterm>
<programlisting language="C">#define G_KEY_FILE_ERROR g_key_file_error_quark()
</programlisting>
<para>Error domain for key file parsing. Errors in this domain will
be from the <link linkend="GKeyFileError"><type>GKeyFileError</type></link> enumeration.</para>
<para>See <link linkend="GError"><type>GError</type></link> for information on error domains.</para>
</refsect2>
<refsect2 id="GKeyFileError" role="enum">
<title>enum GKeyFileError</title>
<indexterm zone="GKeyFileError"><primary sortas="KeyFileError">GKeyFileError</primary></indexterm>
<para>Error codes returned by key file parsing.</para>
<refsect3 id="GKeyFileError.members" role="enum_members">
<title>Members</title>
<informaltable role="enum_members_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="enum_members_name" colwidth="300px"/>
<colspec colname="enum_members_description"/>
<colspec colname="enum_members_annotations" colwidth="200px"/>
<tbody>
<row role="constant"><entry role="enum_member_name"><para id="G-KEY-FILE-ERROR-UNKNOWN-ENCODING:CAPS">G_KEY_FILE_ERROR_UNKNOWN_ENCODING</para></entry>
<entry role="enum_member_description"><para>the text being parsed was in
an unknown encoding</para>
</entry>
<entry role="enum_member_annotations"></entry>
</row>
<row role="constant"><entry role="enum_member_name"><para id="G-KEY-FILE-ERROR-PARSE:CAPS">G_KEY_FILE_ERROR_PARSE</para></entry>
<entry role="enum_member_description"><para>document was ill-formed</para>
</entry>
<entry role="enum_member_annotations"></entry>
</row>
<row role="constant"><entry role="enum_member_name"><para id="G-KEY-FILE-ERROR-NOT-FOUND:CAPS">G_KEY_FILE_ERROR_NOT_FOUND</para></entry>
<entry role="enum_member_description"><para>the file was not found</para>
</entry>
<entry role="enum_member_annotations"></entry>
</row>
<row role="constant"><entry role="enum_member_name"><para id="G-KEY-FILE-ERROR-KEY-NOT-FOUND:CAPS">G_KEY_FILE_ERROR_KEY_NOT_FOUND</para></entry>
<entry role="enum_member_description"><para>a requested key was not found</para>
</entry>
<entry role="enum_member_annotations"></entry>
</row>
<row role="constant"><entry role="enum_member_name"><para id="G-KEY-FILE-ERROR-GROUP-NOT-FOUND:CAPS">G_KEY_FILE_ERROR_GROUP_NOT_FOUND</para></entry>
<entry role="enum_member_description"><para>a requested group was not found</para>
</entry>
<entry role="enum_member_annotations"></entry>
</row>
<row role="constant"><entry role="enum_member_name"><para id="G-KEY-FILE-ERROR-INVALID-VALUE:CAPS">G_KEY_FILE_ERROR_INVALID_VALUE</para></entry>
<entry role="enum_member_description"><para>a value could not be parsed</para>
</entry>
<entry role="enum_member_annotations"></entry>
</row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="GKeyFileFlags" role="enum">
<title>enum GKeyFileFlags</title>
<indexterm zone="GKeyFileFlags"><primary sortas="KeyFileFlags">GKeyFileFlags</primary></indexterm>
<para>Flags which influence the parsing.</para>
<refsect3 id="GKeyFileFlags.members" role="enum_members">
<title>Members</title>
<informaltable role="enum_members_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="enum_members_name" colwidth="300px"/>
<colspec colname="enum_members_description"/>
<colspec colname="enum_members_annotations" colwidth="200px"/>
<tbody>
<row role="constant"><entry role="enum_member_name"><para id="G-KEY-FILE-NONE:CAPS">G_KEY_FILE_NONE</para></entry>
<entry role="enum_member_description"><para>No flags, default behaviour</para>
</entry>
<entry role="enum_member_annotations"></entry>
</row>
<row role="constant"><entry role="enum_member_name"><para id="G-KEY-FILE-KEEP-COMMENTS:CAPS">G_KEY_FILE_KEEP_COMMENTS</para></entry>
<entry role="enum_member_description"><para>Use this flag if you plan to write the
(possibly modified) contents of the key file back to a file;
otherwise all comments will be lost when the key file is
written back.</para>
</entry>
<entry role="enum_member_annotations"></entry>
</row>
<row role="constant"><entry role="enum_member_name"><para id="G-KEY-FILE-KEEP-TRANSLATIONS:CAPS">G_KEY_FILE_KEEP_TRANSLATIONS</para></entry>
<entry role="enum_member_description"><para>Use this flag if you plan to write the
(possibly modified) contents of the key file back to a file;
otherwise only the translations for the current language will be
written back.</para>
</entry>
<entry role="enum_member_annotations"></entry>
</row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="G-KEY-FILE-DESKTOP-GROUP:CAPS" role="macro" condition="since:2.14">
<title>G_KEY_FILE_DESKTOP_GROUP</title>
<indexterm zone="G-KEY-FILE-DESKTOP-GROUP:CAPS" role="2.14"><primary sortas="KEY_FILE_DESKTOP_GROUP">G_KEY_FILE_DESKTOP_GROUP</primary></indexterm>
<programlisting language="C">#define G_KEY_FILE_DESKTOP_GROUP                "Desktop Entry"
</programlisting>
<para>The name of the main group of a desktop entry file, as defined in the
<ulink url="http://freedesktop.org/Standards/desktop-entry-spec">Desktop Entry Specification</ulink>.
Consult the specification for more
details about the meanings of the keys below.</para>
<para role="since">Since: <link linkend="api-index-2.14">2.14</link></para></refsect2>
<refsect2 id="G-KEY-FILE-DESKTOP-KEY-TYPE:CAPS" role="macro" condition="since:2.14">
<title>G_KEY_FILE_DESKTOP_KEY_TYPE</title>
<indexterm zone="G-KEY-FILE-DESKTOP-KEY-TYPE:CAPS" role="2.14"><primary sortas="KEY_FILE_DESKTOP_KEY_TYPE">G_KEY_FILE_DESKTOP_KEY_TYPE</primary></indexterm>
<programlisting language="C">#define G_KEY_FILE_DESKTOP_KEY_TYPE             "Type"
</programlisting>
<para>A key under <link linkend="G-KEY-FILE-DESKTOP-GROUP:CAPS"><type>G_KEY_FILE_DESKTOP_GROUP</type></link>, whose value is a string
giving the type of the desktop entry. Usually
<link linkend="G-KEY-FILE-DESKTOP-TYPE-APPLICATION:CAPS"><type>G_KEY_FILE_DESKTOP_TYPE_APPLICATION</type></link>,
<link linkend="G-KEY-FILE-DESKTOP-TYPE-LINK:CAPS"><type>G_KEY_FILE_DESKTOP_TYPE_LINK</type></link>, or
<link linkend="G-KEY-FILE-DESKTOP-TYPE-DIRECTORY:CAPS"><type>G_KEY_FILE_DESKTOP_TYPE_DIRECTORY</type></link>.</para>
<para role="since">Since: <link linkend="api-index-2.14">2.14</link></para></refsect2>
<refsect2 id="G-KEY-FILE-DESKTOP-KEY-VERSION:CAPS" role="macro" condition="since:2.14">
<title>G_KEY_FILE_DESKTOP_KEY_VERSION</title>
<indexterm zone="G-KEY-FILE-DESKTOP-KEY-VERSION:CAPS" role="2.14"><primary sortas="KEY_FILE_DESKTOP_KEY_VERSION">G_KEY_FILE_DESKTOP_KEY_VERSION</primary></indexterm>
<programlisting language="C">#define G_KEY_FILE_DESKTOP_KEY_VERSION          "Version"
</programlisting>
<para>A key under <link linkend="G-KEY-FILE-DESKTOP-GROUP:CAPS"><type>G_KEY_FILE_DESKTOP_GROUP</type></link>, whose value is a string
giving the version of the Desktop Entry Specification used for
the desktop entry file.</para>
<para role="since">Since: <link linkend="api-index-2.14">2.14</link></para></refsect2>
<refsect2 id="G-KEY-FILE-DESKTOP-KEY-NAME:CAPS" role="macro" condition="since:2.14">
<title>G_KEY_FILE_DESKTOP_KEY_NAME</title>
<indexterm zone="G-KEY-FILE-DESKTOP-KEY-NAME:CAPS" role="2.14"><primary sortas="KEY_FILE_DESKTOP_KEY_NAME">G_KEY_FILE_DESKTOP_KEY_NAME</primary></indexterm>
<programlisting language="C">#define G_KEY_FILE_DESKTOP_KEY_NAME             "Name"
</programlisting>
<para>A key under <link linkend="G-KEY-FILE-DESKTOP-GROUP:CAPS"><type>G_KEY_FILE_DESKTOP_GROUP</type></link>, whose value is a localized
string giving the specific name of the desktop entry.</para>
<para role="since">Since: <link linkend="api-index-2.14">2.14</link></para></refsect2>
<refsect2 id="G-KEY-FILE-DESKTOP-KEY-GENERIC-NAME:CAPS" role="macro" condition="since:2.14">
<title>G_KEY_FILE_DESKTOP_KEY_GENERIC_NAME</title>
<indexterm zone="G-KEY-FILE-DESKTOP-KEY-GENERIC-NAME:CAPS" role="2.14"><primary sortas="KEY_FILE_DESKTOP_KEY_GENERIC_NAME">G_KEY_FILE_DESKTOP_KEY_GENERIC_NAME</primary></indexterm>
<programlisting language="C">#define G_KEY_FILE_DESKTOP_KEY_GENERIC_NAME     "GenericName"
</programlisting>
<para>A key under <link linkend="G-KEY-FILE-DESKTOP-GROUP:CAPS"><type>G_KEY_FILE_DESKTOP_GROUP</type></link>, whose value is a localized
string giving the generic name of the desktop entry.</para>
<para role="since">Since: <link linkend="api-index-2.14">2.14</link></para></refsect2>
<refsect2 id="G-KEY-FILE-DESKTOP-KEY-NO-DISPLAY:CAPS" role="macro" condition="since:2.14">
<title>G_KEY_FILE_DESKTOP_KEY_NO_DISPLAY</title>
<indexterm zone="G-KEY-FILE-DESKTOP-KEY-NO-DISPLAY:CAPS" role="2.14"><primary sortas="KEY_FILE_DESKTOP_KEY_NO_DISPLAY">G_KEY_FILE_DESKTOP_KEY_NO_DISPLAY</primary></indexterm>
<programlisting language="C">#define G_KEY_FILE_DESKTOP_KEY_NO_DISPLAY       "NoDisplay"
</programlisting>
<para>A key under <link linkend="G-KEY-FILE-DESKTOP-GROUP:CAPS"><type>G_KEY_FILE_DESKTOP_GROUP</type></link>, whose value is a boolean
stating whether the desktop entry should be shown in menus.</para>
<para role="since">Since: <link linkend="api-index-2.14">2.14</link></para></refsect2>
<refsect2 id="G-KEY-FILE-DESKTOP-KEY-COMMENT:CAPS" role="macro" condition="since:2.14">
<title>G_KEY_FILE_DESKTOP_KEY_COMMENT</title>
<indexterm zone="G-KEY-FILE-DESKTOP-KEY-COMMENT:CAPS" role="2.14"><primary sortas="KEY_FILE_DESKTOP_KEY_COMMENT">G_KEY_FILE_DESKTOP_KEY_COMMENT</primary></indexterm>
<programlisting language="C">#define G_KEY_FILE_DESKTOP_KEY_COMMENT          "Comment"
</programlisting>
<para>A key under <link linkend="G-KEY-FILE-DESKTOP-GROUP:CAPS"><type>G_KEY_FILE_DESKTOP_GROUP</type></link>, whose value is a localized
string giving the tooltip for the desktop entry.</para>
<para role="since">Since: <link linkend="api-index-2.14">2.14</link></para></refsect2>
<refsect2 id="G-KEY-FILE-DESKTOP-KEY-ICON:CAPS" role="macro" condition="since:2.14">
<title>G_KEY_FILE_DESKTOP_KEY_ICON</title>
<indexterm zone="G-KEY-FILE-DESKTOP-KEY-ICON:CAPS" role="2.14"><primary sortas="KEY_FILE_DESKTOP_KEY_ICON">G_KEY_FILE_DESKTOP_KEY_ICON</primary></indexterm>
<programlisting language="C">#define G_KEY_FILE_DESKTOP_KEY_ICON             "Icon"
</programlisting>
<para>A key under <link linkend="G-KEY-FILE-DESKTOP-GROUP:CAPS"><type>G_KEY_FILE_DESKTOP_GROUP</type></link>, whose value is a localized
string giving the name of the icon to be displayed for the desktop
entry.</para>
<para role="since">Since: <link linkend="api-index-2.14">2.14</link></para></refsect2>
<refsect2 id="G-KEY-FILE-DESKTOP-KEY-HIDDEN:CAPS" role="macro" condition="since:2.14">
<title>G_KEY_FILE_DESKTOP_KEY_HIDDEN</title>
<indexterm zone="G-KEY-FILE-DESKTOP-KEY-HIDDEN:CAPS" role="2.14"><primary sortas="KEY_FILE_DESKTOP_KEY_HIDDEN">G_KEY_FILE_DESKTOP_KEY_HIDDEN</primary></indexterm>
<programlisting language="C">#define G_KEY_FILE_DESKTOP_KEY_HIDDEN           "Hidden"
</programlisting>
<para>A key under <link linkend="G-KEY-FILE-DESKTOP-GROUP:CAPS"><type>G_KEY_FILE_DESKTOP_GROUP</type></link>, whose value is a boolean
stating whether the desktop entry has been deleted by the user.</para>
<para role="since">Since: <link linkend="api-index-2.14">2.14</link></para></refsect2>
<refsect2 id="G-KEY-FILE-DESKTOP-KEY-ONLY-SHOW-IN:CAPS" role="macro" condition="since:2.14">
<title>G_KEY_FILE_DESKTOP_KEY_ONLY_SHOW_IN</title>
<indexterm zone="G-KEY-FILE-DESKTOP-KEY-ONLY-SHOW-IN:CAPS" role="2.14"><primary sortas="KEY_FILE_DESKTOP_KEY_ONLY_SHOW_IN">G_KEY_FILE_DESKTOP_KEY_ONLY_SHOW_IN</primary></indexterm>
<programlisting language="C">#define G_KEY_FILE_DESKTOP_KEY_ONLY_SHOW_IN     "OnlyShowIn"
</programlisting>
<para>A key under <link linkend="G-KEY-FILE-DESKTOP-GROUP:CAPS"><type>G_KEY_FILE_DESKTOP_GROUP</type></link>, whose value is a list of
strings identifying the environments that should display the
desktop entry.</para>
<para role="since">Since: <link linkend="api-index-2.14">2.14</link></para></refsect2>
<refsect2 id="G-KEY-FILE-DESKTOP-KEY-NOT-SHOW-IN:CAPS" role="macro" condition="since:2.14">
<title>G_KEY_FILE_DESKTOP_KEY_NOT_SHOW_IN</title>
<indexterm zone="G-KEY-FILE-DESKTOP-KEY-NOT-SHOW-IN:CAPS" role="2.14"><primary sortas="KEY_FILE_DESKTOP_KEY_NOT_SHOW_IN">G_KEY_FILE_DESKTOP_KEY_NOT_SHOW_IN</primary></indexterm>
<programlisting language="C">#define G_KEY_FILE_DESKTOP_KEY_NOT_SHOW_IN      "NotShowIn"
</programlisting>
<para>A key under <link linkend="G-KEY-FILE-DESKTOP-GROUP:CAPS"><type>G_KEY_FILE_DESKTOP_GROUP</type></link>, whose value is a list of
strings identifying the environments that should not display the
desktop entry.</para>
<para role="since">Since: <link linkend="api-index-2.14">2.14</link></para></refsect2>
<refsect2 id="G-KEY-FILE-DESKTOP-KEY-TRY-EXEC:CAPS" role="macro" condition="since:2.14">
<title>G_KEY_FILE_DESKTOP_KEY_TRY_EXEC</title>
<indexterm zone="G-KEY-FILE-DESKTOP-KEY-TRY-EXEC:CAPS" role="2.14"><primary sortas="KEY_FILE_DESKTOP_KEY_TRY_EXEC">G_KEY_FILE_DESKTOP_KEY_TRY_EXEC</primary></indexterm>
<programlisting language="C">#define G_KEY_FILE_DESKTOP_KEY_TRY_EXEC         "TryExec"
</programlisting>
<para>A key under <link linkend="G-KEY-FILE-DESKTOP-GROUP:CAPS"><type>G_KEY_FILE_DESKTOP_GROUP</type></link>, whose value is a string
giving the file name of a binary on disk used to determine if the
program is actually installed. It is only valid for desktop entries
with the <literal>Application</literal> type.</para>
<para role="since">Since: <link linkend="api-index-2.14">2.14</link></para></refsect2>
<refsect2 id="G-KEY-FILE-DESKTOP-KEY-EXEC:CAPS" role="macro" condition="since:2.14">
<title>G_KEY_FILE_DESKTOP_KEY_EXEC</title>
<indexterm zone="G-KEY-FILE-DESKTOP-KEY-EXEC:CAPS" role="2.14"><primary sortas="KEY_FILE_DESKTOP_KEY_EXEC">G_KEY_FILE_DESKTOP_KEY_EXEC</primary></indexterm>
<programlisting language="C">#define G_KEY_FILE_DESKTOP_KEY_EXEC             "Exec"
</programlisting>
<para>A key under <link linkend="G-KEY-FILE-DESKTOP-GROUP:CAPS"><type>G_KEY_FILE_DESKTOP_GROUP</type></link>, whose value is a string
giving the command line to execute. It is only valid for desktop
entries with the <literal>Application</literal> type.</para>
<para role="since">Since: <link linkend="api-index-2.14">2.14</link></para></refsect2>
<refsect2 id="G-KEY-FILE-DESKTOP-KEY-PATH:CAPS" role="macro" condition="since:2.14">
<title>G_KEY_FILE_DESKTOP_KEY_PATH</title>
<indexterm zone="G-KEY-FILE-DESKTOP-KEY-PATH:CAPS" role="2.14"><primary sortas="KEY_FILE_DESKTOP_KEY_PATH">G_KEY_FILE_DESKTOP_KEY_PATH</primary></indexterm>
<programlisting language="C">#define G_KEY_FILE_DESKTOP_KEY_PATH             "Path"
</programlisting>
<para>A key under <link linkend="G-KEY-FILE-DESKTOP-GROUP:CAPS"><type>G_KEY_FILE_DESKTOP_GROUP</type></link>, whose value is a string
containing the working directory to run the program in. It is only
valid for desktop entries with the <literal>Application</literal> type.</para>
<para role="since">Since: <link linkend="api-index-2.14">2.14</link></para></refsect2>
<refsect2 id="G-KEY-FILE-DESKTOP-KEY-TERMINAL:CAPS" role="macro" condition="since:2.14">
<title>G_KEY_FILE_DESKTOP_KEY_TERMINAL</title>
<indexterm zone="G-KEY-FILE-DESKTOP-KEY-TERMINAL:CAPS" role="2.14"><primary sortas="KEY_FILE_DESKTOP_KEY_TERMINAL">G_KEY_FILE_DESKTOP_KEY_TERMINAL</primary></indexterm>
<programlisting language="C">#define G_KEY_FILE_DESKTOP_KEY_TERMINAL         "Terminal"
</programlisting>
<para>A key under <link linkend="G-KEY-FILE-DESKTOP-GROUP:CAPS"><type>G_KEY_FILE_DESKTOP_GROUP</type></link>, whose value is a boolean
stating whether the program should be run in a terminal window.
It is only valid for desktop entries with the
<literal>Application</literal> type.</para>
<para role="since">Since: <link linkend="api-index-2.14">2.14</link></para></refsect2>
<refsect2 id="G-KEY-FILE-DESKTOP-KEY-MIME-TYPE:CAPS" role="macro" condition="since:2.14">
<title>G_KEY_FILE_DESKTOP_KEY_MIME_TYPE</title>
<indexterm zone="G-KEY-FILE-DESKTOP-KEY-MIME-TYPE:CAPS" role="2.14"><primary sortas="KEY_FILE_DESKTOP_KEY_MIME_TYPE">G_KEY_FILE_DESKTOP_KEY_MIME_TYPE</primary></indexterm>
<programlisting language="C">#define G_KEY_FILE_DESKTOP_KEY_MIME_TYPE        "MimeType"
</programlisting>
<para>A key under <link linkend="G-KEY-FILE-DESKTOP-GROUP:CAPS"><type>G_KEY_FILE_DESKTOP_GROUP</type></link>, whose value is a list
of strings giving the MIME types supported by this desktop entry.</para>
<para role="since">Since: <link linkend="api-index-2.14">2.14</link></para></refsect2>
<refsect2 id="G-KEY-FILE-DESKTOP-KEY-CATEGORIES:CAPS" role="macro" condition="since:2.14">
<title>G_KEY_FILE_DESKTOP_KEY_CATEGORIES</title>
<indexterm zone="G-KEY-FILE-DESKTOP-KEY-CATEGORIES:CAPS" role="2.14"><primary sortas="KEY_FILE_DESKTOP_KEY_CATEGORIES">G_KEY_FILE_DESKTOP_KEY_CATEGORIES</primary></indexterm>
<programlisting language="C">#define G_KEY_FILE_DESKTOP_KEY_CATEGORIES       "Categories"
</programlisting>
<para>A key under <link linkend="G-KEY-FILE-DESKTOP-GROUP:CAPS"><type>G_KEY_FILE_DESKTOP_GROUP</type></link>, whose value is a list
of strings giving the categories in which the desktop entry
should be shown in a menu.</para>
<para role="since">Since: <link linkend="api-index-2.14">2.14</link></para></refsect2>
<refsect2 id="G-KEY-FILE-DESKTOP-KEY-STARTUP-NOTIFY:CAPS" role="macro" condition="since:2.14">
<title>G_KEY_FILE_DESKTOP_KEY_STARTUP_NOTIFY</title>
<indexterm zone="G-KEY-FILE-DESKTOP-KEY-STARTUP-NOTIFY:CAPS" role="2.14"><primary sortas="KEY_FILE_DESKTOP_KEY_STARTUP_NOTIFY">G_KEY_FILE_DESKTOP_KEY_STARTUP_NOTIFY</primary></indexterm>
<programlisting language="C">#define G_KEY_FILE_DESKTOP_KEY_STARTUP_NOTIFY   "StartupNotify"
</programlisting>
<para>A key under <link linkend="G-KEY-FILE-DESKTOP-GROUP:CAPS"><type>G_KEY_FILE_DESKTOP_GROUP</type></link>, whose value is a boolean
stating whether the application supports the
<ulink url="http://www.freedesktop.org/Standards/startup-notification-spec">Startup Notification Protocol Specification</ulink>.</para>
<para role="since">Since: <link linkend="api-index-2.14">2.14</link></para></refsect2>
<refsect2 id="G-KEY-FILE-DESKTOP-KEY-STARTUP-WM-CLASS:CAPS" role="macro" condition="since:2.14">
<title>G_KEY_FILE_DESKTOP_KEY_STARTUP_WM_CLASS</title>
<indexterm zone="G-KEY-FILE-DESKTOP-KEY-STARTUP-WM-CLASS:CAPS" role="2.14"><primary sortas="KEY_FILE_DESKTOP_KEY_STARTUP_WM_CLASS">G_KEY_FILE_DESKTOP_KEY_STARTUP_WM_CLASS</primary></indexterm>
<programlisting language="C">#define G_KEY_FILE_DESKTOP_KEY_STARTUP_WM_CLASS "StartupWMClass"
</programlisting>
<para>A key under <link linkend="G-KEY-FILE-DESKTOP-GROUP:CAPS"><type>G_KEY_FILE_DESKTOP_GROUP</type></link>, whose value is string
identifying the WM class or name hint of a window that the application
will create, which can be used to emulate Startup Notification with
older applications.</para>
<para role="since">Since: <link linkend="api-index-2.14">2.14</link></para></refsect2>
<refsect2 id="G-KEY-FILE-DESKTOP-KEY-URL:CAPS" role="macro" condition="since:2.14">
<title>G_KEY_FILE_DESKTOP_KEY_URL</title>
<indexterm zone="G-KEY-FILE-DESKTOP-KEY-URL:CAPS" role="2.14"><primary sortas="KEY_FILE_DESKTOP_KEY_URL">G_KEY_FILE_DESKTOP_KEY_URL</primary></indexterm>
<programlisting language="C">#define G_KEY_FILE_DESKTOP_KEY_URL              "URL"
</programlisting>
<para>A key under <link linkend="G-KEY-FILE-DESKTOP-GROUP:CAPS"><type>G_KEY_FILE_DESKTOP_GROUP</type></link>, whose value is a string
giving the URL to access. It is only valid for desktop entries
with the <literal>Link</literal> type.</para>
<para role="since">Since: <link linkend="api-index-2.14">2.14</link></para></refsect2>
<refsect2 id="G-KEY-FILE-DESKTOP-KEY-ACTIONS:CAPS" role="macro" condition="since:2.38">
<title>G_KEY_FILE_DESKTOP_KEY_ACTIONS</title>
<indexterm zone="G-KEY-FILE-DESKTOP-KEY-ACTIONS:CAPS" role="2.38"><primary sortas="KEY_FILE_DESKTOP_KEY_ACTIONS">G_KEY_FILE_DESKTOP_KEY_ACTIONS</primary></indexterm>
<programlisting language="C">#define G_KEY_FILE_DESKTOP_KEY_ACTIONS          "Actions"
</programlisting>
<para>A key under <link linkend="G-KEY-FILE-DESKTOP-GROUP:CAPS"><type>G_KEY_FILE_DESKTOP_GROUP</type></link>, whose value is a string list
giving the available application actions.</para>
<para role="since">Since: <link linkend="api-index-2.38">2.38</link></para></refsect2>
<refsect2 id="G-KEY-FILE-DESKTOP-KEY-DBUS-ACTIVATABLE:CAPS" role="macro" condition="since:2.38">
<title>G_KEY_FILE_DESKTOP_KEY_DBUS_ACTIVATABLE</title>
<indexterm zone="G-KEY-FILE-DESKTOP-KEY-DBUS-ACTIVATABLE:CAPS" role="2.38"><primary sortas="KEY_FILE_DESKTOP_KEY_DBUS_ACTIVATABLE">G_KEY_FILE_DESKTOP_KEY_DBUS_ACTIVATABLE</primary></indexterm>
<programlisting language="C">#define G_KEY_FILE_DESKTOP_KEY_DBUS_ACTIVATABLE "DBusActivatable"
</programlisting>
<para>A key under <link linkend="G-KEY-FILE-DESKTOP-GROUP:CAPS"><type>G_KEY_FILE_DESKTOP_GROUP</type></link>, whose value is a boolean set to true
if the application is D-Bus activatable.</para>
<para role="since">Since: <link linkend="api-index-2.38">2.38</link></para></refsect2>
<refsect2 id="G-KEY-FILE-DESKTOP-TYPE-APPLICATION:CAPS" role="macro" condition="since:2.14">
<title>G_KEY_FILE_DESKTOP_TYPE_APPLICATION</title>
<indexterm zone="G-KEY-FILE-DESKTOP-TYPE-APPLICATION:CAPS" role="2.14"><primary sortas="KEY_FILE_DESKTOP_TYPE_APPLICATION">G_KEY_FILE_DESKTOP_TYPE_APPLICATION</primary></indexterm>
<programlisting language="C">#define G_KEY_FILE_DESKTOP_TYPE_APPLICATION     "Application"
</programlisting>
<para>The value of the <link linkend="G-KEY-FILE-DESKTOP-KEY-TYPE:CAPS"><type>G_KEY_FILE_DESKTOP_KEY_TYPE</type></link>, key for desktop
entries representing applications.</para>
<para role="since">Since: <link linkend="api-index-2.14">2.14</link></para></refsect2>
<refsect2 id="G-KEY-FILE-DESKTOP-TYPE-LINK:CAPS" role="macro" condition="since:2.14">
<title>G_KEY_FILE_DESKTOP_TYPE_LINK</title>
<indexterm zone="G-KEY-FILE-DESKTOP-TYPE-LINK:CAPS" role="2.14"><primary sortas="KEY_FILE_DESKTOP_TYPE_LINK">G_KEY_FILE_DESKTOP_TYPE_LINK</primary></indexterm>
<programlisting language="C">#define G_KEY_FILE_DESKTOP_TYPE_LINK            "Link"
</programlisting>
<para>The value of the <link linkend="G-KEY-FILE-DESKTOP-KEY-TYPE:CAPS"><type>G_KEY_FILE_DESKTOP_KEY_TYPE</type></link>, key for desktop
entries representing links to documents.</para>
<para role="since">Since: <link linkend="api-index-2.14">2.14</link></para></refsect2>
<refsect2 id="G-KEY-FILE-DESKTOP-TYPE-DIRECTORY:CAPS" role="macro" condition="since:2.14">
<title>G_KEY_FILE_DESKTOP_TYPE_DIRECTORY</title>
<indexterm zone="G-KEY-FILE-DESKTOP-TYPE-DIRECTORY:CAPS" role="2.14"><primary sortas="KEY_FILE_DESKTOP_TYPE_DIRECTORY">G_KEY_FILE_DESKTOP_TYPE_DIRECTORY</primary></indexterm>
<programlisting language="C">#define G_KEY_FILE_DESKTOP_TYPE_DIRECTORY       "Directory"
</programlisting>
<para>The value of the <link linkend="G-KEY-FILE-DESKTOP-KEY-TYPE:CAPS"><type>G_KEY_FILE_DESKTOP_KEY_TYPE</type></link>, key for desktop
entries representing directories.</para>
<para role="since">Since: <link linkend="api-index-2.14">2.14</link></para></refsect2>

</refsect1>

</refentry>
