<?xml version="1.0"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
               "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd"
[
  <!ENTITY % local.common.attrib "xmlns:xi  CDATA  #FIXED 'http://www.w3.org/2003/XInclude'">
]>
<refentry id="zeitgeist-2.0-utils">
<refmeta>
<refentrytitle role="top_of_page" id="zeitgeist-2.0-utils.top_of_page">utils</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>
  ZEITGEIST-2.0 Library
</refmiscinfo>
</refmeta>
<refnamediv>
<refname>utils</refname>
<refpurpose>Utility functions. FOR INTERNAL USE ONLY</refpurpose>
</refnamediv>

<refsynopsisdiv id="zeitgeist-2.0-utils.synopsis" role="synopsis">
<title role="synopsis.title">Synopsis</title>

<synopsis>const <link linkend="gchar"><returnvalue>gchar</returnvalue></link> *       <link linkend="zeitgeist-utils-get-data-path">zeitgeist_utils_get_data_path</link>       (<parameter><type>void</type></parameter>);
<link linkend="gchar"><returnvalue>gchar</returnvalue></link> *             <link linkend="zeitgeist-utils-get-default-data-path">zeitgeist_utils_get_default_data_path</link>
                                                        (<parameter><type>void</type></parameter>);
const <link linkend="gchar"><returnvalue>gchar</returnvalue></link> *       <link linkend="zeitgeist-utils-get-database-file-path">zeitgeist_utils_get_database_file_path</link>
                                                        (<parameter><type>void</type></parameter>);
<link linkend="void"><returnvalue>void</returnvalue></link>                <link linkend="zeitgeist-utils-set-database-file-path">zeitgeist_utils_set_database_file_path</link>
                                                        (<parameter>const <link linkend="gchar"><type>gchar</type></link> *path</parameter>);
const <link linkend="gchar"><returnvalue>gchar</returnvalue></link> *       <link linkend="zeitgeist-utils-get-database-file-backup-path">zeitgeist_utils_get_database_file_backup_path</link>
                                                        (<parameter><type>void</type></parameter>);
<link linkend="gchar"><returnvalue>gchar</returnvalue></link> *             <link linkend="zeitgeist-utils-get-database-file-retire-name">zeitgeist_utils_get_database_file_retire_name</link>
                                                        (<parameter><type>void</type></parameter>);
const <link linkend="gchar"><returnvalue>gchar</returnvalue></link> *       <link linkend="zeitgeist-utils-get-local-extensions-path">zeitgeist_utils_get_local_extensions_path</link>
                                                        (<parameter><type>void</type></parameter>);
<link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>            <link linkend="zeitgeist-utils-using-in-memory-database">zeitgeist_utils_using_in_memory_database</link>
                                                        (<parameter><type>void</type></parameter>);
<link linkend="void"><returnvalue>void</returnvalue></link>                <link linkend="zeitgeist-utils-backup-database">zeitgeist_utils_backup_database</link>     (<parameter><link linkend="GError"><type>GError</type></link> **error</parameter>);
<link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>            <link linkend="zeitgeist-utils-parse-negation">zeitgeist_utils_parse_negation</link>      (<parameter><link linkend="gchar"><type>gchar</type></link> **val</parameter>);
<link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>            <link linkend="zeitgeist-utils-parse-noexpand">zeitgeist_utils_parse_noexpand</link>      (<parameter><link linkend="gchar"><type>gchar</type></link> **val</parameter>);
<link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>            <link linkend="zeitgeist-utils-parse-wildcard">zeitgeist_utils_parse_wildcard</link>      (<parameter><link linkend="gchar"><type>gchar</type></link> **val</parameter>);
<link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>            <link linkend="zeitgeist-utils-is-empty-string">zeitgeist_utils_is_empty_string</link>     (<parameter>const <link linkend="gchar"><type>gchar</type></link> *s</parameter>);
<link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>            <link linkend="zeitgeist-utils-log-may-read-directly">zeitgeist_utils_log_may_read_directly</link>
                                                        (<parameter><type>void</type></parameter>);
#define             <link linkend="ZEITGEIST-UTILS-ENGINE-DBUS-NAME:CAPS">ZEITGEIST_UTILS_ENGINE_DBUS_NAME</link>
#define             <link linkend="ZEITGEIST-UTILS-ENGINE-DBUS-PATH:CAPS">ZEITGEIST_UTILS_ENGINE_DBUS_PATH</link>
#define             <link linkend="ZEITGEIST-UTILS-SIG-EVENT:CAPS">ZEITGEIST_UTILS_SIG_EVENT</link>
#define             <link linkend="ZEITGEIST-UTILS-MAX-DBUS-RESULT-SIZE:CAPS">ZEITGEIST_UTILS_MAX_DBUS_RESULT_SIZE</link>
#define             <link linkend="ZEITGEIST-UTILS-CACHE-SIZE:CAPS">ZEITGEIST_UTILS_CACHE_SIZE</link>
</synopsis>
</refsynopsisdiv>

<refsect1 id="zeitgeist-2.0-utils.description" role="desc">
<title role="desc.title">Description</title>
<para>
<para>A set of funtions that if used would only affect libzeitgeist in the code it is used in.</para>
</para>
</refsect1>
<refsect1 id="zeitgeist-2.0-utils.details" role="details">
<title role="details.title">Details</title>
<refsect2 id="zeitgeist-utils-get-data-path" role="function">
<title>zeitgeist_utils_get_data_path ()</title>
<indexterm zone="zeitgeist-utils-get-data-path"><primary>zeitgeist_utils_get_data_path</primary></indexterm>
<programlisting>const <link linkend="gchar"><returnvalue>gchar</returnvalue></link> *       zeitgeist_utils_get_data_path       (<parameter><type>void</type></parameter>);</programlisting>
<variablelist role="params">
<varlistentry><term><parameter>self</parameter>&#160;:</term>
<listitem><simpara>the (null) instance</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>. <emphasis role="annotation">[<acronym>transfer none</acronym>]</emphasis></simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="zeitgeist-utils-get-default-data-path" role="function">
<title>zeitgeist_utils_get_default_data_path ()</title>
<indexterm zone="zeitgeist-utils-get-default-data-path"><primary>zeitgeist_utils_get_default_data_path</primary></indexterm>
<programlisting><link linkend="gchar"><returnvalue>gchar</returnvalue></link> *             zeitgeist_utils_get_default_data_path
                                                        (<parameter><type>void</type></parameter>);</programlisting>
<variablelist role="params">
<varlistentry><term><parameter>self</parameter>&#160;:</term>
<listitem><simpara>the (null) instance</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="zeitgeist-utils-get-database-file-path" role="function">
<title>zeitgeist_utils_get_database_file_path ()</title>
<indexterm zone="zeitgeist-utils-get-database-file-path"><primary>zeitgeist_utils_get_database_file_path</primary></indexterm>
<programlisting>const <link linkend="gchar"><returnvalue>gchar</returnvalue></link> *       zeitgeist_utils_get_database_file_path
                                                        (<parameter><type>void</type></parameter>);</programlisting>
<variablelist role="params">
<varlistentry><term><parameter>self</parameter>&#160;:</term>
<listitem><simpara>the (null) instance</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>. <emphasis role="annotation">[<acronym>transfer none</acronym>]</emphasis></simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="zeitgeist-utils-set-database-file-path" role="function">
<title>zeitgeist_utils_set_database_file_path ()</title>
<indexterm zone="zeitgeist-utils-set-database-file-path"><primary>zeitgeist_utils_set_database_file_path</primary></indexterm>
<programlisting><link linkend="void"><returnvalue>void</returnvalue></link>                zeitgeist_utils_set_database_file_path
                                                        (<parameter>const <link linkend="gchar"><type>gchar</type></link> *path</parameter>);</programlisting>
<para>
Sets the filepath of the database.
</para><variablelist role="params">
<varlistentry><term><parameter>self</parameter>&#160;:</term>
<listitem><simpara>the (null) instance</simpara></listitem></varlistentry>
<varlistentry><term><parameter>path</parameter>&#160;:</term>
<listitem><simpara>&nbsp;.  a <link linkend="gchar"><type>gchar</type></link>. <emphasis role="annotation">[<acronym>in</acronym>]</emphasis></simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="zeitgeist-utils-get-database-file-backup-path" role="function">
<title>zeitgeist_utils_get_database_file_backup_path ()</title>
<indexterm zone="zeitgeist-utils-get-database-file-backup-path"><primary>zeitgeist_utils_get_database_file_backup_path</primary></indexterm>
<programlisting>const <link linkend="gchar"><returnvalue>gchar</returnvalue></link> *       zeitgeist_utils_get_database_file_backup_path
                                                        (<parameter><type>void</type></parameter>);</programlisting>
<variablelist role="params">
<varlistentry><term><parameter>self</parameter>&#160;:</term>
<listitem><simpara>the (null) instance</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>. <emphasis role="annotation">[<acronym>transfer none</acronym>]</emphasis></simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="zeitgeist-utils-get-database-file-retire-name" role="function">
<title>zeitgeist_utils_get_database_file_retire_name ()</title>
<indexterm zone="zeitgeist-utils-get-database-file-retire-name"><primary>zeitgeist_utils_get_database_file_retire_name</primary></indexterm>
<programlisting><link linkend="gchar"><returnvalue>gchar</returnvalue></link> *             zeitgeist_utils_get_database_file_retire_name
                                                        (<parameter><type>void</type></parameter>);</programlisting>
<variablelist role="params">
<varlistentry><term><parameter>self</parameter>&#160;:</term>
<listitem><simpara>the (null) instance</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="zeitgeist-utils-get-local-extensions-path" role="function">
<title>zeitgeist_utils_get_local_extensions_path ()</title>
<indexterm zone="zeitgeist-utils-get-local-extensions-path"><primary>zeitgeist_utils_get_local_extensions_path</primary></indexterm>
<programlisting>const <link linkend="gchar"><returnvalue>gchar</returnvalue></link> *       zeitgeist_utils_get_local_extensions_path
                                                        (<parameter><type>void</type></parameter>);</programlisting>
<variablelist role="params">
<varlistentry><term><parameter>self</parameter>&#160;:</term>
<listitem><simpara>the (null) instance</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>. <emphasis role="annotation">[<acronym>transfer none</acronym>]</emphasis></simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="zeitgeist-utils-using-in-memory-database" role="function">
<title>zeitgeist_utils_using_in_memory_database ()</title>
<indexterm zone="zeitgeist-utils-using-in-memory-database"><primary>zeitgeist_utils_using_in_memory_database</primary></indexterm>
<programlisting><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>            zeitgeist_utils_using_in_memory_database
                                                        (<parameter><type>void</type></parameter>);</programlisting>
<variablelist role="params">
<varlistentry><term><parameter>self</parameter>&#160;:</term>
<listitem><simpara>the (null) instance</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>Whether a in-memory SQLite database is in use (vs. a file-based one).</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="zeitgeist-utils-backup-database" role="function">
<title>zeitgeist_utils_backup_database ()</title>
<indexterm zone="zeitgeist-utils-backup-database"><primary>zeitgeist_utils_backup_database</primary></indexterm>
<programlisting><link linkend="void"><returnvalue>void</returnvalue></link>                zeitgeist_utils_backup_database     (<parameter><link linkend="GError"><type>GError</type></link> **error</parameter>);</programlisting>
<variablelist role="params">
<varlistentry><term><parameter>self</parameter>&#160;:</term>
<listitem><simpara>the (null) instance</simpara></listitem></varlistentry>
<varlistentry><term><parameter>error</parameter>&#160;:</term>
<listitem><simpara>location to store the error occuring, or <link linkend="NULL:CAPS"><literal>NULL</literal></link> to ignore</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="zeitgeist-utils-parse-negation" role="function">
<title>zeitgeist_utils_parse_negation ()</title>
<indexterm zone="zeitgeist-utils-parse-negation"><primary>zeitgeist_utils_parse_negation</primary></indexterm>
<programlisting><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>            zeitgeist_utils_parse_negation      (<parameter><link linkend="gchar"><type>gchar</type></link> **val</parameter>);</programlisting>
<para>
Check if the value starts with the negation operator. If it does, remove the operator from the value and return true. Otherwise, return false.
</para><variablelist role="params">
<varlistentry><term><parameter>self</parameter>&#160;:</term>
<listitem><simpara>the (null) instance</simpara></listitem></varlistentry>
<varlistentry><term><parameter>val</parameter>&#160;:</term>
<listitem><simpara>&nbsp;.  value to check. <emphasis role="annotation">[<acronym>inout</acronym>]</emphasis></simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="zeitgeist-utils-parse-noexpand" role="function">
<title>zeitgeist_utils_parse_noexpand ()</title>
<indexterm zone="zeitgeist-utils-parse-noexpand"><primary>zeitgeist_utils_parse_noexpand</primary></indexterm>
<programlisting><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>            zeitgeist_utils_parse_noexpand      (<parameter><link linkend="gchar"><type>gchar</type></link> **val</parameter>);</programlisting>
<para>
Check if the value starts with the noexpand operator. If it does, remove the operator from the value and return true. Otherwise, return false.
</para>
<para>
<para>Check for the negation operator before calling this function.</para>
</para><variablelist role="params">
<varlistentry><term><parameter>self</parameter>&#160;:</term>
<listitem><simpara>the (null) instance</simpara></listitem></varlistentry>
<varlistentry><term><parameter>val</parameter>&#160;:</term>
<listitem><simpara>&nbsp;.  value to check. <emphasis role="annotation">[<acronym>inout</acronym>]</emphasis></simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="zeitgeist-utils-parse-wildcard" role="function">
<title>zeitgeist_utils_parse_wildcard ()</title>
<indexterm zone="zeitgeist-utils-parse-wildcard"><primary>zeitgeist_utils_parse_wildcard</primary></indexterm>
<programlisting><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>            zeitgeist_utils_parse_wildcard      (<parameter><link linkend="gchar"><type>gchar</type></link> **val</parameter>);</programlisting>
<para>
Check if the value ends with the wildcard character. If it does, remove the wildcard character from the value and return true. Otherwise, return false.
</para><variablelist role="params">
<varlistentry><term><parameter>self</parameter>&#160;:</term>
<listitem><simpara>the (null) instance</simpara></listitem></varlistentry>
<varlistentry><term><parameter>val</parameter>&#160;:</term>
<listitem><simpara>&nbsp;.  value to check. <emphasis role="annotation">[<acronym>inout</acronym>]</emphasis></simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="zeitgeist-utils-is-empty-string" role="function">
<title>zeitgeist_utils_is_empty_string ()</title>
<indexterm zone="zeitgeist-utils-is-empty-string"><primary>zeitgeist_utils_is_empty_string</primary></indexterm>
<programlisting><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>            zeitgeist_utils_is_empty_string     (<parameter>const <link linkend="gchar"><type>gchar</type></link> *s</parameter>);</programlisting>
<para>
Return true if a string is empty (null or containing just a null byte).
</para><variablelist role="params">
<varlistentry><term><parameter>self</parameter>&#160;:</term>
<listitem><simpara>the (null) instance</simpara></listitem></varlistentry>
<varlistentry><term><parameter>s</parameter>&#160;:</term>
<listitem><simpara>&nbsp;.  string to check. <emphasis role="annotation">[<acronym>in</acronym>][<acronym>allow-none</acronym>]</emphasis></simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="zeitgeist-utils-log-may-read-directly" role="function">
<title>zeitgeist_utils_log_may_read_directly ()</title>
<indexterm zone="zeitgeist-utils-log-may-read-directly"><primary>zeitgeist_utils_log_may_read_directly</primary></indexterm>
<programlisting><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>            zeitgeist_utils_log_may_read_directly
                                                        (<parameter><type>void</type></parameter>);</programlisting>
<variablelist role="params">
<varlistentry><term><parameter>self</parameter>&#160;:</term>
<listitem><simpara>the (null) instance</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>True if direct reading of the DB is enabled for Log, default is True.</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="ZEITGEIST-UTILS-ENGINE-DBUS-NAME:CAPS" role="macro">
<title>ZEITGEIST_UTILS_ENGINE_DBUS_NAME</title>
<indexterm zone="ZEITGEIST-UTILS-ENGINE-DBUS-NAME:CAPS"><primary>ZEITGEIST_UTILS_ENGINE_DBUS_NAME</primary></indexterm>
<programlisting>#define ZEITGEIST_UTILS_ENGINE_DBUS_NAME "org.gnome.zeitgeist.Engine"
</programlisting>
</refsect2>
<refsect2 id="ZEITGEIST-UTILS-ENGINE-DBUS-PATH:CAPS" role="macro">
<title>ZEITGEIST_UTILS_ENGINE_DBUS_PATH</title>
<indexterm zone="ZEITGEIST-UTILS-ENGINE-DBUS-PATH:CAPS"><primary>ZEITGEIST_UTILS_ENGINE_DBUS_PATH</primary></indexterm>
<programlisting>#define ZEITGEIST_UTILS_ENGINE_DBUS_PATH "/org/gnome/zeitgeist/log/activity"
</programlisting>
</refsect2>
<refsect2 id="ZEITGEIST-UTILS-SIG-EVENT:CAPS" role="macro">
<title>ZEITGEIST_UTILS_SIG_EVENT</title>
<indexterm zone="ZEITGEIST-UTILS-SIG-EVENT:CAPS"><primary>ZEITGEIST_UTILS_SIG_EVENT</primary></indexterm>
<programlisting>#define ZEITGEIST_UTILS_SIG_EVENT "asaasay"
</programlisting>
</refsect2>
<refsect2 id="ZEITGEIST-UTILS-MAX-DBUS-RESULT-SIZE:CAPS" role="macro">
<title>ZEITGEIST_UTILS_MAX_DBUS_RESULT_SIZE</title>
<indexterm zone="ZEITGEIST-UTILS-MAX-DBUS-RESULT-SIZE:CAPS"><primary>ZEITGEIST_UTILS_MAX_DBUS_RESULT_SIZE</primary></indexterm>
<programlisting>#define ZEITGEIST_UTILS_MAX_DBUS_RESULT_SIZE ((gsize) ((4 * 1024) * 1024))
</programlisting>
</refsect2>
<refsect2 id="ZEITGEIST-UTILS-CACHE-SIZE:CAPS" role="macro">
<title>ZEITGEIST_UTILS_CACHE_SIZE</title>
<indexterm zone="ZEITGEIST-UTILS-CACHE-SIZE:CAPS"><primary>ZEITGEIST_UTILS_CACHE_SIZE</primary></indexterm>
<programlisting>#define ZEITGEIST_UTILS_CACHE_SIZE ((guint) 0)
</programlisting>
</refsect2>

</refsect1>

</refentry>
